Fix Battle Bond activating multiple times in battle

This commit is contained in:
DizzyEggg 2023-02-15 15:30:29 +01:00
parent e3e005b0cc
commit 3f0f7c6b7f
2 changed files with 5 additions and 2 deletions

View File

@ -653,6 +653,7 @@ struct BattleStruct
u8 targetsDone[MAX_BATTLERS_COUNT]; // Each battler as a bit.
u16 overwrittenAbilities[MAX_BATTLERS_COUNT]; // abilities overwritten during battle (keep separate from battle history in case of switching)
bool8 allowedToChangeFormInWeather[PARTY_SIZE][2]; // For each party member and side, used by Ice Face.
u8 battleBondTransformed[2]; // Bitfield for each party.
};
#define F_DYNAMIC_TYPE_1 (1 << 6)

View File

@ -9851,8 +9851,10 @@ static void Cmd_various(void)
case VARIOUS_TRY_ACTIVATE_BATTLE_BOND:
if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND
&& HasAttackerFaintedTarget()
&& CalculateEnemyPartyCount() > 1)
&& CalculateEnemyPartyCount() > 1
&& !(gBattleStruct->battleBondTransformed[GET_BATTLER_SIDE2(gBattlerAttacker)] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]))
{
gBattleStruct->battleBondTransformed[GET_BATTLER_SIDE2(gBattlerAttacker)] |= gBitTable[gBattlerPartyIndexes[gBattlerAttacker]];
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species);
gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species;
gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH;
@ -14965,7 +14967,7 @@ static void Cmd_callnative(void)
func();
}
// Callnative Funcs
// Callnative Funcs
void BS_CalcMetalBurstDmg(void)
{
u8 sideAttacker = GetBattlerSide(gBattlerAttacker);