mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
user xor operator for clearing status flags
use xor operator for clearing status flags
This commit is contained in:
parent
61edd43974
commit
9c93ef3bff
|
@ -3509,7 +3509,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
|
||||||
ld hl,W_PLAYERBATTSTATUS1
|
ld hl,W_PLAYERBATTSTATUS1
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
; clear bide, thrashing, charging up, and trapping moves such as warp (already cleared for confusion damage)
|
; clear bide, thrashing, charging up, and trapping moves such as warp (already cleared for confusion damage)
|
||||||
and a, (1 << AttackingMultipleTimes) | (1 << Flinched) | (1 << Invulnerable) | (1 << Confused)
|
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
ld a,[W_PLAYERMOVEEFFECT]
|
ld a,[W_PLAYERMOVEEFFECT]
|
||||||
cp a,FLY_EFFECT
|
cp a,FLY_EFFECT
|
||||||
|
@ -3585,12 +3585,12 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
|
||||||
ld hl,ThrashingAboutText
|
ld hl,ThrashingAboutText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl,wPlayerNumAttacksLeft
|
ld hl,wPlayerNumAttacksLeft
|
||||||
dec [hl] ; did Trashing About counter hit 0?
|
dec [hl] ; did Thrashing About counter hit 0?
|
||||||
ld hl,PlayerCalcMoveDamage ; skip DecrementPP
|
ld hl,PlayerCalcMoveDamage ; skip DecrementPP
|
||||||
jp nz,.returnToHL
|
jp nz,.returnToHL
|
||||||
push hl
|
push hl
|
||||||
ld hl,W_PLAYERBATTSTATUS1
|
ld hl,W_PLAYERBATTSTATUS1
|
||||||
res ThrashingAbout,[hl] ; no longer trashing about
|
res ThrashingAbout,[hl] ; no longer thrashing about
|
||||||
set Confused,[hl] ; confused
|
set Confused,[hl] ; confused
|
||||||
call BattleRandom
|
call BattleRandom
|
||||||
and a,3
|
and a,3
|
||||||
|
@ -6023,7 +6023,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
|
||||||
ld hl, W_ENEMYBATTSTATUS1
|
ld hl, W_ENEMYBATTSTATUS1
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
; clear bide, thrashing about, charging up, and multi-turn moves such as warp
|
; clear bide, thrashing about, charging up, and multi-turn moves such as warp
|
||||||
and (1 << AttackingMultipleTimes) | (1 << Flinched) | (1 << Invulnerable) | (1 << Confused)
|
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld a, [W_ENEMYMOVEEFFECT]
|
ld a, [W_ENEMYMOVEEFFECT]
|
||||||
cp FLY_EFFECT
|
cp FLY_EFFECT
|
||||||
|
@ -6097,7 +6097,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
|
||||||
ld hl, ThrashingAboutText
|
ld hl, ThrashingAboutText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wEnemyNumAttacksLeft
|
ld hl, wEnemyNumAttacksLeft
|
||||||
dec [hl] ; did Trashing About counter hit 0?
|
dec [hl] ; did Thrashing About counter hit 0?
|
||||||
ld hl, EnemyCalcMoveDamage ; skip DecrementPP
|
ld hl, EnemyCalcMoveDamage ; skip DecrementPP
|
||||||
jp nz, .enemyReturnToHL
|
jp nz, .enemyReturnToHL
|
||||||
push hl
|
push hl
|
||||||
|
|
|
@ -51,7 +51,7 @@ CureVolatileStatuses: ; 13a37 (4:7a37)
|
||||||
inc hl ; BATTSTATUS2
|
inc hl ; BATTSTATUS2
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
; clear UsingXAccuracy, ProtectedByMist, GettingPumped, and Seeded statuses
|
; clear UsingXAccuracy, ProtectedByMist, GettingPumped, and Seeded statuses
|
||||||
and (1 << UsingRage) | (1 << NeedsToRecharge) | (1 << HasSubstituteUp) | (1 << 3)
|
and $ff ^((1 << UsingXAccuracy) | (1 << ProtectedByMist) | (1 << GettingPumped) | (1 << Seeded))
|
||||||
ld [hli], a ; BATTSTATUS3
|
ld [hli], a ; BATTSTATUS3
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses
|
and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses
|
||||||
|
|
Loading…
Reference in a new issue