shithub: pokecrystal

Download patch

ref: dbe4c7ab67cb88ef4ce725598b2082b13a566776
parent: c2dba431884fdd9d61a90f6c3efd1876aa1cfa14
author: yenatch <yenatch@gmail.com>
date: Tue Jun 17 08:52:32 EDT 2014

Fix some misnamed substatus constants.

SUBSTATUS_ROLLOUT was actually SUBSTATUS_RAMPAGE.
SUBSTATUS_ENCORED was actually SUBSTATUS_ROLLOUT.
Substatus 5 bit 4 was actually SUBSTATUS_ENCORED.

Also use some more (sub)status constants where needed.

--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -439,28 +439,23 @@
 
 AIScoring_LockOn: ; 3881d
 	ld a, [PlayerSubStatus5]
-	bit 5, a
+	bit SUBSTATUS_LOCK_ON, a
 	jr nz, .asm_38882
 
 	push hl
 	call AICheckEnemyQuarterHP
-
 	jr nc, .asm_38877
 
 	call AICheckEnemyHalfHP
-
 	jr c, .asm_38834
 
 	call AICompareSpeed
-
 	jr nc, .asm_38877
 
-
 .asm_38834
 	ld a, [PlayerEvaLevel]
 	cp $a
 	jr nc, .asm_3887a
-
 	cp $8
 	jr nc, .asm_38875
 
@@ -467,13 +462,11 @@
 	ld a, [EnemyAccLevel]
 	cp $5
 	jr c, .asm_3887a
-
 	cp $7
 	jr c, .asm_38875
 
 	ld hl, EnemyMonMoves
 	ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
-
 .asm_3884f
 	dec c
 	jr z, .asm_38877
@@ -490,11 +483,10 @@
 
 	ld a, $1
 	ld [hBattleTurn], a
+
 	push hl
 	push bc
-
 	callba Function347c8
-
 	ld a, [$d265]
 	cp $a
 	pop bc
@@ -501,7 +493,6 @@
 	pop hl
 	jr c, .asm_3884f
 
-
 .asm_38875
 	pop hl
 	ret
@@ -514,8 +505,8 @@
 .asm_3887a
 	pop hl
 	call Function39527
-
 	ret c
+
 	dec [hl]
 	dec [hl]
 	ret
@@ -546,11 +537,9 @@
 	dec [hl]
 	jr .asm_3888b
 
-
 .asm_388a2
 	pop hl
 	jp AIDiscourageMove
-
 ; 388a6
 
 
@@ -632,7 +621,6 @@
 	jr c, .asm_388ef
 	jr .asm_38911
 
-
 .asm_3890a
 	call Function39527
 	jr c, .asm_38911
@@ -661,7 +649,7 @@
 	jr nz, .asm_388ef
 
 	ld a, [PlayerSubStatus1]
-	bit SUBSTATUS_ENCORED, a
+	bit SUBSTATUS_ROLLOUT, a
 	jr nz, .asm_388ef
 
 
@@ -679,8 +667,8 @@
 
 .asm_38941
 	call Function39527
-
 	ret c
+
 	dec [hl]
 	ret
 ; 38947
@@ -802,7 +790,7 @@
 	jr nz, .asm_3899d
 
 	ld a, [PlayerSubStatus1]
-	bit SUBSTATUS_ENCORED, a
+	bit SUBSTATUS_ROLLOUT, a
 	jr nz, .asm_3899d
 
 .asm_389e4
@@ -951,7 +939,7 @@
 	jr nz, .asm_38a91
 
 	ld a, [PlayerSubStatus1]
-	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
+	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
 	jr nz, .asm_38a91
 
 	ld a, [PlayerTurnsTaken]
@@ -1168,7 +1156,7 @@
 
 AIScoring_Rage: ; 38b7f
 	ld a, [EnemySubStatus4]
-	bit 6, a
+	bit SUBSTATUS_RAGE, a
 	jr z, .asm_38b9b
 
 	call Function39527
@@ -1714,7 +1702,7 @@
 	jr nz, .asm_38e26
 
 	ld a, [PlayerSubStatus1]
-	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ENCORED | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
+	and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
 	jr nz, .asm_38e26
 
 	push hl
@@ -1902,7 +1890,7 @@
 	bit SUBSTATUS_CURSE, a
 	jr nz, .asm_38f0d
 
