Skip to content

Don't lose HP from poisoning in the overworld

Idain edited this page Mar 8, 2021 · 4 revisions

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
  2. Get rid of useless routines

1. Stop wPoisonStepCounter from counting our steps

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

2. Get rid of useless routines

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.

Clone this wiki locally