Identify more bit flags (#1153)

This commit is contained in:
Sylvie
2024-11-29 19:29:30 -05:00
committed by GitHub
parent 8894e29da2
commit 644bd42fb0
78 changed files with 539 additions and 472 deletions

View File

@@ -1285,7 +1285,7 @@ BattleCommand_Stab:
ld [wCurDamage + 1], a
ld hl, wTypeModifier
set 7, [hl]
set STAB_DAMAGE_F, [hl]
.SkipStab:
ld a, BATTLE_VARS_MOVE_TYPE
@@ -1324,7 +1324,7 @@ BattleCommand_Stab:
push bc
inc hl
ld a, [wTypeModifier]
and %10000000
and STAB_DAMAGE
ld b, a
; If the target is immune to the move, treat it as a miss and calculate the damage as 0
ld a, [hl]
@@ -1390,7 +1390,7 @@ BattleCommand_Stab:
ld a, [wTypeMatchup]
ld b, a
ld a, [wTypeModifier]
and %10000000
and STAB_DAMAGE
or b
ld [wTypeModifier], a
ret
@@ -2198,7 +2198,7 @@ GetFailureResultText:
ld hl, DoesntAffectText
ld de, DoesntAffectText
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
jr z, .got_text
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
@@ -2223,7 +2223,7 @@ GetFailureResultText:
ret nz
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
ret z
ld hl, wCurDamage
@@ -2268,7 +2268,7 @@ BattleCommand_BideFailText:
ret z
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
jp z, PrintDoesntAffect
jp PrintButItFailed
@@ -2323,7 +2323,7 @@ BattleCommand_SuperEffectiveLoopText:
BattleCommand_SuperEffectiveText:
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
cp EFFECTIVE
ret z
ld hl, SuperEffectiveText
@@ -3673,7 +3673,7 @@ BattleCommand_PoisonTarget:
and a
ret nz
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
ret z
call CheckIfTargetIsPoisonType
ret z
@@ -3701,7 +3701,7 @@ BattleCommand_PoisonTarget:
BattleCommand_Poison:
ld hl, DoesntAffectText
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
jp z, .failed
call CheckIfTargetIsPoisonType
@@ -3937,7 +3937,7 @@ BattleCommand_BurnTarget:
and a
jp nz, Defrost
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
ret z
call CheckMoveTypeMatchesTarget ; Don't burn a Fire-type
ret z
@@ -4001,7 +4001,7 @@ BattleCommand_FreezeTarget:
and a
ret nz
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
ret z
ld a, [wBattleWeather]
cp WEATHER_SUN
@@ -4052,7 +4052,7 @@ BattleCommand_ParalyzeTarget:
and a
ret nz
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
ret z
call GetOpponentItem
ld a, b
@@ -5420,7 +5420,7 @@ BattleCommand_HeldFlinch:
BattleCommand_OHKO:
call ResetDamage
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
jr z, .no_effect
ld hl, wEnemyMonLevel
ld de, wBattleMonLevel
@@ -5834,7 +5834,7 @@ BattleCommand_Paralyze:
bit PAR, a
jr nz, .paralyzed
ld a, [wTypeModifier]
and $7f
and EFFECTIVENESS_MASK
jr z, .didnt_affect
call GetOpponentItem
ld a, b