shithub: pokecrystal

Download patch

ref: 5f0597e944144763fed4275db45a433a235c4448
parent: 73c020074e667d06a61655bbe06dc9b3e3744e03
author: vulcandth <vulcandth@gmail.com>
date: Fri Jun 17 17:25:56 EDT 2022

Rename `SLP` to `SLP_MASK` (#918)

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>

--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -154,7 +154,7 @@
 DEF NUM_BATTLE_VAR_LOCATION_PAIRS EQU const_value / 2
 
 ; status condition bit flags
-DEF SLP EQU %111 ; 0-7 turns
+DEF SLP_MASK EQU %111 ; 0-7 turns
 	const_def 3
 	const PSN
 	const BRN
@@ -161,7 +161,7 @@
 	const FRZ
 	const PAR
 
-DEF ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP
+DEF ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP_MASK
 
 ; wPlayerSubStatus1 or wEnemySubStatus1 bit flags
 	const_def
--- a/data/battle/held_heal_status.asm
+++ b/data/battle/held_heal_status.asm
@@ -4,7 +4,7 @@
 	db HELD_HEAL_POISON,   1 << PSN
 	db HELD_HEAL_FREEZE,   1 << FRZ
 	db HELD_HEAL_BURN,     1 << BRN
-	db HELD_HEAL_SLEEP,    SLP
+	db HELD_HEAL_SLEEP,    SLP_MASK
 	db HELD_HEAL_PARALYZE, 1 << PAR
 	db HELD_HEAL_STATUS,   ALL_STATUS
 	db -1 ; end
--- a/data/items/heal_status.asm
+++ b/data/items/heal_status.asm
@@ -5,7 +5,7 @@
 	db ANTIDOTE,     PARTYMENUTEXT_HEAL_PSN, 1 << PSN
 	db BURN_HEAL,    PARTYMENUTEXT_HEAL_BRN, 1 << BRN
 	db ICE_HEAL,     PARTYMENUTEXT_HEAL_FRZ, 1 << FRZ
-	db AWAKENING,    PARTYMENUTEXT_HEAL_SLP, SLP
+	db AWAKENING,    PARTYMENUTEXT_HEAL_SLP, SLP_MASK
 	db PARLYZ_HEAL,  PARTYMENUTEXT_HEAL_PAR, 1 << PAR
 	db FULL_HEAL,    PARTYMENUTEXT_HEAL_ALL, %11111111
 	db FULL_RESTORE, PARTYMENUTEXT_HEAL_ALL, %11111111
@@ -14,6 +14,6 @@
 	db PRZCUREBERRY, PARTYMENUTEXT_HEAL_PAR, 1 << PAR
 	db BURNT_BERRY,  PARTYMENUTEXT_HEAL_FRZ, 1 << FRZ
 	db ICE_BERRY,    PARTYMENUTEXT_HEAL_BRN, 1 << BRN
-	db MINT_BERRY,   PARTYMENUTEXT_HEAL_SLP, SLP
+	db MINT_BERRY,   PARTYMENUTEXT_HEAL_SLP, SLP_MASK
 	db MIRACLEBERRY, PARTYMENUTEXT_HEAL_ALL, %11111111
 	db -1, 0, 0 ; end
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -1148,7 +1148,7 @@
 -; Uncomment the line below to fix this.
  	ld b, a
  	ld a, [wEnemyMonStatus]
- 	and 1 << FRZ | SLP
+ 	and 1 << FRZ | SLP_MASK
  	ld c, 10
  	jr nz, .addstatus
 -	; ld a, [wEnemyMonStatus]
--- a/engine/battle/ai/items.asm
+++ b/engine/battle/ai/items.asm
@@ -319,7 +319,7 @@
 	jp c, .Use
 .FailToxicCheck:
 	ld a, [wEnemyMonStatus]
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	jp z, .DontUse
 	jp .Use
 
--- a/engine/battle/ai/redundant.asm
+++ b/engine/battle/ai/redundant.asm
@@ -102,7 +102,7 @@
 .Snore:
 .SleepTalk:
 	ld a, [wEnemyMonStatus]
-	and SLP
+	and SLP_MASK
 	jr z, .Redundant
 	jr .NotRedundant
 
@@ -166,7 +166,7 @@
 
 .DreamEater:
 	ld a, [wBattleMonStatus]
-	and SLP
+	and SLP_MASK
 	jr z, .Redundant
 	jr .NotRedundant
 
--- a/engine/battle/ai/scoring.asm
+++ b/engine/battle/ai/scoring.asm
@@ -1472,7 +1472,7 @@
 ; Greatly discourage this move otherwise.
 
 	ld a, [wEnemyMonStatus]
-	and SLP
+	and SLP_MASK
 	cp 1
 	jr z, .discourage
 
@@ -1610,7 +1610,7 @@
 	jr z, .ok
 	dec [hl]
 .ok
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	ret z
 	call AI_50_50
 	ret c
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -765,7 +765,7 @@
 	jr nz, .Stay
 
 	ld a, [wEnemyMonStatus]
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	jr nz, .Stay
 
 	ld a, [wTempEnemyMonSpecies]
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -147,12 +147,12 @@
 
 	ld hl, wBattleMonStatus
 	ld a, [hl]
-	and SLP
+	and SLP_MASK
 	jr z, .not_asleep
 
 	dec a
 	ld [wBattleMonStatus], a
-	and SLP
+	and SLP_MASK
 	jr z, .woke_up
 
 	xor a
@@ -376,7 +376,7 @@
 
 	ld hl, wEnemyMonStatus
 	ld a, [hl]
-	and SLP
+	and SLP_MASK
 	jr z, .not_asleep
 
 	dec a
@@ -772,7 +772,7 @@
 	call BattleRandom
 	add a
 	swap a
-	and SLP
+	and SLP_MASK
 	jr z, .Nap
 
 	ld [wBattleMonStatus], a
@@ -925,7 +925,7 @@
 .CheckSleep:
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	ret z
 
 ; 'ignored orders…sleeping!'
@@ -1636,7 +1636,7 @@
 
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	ret
 
 .Protect:
@@ -3589,7 +3589,7 @@
 	ld d, h
 	ld e, l
 	ld a, [de]
-	and SLP
+	and SLP_MASK
 	ld hl, AlreadyAsleepText
 	jr nz, .fail
 
@@ -3609,7 +3609,7 @@
 	jr nz, .fail
 
 	call AnimateCurrentMove
-	ld b, SLP
+	ld b, SLP_MASK
 	ld a, [wInBattleTowerBattle]
 	and a
 	jr z, .random_loop
@@ -3619,7 +3619,7 @@
 	call BattleRandom
 	and b
 	jr z, .random_loop
-	cp SLP
+	cp SLP_MASK
 	jr z, .random_loop
 	inc a
 	ld [de], a
@@ -4926,7 +4926,7 @@
 ; No rampage during Sleep Talk.
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	ret nz
 
 	ld de, wPlayerRolloutCount
@@ -5344,7 +5344,7 @@
 
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	jr nz, .fail
 
 	call CheckOpponentWentFirst
@@ -5361,7 +5361,7 @@
 
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVar
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	ret nz
 
 	call CheckOpponentWentFirst
@@ -5477,7 +5477,7 @@
 	call BattleCommand_ClearText
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	jr z, .awake
 
 	call BattleCommand_MoveDelay
--- a/engine/battle/move_effects/baton_pass.asm
+++ b/engine/battle/move_effects/baton_pass.asm
@@ -128,7 +128,7 @@
 	; Nightmare isn't passed.
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	jr nz, .ok
 
 	ld a, BATTLE_VARS_SUBSTATUS1
--- a/engine/battle/move_effects/nightmare.asm
+++ b/engine/battle/move_effects/nightmare.asm
@@ -13,7 +13,7 @@
 
 	ld a, BATTLE_VARS_STATUS_OPP
 	call GetBattleVarAddr
-	and SLP
+	and SLP_MASK
 	jr z, .failed
 
 ; Bail if the opponent is already having a nightmare.
--- a/engine/battle/move_effects/rollout.asm
+++ b/engine/battle/move_effects/rollout.asm
@@ -23,7 +23,7 @@
 BattleCommand_RolloutPower:
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	ret nz
 
 	ld hl, wPlayerRolloutCount
--- a/engine/battle/move_effects/sleep_talk.asm
+++ b/engine/battle/move_effects/sleep_talk.asm
@@ -15,7 +15,7 @@
 .got_moves
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	jr z, .fail
 	ld a, [hl]
 	and a
--- a/engine/battle/move_effects/snore.asm
+++ b/engine/battle/move_effects/snore.asm
@@ -1,7 +1,7 @@
 BattleCommand_Snore:
 	ld a, BATTLE_VARS_STATUS
 	call GetBattleVar
-	and SLP
+	and SLP_MASK
 	ret nz
 	call ResetDamage
 	ld a, $1
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -341,7 +341,7 @@
 ; Uncomment the line below to fix this.
 	ld b, a
 	ld a, [wEnemyMonStatus]
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	ld c, 10
 	jr nz, .addstatus
 	; ld a, [wEnemyMonStatus]
@@ -2189,7 +2189,7 @@
 	xor a
 	ld [wPokeFluteCuredSleep], a
 
-	ld b, ~SLP
+	ld b, ~SLP_MASK
 
 	ld hl, wPartyMon1Status
 	call .CureSleep
@@ -2231,7 +2231,7 @@
 .loop
 	ld a, [hl]
 	push af
-	and SLP
+	and SLP_MASK
 	jr z, .not_asleep
 	ld a, TRUE
 	ld [wPokeFluteCuredSleep], a
--- a/engine/pokemon/mon_stats.asm
+++ b/engine/pokemon/mon_stats.asm
@@ -416,7 +416,7 @@
 	bit PAR, a
 	jr nz, .place
 	ld de, SlpString
-	and SLP
+	and SLP_MASK
 	jr z, .no_status
 
 .place
--- a/engine/pokemon/stats_screen.asm
+++ b/engine/pokemon/stats_screen.asm
@@ -1183,7 +1183,7 @@
 	ld hl, MON_STATUS
 	add hl, bc
 	ld a, [hl]
-	and 1 << FRZ | SLP
+	and 1 << FRZ | SLP_MASK
 	jr nz, .fainted_frz_slp
 	and a
 	ret