mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
fix synthesis and leaf guard w utility umbrella
This commit is contained in:
parent
a461823cbf
commit
468ee66cd8
@ -1989,10 +1989,9 @@
|
||||
goto \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifleafguard jumpptr:req
|
||||
jumpifhalfword CMP_NO_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, 1f
|
||||
jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr
|
||||
1:
|
||||
.macro jumpifleafguardprotected battler:req, jumpptr:req
|
||||
various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED
|
||||
.4byte \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifsafeguard jumpptr:req
|
||||
|
@ -2512,7 +2512,7 @@ BattleScript_EffectSleep::
|
||||
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
|
||||
jumpifflowerveil BattleScript_FlowerVeilProtects
|
||||
jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects
|
||||
jumpifleafguard BattleScript_LeafGuardProtects
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||
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_COMATOSE, BattleScript_LeafGuardProtects
|
||||
jumpifflowerveil BattleScript_FlowerVeilProtects
|
||||
jumpifleafguard BattleScript_LeafGuardProtects
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||
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_COMATOSE, BattleScript_LeafGuardProtects
|
||||
jumpifflowerveil BattleScript_FlowerVeilProtects
|
||||
jumpifleafguard BattleScript_LeafGuardProtects
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||
jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned
|
||||
@ -3434,7 +3434,7 @@ BattleScript_EffectParalyze:
|
||||
jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected
|
||||
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
|
||||
jumpifflowerveil BattleScript_FlowerVeilProtects
|
||||
jumpifleafguard BattleScript_LeafGuardProtects
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||
.if B_GLARE_GHOST >= GEN_4
|
||||
@ -4874,7 +4874,7 @@ BattleScript_EffectWillOWisp::
|
||||
jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents
|
||||
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
|
||||
jumpifflowerveil BattleScript_FlowerVeilProtects
|
||||
jumpifleafguard BattleScript_LeafGuardProtects
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||
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_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective
|
||||
jumpifflowerveil BattleScript_FlowerVeilProtects
|
||||
jumpifleafguard BattleScript_LeafGuardProtects
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||
jumpifsafeguard BattleScript_SafeguardProtected
|
||||
|
@ -195,6 +195,7 @@
|
||||
#define VARIOUS_APPLY_PLASMA_FISTS 122
|
||||
#define VARIOUS_JUMP_IF_SPECIES 123
|
||||
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 124
|
||||
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 125
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
@ -8990,6 +8990,12 @@ static void Cmd_various(void)
|
||||
else
|
||||
gBattlescriptCurrInstr += 9;
|
||||
return;
|
||||
case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED:
|
||||
if (IsLeafGuardProtected(gActiveBattler))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
return;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
@ -11514,9 +11520,9 @@ static void Cmd_recoverbasedonsunlight(void)
|
||||
}
|
||||
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;
|
||||
else if (IsBattlerWeatherAffected(gBattlerAttacker, WEATHER_SUN_ANY))
|
||||
else if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30;
|
||||
else // not sunny weather
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
|
||||
|
Loading…
Reference in New Issue
Block a user