2014-06-17 18:58:11 +00:00
|
|
|
MAX_ROLLOUT_COUNT EQU 5
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_CheckCurl:
|
2013-12-01 19:19:57 +00:00
|
|
|
; checkcurl
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld de, wPlayerRolloutCount
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2013-12-01 19:19:57 +00:00
|
|
|
and a
|
2014-06-17 19:52:32 +00:00
|
|
|
jr z, .ok
|
2018-01-23 22:39:09 +00:00
|
|
|
ld de, wEnemyRolloutCount
|
2014-06-17 19:52:32 +00:00
|
|
|
.ok
|
2013-12-01 19:19:57 +00:00
|
|
|
ld a, BATTLE_VARS_SUBSTATUS1
|
|
|
|
call GetBattleVar
|
2014-06-17 19:52:32 +00:00
|
|
|
bit SUBSTATUS_ROLLOUT, a
|
|
|
|
jr z, .reset
|
2013-12-01 19:19:57 +00:00
|
|
|
|
|
|
|
ld b, $4 ; doturn
|
|
|
|
jp SkipToBattleCommand
|
|
|
|
|
2014-06-17 19:52:32 +00:00
|
|
|
.reset
|
2013-12-01 19:19:57 +00:00
|
|
|
xor a
|
|
|
|
ld [de], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
BattleCommand_RolloutPower:
|
2013-12-01 19:19:57 +00:00
|
|
|
; rolloutpower
|
|
|
|
|
|
|
|
ld a, BATTLE_VARS_STATUS
|
|
|
|
call GetBattleVar
|
2014-06-17 18:58:11 +00:00
|
|
|
and SLP
|
2013-12-01 19:19:57 +00:00
|
|
|
ret nz
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPlayerRolloutCount
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hBattleTurn]
|
2013-12-01 19:19:57 +00:00
|
|
|
and a
|
2016-01-09 21:28:22 +00:00
|
|
|
jr z, .got_rollout_count
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wEnemyRolloutCount
|
2013-12-01 19:19:57 +00:00
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
.got_rollout_count
|
2013-12-01 19:19:57 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2016-01-09 21:28:22 +00:00
|
|
|
jr nz, .skip_set_rampage
|
2013-12-01 19:19:57 +00:00
|
|
|
ld a, 1
|
2016-01-09 21:28:22 +00:00
|
|
|
ld [wSomeoneIsRampaging], a
|
2013-12-01 19:19:57 +00:00
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
.skip_set_rampage
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wAttackMissed]
|
2013-12-01 19:19:57 +00:00
|
|
|
and a
|
|
|
|
jr z, .hit
|
|
|
|
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS1
|
2014-06-14 07:34:57 +00:00
|
|
|
call GetBattleVarAddr
|
2013-12-01 19:19:57 +00:00
|
|
|
res 6, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.hit
|
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
|
|
|
ld b, a
|
2014-06-17 18:58:11 +00:00
|
|
|
cp MAX_ROLLOUT_COUNT
|
2016-01-09 21:28:22 +00:00
|
|
|
jr c, .not_done_with_rollout
|
2013-12-01 19:19:57 +00:00
|
|
|
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS1
|
2014-06-14 07:34:57 +00:00
|
|
|
call GetBattleVarAddr
|
2014-06-17 19:52:32 +00:00
|
|
|
res SUBSTATUS_ROLLOUT, [hl]
|
2016-01-09 21:28:22 +00:00
|
|
|
jr .done_with_substatus_flag
|
2013-12-01 19:19:57 +00:00
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
.not_done_with_rollout
|
2013-12-01 19:19:57 +00:00
|
|
|
ld a, BATTLE_VARS_SUBSTATUS1
|
2014-06-14 07:34:57 +00:00
|
|
|
call GetBattleVarAddr
|
2014-06-17 19:52:32 +00:00
|
|
|
set SUBSTATUS_ROLLOUT, [hl]
|
2013-12-01 19:19:57 +00:00
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
.done_with_substatus_flag
|
2013-12-01 19:19:57 +00:00
|
|
|
ld a, BATTLE_VARS_SUBSTATUS2
|
|
|
|
call GetBattleVar
|
2014-06-17 18:58:11 +00:00
|
|
|
bit SUBSTATUS_CURLED, a
|
2016-01-09 21:28:22 +00:00
|
|
|
jr z, .not_curled
|
2013-12-01 19:19:57 +00:00
|
|
|
inc b
|
2016-01-09 21:28:22 +00:00
|
|
|
.not_curled
|
|
|
|
.loop
|
2013-12-01 19:19:57 +00:00
|
|
|
dec b
|
2016-01-09 21:28:22 +00:00
|
|
|
jr z, .done_damage
|
2013-12-01 19:19:57 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wCurDamage + 1
|
2013-12-01 19:19:57 +00:00
|
|
|
sla [hl]
|
|
|
|
dec hl
|
|
|
|
rl [hl]
|
2016-01-09 21:28:22 +00:00
|
|
|
jr nc, .loop
|
2013-12-01 19:19:57 +00:00
|
|
|
|
|
|
|
ld a, $ff
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
.done_damage
|
2013-12-01 19:19:57 +00:00
|
|
|
ret
|