diff options
-rw-r--r-- | Don't-receive-damage-from-poisoning-in-the-overworld.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Don't-receive-damage-from-poisoning-in-the-overworld.md b/Don't-receive-damage-from-poisoning-in-the-overworld.md new file mode 100644 index 0000000..d325933 --- /dev/null +++ b/Don't-receive-damage-from-poisoning-in-the-overworld.md @@ -0,0 +1,50 @@ +In older generations (up to the 4th gen) poisoned Pokémon used to lose 1 HP every four steps and even faint from it (except in the 4th gen, where they survive with 1 HP). In the 5th generation onwards this no longer happens, so the objective of this simple tutorial is to implement this change and make our poisoned Pokémon no longer lose HP in the overworld. + +## Contents +1. [Stop wPoisonStepCounter from counting our steps](#1-stop-wPoisonStepCounter-from-counting-our-steps) +2. [Get rid of useless routines](#2-get-rid-of-useless-routines) + + +## 1. Stop wPoisonStepCounter from counting our steps + +Edit [engine/overworld/events.asm](https://github.com/pret/pokecrystal/blob/master/engine/overworld/events.asm): + +```diff +CountStep: + ... + +- ; Count the step for poison and total steps +- ld hl, wPoisonStepCount +- inc [hl] + ld hl, wStepCount + inc [hl] + ; Every 256 steps, increase the happiness of all your Pokemon. + jr nz, .skip_happiness +``` + +## 2. Get rid of useless routines + +In the same file: + +```diff +... +.skip_egg + ; Increase the EXP of (both) DayCare Pokemon by 1. + farcall DayCareStep + +- ; Every 4 steps, deal damage to all poisoned Pokemon. +- ld hl, wPoisonStepCount +- ld a, [hl] +- cp 4 +- jr c, .skip_poison +- ld [hl], 0 + +- farcall DoPoisonStep +- jr c, .doscript + +-.skip_poison + farcall DoBikeStep +``` +Since wPoisonStepCounter has stopped counting our steps, we no longer need to check how many steps we've taken to determine whether to receive poison damage or not. + +And that's it! Our Pokémon will no longer receive poison damage while walking in the overworld. Optionally, you can safely delete [engine/events/poisonstep.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/poisonstep.asm), since this is the only instance where DoPoisonStep was called.
\ No newline at end of file |