fix synthesis and leaf guard w utility umbrella

This commit is contained in:
ghoulslash 2021-10-30 11:04:50 -04:00
parent a461823cbf
commit 468ee66cd8
4 changed files with 18 additions and 12 deletions

View File

@ -1989,10 +1989,9 @@
goto \jumpptr goto \jumpptr
.endm .endm
.macro jumpifleafguard jumpptr:req .macro jumpifleafguardprotected battler:req, jumpptr:req
jumpifhalfword CMP_NO_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, 1f various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED
jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr .4byte \jumpptr
1:
.endm .endm
.macro jumpifsafeguard jumpptr:req .macro jumpifsafeguard jumpptr:req

View File

@ -2512,7 +2512,7 @@ BattleScript_EffectSleep::
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents
@ -3054,7 +3054,7 @@ BattleScript_EffectToxic::
jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned
@ -3409,7 +3409,7 @@ BattleScript_EffectPoison::
jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned
@ -3434,7 +3434,7 @@ BattleScript_EffectParalyze:
jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
.if B_GLARE_GHOST >= GEN_4 .if B_GLARE_GHOST >= GEN_4
@ -4874,7 +4874,7 @@ BattleScript_EffectWillOWisp::
jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents
@ -5152,7 +5152,7 @@ BattleScript_EffectYawn::
jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective
jumpifflowerveil BattleScript_FlowerVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
jumpifsubstituteblocks BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed
jumpifsafeguard BattleScript_SafeguardProtected jumpifsafeguard BattleScript_SafeguardProtected

View File

@ -195,6 +195,7 @@
#define VARIOUS_APPLY_PLASMA_FISTS 122 #define VARIOUS_APPLY_PLASMA_FISTS 122
#define VARIOUS_JUMP_IF_SPECIES 123 #define VARIOUS_JUMP_IF_SPECIES 123
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 124 #define VARIOUS_JUMP_IF_WEATHER_AFFECTED 124
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 125
// Cmd_manipulatedamage // Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0 #define DMG_CHANGE_SIGN 0

View File

@ -8990,6 +8990,12 @@ static void Cmd_various(void)
else else
gBattlescriptCurrInstr += 9; gBattlescriptCurrInstr += 9;
return; return;
case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED:
if (IsLeafGuardProtected(gActiveBattler))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5);
else
gBattlescriptCurrInstr += 7;
return;
} }
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
@ -11514,9 +11520,9 @@ static void Cmd_recoverbasedonsunlight(void)
} }
else else
{ {
if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT) if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT || GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA)
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
else if (IsBattlerWeatherAffected(gBattlerAttacker, WEATHER_SUN_ANY)) else if (gBattleWeather & WEATHER_SUN_ANY)
gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30;
else // not sunny weather else // not sunny weather
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;