The full logic of the P potion's effects is pretty complex. For starters:
- If you are a turtle, drinking a P potion will cause you to lose half your remaining health and then turn back into a human.
- If you have less than 8% of your health left, drinking a P potion will heal you for one of the following amounts, chosen at random: 3, 7, 10, 200, 400, 600, 50%, 65%, 80%. (EDIT: On closer inspection there's a bug here; if the game gives you a message saying you've healed 3 or 7 health, actually you've healed 10.)
Otherwise, the potion's effects are randomly determined based on the number of P potions you've drunk in the past--let's call this number P#. Here are the possible effects along with their chances of happening:
- There is approximately a one in (P# / 2) chance of either gaining or losing either 20% or 30% of your maximum health, determined at random. The first two times you drink a P potion this is guaranteed to happen (unless you are a turtle or have less than 8% of your health remaining), since it will be a one in one chance, or 100%. If you have drunk a lot of P potions this will become unlikely to happen, for example if you have drunk 10 potions your chances will be about 1 in 5 for this to happen (20%), for 40 potions it will be about 1 in 20 (5%), etc.
If the above does not happen, there is approximately a one in (P# / 6) chance of getting one of four effects, chosen at random. Again, the more P potions you drink the less likely this is to happen, starting from 100% if you've drunk less than 6, and going down from there. Here are the possible effects:
- You will be unable to move for a short time.
- You will turn into a turtle for a short time.
- Your health will be completely restored.
- You will be reduced to 10 health.
If neither of the above happens, the game will say "Something strange is happening." You will then cast a number of spells for free in quick succession. The spells you cast are (naturally) determined at random. There are three different possibilities:
- Acid rain, Teleport, Fireball
- Three Acid rains, followed by a Teleport
- Four fireballs intermixed with Teleports (so you will teleport between each Fireball)
The exact code that determines the P potion's effects can be found by downloading the game's JavaScript source code and doing a search for "castPlayerPPotion".