Rename SLP to SLP_MASK (#918)

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
This commit is contained in:
vulcandth 2022-06-17 21:25:56 -05:00 committed by GitHub
parent 73c020074e
commit 5f0597e944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 35 additions and 35 deletions

View File

@ -154,14 +154,14 @@ assert const_value % 2 == 0
DEF NUM_BATTLE_VAR_LOCATION_PAIRS EQU const_value / 2 DEF NUM_BATTLE_VAR_LOCATION_PAIRS EQU const_value / 2
; status condition bit flags ; status condition bit flags
DEF SLP EQU %111 ; 0-7 turns DEF SLP_MASK EQU %111 ; 0-7 turns
const_def 3 const_def 3
const PSN const PSN
const BRN const BRN
const FRZ const FRZ
const PAR 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 ; wPlayerSubStatus1 or wEnemySubStatus1 bit flags
const_def const_def

View File

@ -4,7 +4,7 @@ HeldStatusHealingEffects:
db HELD_HEAL_POISON, 1 << PSN db HELD_HEAL_POISON, 1 << PSN
db HELD_HEAL_FREEZE, 1 << FRZ db HELD_HEAL_FREEZE, 1 << FRZ
db HELD_HEAL_BURN, 1 << BRN 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_PARALYZE, 1 << PAR
db HELD_HEAL_STATUS, ALL_STATUS db HELD_HEAL_STATUS, ALL_STATUS
db -1 ; end db -1 ; end

View File

@ -5,7 +5,7 @@ StatusHealingActions:
db ANTIDOTE, PARTYMENUTEXT_HEAL_PSN, 1 << PSN db ANTIDOTE, PARTYMENUTEXT_HEAL_PSN, 1 << PSN
db BURN_HEAL, PARTYMENUTEXT_HEAL_BRN, 1 << BRN db BURN_HEAL, PARTYMENUTEXT_HEAL_BRN, 1 << BRN
db ICE_HEAL, PARTYMENUTEXT_HEAL_FRZ, 1 << FRZ 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 PARLYZ_HEAL, PARTYMENUTEXT_HEAL_PAR, 1 << PAR
db FULL_HEAL, PARTYMENUTEXT_HEAL_ALL, %11111111 db FULL_HEAL, PARTYMENUTEXT_HEAL_ALL, %11111111
db FULL_RESTORE, PARTYMENUTEXT_HEAL_ALL, %11111111 db FULL_RESTORE, PARTYMENUTEXT_HEAL_ALL, %11111111
@ -14,6 +14,6 @@ StatusHealingActions:
db PRZCUREBERRY, PARTYMENUTEXT_HEAL_PAR, 1 << PAR db PRZCUREBERRY, PARTYMENUTEXT_HEAL_PAR, 1 << PAR
db BURNT_BERRY, PARTYMENUTEXT_HEAL_FRZ, 1 << FRZ db BURNT_BERRY, PARTYMENUTEXT_HEAL_FRZ, 1 << FRZ
db ICE_BERRY, PARTYMENUTEXT_HEAL_BRN, 1 << BRN 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 MIRACLEBERRY, PARTYMENUTEXT_HEAL_ALL, %11111111
db -1, 0, 0 ; end db -1, 0, 0 ; end

View File

@ -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. -; Uncomment the line below to fix this.
ld b, a ld b, a
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
ld c, 10 ld c, 10
jr nz, .addstatus jr nz, .addstatus
- ; ld a, [wEnemyMonStatus] - ; ld a, [wEnemyMonStatus]

View File

@ -319,7 +319,7 @@ AI_Items:
jp c, .Use jp c, .Use
.FailToxicCheck: .FailToxicCheck:
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
jp z, .DontUse jp z, .DontUse
jp .Use jp .Use

View File

@ -102,7 +102,7 @@ AI_Redundant:
.Snore: .Snore:
.SleepTalk: .SleepTalk:
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and SLP and SLP_MASK
jr z, .Redundant jr z, .Redundant
jr .NotRedundant jr .NotRedundant
@ -166,7 +166,7 @@ AI_Redundant:
.DreamEater: .DreamEater:
ld a, [wBattleMonStatus] ld a, [wBattleMonStatus]
and SLP and SLP_MASK
jr z, .Redundant jr z, .Redundant
jr .NotRedundant jr .NotRedundant

View File

@ -1472,7 +1472,7 @@ AI_Smart_SleepTalk:
; Greatly discourage this move otherwise. ; Greatly discourage this move otherwise.
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and SLP and SLP_MASK
cp 1 cp 1
jr z, .discourage jr z, .discourage
@ -1610,7 +1610,7 @@ AI_Smart_HealBell:
jr z, .ok jr z, .ok
dec [hl] dec [hl]
.ok .ok
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
ret z ret z
call AI_50_50 call AI_50_50
ret c ret c

View File

@ -765,7 +765,7 @@ TryEnemyFlee:
jr nz, .Stay jr nz, .Stay
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
jr nz, .Stay jr nz, .Stay
ld a, [wTempEnemyMonSpecies] ld a, [wTempEnemyMonSpecies]

View File

@ -147,12 +147,12 @@ BattleCommand_CheckTurn:
ld hl, wBattleMonStatus ld hl, wBattleMonStatus
ld a, [hl] ld a, [hl]
and SLP and SLP_MASK
jr z, .not_asleep jr z, .not_asleep
dec a dec a
ld [wBattleMonStatus], a ld [wBattleMonStatus], a
and SLP and SLP_MASK
jr z, .woke_up jr z, .woke_up
xor a xor a
@ -376,7 +376,7 @@ CheckEnemyTurn:
ld hl, wEnemyMonStatus ld hl, wEnemyMonStatus
ld a, [hl] ld a, [hl]
and SLP and SLP_MASK
jr z, .not_asleep jr z, .not_asleep
dec a dec a
@ -772,7 +772,7 @@ BattleCommand_CheckObedience:
call BattleRandom call BattleRandom
add a add a
swap a swap a
and SLP and SLP_MASK
jr z, .Nap jr z, .Nap
ld [wBattleMonStatus], a ld [wBattleMonStatus], a
@ -925,7 +925,7 @@ IgnoreSleepOnly:
.CheckSleep: .CheckSleep:
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
ret z ret z
; 'ignored orders…sleeping!' ; 'ignored orders…sleeping!'
@ -1636,7 +1636,7 @@ BattleCommand_CheckHit:
ld a, BATTLE_VARS_STATUS_OPP ld a, BATTLE_VARS_STATUS_OPP
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
ret ret
.Protect: .Protect:
@ -3589,7 +3589,7 @@ BattleCommand_SleepTarget:
ld d, h ld d, h
ld e, l ld e, l
ld a, [de] ld a, [de]
and SLP and SLP_MASK
ld hl, AlreadyAsleepText ld hl, AlreadyAsleepText
jr nz, .fail jr nz, .fail
@ -3609,7 +3609,7 @@ BattleCommand_SleepTarget:
jr nz, .fail jr nz, .fail
call AnimateCurrentMove call AnimateCurrentMove
ld b, SLP ld b, SLP_MASK
ld a, [wInBattleTowerBattle] ld a, [wInBattleTowerBattle]
and a and a
jr z, .random_loop jr z, .random_loop
@ -3619,7 +3619,7 @@ BattleCommand_SleepTarget:
call BattleRandom call BattleRandom
and b and b
jr z, .random_loop jr z, .random_loop
cp SLP cp SLP_MASK
jr z, .random_loop jr z, .random_loop
inc a inc a
ld [de], a ld [de], a
@ -4926,7 +4926,7 @@ BattleCommand_Rampage:
; No rampage during Sleep Talk. ; No rampage during Sleep Talk.
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
ret nz ret nz
ld de, wPlayerRolloutCount ld de, wPlayerRolloutCount
@ -5344,7 +5344,7 @@ BattleCommand_FakeOut:
ld a, BATTLE_VARS_STATUS_OPP ld a, BATTLE_VARS_STATUS_OPP
call GetBattleVar call GetBattleVar
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
jr nz, .fail jr nz, .fail
call CheckOpponentWentFirst call CheckOpponentWentFirst
@ -5361,7 +5361,7 @@ BattleCommand_FlinchTarget:
ld a, BATTLE_VARS_STATUS_OPP ld a, BATTLE_VARS_STATUS_OPP
call GetBattleVar call GetBattleVar
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
ret nz ret nz
call CheckOpponentWentFirst call CheckOpponentWentFirst
@ -5477,7 +5477,7 @@ BattleCommand_Charge:
call BattleCommand_ClearText call BattleCommand_ClearText
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
jr z, .awake jr z, .awake
call BattleCommand_MoveDelay call BattleCommand_MoveDelay

View File

@ -128,7 +128,7 @@ ResetBatonPassStatus:
; Nightmare isn't passed. ; Nightmare isn't passed.
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
jr nz, .ok jr nz, .ok
ld a, BATTLE_VARS_SUBSTATUS1 ld a, BATTLE_VARS_SUBSTATUS1

View File

@ -13,7 +13,7 @@ BattleCommand_Nightmare:
ld a, BATTLE_VARS_STATUS_OPP ld a, BATTLE_VARS_STATUS_OPP
call GetBattleVarAddr call GetBattleVarAddr
and SLP and SLP_MASK
jr z, .failed jr z, .failed
; Bail if the opponent is already having a nightmare. ; Bail if the opponent is already having a nightmare.

View File

@ -23,7 +23,7 @@ BattleCommand_CheckCurl:
BattleCommand_RolloutPower: BattleCommand_RolloutPower:
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
ret nz ret nz
ld hl, wPlayerRolloutCount ld hl, wPlayerRolloutCount

View File

@ -15,7 +15,7 @@ BattleCommand_SleepTalk:
.got_moves .got_moves
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
jr z, .fail jr z, .fail
ld a, [hl] ld a, [hl]
and a and a

View File

@ -1,7 +1,7 @@
BattleCommand_Snore: BattleCommand_Snore:
ld a, BATTLE_VARS_STATUS ld a, BATTLE_VARS_STATUS
call GetBattleVar call GetBattleVar
and SLP and SLP_MASK
ret nz ret nz
call ResetDamage call ResetDamage
ld a, $1 ld a, $1

View File

@ -341,7 +341,7 @@ PokeBallEffect:
; Uncomment the line below to fix this. ; Uncomment the line below to fix this.
ld b, a ld b, a
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
ld c, 10 ld c, 10
jr nz, .addstatus jr nz, .addstatus
; ld a, [wEnemyMonStatus] ; ld a, [wEnemyMonStatus]
@ -2189,7 +2189,7 @@ PokeFluteEffect:
xor a xor a
ld [wPokeFluteCuredSleep], a ld [wPokeFluteCuredSleep], a
ld b, ~SLP ld b, ~SLP_MASK
ld hl, wPartyMon1Status ld hl, wPartyMon1Status
call .CureSleep call .CureSleep
@ -2231,7 +2231,7 @@ PokeFluteEffect:
.loop .loop
ld a, [hl] ld a, [hl]
push af push af
and SLP and SLP_MASK
jr z, .not_asleep jr z, .not_asleep
ld a, TRUE ld a, TRUE
ld [wPokeFluteCuredSleep], a ld [wPokeFluteCuredSleep], a

View File

@ -416,7 +416,7 @@ PlaceNonFaintStatus:
bit PAR, a bit PAR, a
jr nz, .place jr nz, .place
ld de, SlpString ld de, SlpString
and SLP and SLP_MASK
jr z, .no_status jr z, .no_status
.place .place

View File

@ -1183,7 +1183,7 @@ CheckFaintedFrzSlp:
ld hl, MON_STATUS ld hl, MON_STATUS
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and 1 << FRZ | SLP and 1 << FRZ | SLP_MASK
jr nz, .fainted_frz_slp jr nz, .fainted_frz_slp
and a and a
ret ret