-	bit SUBSTATUS_ENCORED, a
+	bit SUBSTATUS_ROLLOUT, a
 	jr z, .asm_38f14
 
 	ld a, [PlayerRolloutCount]
@@ -1966,7 +1954,7 @@
 	jr c, .asm_38f75
 
 	ld a, [PlayerSubStatus5]
-	bit 7, a
+	bit SUBSTATUS_CANT_RUN, a
 	jr nz, .asm_38f6f
 
 	push hl
@@ -1984,8 +1972,8 @@
 
 .asm_38f6f
 	call Function39527
-
 	ret c
+
 	dec [hl]
 	ret
 
@@ -2146,7 +2134,7 @@
 AIScoring_Attract: ; 39026
 	ld a, [PlayerTurnsTaken]
 	and a
-	jr z, .asm_39032
+	jr z, .first_turn
 
 	call Function39521
 	ret c
@@ -2153,7 +2141,7 @@
 	inc [hl]
 	ret
 
-.asm_39032
+.first_turn
 	call Random
 	cp 200
 	ret nc
@@ -2180,7 +2168,7 @@
 
 	ld a, [PlayerSubStatus3]
 	bit SUBSTATUS_UNDERGROUND, a
-	jr z, .asm_39058
+	jr z, .could_dig
 
 	call AICompareSpeed
 	ret nc
@@ -2188,7 +2176,9 @@
 	dec [hl]
 	ret
 
-.asm_39058
+.could_dig
+	; Try to predict if the player
+	; will use Dig this turn.
 	call AICompareSpeed
 	ret c
 	call Function39527
@@ -2263,7 +2253,7 @@
 	jr c, .asm_390c9
 
 	ld a, d
-	cp $32
+	cp 50
 	jr c, .asm_390c9
 
 	ld a, [$d265]
@@ -2271,7 +2261,7 @@
 	jr nc, .asm_390c7
 
 	ld a, d
-	cp $46
+	cp 70
 	ret c
 
 .asm_390c7
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -603,11 +603,11 @@
 	res SUBSTATUS_FLINCHED, [hl]
 
 	ld a, [hl]
-	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT
+	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE
 	jp nz, .quit
 
 	ld hl, PlayerSubStatus1
-	bit SUBSTATUS_ENCORED, [hl]
+	bit SUBSTATUS_ROLLOUT, [hl]
 	jp nz, .quit
 
 	and a
@@ -622,7 +622,7 @@
 	call Function3c410
 	jp c, .asm_3c4ba
 	ld hl, PlayerSubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	jr z, .asm_3c449
 	ld a, [LastPlayerMove]
 	ld [CurPlayerMove], a
@@ -725,7 +725,7 @@
 	call .asm_3c518
 .asm_3c4ed
 	ld hl, PlayerSubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	ret z
 	ld a, [PlayerEncoreCount]
 	dec a
@@ -742,7 +742,7 @@
 
 .asm_3c50a
 	ld hl, PlayerSubStatus5
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	call SetEnemyTurn
 	ld hl, BattleText_0x80c8a
 	jp StdBattleTextBox
@@ -749,7 +749,7 @@
 
 .asm_3c518
 	ld hl, EnemySubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	ret z
 	ld a, [EnemyEncoreCount]
 	dec a
@@ -766,7 +766,7 @@
 
 .asm_3c535
 	ld hl, EnemySubStatus5
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	call SetPlayerTurn
 	ld hl, BattleText_0x80c8a
 	jp StdBattleTextBox
@@ -1095,26 +1095,28 @@
 	push de
 	call StdBattleTextBox
 	pop de
+
 	xor a
 	ld [$cfca], a
 	call Function3ee0f
 	call GetEighthMaxHP
-	ld de, $c674
+	ld de, PlayerToxicCount
 	ld a, [hBattleTurn]
 	and a
 	jr z, .asm_3c74d
-	ld de, $c67c
-
+	ld de, EnemyToxicCount
 .asm_3c74d
+
 	ld a, BATTLE_VARS_SUBSTATUS5
 	call GetBattleVar
 	bit SUBSTATUS_TOXIC, a
 	jr z, .asm_3c765
+
 	call GetSixteenthMaxHP
 	ld a, [de]
 	inc a
 	ld [de], a
-	ld hl, $0000
+	ld hl, 0
 .asm_3c75f
 	add hl, bc
 	dec a
@@ -1600,7 +1602,7 @@
 	call .asm_3cac9
 .asm_3ca9d
 	ld a, [BattleMonStatus]
-	bit 5, a
+	bit FRZ, a
 	ret z
 	ld a, [$c73f]
 	and a
@@ -1613,7 +1615,7 @@
 	ld a, [CurBattleMon]
 	ld hl, PartyMon1Status
 	call GetPartyLocation
-	ld [hl], $0
+	ld [hl], 0
 	call UpdateBattleHuds
 	call SetEnemyTurn
 	ld hl, DefrostedOpponentText
@@ -1621,7 +1623,7 @@
 
 .asm_3cac9
 	ld a, [EnemyMonStatus]
-	bit 5, a
+	bit FRZ, a
 	ret z
 	ld a, [$c740]
 	and a
@@ -1631,6 +1633,7 @@
 	ret nc
 	xor a
 	ld [EnemyMonStatus], a
+
 	ld a, [IsInBattle]
 	dec a
 	jr z, .asm_3caef
@@ -1637,9 +1640,9 @@
 	ld a, [CurOTMon]
 	ld hl, OTPartyMon1Status
 	call GetPartyLocation
-	ld [hl], $0
-
+	ld [hl], 0
 .asm_3caef
+
 	call UpdateBattleHuds
 	call SetPlayerTurn
 	ld hl, DefrostedOpponentText
@@ -2938,7 +2941,6 @@
 ; 3d2e0
 
 
-
 Function3d2e0: ; 3d2e0
 	ld a, [InLinkBattle]
 	cp $4
@@ -3625,7 +3627,7 @@
 	and a
 	jp nz, .asm_3d749
 	ld a, [Options]
-	bit 6, a
+	bit BATTLE_SHIFT, a
 	jr nz, .asm_3d749
 	ld a, [CurPartyMon]
 	push af
@@ -4911,7 +4913,7 @@
 	pop bc
 	ret nz
 	ld a, b
-	cp $7f
+	cp " "
 	jr nz, .asm_3e02d
 	dec hl
 
@@ -5675,14 +5677,15 @@
 	ld a, $1
 	ld [hBGMapMode], a
 	call Function1bd3
-	bit 6, a
+	bit 6, a ; D_UP
 	jp nz, .asm_3e61d
-	bit 7, a
+	bit 7, a ; D_DOWN
 	jp nz, .asm_3e62e
-	bit 2, a
-	jp nz, Function3e643
-	bit 1, a
+	bit 2, a ; B_BUTTON
+	jp nz, .asm_3e643
+	bit 1, a ; A_BUTTON
 	push af
+
 	xor a
 	ld [$d0e3], a
 	ld a, [$cfa9]
@@ -5692,6 +5695,7 @@
 	ld a, [$d235]
 	dec a
 	jr nz, .asm_3e5d0
+
 	pop af
 	ret
 
@@ -5700,6 +5704,7 @@
 	ld a, b
 	ld [CurMoveNum], a
 	jr nz, .asm_3e5d9
+
 	pop af
 	ret
 
@@ -5706,6 +5711,7 @@
 .asm_3e5d9
 	pop af
 	ret nz
+
 	ld hl, BattleMonPP
 	ld a, [$cfa9]
 	ld c, a
@@ -5762,7 +5768,7 @@
 	jp .asm_3e57a
 ; 3e62e
 
-.asm_3e62e: ; 3e62e
+.asm_3e62e ; 3e62e
 	ld a, [$cfa9]
 	ld b, a
 	ld a, [$d0eb]
@@ -5775,7 +5781,7 @@
 	jp .asm_3e57a
 ; 3e643
 
-Function3e643: ; 3e643
+.asm_3e643 ; 3e643
 	ld a, [$d0e3]
 	and a
 	jr z, .asm_3e6bf
@@ -5942,10 +5948,9 @@
 	hlcoord 5, 11
 	ld a, [InLinkBattle]
 	cp $4
-	jr c, .asm_3e76c
+	jr c, .ok
 	hlcoord 5, 11
-
-.asm_3e76c
+.ok
 	push hl
 	ld de, StringBuffer1
 	ld bc, $0102
