Merge pull request #1580 from ghoulslash/water_bubble

Water Bubble Prevents Burn
This commit is contained in:
DizzyEggg 2021-09-08 20:00:45 +02:00 committed by GitHub
commit decf65a025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View File

@ -4286,6 +4286,7 @@ BattleScript_EffectWillOWisp::
jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned
jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected
jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents
jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguard BattleScript_LeafGuardProtects
@ -4300,6 +4301,7 @@ BattleScript_EffectWillOWisp::
goto BattleScript_MoveEnd
BattleScript_WaterVeilPrevents::
call BattleScript_AbilityPopUp
copybyte gEffectBattler, gBattlerTarget
setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS
call BattleScript_BRNPrevention

View File

@ -821,7 +821,7 @@ static bool8 DoesAbilityPreventStatus(struct Pokemon *mon, u32 status)
ret = TRUE;
break;
case STATUS1_BURN:
if (ability == ABILITY_WATER_VEIL)
if (ability == ABILITY_WATER_VEIL || ability == ABILITY_WATER_BUBBLE)
ret = TRUE;
break;
case STATUS1_PARALYSIS:

View File

@ -2615,11 +2615,11 @@ void SetMoveEffect(bool32 primary, u32 certain)
statusChanged = TRUE;
break;
case STATUS1_BURN:
if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL
if ((GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL || GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{
gLastUsedAbility = ABILITY_WATER_VEIL;
RecordAbilityBattle(gEffectBattler, ABILITY_WATER_VEIL);
gLastUsedAbility = GetBattlerAbility(gEffectBattler);
RecordAbilityBattle(gEffectBattler, GetBattlerAbility(gEffectBattler));
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention;
@ -2648,6 +2648,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
break;
if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL
|| GetBattlerAbility(gEffectBattler) == ABILITY_COMATOSE
|| GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE
|| IsAbilityStatusProtected(gEffectBattler))
break;
if (gBattleMons[gEffectBattler].status1)
@ -8259,7 +8260,8 @@ static void Cmd_various(void)
}
else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_BURN)
{
if (GetBattlerAbility(gBattlerTarget) == ABILITY_WATER_VEIL)
if (GetBattlerAbility(gBattlerTarget) == ABILITY_WATER_VEIL
|| GetBattlerAbility(gBattlerTarget) == ABILITY_WATER_BUBBLE)
{
gBattlerAbility = gBattlerTarget;
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));

View File

@ -4863,6 +4863,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& TARGET_TURN_DAMAGED
&& !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_WATER_VEIL
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_WATER_BUBBLE
&& !(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY)
&& !IsAbilityStatusProtected(gBattlerAttacker)
&& (Random() % 3) == 0)
@ -5070,6 +5071,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
}
break;
case ABILITY_WATER_VEIL:
case ABILITY_WATER_BUBBLE:
if (gBattleMons[battler].status1 & STATUS1_BURN)
{
StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn);