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
120
engine/battle/move_effects/encore.asm
Normal file
120
engine/battle/move_effects/encore.asm
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
BattleCommand_Encore:
|
||||
ld hl, wEnemyMonMoves
|
||||
ld de, wEnemyEncoreCount
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .ok
|
||||
ld hl, wBattleMonMoves
|
||||
ld de, wPlayerEncoreCount
|
||||
.ok
|
||||
ld a, BATTLE_VARS_LAST_MOVE_OPP
|
||||
call GetBattleVar
|
||||
ld b, a
|
||||
push hl
|
||||
ld hl, .invalid_moves
|
||||
call CheckMoveInList
|
||||
pop hl
|
||||
jp c, .failed
|
||||
|
||||
.got_move
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr nz, .got_move
|
||||
|
||||
ld bc, wBattleMonPP - wBattleMonMoves - 1
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and PP_MASK
|
||||
jp z, .failed
|
||||
ld a, [wAttackMissed]
|
||||
and a
|
||||
jp nz, .failed
|
||||
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
||||
call GetBattleVarAddr
|
||||
bit SUBSTATUS_ENCORED, [hl]
|
||||
jp nz, .failed
|
||||
set SUBSTATUS_ENCORED, [hl]
|
||||
call BattleRandom
|
||||
and $3
|
||||
inc a
|
||||
inc a
|
||||
inc a
|
||||
ld [de], a
|
||||
call CheckOpponentWentFirst
|
||||
jr nz, .finish_move
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .force_last_enemy_move
|
||||
|
||||
push hl
|
||||
ld a, [wLastPlayerMove]
|
||||
ld b, a
|
||||
ld c, 0
|
||||
ld hl, wBattleMonMoves
|
||||
.find_player_move
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr z, .got_player_move
|
||||
inc c
|
||||
ld a, c
|
||||
cp NUM_MOVES
|
||||
jr c, .find_player_move
|
||||
pop hl
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
xor a
|
||||
ld [de], a
|
||||
jr .failed
|
||||
|
||||
.got_player_move
|
||||
pop hl
|
||||
ld a, c
|
||||
ld [wCurMoveNum], a
|
||||
ld a, b
|
||||
ld [wCurPlayerMove], a
|
||||
ld de, wPlayerMoveStruct
|
||||
call GetMoveData
|
||||
jr .finish_move
|
||||
|
||||
.force_last_enemy_move
|
||||
push hl
|
||||
ld a, [wLastEnemyMove]
|
||||
ld b, a
|
||||
ld c, 0
|
||||
ld hl, wEnemyMonMoves
|
||||
.find_enemy_move
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr z, .got_enemy_move
|
||||
inc c
|
||||
ld a, c
|
||||
cp NUM_MOVES
|
||||
jr c, .find_enemy_move
|
||||
pop hl
|
||||
res SUBSTATUS_ENCORED, [hl]
|
||||
xor a
|
||||
ld [de], a
|
||||
jr .failed
|
||||
|
||||
.got_enemy_move
|
||||
pop hl
|
||||
ld a, c
|
||||
ld [wCurEnemyMoveNum], a
|
||||
ld a, b
|
||||
ld [wCurEnemyMove], a
|
||||
ld de, wEnemyMoveStruct
|
||||
call GetMoveData
|
||||
|
||||
.finish_move
|
||||
call AnimateCurrentMove
|
||||
ld hl, GotAnEncoreText
|
||||
jp StdBattleTextbox
|
||||
|
||||
.failed
|
||||
jp PrintDidntAffect2
|
||||
|
||||
.invalid_moves
|
||||
dw NO_MOVE
|
||||
dw STRUGGLE
|
||||
dw ENCORE
|
||||
dw MIRROR_MOVE
|
||||
dw -1
|
||||
Loading…
Add table
Add a link
Reference in a new issue