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
156
engine/battle/move_effects/transform.asm
Normal file
156
engine/battle/move_effects/transform.asm
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
BattleCommand_Transform:
|
||||
call ClearLastMove
|
||||
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
||||
call GetBattleVarAddr
|
||||
bit SUBSTATUS_TRANSFORMED, [hl]
|
||||
jp nz, BattleEffect_ButItFailed
|
||||
call CheckHiddenOpponent
|
||||
jp nz, BattleEffect_ButItFailed
|
||||
xor a
|
||||
ld [wNumHits], a
|
||||
ld a, $1
|
||||
ld [wBattleAnimParam], a
|
||||
ld a, BATTLE_VARS_SUBSTATUS4
|
||||
call GetBattleVarAddr
|
||||
bit SUBSTATUS_SUBSTITUTE, [hl]
|
||||
push af
|
||||
jr z, .mimic_substitute
|
||||
call CheckUserIsCharging
|
||||
jr nz, .mimic_substitute
|
||||
ld hl, SUBSTITUTE
|
||||
call GetMoveIDFromIndex
|
||||
call LoadAnim
|
||||
.mimic_substitute
|
||||
ld a, BATTLE_VARS_SUBSTATUS5
|
||||
call GetBattleVarAddr
|
||||
set SUBSTATUS_TRANSFORMED, [hl]
|
||||
call ResetActorDisable
|
||||
ld hl, wBattleMonSpecies
|
||||
ld de, wEnemyMonSpecies
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr nz, .got_mon_species
|
||||
ld hl, wEnemyMonSpecies
|
||||
ld de, wBattleMonSpecies
|
||||
xor a
|
||||
ld [wCurMoveNum], a
|
||||
.got_mon_species
|
||||
push hl
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
inc de
|
||||
ld bc, NUM_MOVES
|
||||
call CopyBytes
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .mimic_enemy_backup
|
||||
ld a, [de]
|
||||
ld [wEnemyBackupDVs], a
|
||||
inc de
|
||||
ld a, [de]
|
||||
ld [wEnemyBackupDVs + 1], a
|
||||
dec de
|
||||
.mimic_enemy_backup
|
||||
; copy DVs
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
; move pointer to stats
|
||||
ld bc, wBattleMonStats - wBattleMonPP
|
||||
add hl, bc
|
||||
push hl
|
||||
ld h, d
|
||||
ld l, e
|
||||
add hl, bc
|
||||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
ld bc, wBattleMonStructEnd - wBattleMonStats
|
||||
call CopyBytes
|
||||
; init the power points
|
||||
ld bc, wBattleMonMoves - wBattleMonStructEnd
|
||||
add hl, bc
|
||||
push de
|
||||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
ld bc, wBattleMonPP - wBattleMonStructEnd
|
||||
add hl, bc
|
||||
ld b, NUM_MOVES
|
||||
.pp_loop
|
||||
ld a, [de]
|
||||
inc de
|
||||
and a
|
||||
jr z, .done_move
|
||||
push bc
|
||||
ld bc, SKETCH
|
||||
call CompareMove
|
||||
pop bc
|
||||
ld a, 1
|
||||
jr z, .done_move
|
||||
ld a, 5
|
||||
.done_move
|
||||
ld [hli], a
|
||||
dec b
|
||||
jr nz, .pp_loop
|
||||
pop hl
|
||||
ld a, [hl]
|
||||
ld [wNamedObjectIndex], a
|
||||
call GetPokemonName
|
||||
ld hl, wEnemyStats
|
||||
ld de, wPlayerStats
|
||||
ld bc, 2 * 5
|
||||
call BattleSideCopy
|
||||
ld hl, wEnemyStatLevels
|
||||
ld de, wPlayerStatLevels
|
||||
ld bc, 8
|
||||
call BattleSideCopy
|
||||
call _CheckBattleScene
|
||||
jr c, .mimic_anims
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld a, [wPlayerMinimized]
|
||||
jr z, .got_byte
|
||||
ld a, [wEnemyMinimized]
|
||||
.got_byte
|
||||
and a
|
||||
jr nz, .mimic_anims
|
||||
call LoadMoveAnim
|
||||
jr .after_anim
|
||||
|
||||
.mimic_anims
|
||||
call BattleCommand_MoveDelay
|
||||
call BattleCommand_RaiseSubNoAnim
|
||||
.after_anim
|
||||
xor a
|
||||
ld [wNumHits], a
|
||||
ld a, $2
|
||||
ld [wBattleAnimParam], a
|
||||
pop af
|
||||
jr z, .no_substitute
|
||||
ld hl, SUBSTITUTE
|
||||
call GetMoveIDFromIndex
|
||||
call LoadAnim
|
||||
.no_substitute
|
||||
ld hl, TransformedText
|
||||
jp StdBattleTextbox
|
||||
|
||||
BattleSideCopy:
|
||||
; Copy bc bytes from hl to de if it's the player's turn.
|
||||
; Copy bc bytes from de to hl if it's the enemy's turn.
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .copy
|
||||
|
||||
; Swap hl and de
|
||||
push hl
|
||||
ld h, d
|
||||
ld l, e
|
||||
pop de
|
||||
.copy
|
||||
jp CopyBytes
|
||||
Loading…
Add table
Add a link
Reference in a new issue