A lot of fixes

-Fixed Gulp Missile's activation. Its effects were happening even if the conditions weren't actually met in battle.
-Fixed Gulp Missile activating if the only/last target has already fainted.
-Fixed Gulp Missile's Gorging animation, though it still uses Tackle's.
-Fixed Gulp Missile's Gorging attack affecting an opponent with Magic Guard.
-Fixed Gulp Missile changing Cramorant's form if Surf failed.
This commit is contained in:
LOuroboros 2021-09-26 19:59:56 -03:00
parent 872d2a7008
commit a49ea33dd0
3 changed files with 40 additions and 23 deletions

View File

@ -24398,18 +24398,16 @@ General_TotemFlare::
clearmonbg ANIM_ATTACKER clearmonbg ANIM_ATTACKER
end end
General_GulpMissile: @ Modified Tackle anim (placeholder) General_GulpMissile: @ Tackle anim (placeholder)
loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_ATTACKER monbg ANIM_ATTACKER
setalpha 12, 8 setalpha 12, 8
createsprite gHorizontalLungeSpriteTemplate, ANIM_TARGET, 2, 4, 4 createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4
delay 6 delay 6
createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, ANIM_ATTACKER, 2 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_ATTACKER, 2
createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 3, 0, 6, 1 createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 3, 0, 6, 1
playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_ATTACKER playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET
waitforvisualfinish waitforvisualfinish
delay 10
playse SE_EFFECTIVE
clearmonbg ANIM_ATTACKER clearmonbg ANIM_ATTACKER
blendoff blendoff
end end

View File

@ -6005,9 +6005,14 @@ BattleScript_GulpMissileGorging::
playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL
waitanimation waitanimation
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
effectivenesssound
hitanimation BS_ATTACKER
waitstate
jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_GulpMissileNoDmgGorging
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
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
waitanimation waitanimation
@ -6022,9 +6027,14 @@ BattleScript_GulpMissileGulping::
playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL
waitanimation waitanimation
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
effectivenesssound
hitanimation BS_ATTACKER
waitstate
jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_GulpMissileNoDmgGulping
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
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

View File

@ -4985,17 +4985,22 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
} }
break; break;
case ABILITY_GULP_MISSILE: case ABILITY_GULP_MISSILE:
gBattlerAttacker = battler;
gBattlerTarget = BATTLE_OPPOSITE(battler);
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) && IsBattlerAlive(gBattlerAttacker)
&& gBattleMons[battler].species == SPECIES_CRAMORANT_GORGING) && gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING)
{ {
gBattleStruct->changedSpecies[gBattlerPartyIndexes[battler]] = gBattleMons[battler].species; gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerTarget]] = gBattleMons[gBattlerTarget].species;
gBattleMons[battler].species = SPECIES_CRAMORANT; gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
if (gBattleMoveDamage == 0) {
gBattleMoveDamage = 1; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
}
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_GulpMissileGorging; gBattlescriptCurrInstr = BattleScript_GulpMissileGorging;
effect++; effect++;
@ -5003,14 +5008,17 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
else if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) else if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg && !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& TARGET_TURN_DAMAGED && TARGET_TURN_DAMAGED
&& IsBattlerAlive(battler) && IsBattlerAlive(gBattlerAttacker)
&& gBattleMons[battler].species == SPECIES_CRAMORANT_GULPING) && gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GULPING)
{ {
gBattleStruct->changedSpecies[gBattlerPartyIndexes[battler]] = gBattleMons[battler].species; gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerTarget]] = gBattleMons[gBattlerTarget].species;
gBattleMons[battler].species = SPECIES_CRAMORANT; gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
if (gBattleMoveDamage == 0) {
gBattleMoveDamage = 1; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
}
SET_STATCHANGER(STAT_DEF, 1, TRUE); SET_STATCHANGER(STAT_DEF, 1, TRUE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping; gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
@ -5054,9 +5062,10 @@ 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(battler)) if ((effect = ShouldChangeFormHpBased(gBattlerAttacker))
&& (gCurrentMove == MOVE_SURF && (gCurrentMove == MOVE_SURF || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER)
|| gStatuses3[battler] & STATUS3_UNDERWATER)) && TARGET_TURN_DAMAGED
&& IsBattlerAlive(gBattlerAttacker))
{ {
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AttackerFormChange; gBattlescriptCurrInstr = BattleScript_AttackerFormChange;