@@ -6033,14 +6038,14 @@
 	ld [CurEnemyMoveNum], a
 	ld c, a
 	ld a, [EnemySubStatus1]
-	bit SUBSTATUS_ENCORED, a
+	bit SUBSTATUS_ROLLOUT, a
 	jp nz, .asm_3e882
 	ld a, [EnemySubStatus3]
-	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT | 1 << SUBSTATUS_BIDE
+	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
 	jp nz, .asm_3e882
 
 	ld hl, EnemySubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	ld a, [LastEnemyMove]
 	jp nz, .asm_3e87f
 	ld hl, EnemyMonMoves
@@ -6051,7 +6056,7 @@
 
 .asm_3e817
 	ld hl, EnemySubStatus5
-	bit 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
 	jr z, .asm_3e824
 	ld a, [LastEnemyMove]
 	jp .asm_3e87f
@@ -6155,7 +6160,7 @@
 	ret
 
 .asm_3e8bd
-	ld a, $a5
+	ld a, STRUGGLE
 	jr .asm_3e87f
 ; 3e8c1
 
@@ -6175,10 +6180,10 @@
 	ret nz
 	ld hl, EnemySubStatus3
 	ld a, [hl]
-	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_ROLLOUT | 1 << SUBSTATUS_BIDE
+	and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
 	ret nz
 	ld hl, EnemySubStatus1
-	bit SUBSTATUS_ENCORED, [hl]
+	bit SUBSTATUS_ROLLOUT, [hl]
 	ret
 ; 3e8e4
 
@@ -6554,7 +6559,6 @@
 	
 	
 .Moves
-; ????
 	ld hl, BaseType1
 	ld de, EnemyMonType1
 	ld a, [hli]
@@ -6884,7 +6888,7 @@
 	and a
 	jr z, .asm_3ec5a
 	ld a, [BattleMonStatus]
-	and $40
+	and 1 << PAR
 	ret z
 	ld hl, $c645
 	ld a, [hld]
@@ -6905,7 +6909,7 @@
 
 .asm_3ec5a
 	ld a, [EnemyMonStatus]
-	and $40
+	and 1 << PAR
 	ret z
 	ld hl, $d21f
 	ld a, [hld]
@@ -6930,7 +6934,7 @@
 	and a
 	jr z, .asm_3ec93
 	ld a, [BattleMonStatus]
-	and $10
+	and 1 << BRN
 	ret z
 	ld hl, $c641
 	ld a, [hld]
@@ -6949,7 +6953,7 @@
 
 .asm_3ec93
 	ld a, [EnemyMonStatus]
-	and $10
+	and 1 << BRN
 	ret z
 	ld hl, $d21b
 	ld a, [hld]
@@ -8288,9 +8292,10 @@
 
 Function3f43d: ; 3f43d
 	ld a, [PlayerSubStatus4]
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ld hl, BattleAnimCmd_DD
 	jr nz, Function3f46f
+
 Function3f447: ; 3f447
 	ld a, [$c6fe]
 	and a
@@ -8323,7 +8328,7 @@
 
 Function3f47c: ; 3f47c
 	ld a, [EnemySubStatus4]
-	bit 4, a
+	bit SUBSTATUS_SUBSTITUTE, a
 	ld hl, BattleAnimCmd_DD
 	jr nz, Function3f4b4
 Function3f486: ; 3f486
@@ -8661,10 +8666,10 @@
 	ld [$d0e1], a
 	ld hl, PlayerSubStatus1
 	ld b, $18
-.asm_3f715
+.loop
 	ld [hli], a
 	dec b
-	jr nz, .asm_3f715
+	jr nz, .loop
 	call WaitSFX
 	ret
 ; 3f71d
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -356,12 +356,12 @@
 CantMove: ; 341f0
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVarAddr
-	res SUBSTATUS_ENCORED, [hl]
+	res SUBSTATUS_ROLLOUT, [hl]
 
 	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVarAddr
 	ld a, [hl]
-	and $ff ^ (1<<SUBSTATUS_BIDE + 1<<SUBSTATUS_ROLLOUT + 1<<SUBSTATUS_CHARGED)
+	and $ff ^ (1<<SUBSTATUS_BIDE + 1<<SUBSTATUS_RAMPAGE + 1<<SUBSTATUS_CHARGED)
 	ld [hl], a
 
 	call ResetFuryCutterCount
