More fixes

-Removed IsBattlerAlive check for case ABILITY_GULP_MISSILE in ABILITYEFFECT_MOVE_END_ATTACKER. Turns out Cramorant can change form even on single wild battles.
-Added a check for IsBattlerAlive in the case ABILITY_GULP_MISSILE of ABILITYEFFECT_MOVE_END, because otherwise, for whatever reason, the user was trying to trigger the Gulping effect even in its base form.
-Set the stat to change for the Gulping effect from within the battle script. The rest of the effect is handled there, so may as well.
-Fixed the check for case ABILITY_GULP_MISSILE in ABILITYEFFECT_MOVE_END_ATTACKER. Apparently, a silent species change was happening because of the order of the checks. Thanks to AsparagusEduardo for pointing this one out.
-Fixed the secondary effect of a target's Gulp Missile affecting an attacker that has fainted.
-Fixed the Defense reduction of the Gulping effect bypassing Clear Body.
This commit is contained in:
LOuroboros 2021-09-29 06:13:56 -03:00
parent e783cde387
commit 0389dbf9f2
2 changed files with 19 additions and 5 deletions

View File

@ -6012,6 +6012,7 @@ BattleScript_GulpMissileGorging::
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
jumpifbyteequal gBattlerFainted, gBattlerAttacker, BattleScript_GulpMissileNoSecondEffectGorging
BattleScript_GulpMissileNoDmgGorging: BattleScript_GulpMissileNoDmgGorging:
handleformchange BS_TARGET, 0 handleformchange BS_TARGET, 0
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
@ -6021,6 +6022,11 @@ BattleScript_GulpMissileNoDmgGorging:
seteffectprimary seteffectprimary
swapattackerwithtarget swapattackerwithtarget
return return
BattleScript_GulpMissileNoSecondEffectGorging:
handleformchange BS_TARGET, 0
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
waitanimation
return
BattleScript_GulpMissileGulping:: BattleScript_GulpMissileGulping::
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
@ -6034,10 +6040,13 @@ BattleScript_GulpMissileGulping::
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
jumpifbyteequal gBattlerFainted, gBattlerAttacker, BattleScript_GulpMissileNoSecondEffectGulping
jumpifability BS_ATTACKER, ABILITY_CLEAR_BODY, BattleScript_GulpMissileGulpingRet
BattleScript_GulpMissileNoDmgGulping: BattleScript_GulpMissileNoDmgGulping:
handleformchange BS_TARGET, 0 handleformchange BS_TARGET, 0
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
waitanimation waitanimation
setstatchanger STAT_DEF, 1, TRUE
statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL
setgraphicalstatchangevalues setgraphicalstatchangevalues
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
@ -6045,6 +6054,12 @@ BattleScript_GulpMissileNoDmgGulping:
printstring STRINGID_ATTACKERSSTATROSE printstring STRINGID_ATTACKERSSTATROSE
waitmessage 0x40 waitmessage 0x40
return return
BattleScript_GulpMissileNoSecondEffectGulping:
handleformchange BS_TARGET, 0
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
waitanimation
BattleScript_GulpMissileGulpingRet:
return
BattleScript_PerishSongCountGoesDown:: BattleScript_PerishSongCountGoesDown::
printstring STRINGID_PKMNPERISHCOUNTFELL printstring STRINGID_PKMNPERISHCOUNTFELL

View File

@ -4987,7 +4987,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_GULP_MISSILE: case ABILITY_GULP_MISSILE:
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& TARGET_TURN_DAMAGED) && TARGET_TURN_DAMAGED
&& IsBattlerAlive(battler))
{ {
if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING) if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING)
{ {
@ -5013,7 +5014,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
} }
SET_STATCHANGER(STAT_DEF, 1, TRUE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping; gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
effect++; effect++;
@ -5057,9 +5057,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
} }
break; break;
case ABILITY_GULP_MISSILE: case ABILITY_GULP_MISSILE:
if ((effect = ShouldChangeFormHpBased(gBattlerAttacker)) if (((gCurrentMove == MOVE_SURF && TARGET_TURN_DAMAGED) || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)
&& ((gCurrentMove == MOVE_SURF && TARGET_TURN_DAMAGED) || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER) && (effect = ShouldChangeFormHpBased(gBattlerAttacker)))
&& IsBattlerAlive(gBattlerTarget))
{ {
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AttackerFormChange; gBattlescriptCurrInstr = BattleScript_AttackerFormChange;