-
Notifications
You must be signed in to change notification settings - Fork 806
Don't lose HP from poisoning in the overworld
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.
Edit engine/overworld/events.asm:
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
In the same file:
...
.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 take poison damage or not.
And that's it! Our Pokémon will no longer lose HP damage while walking in the overworld. Optionally, you can safely delete engine/events/poisonstep.asm, since this is the only instance where DoPoisonStep was called.