@@ -819,7 +819,7 @@
 	ld hl, WontObeyText
 	call StdBattleTextBox
 	call HitConfusion
-	jp Function3450c
+	jp .asm_3450c
 
 
 .Nap
@@ -855,7 +855,7 @@
 
 .Print
 	call StdBattleTextBox
-	jp Function3450c
+	jp .asm_3450c
 
 
 .UseInstead
@@ -959,19 +959,15 @@
 	pop af
 	ld [CurMoveNum], a
 
-	; fallthrough
-; 3450c
 
-
-Function3450c: ; 3450c
+.asm_3450c
 	xor a
 	ld [LastPlayerMove], a
 	ld [LastEnemyCounterMove], a
 
+	; Break Encore too.
 	ld hl, PlayerSubStatus5
-	res 4, [hl]
-
-; Break encore too.
+	res SUBSTATUS_ENCORED, [hl]
 	xor a
 	ld [PlayerEncoreCount], a
 
@@ -994,7 +990,7 @@
 .CheckSleep
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and 7
+	and SLP
 	ret z
 
 ; 'ignored orders…sleeping!'
@@ -4475,20 +4471,20 @@
 	ld de, EnemyEncoreCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35875 ; 3586d $6
+	jr z, .ok
 	ld hl, BattleMonMoves
 	ld de, PlayerEncoreCount
-.asm_35875
+.ok
 	ld a, BATTLE_VARS_LAST_MOVE_OPP
 	call GetBattleVar
 	and a
-	jp z, .asm_35923
+	jp z, .failed
 	cp STRUGGLE
-	jp z, .asm_35923
+	jp z, .failed
 	cp ENCORE
-	jp z, .asm_35923
+	jp z, .failed
 	cp MIRROR_MOVE
-	jp z, .asm_35923
+	jp z, .failed
 	ld b, a
 
 .asm_3588e
@@ -4500,15 +4496,15 @@
 	add hl, bc
 	ld a, [hl]
 	and $3f
-	jp z, .asm_35923
+	jp z, .failed
 	ld a, [AttackMissed]
 	and a
-	jp nz, .asm_35923
+	jp nz, .failed
 	ld a, BATTLE_VARS_SUBSTATUS5_OPP
 	call GetBattleVarAddr
-	bit 4, [hl]
-	jp nz, .asm_35923
-	set 4, [hl]
+	bit SUBSTATUS_ENCORED, [hl]
+	jp nz, .failed
+	set SUBSTATUS_ENCORED, [hl]
 	call BattleRandom
 	and $3
 	inc a
@@ -4535,10 +4531,11 @@
 	cp NUM_MOVES
 	jr c, .asm_358cc
 	pop hl
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	xor a
 	ld [de], a
-	jr .asm_35923
+	jr .failed
+
 .asm_358dd
 	pop hl
 
@@ -4566,10 +4563,10 @@
 	cp NUM_MOVES
 	jr c, .asm_358f9
 	pop hl
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 	xor a
 	ld [de], a
-	jr .asm_35923
+	jr .failed
 .asm_3590a
 	pop hl
 
@@ -4586,7 +4583,7 @@
 	ld hl, GotAnEncoreText
 	jp StdBattleTextBox
 
-.asm_35923
+.failed
 	jp PrintDidntAffect2
 ; 35926
 
@@ -5669,6 +5666,7 @@
 	call BattleRandom
 	cp $40
 	jr c, .asm_35fb8
+
 .asm_35f89
 	call CheckSubstituteOpp
 	jr nz, .asm_35fb8
@@ -5677,12 +5675,12 @@
 	jr nz, .asm_35fb8
 	call Function35fc9
 	jr z, .asm_35fa4
-	call Function35fc0
 
+	call Function35fc0
 	ld hl, WasPoisonedText
 	call StdBattleTextBox
-
 	jr .asm_35fb1
+
 .asm_35fa4
 	set SUBSTATUS_TOXIC, [hl]
 	xor a
@@ -5716,10 +5714,10 @@
 	call GetBattleVarAddr
 	ld a, [hBattleTurn]
 	and a
