shithub: pokecrystal

ref: 7d3ea88611efbc2f9b903063e2816b1cae1bad35
dir: /engine/battle/move_effects/lock_on.asm/

View raw version
BattleCommand_LockOn:
; lockon

	call CheckSubstituteOpp
	jr nz, .fail

	ld a, [wAttackMissed]
	and a
	jr nz, .fail

	ld a, BATTLE_VARS_SUBSTATUS5_OPP
	call GetBattleVarAddr
	set SUBSTATUS_LOCK_ON, [hl]
	call AnimateCurrentMove

	ld hl, TookAimText
	jp StdBattleTextbox

.fail
	call AnimateFailedMove
	jp PrintDidntAffect