user xor operator for clearing status flags

use xor operator for clearing status flags
This commit is contained in:
xCrystal 2015-04-09 11:30:04 +02:00
parent 61edd43974
commit 9c93ef3bff
2 changed files with 6 additions and 6 deletions

View file

@ -3509,7 +3509,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
ld hl,W_PLAYERBATTSTATUS1
ld a,[hl]
; 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 a,[W_PLAYERMOVEEFFECT]
cp a,FLY_EFFECT
@ -3585,12 +3585,12 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
ld hl,ThrashingAboutText
call PrintText
ld hl,wPlayerNumAttacksLeft
dec [hl] ; did Trashing About counter hit 0?
dec [hl] ; did Thrashing About counter hit 0?
ld hl,PlayerCalcMoveDamage ; skip DecrementPP
jp nz,.returnToHL
push hl
ld hl,W_PLAYERBATTSTATUS1
res ThrashingAbout,[hl] ; no longer trashing about
res ThrashingAbout,[hl] ; no longer thrashing about
set Confused,[hl] ; confused
call BattleRandom
and a,3
@ -6023,7 +6023,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld hl, W_ENEMYBATTSTATUS1
ld a, [hl]
; 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 a, [W_ENEMYMOVEEFFECT]
cp FLY_EFFECT
@ -6097,7 +6097,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld hl, ThrashingAboutText
call PrintText
ld hl, wEnemyNumAttacksLeft
dec [hl] ; did Trashing About counter hit 0?
dec [hl] ; did Thrashing About counter hit 0?
ld hl, EnemyCalcMoveDamage ; skip DecrementPP
jp nz, .enemyReturnToHL
push hl

View file

@ -51,7 +51,7 @@ CureVolatileStatuses: ; 13a37 (4:7a37)
inc hl ; BATTSTATUS2
ld a, [hl]
; 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 a, [hl]
and %11110000 | (1 << Transformed) ; clear Bad Poison, Reflect and Light Screen statuses