shithub: pokecrystal

ref: 38ede6d7f04414d995c13198efb9485d34f17004
dir: /engine/battle/move_effects/lock_on.asm/

View raw version
BattleCommand_LockOn: ; 35a53
; 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

; 35a74