shithub: pokered

Download patch

ref: 9c93ef3bff67f0f3ded2856b612ec632f22b2d46
parent: 61edd43974bf53aaacf96a355ebf2d1e35b59c91
author: xCrystal <rgr.crystal@gmail.com>
date: Thu Apr 9 07:30:04 EDT 2015

user xor operator for clearing status flags

use xor operator for clearing status flags

--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3509,7 +3509,7 @@
 	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 @@
 	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 @@
 	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 @@
 	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
--- a/engine/battle/moveEffects/haze_effect.asm
+++ b/engine/battle/moveEffects/haze_effect.asm
@@ -51,7 +51,7 @@
 	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