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
73
engine/battle/move_effects/disable.asm
Normal file
73
engine/battle/move_effects/disable.asm
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
BattleCommand_Disable:
|
||||
ld a, [wAttackMissed]
|
||||
and a
|
||||
jr nz, .failed
|
||||
|
||||
ld de, wEnemyDisableCount
|
||||
ld hl, wEnemyMonMoves
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .got_moves
|
||||
ld de, wPlayerDisableCount
|
||||
ld hl, wBattleMonMoves
|
||||
.got_moves
|
||||
|
||||
ld a, [de]
|
||||
and a
|
||||
jr nz, .failed
|
||||
|
||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||
call GetBattleVar
|
||||
and a
|
||||
jr z, .failed
|
||||
ld b, a
|
||||
push bc
|
||||
ld bc, STRUGGLE
|
||||
call CompareMove
|
||||
pop bc
|
||||
jr z, .failed
|
||||
|
||||
ld c, $ff
|
||||
.loop
|
||||
inc c
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr nz, .loop
|
||||
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld hl, wEnemyMonPP
|
||||
jr z, .got_pp
|
||||
ld hl, wBattleMonPP
|
||||
.got_pp
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .failed
|
||||
.loop2
|
||||
call BattleRandom
|
||||
and 7
|
||||
jr z, .loop2
|
||||
inc a
|
||||
inc c
|
||||
swap c
|
||||
add c
|
||||
ld [de], a
|
||||
call AnimateCurrentMove
|
||||
ld hl, wDisabledMove
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr nz, .got_disabled_move_pointer
|
||||
inc hl
|
||||
.got_disabled_move_pointer
|
||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||
call GetBattleVar
|
||||
ld [hl], a
|
||||
ld [wNamedObjectIndex], a
|
||||
call GetMoveName
|
||||
ld hl, WasDisabledText
|
||||
jp StdBattleTextbox
|
||||
|
||||
.failed
|
||||
jp FailMove
|
||||
Loading…
Add table
Add a link
Reference in a new issue