shithub: pokecrystal

ref: 2354c41a96bdf80861338add2f0b3a67b18f160e
dir: /engine/battle/move_effects/pursuit.asm/

View raw version
BattleCommand_Pursuit:
; pursuit
; Double damage if the opponent is switching.

	ld hl, wEnemyIsSwitching
	ldh a, [hBattleTurn]
	and a
	jr z, .ok
	ld hl, wPlayerIsSwitching
.ok
	ld a, [hl]
	and a
	ret z

	ld hl, wCurDamage + 1
	sla [hl]
	dec hl
	rl [hl]
	ret nc

	ld a, $ff
	ld [hli], a
	ld [hl], a
	ret