summaryrefslogtreecommitdiff
path: root/engine/battle/moveEffects/haze_effect.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle/moveEffects/haze_effect.asm')
-rw-r--r--engine/battle/moveEffects/haze_effect.asm43
1 files changed, 24 insertions, 19 deletions
diff --git a/engine/battle/moveEffects/haze_effect.asm b/engine/battle/moveEffects/haze_effect.asm
index 2343e784..06907bcc 100644
--- a/engine/battle/moveEffects/haze_effect.asm
+++ b/engine/battle/moveEffects/haze_effect.asm
@@ -1,59 +1,64 @@
-HazeEffect_: ; 139da (4:79da)
+HazeEffect_:
ld a, $7
+; store 7 on every stat mod
ld hl, wPlayerMonAttackMod
call ResetStatMods
ld hl, wEnemyMonAttackMod
call ResetStatMods
+; copy unmodified stats to battle stats
ld hl, wPlayerMonUnmodifiedAttack
ld de, wBattleMonAttack
call ResetStats
ld hl, wEnemyMonUnmodifiedAttack
ld de, wEnemyMonAttack
call ResetStats
+; cure non-volatile status, but only for the target
ld hl, wEnemyMonStatus
ld de, wEnemySelectedMove
ld a, [H_WHOSETURN]
and a
- jr z, .asm_13a09
+ jr z, .cureStatuses
ld hl, wBattleMonStatus
- dec de
+ dec de ; wPlayerSelectedMove
-.asm_13a09
+.cureStatuses
ld a, [hl]
ld [hl], $0
- and $27
- jr z, .asm_13a13
+ and SLP | (1 << FRZ)
+ jr z, .cureVolatileStatuses
+; prevent the Pokemon from executing a move if it was asleep or frozen
ld a, $ff
ld [de], a
-.asm_13a13
+.cureVolatileStatuses
xor a
- ld [W_PLAYERDISABLEDMOVE], a
- ld [W_ENEMYDISABLEDMOVE], a
- ld hl, wccee
+ ld [wPlayerDisabledMove], a
+ ld [wEnemyDisabledMove], a
+ ld hl, wPlayerDisabledMoveNumber
ld [hli], a
ld [hl], a
- ld hl, W_PLAYERBATTSTATUS1
- call CureStatuses
- ld hl, W_ENEMYBATTSTATUS1
- call CureStatuses
+ ld hl, wPlayerBattleStatus1
+ call CureVolatileStatuses
+ ld hl, wEnemyBattleStatus1
+ call CureVolatileStatuses
ld hl, PlayCurrentMoveAnimation
call CallBankF
ld hl, StatusChangesEliminatedText
jp PrintText
-CureStatuses: ; 13a37 (4:7a37)
+CureVolatileStatuses:
res Confused, [hl]
inc hl ; BATTSTATUS2
ld a, [hl]
- and (1 << UsingRage) | (1 << NeedsToRecharge) | (1 << HasSubstituteUp) | (1 << 3) ; clear all but these from BATTSTATUS2
+ ; clear UsingXAccuracy, ProtectedByMist, GettingPumped, and Seeded statuses
+ and $ff ^((1 << UsingXAccuracy) | (1 << ProtectedByMist) | (1 << GettingPumped) | (1 << Seeded))
ld [hli], a ; BATTSTATUS3
ld a, [hl]
and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses
ld [hl], a
ret
-ResetStatMods: ; 13a43 (4:7a43)
+ResetStatMods:
ld b, $8
.loop
ld [hli], a
@@ -61,7 +66,7 @@ ResetStatMods: ; 13a43 (4:7a43)
jr nz, .loop
ret
-ResetStats: ; 13a4a (4:7a4a)
+ResetStats:
ld b, $8
.loop
ld a, [hli]
@@ -71,6 +76,6 @@ ResetStats: ; 13a4a (4:7a4a)
jr nz, .loop
ret
-StatusChangesEliminatedText: ; 13a53 (4:7a53)
+StatusChangesEliminatedText:
TX_FAR _StatusChangesEliminatedText
db "@"