mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Moved Hunger Switch to form change table.
This commit is contained in:
parent
62912f8caf
commit
2ef2134be1
@ -7525,6 +7525,7 @@ BattleScript_AttackerFormChangeEnd3::
|
||||
|
||||
BattleScript_AttackerFormChangeEnd3NoPopup::
|
||||
call BattleScript_AttackerFormChangeNoPopup
|
||||
end3
|
||||
|
||||
BattleScript_AttackerFormChangeMoveEffect::
|
||||
waitmessage 1
|
||||
|
@ -84,3 +84,7 @@
|
||||
// The battle indicator icon is based on the species, with Primal Groudon's as Omega and otherwise being Alpha.
|
||||
// param1: item to hold.
|
||||
#define FORM_CHANGE_BATTLE_PRIMAL_REVERSION 13
|
||||
|
||||
// Form change that activates automatically when the turn ends.
|
||||
// param1: ability to check.
|
||||
#define FORM_CHANGE_BATTLE_TURN_END 14
|
||||
|
@ -3817,7 +3817,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score);
|
||||
break;
|
||||
case MOVE_KINGS_SHIELD:
|
||||
#if (defined SPECIES_AEGISLASH && defined SPECIES_AEGISLASH_BLADE)
|
||||
if (AI_DATA->abilities[battlerAtk] == ABILITY_STANCE_CHANGE //Special logic for Aegislash
|
||||
&& gBattleMons[battlerAtk].species == SPECIES_AEGISLASH_BLADE
|
||||
&& !IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]))
|
||||
@ -3825,7 +3824,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
score += 3;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
//fallthrough
|
||||
default: // protect
|
||||
ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score);
|
||||
@ -4484,7 +4482,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
score += 3;
|
||||
break;
|
||||
case EFFECT_RELIC_SONG:
|
||||
#if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE)
|
||||
if (!(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED)) // Don't try to change form if it's transformed.
|
||||
{
|
||||
if (gBattleMons[battlerAtk].species == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense)
|
||||
@ -4492,7 +4489,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
else if (gBattleMons[battlerAtk].species == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense)
|
||||
score += 3; // Change to Aria if can do more damage
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case EFFECT_ELECTRIC_TERRAIN:
|
||||
case EFFECT_MISTY_TERRAIN:
|
||||
|
@ -5019,18 +5019,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
}
|
||||
break;
|
||||
case ABILITY_HUNGER_SWITCH:
|
||||
if (!(gBattleMons[battler].status2 & STATUS2_TRANSFORMED))
|
||||
if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_TURN_END))
|
||||
{
|
||||
if (gBattleMons[battler].species == SPECIES_MORPEKO)
|
||||
{
|
||||
gBattleMons[battler].species = SPECIES_MORPEKO_HANGRY;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup);
|
||||
}
|
||||
else if (gBattleMons[battler].species == SPECIES_MORPEKO_HANGRY)
|
||||
{
|
||||
gBattleMons[battler].species = SPECIES_MORPEKO;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup);
|
||||
}
|
||||
BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup);
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
@ -9788,7 +9779,6 @@ u16 GetBattleFormChangeTargetSpecies(u8 battlerId, u16 method)
|
||||
targetSpecies = formChanges[i].targetSpecies;
|
||||
break;
|
||||
case FORM_CHANGE_BATTLE_HP_PERCENT:
|
||||
{
|
||||
if (formChanges[i].param1 == GetBattlerAbility(battlerId))
|
||||
{
|
||||
// We multiply by 100 to make sure that integer division doesn't mess with the health check.
|
||||
@ -9806,7 +9796,10 @@ u16 GetBattleFormChangeTargetSpecies(u8 battlerId, u16 method)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FORM_CHANGE_BATTLE_TURN_END:
|
||||
if (formChanges[i].param1 == GetBattlerAbility(battlerId))
|
||||
targetSpecies = formChanges[i].targetSpecies;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -604,9 +604,11 @@ static const struct FormChange sCramorantFormChangeTable[] = {
|
||||
};
|
||||
|
||||
static const struct FormChange sMorpekoFormChangeTable[] = {
|
||||
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO},
|
||||
{FORM_CHANGE_FAINT, SPECIES_MORPEKO},
|
||||
{FORM_CHANGE_END_BATTLE, SPECIES_MORPEKO},
|
||||
{FORM_CHANGE_BATTLE_TURN_END, SPECIES_MORPEKO_HANGRY, ABILITY_HUNGER_SWITCH},
|
||||
{FORM_CHANGE_BATTLE_TURN_END, SPECIES_MORPEKO , ABILITY_HUNGER_SWITCH},
|
||||
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO},
|
||||
{FORM_CHANGE_FAINT, SPECIES_MORPEKO},
|
||||
{FORM_CHANGE_END_BATTLE, SPECIES_MORPEKO},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user