2014-06-17 18:58:11 +00:00
|
|
|
MAX_ROLLOUT_COUNT EQU 5
|
|
|
|
|
|
|
|
|
2015-11-06 19:45:10 +00:00
|
|
|
BattleCommand_CheckCurl: ; 37718
|
2013-12-01 19:19:57 +00:00
|
|
|
; checkcurl
|
|
|
|
|
|
|
|
ld de, PlayerRolloutCount
|
|
|
|
ld a, [hBattleTurn]
|
|
|
|
and a
|
2014-06-17 19:52:32 +00:00
|
|
|
jr z, .ok
|
2013-12-01 19:19:57 +00:00
|
|
|
ld de, EnemyRolloutCount
|
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
|
|
|
|
; 37734
|
|
|
|
|
|
|
|
|
2015-11-06 19:45:10 +00:00
|
|
|
BattleCommand_RolloutPower: ; 37734
|
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
|
|
|
|
|
|
|
|
ld hl, PlayerRolloutCount
|
|
|
|
ld a, [hBattleTurn]
|
|
|
|
and a
|
|
|
|
jr z, .asm_37747
|
|
|
|
ld hl, EnemyRolloutCount
|
|
|
|
|
|
|
|
.asm_37747
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_37750
|
|
|
|
ld a, 1
|
2015-02-08 08:03:32 +00:00
|
|
|
ld [wc73e], a
|
2013-12-01 19:19:57 +00:00
|
|
|
|
|
|
|
.asm_37750
|
|
|
|
ld a, [AttackMissed]
|
|
|
|
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
|
2013-12-01 19:19:57 +00:00
|
|
|
jr c, .asm_3776e
|
|
|
|
|
|
|
|
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]
|
2013-12-01 19:19:57 +00:00
|
|
|
jr .asm_37775
|
|
|
|
|
|
|
|
.asm_3776e
|
|
|
|
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
|
|
|
|
|
|
|
.asm_37775
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS2
|
|
|
|
call GetBattleVar
|
2014-06-17 18:58:11 +00:00
|
|
|
bit SUBSTATUS_CURLED, a
|
2013-12-01 19:19:57 +00:00
|
|
|
jr z, .asm_3777f
|
|
|
|
inc b
|
|
|
|
.asm_3777f
|
|
|
|
dec b
|
|
|
|
jr z, .asm_37790
|
|
|
|
|
|
|
|
ld hl, CurDamage + 1
|
|
|
|
sla [hl]
|
|
|
|
dec hl
|
|
|
|
rl [hl]
|
|
|
|
jr nc, .asm_3777f
|
|
|
|
|
|
|
|
ld a, $ff
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
.asm_37790
|
|
|
|
ret
|
|
|
|
; 37791
|