Rename SLP to SLP_MASK (#361)

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

View file

@ -57,7 +57,7 @@ DEF NOT_VERY_EFFECTIVE EQU 05
DEF NO_EFFECT EQU 00 DEF NO_EFFECT EQU 00
; non-volatile statuses ; non-volatile statuses
DEF SLP EQU %111 ; sleep counter DEF SLP_MASK EQU %111 ; 0-7 turns
const_def 3 const_def 3
const PSN ; 3 const PSN ; 3
const BRN ; 4 const BRN ; 4

View file

@ -308,7 +308,7 @@ MainInBattleLoop:
and a and a
ret nz ; return if pokedoll was used to escape from battle ret nz ; return if pokedoll was used to escape from battle
ld a, [wBattleMonStatus] ld a, [wBattleMonStatus]
and (1 << FRZ) | SLP ; is mon frozen or asleep? and (1 << FRZ) | SLP_MASK
jr nz, .selectEnemyMove ; if so, jump jr nz, .selectEnemyMove ; if so, jump
ld a, [wPlayerBattleStatus1] ld a, [wPlayerBattleStatus1]
and (1 << STORING_ENERGY) | (1 << USING_TRAPPING_MOVE) ; check player is using Bide or using a multi-turn attack like wrap and (1 << STORING_ENERGY) | (1 << USING_TRAPPING_MOVE) ; check player is using Bide or using a multi-turn attack like wrap
@ -2934,7 +2934,7 @@ SelectEnemyMove:
and (1 << CHARGING_UP) | (1 << THRASHING_ABOUT) ; using a charging move or thrash/petal dance and (1 << CHARGING_UP) | (1 << THRASHING_ABOUT) ; using a charging move or thrash/petal dance
ret nz ret nz
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and SLP | 1 << FRZ ; sleeping or frozen and (1 << FRZ) | SLP_MASK
ret nz ret nz
ld a, [wEnemyBattleStatus1] ld a, [wEnemyBattleStatus1]
and (1 << USING_TRAPPING_MOVE) | (1 << STORING_ENERGY) ; using a trapping move like wrap or bide and (1 << USING_TRAPPING_MOVE) | (1 << STORING_ENERGY) ; using a trapping move like wrap or bide
@ -3275,7 +3275,7 @@ PrintGhostText:
and a and a
jr nz, .Ghost jr nz, .Ghost
ld a, [wBattleMonStatus] ; player's turn ld a, [wBattleMonStatus] ; player's turn
and SLP | (1 << FRZ) and (1 << FRZ) | SLP_MASK
ret nz ret nz
ld hl, ScaredText ld hl, ScaredText
call PrintText call PrintText
@ -3317,7 +3317,7 @@ IsGhostBattle:
CheckPlayerStatusConditions: CheckPlayerStatusConditions:
ld hl, wBattleMonStatus ld hl, wBattleMonStatus
ld a, [hl] ld a, [hl]
and SLP ; sleep mask and SLP_MASK
jr z, .FrozenCheck jr z, .FrozenCheck
; sleeping ; sleeping
dec a dec a
@ -4029,7 +4029,7 @@ CheckForDisobedience:
call BattleRandom call BattleRandom
add a add a
swap a swap a
and SLP ; sleep mask and SLP_MASK
jr z, .monNaps ; keep trying until we get at least 1 turn of sleep jr z, .monNaps ; keep trying until we get at least 1 turn of sleep
ld [wBattleMonStatus], a ld [wBattleMonStatus], a
ld hl, BeganToNapText ld hl, BeganToNapText
@ -5362,7 +5362,7 @@ MoveHitTest:
cp DREAM_EATER_EFFECT cp DREAM_EATER_EFFECT
jr nz, .swiftCheck jr nz, .swiftCheck
ld a, [bc] ld a, [bc]
and SLP ; is the target pokemon sleeping? and SLP_MASK
jp z, .moveMissed jp z, .moveMissed
.swiftCheck .swiftCheck
ld a, [de] ld a, [de]
@ -5796,7 +5796,7 @@ ExecuteEnemyMoveDone:
CheckEnemyStatusConditions: CheckEnemyStatusConditions:
ld hl, wEnemyMonStatus ld hl, wEnemyMonStatus
ld a, [hl] ld a, [hl]
and SLP ; sleep mask and SLP_MASK
jr z, .checkIfFrozen jr z, .checkIfFrozen
dec a ; decrement number of turns left dec a ; decrement number of turns left
ld [wEnemyMonStatus], a ld [wEnemyMonStatus], a

View file

@ -24,7 +24,7 @@ HazeEffect_:
.cureStatuses .cureStatuses
ld a, [hl] ld a, [hl]
ld [hl], $0 ld [hl], $0
and SLP | (1 << FRZ) and (1 << FRZ) | SLP_MASK
jr z, .cureVolatileStatuses jr z, .cureVolatileStatuses
; prevent the Pokemon from executing a move if it was asleep or frozen ; prevent the Pokemon from executing a move if it was asleep or frozen
ld a, $ff ld a, $ff

View file

@ -225,7 +225,7 @@ ItemUseBall:
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and a and a
jr z, .skipAilmentValueSubtraction ; no ailments jr z, .skipAilmentValueSubtraction ; no ailments
and 1 << FRZ | SLP and (1 << FRZ) | SLP_MASK
ld c, 12 ld c, 12
jr z, .notFrozenOrAsleep jr z, .notFrozenOrAsleep
ld c, 25 ld c, 25
@ -380,7 +380,7 @@ ItemUseBall:
ld a, [wEnemyMonStatus] ld a, [wEnemyMonStatus]
and a and a
jr z, .skip5 jr z, .skip5
and 1 << FRZ | SLP and (1 << FRZ) | SLP_MASK
ld b, 5 ld b, 5
jr z, .addAilmentValue jr z, .addAilmentValue
ld b, 10 ld b, 10
@ -878,7 +878,7 @@ ItemUseMedicine:
lb bc, ICE_HEAL_MSG, 1 << FRZ lb bc, ICE_HEAL_MSG, 1 << FRZ
cp ICE_HEAL cp ICE_HEAL
jr z, .checkMonStatus jr z, .checkMonStatus
lb bc, AWAKENING_MSG, SLP lb bc, AWAKENING_MSG, SLP_MASK
cp AWAKENING cp AWAKENING
jr z, .checkMonStatus jr z, .checkMonStatus
lb bc, PARALYZ_HEAL_MSG, 1 << PAR lb bc, PARALYZ_HEAL_MSG, 1 << PAR
@ -1700,7 +1700,7 @@ ItemUsePokeflute:
.inBattle .inBattle
xor a xor a
ld [wWereAnyMonsAsleep], a ld [wWereAnyMonsAsleep], a
ld b, ~SLP & $ff ld b, ~SLP_MASK
ld hl, wPartyMon1Status ld hl, wPartyMon1Status
call WakeUpEntireParty call WakeUpEntireParty
ld a, [wIsInBattle] ld a, [wIsInBattle]
@ -1752,7 +1752,7 @@ WakeUpEntireParty:
.loop .loop
ld a, [hl] ld a, [hl]
push af push af
and SLP ; is pokemon asleep? and SLP_MASK
jr z, .notAsleep jr z, .notAsleep
ld a, 1 ld a, 1
ld [wWereAnyMonsAsleep], a ; indicate that a pokemon had to be woken up ld [wWereAnyMonsAsleep], a ; indicate that a pokemon had to be woken up

View file

@ -8,7 +8,7 @@ PrintStatusAilment::
jr nz, .frz jr nz, .frz
bit PAR, a bit PAR, a
jr nz, .par jr nz, .par
and SLP and SLP_MASK
ret z ret z
ld a, "S" ld a, "S"
ld [hli], a ld [hli], a