-	ld de, $c67c
-	jr z, .asm_35fd9
-	ld de, $c674
-.asm_35fd9
+	ld de, EnemyToxicCount
+	jr z, .ok
+	ld de, PlayerToxicCount
+.ok
 	ld a, BATTLE_VARS_MOVE_EFFECT
 	call GetBattleVar
 	cp EFFECT_TOXIC
@@ -5731,9 +5729,9 @@
 	ld de, EnemyMonType1
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_35fec
+	jr z, .ok
 	ld de, BattleMonType1
-.asm_35fec
+.ok
 	ld a, [de]
 	inc de
 	cp POISON
@@ -7057,7 +7055,7 @@
 .ok
 	ld a, BATTLE_VARS_SUBSTATUS3
 	call GetBattleVarAddr
-	set SUBSTATUS_ROLLOUT, [hl]
+	set SUBSTATUS_RAMPAGE, [hl]
 	call BattleRandom
 	and 1
 	inc a
@@ -9831,7 +9829,7 @@
 	ld a, BATTLE_VARS_SUBSTATUS5
 	call GetBattleVarAddr
 	res SUBSTATUS_TRANSFORMED, [hl]
-	res 4, [hl]
+	res SUBSTATUS_ENCORED, [hl]
 
 	; New mon hasn't used a move yet.
 	ld a, BATTLE_VARS_LAST_MOVE
--- a/battle/effects/rollout.asm
+++ b/battle/effects/rollout.asm
@@ -7,19 +7,18 @@
 	ld de, PlayerRolloutCount
 	ld a, [hBattleTurn]
 	and a
-	jr z, .asm_37723
+	jr z, .ok
 	ld de, EnemyRolloutCount
-
-.asm_37723
+.ok
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVar
-	bit SUBSTATUS_ENCORED, a
-	jr z, .asm_37731
+	bit SUBSTATUS_ROLLOUT, a
+	jr z, .reset
 
 	ld b, $4 ; doturn
 	jp SkipToBattleCommand
 
-.asm_37731
+.reset
 	xor a
 	ld [de], a
 	ret
@@ -66,13 +65,13 @@
 
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVarAddr
-	res SUBSTATUS_ENCORED, [hl]
+	res SUBSTATUS_ROLLOUT, [hl]
 	jr .asm_37775
 
 .asm_3776e
 	ld a, BATTLE_VARS_SUBSTATUS1
 	call GetBattleVarAddr
-	set SUBSTATUS_ENCORED, [hl]
+	set SUBSTATUS_ROLLOUT, [hl]
 
 .asm_37775
 	ld a, BATTLE_VARS_SUBSTATUS2
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -86,7 +86,7 @@
 
 ; substatus
 SUBSTATUS_IN_LOVE      EQU 7
-SUBSTATUS_ENCORED      EQU 6
+SUBSTATUS_ROLLOUT      EQU 6
 SUBSTATUS_ENDURE       EQU 5
 SUBSTATUS_PERISH       EQU 4
 SUBSTATUS_IDENTIFIED   EQU 3
@@ -101,7 +101,7 @@
 SUBSTATUS_UNDERGROUND  EQU 5
 SUBSTATUS_CHARGED      EQU 4
 SUBSTATUS_FLINCHED     EQU 3
-SUBSTATUS_ROLLOUT      EQU 1
+SUBSTATUS_RAMPAGE      EQU 1
 SUBSTATUS_BIDE         EQU 0
 
 SUBSTATUS_LEECH_SEED   EQU 7
@@ -115,6 +115,7 @@
 SUBSTATUS_CANT_RUN     EQU 7
 SUBSTATUS_DESTINY_BOND EQU 6
 SUBSTATUS_LOCK_ON      EQU 5
+SUBSTATUS_ENCORED      EQU 4
 SUBSTATUS_TRANSFORMED  EQU 3
 SUBSTATUS_TOXIC        EQU 0
 
--- a/wram.asm
+++ b/wram.asm
@@ -433,6 +433,7 @@
 	ds 1
 PlayerConfuseCount:: ; c673
 	ds 1
+PlayerToxicCount:: ; c674
 	ds 1
 PlayerDisableCount:: ; c675
 	ds 1
@@ -449,6 +450,7 @@
 	ds 1
 EnemyConfuseCount:: ; c67b
 	ds 1
+EnemyToxicCount:: ; c67c
 	ds 1
 EnemyDisableCount:: ; c67d
 	ds 1
--