shithub: pokecrystal

ref: 55ca2da25acc0598539eede5359f25f08223de2d
dir: /engine/battle/move_effects/lock_on.asm/

View raw version
BattleCommand_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