mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
Fix Battle Bond
Battle Bond Greninja transforms only after a KO, and doesn't revert when switched out.
This commit is contained in:
parent
e66820e646
commit
bb8d0e3d6b
@ -1825,6 +1825,10 @@
|
|||||||
various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER
|
various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro tryactivatebattlebond battler:req
|
||||||
|
various \battler, VARIOUS_TRY_ACTIVATE_BATTLE_BOND
|
||||||
|
.endm
|
||||||
|
|
||||||
@ helpful macros
|
@ helpful macros
|
||||||
.macro setstatchanger stat:req, stages:req, down:req
|
.macro setstatchanger stat:req, stages:req, down:req
|
||||||
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7
|
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7
|
||||||
|
@ -5288,6 +5288,7 @@ BattleScript_FaintTarget::
|
|||||||
tryactivatemoxie BS_ATTACKER @ and chilling neigh, as one ice rider
|
tryactivatemoxie BS_ATTACKER @ and chilling neigh, as one ice rider
|
||||||
tryactivatebeastboost BS_ATTACKER
|
tryactivatebeastboost BS_ATTACKER
|
||||||
tryactivategrimneigh BS_ATTACKER @ and as one shadow rider
|
tryactivategrimneigh BS_ATTACKER @ and as one shadow rider
|
||||||
|
tryactivatebattlebond BS_ATTACKER
|
||||||
trytrainerslidefirstdownmsg BS_TARGET
|
trytrainerslidefirstdownmsg BS_TARGET
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -185,6 +185,7 @@
|
|||||||
#define VARIOUS_REMOVE_TERRAIN 113
|
#define VARIOUS_REMOVE_TERRAIN 113
|
||||||
#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 114
|
#define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 114
|
||||||
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 115
|
#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 115
|
||||||
|
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 116
|
||||||
|
|
||||||
// Cmd_manipulatedamage
|
// Cmd_manipulatedamage
|
||||||
#define DMG_CHANGE_SIGN 0
|
#define DMG_CHANGE_SIGN 0
|
||||||
|
@ -8822,6 +8822,19 @@ static void Cmd_various(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case VARIOUS_TRY_ACTIVATE_BATTLE_BOND:
|
||||||
|
if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND
|
||||||
|
&& HasAttackerFaintedTarget()
|
||||||
|
&& CalculateEnemyPartyCount() > 1)
|
||||||
|
{
|
||||||
|
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species);
|
||||||
|
gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species;
|
||||||
|
gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH;
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 3;
|
gBattlescriptCurrInstr += 3;
|
||||||
|
@ -5147,18 +5147,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_BATTLE_BOND:
|
|
||||||
if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND
|
|
||||||
&& gBattleResults.opponentFaintCounter != 0
|
|
||||||
&& CalculateEnemyPartyCount() > 1)
|
|
||||||
{
|
|
||||||
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species);
|
|
||||||
gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species;
|
|
||||||
gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH;
|
|
||||||
BattleScriptPushCursor();
|
|
||||||
gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITYEFFECT_MOVE_END_OTHER: // Abilities that activate on *another* battler's moveend: Dancer, Soul-Heart, Receiver, Symbiosis
|
case ABILITYEFFECT_MOVE_END_OTHER: // Abilities that activate on *another* battler's moveend: Dancer, Soul-Heart, Receiver, Symbiosis
|
||||||
@ -8846,6 +8834,7 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut)
|
|||||||
static const u16 species[][2] = // changed form id, default form id
|
static const u16 species[][2] = // changed form id, default form id
|
||||||
{
|
{
|
||||||
{SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU},
|
{SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU},
|
||||||
|
{SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND},
|
||||||
{SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH},
|
{SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH},
|
||||||
{SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN},
|
{SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN},
|
||||||
{SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED},
|
{SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED},
|
||||||
@ -8858,11 +8847,10 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut)
|
|||||||
{SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI},
|
{SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI},
|
||||||
{SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT},
|
{SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT},
|
||||||
{SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT},
|
{SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT},
|
||||||
{SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isSwitchingOut) // Don't revert Mimikyu Busted when switching out
|
if (isSwitchingOut) // Don't revert Mimikyu Busted or Ash-Greninja when switching out
|
||||||
i = 1;
|
i = 2;
|
||||||
else
|
else
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user