mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
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:
parent
e783cde387
commit
0389dbf9f2
@ -6012,6 +6012,7 @@ BattleScript_GulpMissileGorging::
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||
jumpifbyteequal gBattlerFainted, gBattlerAttacker, BattleScript_GulpMissileNoSecondEffectGorging
|
||||
BattleScript_GulpMissileNoDmgGorging:
|
||||
handleformchange BS_TARGET, 0
|
||||
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
|
||||
@ -6021,6 +6022,11 @@ BattleScript_GulpMissileNoDmgGorging:
|
||||
seteffectprimary
|
||||
swapattackerwithtarget
|
||||
return
|
||||
BattleScript_GulpMissileNoSecondEffectGorging:
|
||||
handleformchange BS_TARGET, 0
|
||||
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
|
||||
waitanimation
|
||||
return
|
||||
|
||||
BattleScript_GulpMissileGulping::
|
||||
call BattleScript_AbilityPopUp
|
||||
@ -6034,10 +6040,13 @@ BattleScript_GulpMissileGulping::
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||
jumpifbyteequal gBattlerFainted, gBattlerAttacker, BattleScript_GulpMissileNoSecondEffectGulping
|
||||
jumpifability BS_ATTACKER, ABILITY_CLEAR_BODY, BattleScript_GulpMissileGulpingRet
|
||||
BattleScript_GulpMissileNoDmgGulping:
|
||||
handleformchange BS_TARGET, 0
|
||||
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
|
||||
waitanimation
|
||||
setstatchanger STAT_DEF, 1, TRUE
|
||||
statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL
|
||||
setgraphicalstatchangevalues
|
||||
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
@ -6045,6 +6054,12 @@ BattleScript_GulpMissileNoDmgGulping:
|
||||
printstring STRINGID_ATTACKERSSTATROSE
|
||||
waitmessage 0x40
|
||||
return
|
||||
BattleScript_GulpMissileNoSecondEffectGulping:
|
||||
handleformchange BS_TARGET, 0
|
||||
playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
|
||||
waitanimation
|
||||
BattleScript_GulpMissileGulpingRet:
|
||||
return
|
||||
|
||||
BattleScript_PerishSongCountGoesDown::
|
||||
printstring STRINGID_PKMNPERISHCOUNTFELL
|
||||
|
@ -4987,7 +4987,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
case ABILITY_GULP_MISSILE:
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& TARGET_TURN_DAMAGED)
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& IsBattlerAlive(battler))
|
||||
{
|
||||
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)
|
||||
gBattleMoveDamage = 1;
|
||||
}
|
||||
SET_STATCHANGER(STAT_DEF, 1, TRUE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
|
||||
effect++;
|
||||
@ -5057,9 +5057,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
}
|
||||
break;
|
||||
case ABILITY_GULP_MISSILE:
|
||||
if ((effect = ShouldChangeFormHpBased(gBattlerAttacker))
|
||||
&& ((gCurrentMove == MOVE_SURF && TARGET_TURN_DAMAGED) || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)
|
||||
&& IsBattlerAlive(gBattlerTarget))
|
||||
if (((gCurrentMove == MOVE_SURF && TARGET_TURN_DAMAGED) || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)
|
||||
&& (effect = ShouldChangeFormHpBased(gBattlerAttacker)))
|
||||
{
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_AttackerFormChange;
|
||||
|
Loading…
Reference in New Issue
Block a user