From 5f0597e944144763fed4275db45a433a235c4448 Mon Sep 17 00:00:00 2001 From: vulcandth Date: Fri, 17 Jun 2022 21:25:56 -0500 Subject: [PATCH] Rename `SLP` to `SLP_MASK` (#918) Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> --- constants/battle_constants.asm | 4 ++-- data/battle/held_heal_status.asm | 2 +- data/items/heal_status.asm | 4 ++-- docs/bugs_and_glitches.md | 2 +- engine/battle/ai/items.asm | 2 +- engine/battle/ai/redundant.asm | 4 ++-- engine/battle/ai/scoring.asm | 4 ++-- engine/battle/core.asm | 2 +- engine/battle/effect_commands.asm | 26 +++++++++++------------ engine/battle/move_effects/baton_pass.asm | 2 +- engine/battle/move_effects/nightmare.asm | 2 +- engine/battle/move_effects/rollout.asm | 2 +- engine/battle/move_effects/sleep_talk.asm | 2 +- engine/battle/move_effects/snore.asm | 2 +- engine/items/item_effects.asm | 6 +++--- engine/pokemon/mon_stats.asm | 2 +- engine/pokemon/stats_screen.asm | 2 +- 17 files changed, 35 insertions(+), 35 deletions(-) diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 91a5cdf9f..cc5e36d08 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -154,14 +154,14 @@ assert const_value % 2 == 0 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 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 diff --git a/data/battle/held_heal_status.asm b/data/battle/held_heal_status.asm index ac11b645b..87cf82a3d 100644 --- a/data/battle/held_heal_status.asm +++ b/data/battle/held_heal_status.asm @@ -4,7 +4,7 @@ HeldStatusHealingEffects: 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 diff --git a/data/items/heal_status.asm b/data/items/heal_status.asm index b39f2f80d..ea65811e2 100644 --- a/data/items/heal_status.asm +++ b/data/items/heal_status.asm @@ -5,7 +5,7 @@ StatusHealingActions: 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 @@ StatusHealingActions: 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 diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index dd4c61cf7..405b39f62 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -1148,7 +1148,7 @@ This can occur if your party and current PC box are both full when you start the -; 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] diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index 0eeb8dc3b..035e8a15f 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -319,7 +319,7 @@ AI_Items: jp c, .Use .FailToxicCheck: ld a, [wEnemyMonStatus] - and 1 << FRZ | SLP + and 1 << FRZ | SLP_MASK jp z, .DontUse jp .Use diff --git a/engine/battle/ai/redundant.asm b/engine/battle/ai/redundant.asm index d78fccb84..ba27fe933 100644 --- a/engine/battle/ai/redundant.asm +++ b/engine/battle/ai/redundant.asm @@ -102,7 +102,7 @@ AI_Redundant: .Snore: .SleepTalk: ld a, [wEnemyMonStatus] - and SLP + and SLP_MASK jr z, .Redundant jr .NotRedundant @@ -166,7 +166,7 @@ AI_Redundant: .DreamEater: ld a, [wBattleMonStatus] - and SLP + and SLP_MASK jr z, .Redundant jr .NotRedundant diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index 1116e2c6b..f459a63ea 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -1472,7 +1472,7 @@ AI_Smart_SleepTalk: ; Greatly discourage this move otherwise. ld a, [wEnemyMonStatus] - and SLP + and SLP_MASK cp 1 jr z, .discourage @@ -1610,7 +1610,7 @@ AI_Smart_HealBell: jr z, .ok dec [hl] .ok - and 1 << FRZ | SLP + and 1 << FRZ | SLP_MASK ret z call AI_50_50 ret c diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4e7fc53c6..5d66d1793 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -765,7 +765,7 @@ TryEnemyFlee: jr nz, .Stay ld a, [wEnemyMonStatus] - and 1 << FRZ | SLP + and 1 << FRZ | SLP_MASK jr nz, .Stay ld a, [wTempEnemyMonSpecies] diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index fbc12824d..c900954bf 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -147,12 +147,12 @@ BattleCommand_CheckTurn: 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 @@ CheckEnemyTurn: ld hl, wEnemyMonStatus ld a, [hl] - and SLP + and SLP_MASK jr z, .not_asleep dec a @@ -772,7 +772,7 @@ BattleCommand_CheckObedience: call BattleRandom add a swap a - and SLP + and SLP_MASK jr z, .Nap ld [wBattleMonStatus], a @@ -925,7 +925,7 @@ IgnoreSleepOnly: .CheckSleep: ld a, BATTLE_VARS_STATUS call GetBattleVar - and SLP + and SLP_MASK ret z ; 'ignored orders…sleeping!' @@ -1636,7 +1636,7 @@ BattleCommand_CheckHit: ld a, BATTLE_VARS_STATUS_OPP call GetBattleVar - and SLP + and SLP_MASK ret .Protect: @@ -3589,7 +3589,7 @@ BattleCommand_SleepTarget: ld d, h ld e, l ld a, [de] - and SLP + and SLP_MASK ld hl, AlreadyAsleepText jr nz, .fail @@ -3609,7 +3609,7 @@ BattleCommand_SleepTarget: 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 @@ BattleCommand_SleepTarget: 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 @@ BattleCommand_Rampage: ; 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 @@ BattleCommand_FakeOut: 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 @@ BattleCommand_FlinchTarget: 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 @@ BattleCommand_Charge: call BattleCommand_ClearText ld a, BATTLE_VARS_STATUS call GetBattleVar - and SLP + and SLP_MASK jr z, .awake call BattleCommand_MoveDelay diff --git a/engine/battle/move_effects/baton_pass.asm b/engine/battle/move_effects/baton_pass.asm index 622aa2b4c..29759f087 100644 --- a/engine/battle/move_effects/baton_pass.asm +++ b/engine/battle/move_effects/baton_pass.asm @@ -128,7 +128,7 @@ ResetBatonPassStatus: ; Nightmare isn't passed. ld a, BATTLE_VARS_STATUS call GetBattleVar - and SLP + and SLP_MASK jr nz, .ok ld a, BATTLE_VARS_SUBSTATUS1 diff --git a/engine/battle/move_effects/nightmare.asm b/engine/battle/move_effects/nightmare.asm index 192cd743c..c0d926c00 100644 --- a/engine/battle/move_effects/nightmare.asm +++ b/engine/battle/move_effects/nightmare.asm @@ -13,7 +13,7 @@ BattleCommand_Nightmare: 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. diff --git a/engine/battle/move_effects/rollout.asm b/engine/battle/move_effects/rollout.asm index 0b5124317..1734d1be0 100644 --- a/engine/battle/move_effects/rollout.asm +++ b/engine/battle/move_effects/rollout.asm @@ -23,7 +23,7 @@ BattleCommand_CheckCurl: BattleCommand_RolloutPower: ld a, BATTLE_VARS_STATUS call GetBattleVar - and SLP + and SLP_MASK ret nz ld hl, wPlayerRolloutCount diff --git a/engine/battle/move_effects/sleep_talk.asm b/engine/battle/move_effects/sleep_talk.asm index c0d7f8b74..091cee16c 100644 --- a/engine/battle/move_effects/sleep_talk.asm +++ b/engine/battle/move_effects/sleep_talk.asm @@ -15,7 +15,7 @@ BattleCommand_SleepTalk: .got_moves ld a, BATTLE_VARS_STATUS call GetBattleVar - and SLP + and SLP_MASK jr z, .fail ld a, [hl] and a diff --git a/engine/battle/move_effects/snore.asm b/engine/battle/move_effects/snore.asm index ade87551c..a8b14f26a 100644 --- 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 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index a4157d908..0462cad42 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -341,7 +341,7 @@ PokeBallEffect: ; 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 @@ PokeFluteEffect: xor a ld [wPokeFluteCuredSleep], a - ld b, ~SLP + ld b, ~SLP_MASK ld hl, wPartyMon1Status call .CureSleep @@ -2231,7 +2231,7 @@ PokeFluteEffect: .loop ld a, [hl] push af - and SLP + and SLP_MASK jr z, .not_asleep ld a, TRUE ld [wPokeFluteCuredSleep], a diff --git a/engine/pokemon/mon_stats.asm b/engine/pokemon/mon_stats.asm index 78f963ebd..078c21fdb 100644 --- a/engine/pokemon/mon_stats.asm +++ b/engine/pokemon/mon_stats.asm @@ -416,7 +416,7 @@ PlaceNonFaintStatus: bit PAR, a jr nz, .place ld de, SlpString - and SLP + and SLP_MASK jr z, .no_status .place diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index a56cde835..cc7d85616 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -1183,7 +1183,7 @@ CheckFaintedFrzSlp: 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