diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 71dcf8b2b..d7de92096 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24398,18 +24398,16 @@ General_TotemFlare:: clearmonbg ANIM_ATTACKER end -General_GulpMissile: @ Modified Tackle anim (placeholder) +General_GulpMissile: @ Tackle anim (placeholder) loadspritegfx ANIM_TAG_IMPACT monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gHorizontalLungeSpriteTemplate, ANIM_TARGET, 2, 4, 4 + createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4 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 - playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_ATTACKER + playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET waitforvisualfinish - delay 10 - playse SE_EFFECTIVE clearmonbg ANIM_ATTACKER blendoff end diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index cf3204727..381c67a30 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6005,9 +6005,14 @@ BattleScript_GulpMissileGorging:: playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL waitanimation orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + effectivenesssound + hitanimation BS_ATTACKER + waitstate + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_GulpMissileNoDmgGorging healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL +BattleScript_GulpMissileNoDmgGorging: handleformchange BS_TARGET, 0 playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL waitanimation @@ -6022,9 +6027,14 @@ BattleScript_GulpMissileGulping:: playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL waitanimation orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + effectivenesssound + hitanimation BS_ATTACKER + waitstate + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_GulpMissileNoDmgGulping healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL +BattleScript_GulpMissileNoDmgGulping: handleformchange BS_TARGET, 0 playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL waitanimation diff --git a/src/battle_util.c b/src/battle_util.c index ac4257fe7..436ac4d1a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4985,17 +4985,22 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_GULP_MISSILE: + gBattlerAttacker = battler; + gBattlerTarget = BATTLE_OPPOSITE(battler); if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && IsBattlerAlive(battler) - && gBattleMons[battler].species == SPECIES_CRAMORANT_GORGING) + && IsBattlerAlive(gBattlerAttacker) + && gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING) { - gBattleStruct->changedSpecies[gBattlerPartyIndexes[battler]] = gBattleMons[battler].species; - gBattleMons[battler].species = SPECIES_CRAMORANT; - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; + gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerTarget]] = gBattleMons[gBattlerTarget].species; + gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT; + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + } BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_GulpMissileGorging; effect++; @@ -5003,14 +5008,17 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move else if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && IsBattlerAlive(battler) - && gBattleMons[battler].species == SPECIES_CRAMORANT_GULPING) + && IsBattlerAlive(gBattlerAttacker) + && gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GULPING) { - gBattleStruct->changedSpecies[gBattlerPartyIndexes[battler]] = gBattleMons[battler].species; - gBattleMons[battler].species = SPECIES_CRAMORANT; - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; + gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerTarget]] = gBattleMons[gBattlerTarget].species; + gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT; + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + { + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + } SET_STATCHANGER(STAT_DEF, 1, TRUE); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_GulpMissileGulping; @@ -5054,9 +5062,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_GULP_MISSILE: - if ((effect = ShouldChangeFormHpBased(battler)) - && (gCurrentMove == MOVE_SURF - || gStatuses3[battler] & STATUS3_UNDERWATER)) + if ((effect = ShouldChangeFormHpBased(gBattlerAttacker)) + && (gCurrentMove == MOVE_SURF || gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER) + && TARGET_TURN_DAMAGED + && IsBattlerAlive(gBattlerAttacker)) { BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_AttackerFormChange;