summaryrefslogtreecommitdiff
path: root/battle/effects/rollout.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-12-01 14:19:57 -0500
committeryenatch <yenatch@gmail.com>2013-12-01 14:19:57 -0500
commitd7cdd0ac7383fd120a2b8114af08541058cb691c (patch)
tree54ab2531a047f3275dbe66a0f28dca1a3e5eddeb /battle/effects/rollout.asm
parentd7bf70f3c902ce9380e05ccd6828b5e8973d4ae1 (diff)
split out some more move effects
Diffstat (limited to 'battle/effects/rollout.asm')
-rw-r--r--battle/effects/rollout.asm97
1 files changed, 97 insertions, 0 deletions
diff --git a/battle/effects/rollout.asm b/battle/effects/rollout.asm
new file mode 100644
index 000000000..13c91a8d9
--- /dev/null
+++ b/battle/effects/rollout.asm
@@ -0,0 +1,97 @@
+BattleCommand5b: ; 37718
+; checkcurl
+
+ ld de, PlayerRolloutCount
+ ld a, [hBattleTurn]
+ and a
+ jr z, .asm_37723
+ ld de, EnemyRolloutCount
+
+.asm_37723
+ ld a, BATTLE_VARS_SUBSTATUS1
+ call GetBattleVar
+ bit SUBSTATUS_ENCORED, a
+ jr z, .asm_37731
+
+ ld b, $4 ; doturn
+ jp SkipToBattleCommand
+
+.asm_37731
+ xor a
+ ld [de], a
+ ret
+; 37734
+
+
+BattleCommand5c: ; 37734
+; rolloutpower
+
+ ld a, BATTLE_VARS_STATUS
+ call GetBattleVar
+ and 7
+ 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
+ ld [$c73e], a
+
+.asm_37750
+ ld a, [AttackMissed]
+ and a
+ jr z, .hit
+
+ ld a, BATTLE_VARS_SUBSTATUS1
+ call _GetBattleVar
+ res 6, [hl]
+ ret
+
+.hit
+ inc [hl]
+ ld a, [hl]
+ ld b, a
+ cp $5
+ jr c, .asm_3776e
+
+ ld a, BATTLE_VARS_SUBSTATUS1
+ call _GetBattleVar
+ res 6, [hl]
+ jr .asm_37775
+
+.asm_3776e
+ ld a, BATTLE_VARS_SUBSTATUS1
+ call _GetBattleVar
+ set 6, [hl]
+
+.asm_37775
+ ld a, BATTLE_VARS_SUBSTATUS2
+ call GetBattleVar
+ bit 0, a
+ 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
+