2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_StoreEnergy:
|
2018-01-26 16:36:00 +00:00
|
|
|
; storeenergy
|
|
|
|
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS3
|
|
|
|
call GetBattleVar
|
|
|
|
bit SUBSTATUS_BIDE, a
|
|
|
|
ret z
|
|
|
|
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wPlayerRolloutCount
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr z, .check_still_storing_energy
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wEnemyRolloutCount
|
2018-01-26 16:36:00 +00:00
|
|
|
.check_still_storing_energy
|
|
|
|
dec [hl]
|
|
|
|
jr nz, .still_storing
|
|
|
|
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS3
|
|
|
|
call GetBattleVarAddr
|
|
|
|
res SUBSTATUS_BIDE, [hl]
|
|
|
|
|
|
|
|
ld hl, UnleashedEnergyText
|
2019-04-08 12:15:10 +00:00
|
|
|
call StdBattleTextbox
|
2018-01-26 16:36:00 +00:00
|
|
|
|
|
|
|
ld a, BATTLE_VARS_MOVE_POWER
|
|
|
|
call GetBattleVarAddr
|
|
|
|
ld a, 1
|
|
|
|
ld [hl], a
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wPlayerDamageTaken + 1
|
2018-01-26 16:36:00 +00:00
|
|
|
ld de, wPlayerCharging ; player
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr z, .player
|
2018-02-03 23:21:53 +00:00
|
|
|
ld hl, wEnemyDamageTaken + 1
|
2018-01-26 16:36:00 +00:00
|
|
|
ld de, wEnemyCharging ; enemy
|
|
|
|
.player
|
|
|
|
ld a, [hld]
|
|
|
|
add a
|
|
|
|
ld b, a
|
2018-02-03 23:21:53 +00:00
|
|
|
ld [wCurDamage + 1], a
|
2018-01-26 16:36:00 +00:00
|
|
|
ld a, [hl]
|
|
|
|
rl a
|
2018-02-03 23:21:53 +00:00
|
|
|
ld [wCurDamage], a
|
2018-01-26 16:36:00 +00:00
|
|
|
jr nc, .not_maxed
|
|
|
|
ld a, $ff
|
2018-02-03 23:21:53 +00:00
|
|
|
ld [wCurDamage], a
|
|
|
|
ld [wCurDamage + 1], a
|
2018-01-26 16:36:00 +00:00
|
|
|
.not_maxed
|
|
|
|
or b
|
|
|
|
jr nz, .built_up_something
|
|
|
|
ld a, 1
|
2018-02-03 23:21:53 +00:00
|
|
|
ld [wAttackMissed], a
|
2018-01-26 16:36:00 +00:00
|
|
|
.built_up_something
|
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
ld [de], a
|
|
|
|
|
|
|
|
ld a, BATTLE_VARS_MOVE_ANIM
|
|
|
|
call GetBattleVarAddr
|
|
|
|
ld a, BIDE
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
ld b, unleashenergy_command
|
|
|
|
jp SkipToBattleCommand
|
|
|
|
|
|
|
|
.still_storing
|
|
|
|
ld hl, StoringEnergyText
|
2019-04-08 12:15:10 +00:00
|
|
|
call StdBattleTextbox
|
2018-01-26 16:36:00 +00:00
|
|
|
jp EndMoveEffect
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_UnleashEnergy:
|
2018-01-26 16:36:00 +00:00
|
|
|
; unleashenergy
|
|
|
|
|
2018-02-03 23:21:53 +00:00
|
|
|
ld de, wPlayerDamageTaken
|
|
|
|
ld bc, wPlayerRolloutCount
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2018-01-26 16:36:00 +00:00
|
|
|
and a
|
|
|
|
jr z, .got_damage
|
2018-02-03 23:21:53 +00:00
|
|
|
ld de, wEnemyDamageTaken
|
|
|
|
ld bc, wEnemyRolloutCount
|
2018-01-26 16:36:00 +00:00
|
|
|
.got_damage
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS3
|
|
|
|
call GetBattleVarAddr
|
|
|
|
set SUBSTATUS_BIDE, [hl]
|
|
|
|
xor a
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld [de], a
|
|
|
|
ld [wPlayerMoveStructEffect], a
|
|
|
|
ld [wEnemyMoveStructEffect], a
|
|
|
|
call BattleRandom
|
|
|
|
and 1
|
|
|
|
inc a
|
|
|
|
inc a
|
|
|
|
ld [bc], a
|
|
|
|
ld a, 1
|
|
|
|
ld [wKickCounter], a
|
|
|
|
call AnimateCurrentMove
|
|
|
|
jp EndMoveEffect
|