mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-07 00:25:24 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
56
engine/battle/move_effects/counter.asm
Normal file
56
engine/battle/move_effects/counter.asm
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
BattleCommand_Counter:
|
||||
ld a, 1
|
||||
ld [wAttackMissed], a
|
||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||
call GetBattleVar
|
||||
and a
|
||||
ret z
|
||||
|
||||
ld b, a
|
||||
callfar GetMoveEffect
|
||||
ld a, b
|
||||
cp EFFECT_COUNTER
|
||||
ret z
|
||||
|
||||
call BattleCommand_ResetTypeMatchup
|
||||
ld a, [wTypeMatchup]
|
||||
and a
|
||||
ret z
|
||||
|
||||
call CheckOpponentWentFirst
|
||||
ret z
|
||||
|
||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||
call GetBattleVar
|
||||
ld de, wStringBuffer1
|
||||
call GetMoveData
|
||||
|
||||
ld a, [wStringBuffer1 + MOVE_POWER]
|
||||
and a
|
||||
ret z
|
||||
|
||||
ld a, [wStringBuffer1 + MOVE_TYPE]
|
||||
cp SPECIAL
|
||||
ret nc
|
||||
|
||||
; BUG: Counter and Mirror Coat still work if the opponent uses an item (see docs/bugs_and_glitches.md)
|
||||
ld hl, wCurDamage
|
||||
ld a, [hli]
|
||||
or [hl]
|
||||
ret z
|
||||
|
||||
ld a, [hl]
|
||||
add a
|
||||
ld [hld], a
|
||||
ld a, [hl]
|
||||
adc a
|
||||
ld [hl], a
|
||||
jr nc, .capped
|
||||
ld a, $ff
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
.capped
|
||||
|
||||
xor a
|
||||
ld [wAttackMissed], a
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue