Fixes Round and Fusion moves doubling power from previous turn's move (#7476)

This commit is contained in:
PhallenTree 2025-08-04 11:41:43 +01:00 committed by GitHub
parent 2546158479
commit 014f289ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 15 deletions

View File

@ -6829,6 +6829,7 @@ static void Cmd_moveend(void)
UpdateStallMons();
if ((gBattleStruct->moveResultFlags[gBattlerTarget] & (MOVE_RESULT_FAILED | MOVE_RESULT_DOESNT_AFFECT_FOE))
|| (gBattleMons[gBattlerAttacker].status2 & (STATUS2_FLINCHED))
|| gBattleStruct->pledgeMove == TRUE // Is the battler that uses the first Pledge move in the combo
|| gProtectStructs[gBattlerAttacker].nonVolatileStatusImmobility)
gBattleStruct->battlerState[gBattlerAttacker].stompingTantrumTimer = 2;
@ -12194,7 +12195,7 @@ void BS_RemoveStockpileCounters(void)
{
NATIVE_ARGS();
if (GetMoveEffect(gCurrentMove) == EFFECT_SWALLOW
if (GetMoveEffect(gCurrentMove) == EFFECT_SPIT_UP
&& gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT
&& IsBattlerAlive(gBattlerTarget))
{
@ -16996,7 +16997,7 @@ static void TryUpdateRoundTurnOrder(void)
}
// update turn order for round users
for (i = 0; roundUsers[i] != 0xFF && i < 3; i++)
for (i = 0; i < 3 && roundUsers[i] != 0xFF; i++)
{
gBattlerByTurnOrder[currRounder] = roundUsers[i];
gProtectStructs[roundUsers[i]].quash = TRUE; // Make it so their turn order can't be changed again
@ -17004,7 +17005,7 @@ static void TryUpdateRoundTurnOrder(void)
}
// Update turn order for non-round users
for (i = 0; nonRoundUsers[i] != 0xFF && i < 3; i++)
for (i = 0; i < 3 && nonRoundUsers[i] != 0xFF; i++)
{
gBattlerByTurnOrder[currRounder] = nonRoundUsers[i];
currRounder++;

View File

@ -8072,6 +8072,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData
u32 battlerAtk = damageCalcData->battlerAtk;
u32 battlerDef = damageCalcData->battlerDef;
u32 move = damageCalcData->move;
u32 moveEffect = GetMoveEffect(move);
u32 i;
u32 basePower = GetMovePower(move);
@ -8083,7 +8084,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData
if (GetActiveGimmick(battlerAtk) == GIMMICK_DYNAMAX)
return GetMaxMovePower(move);
switch (GetMoveEffect(move))
switch (moveEffect)
{
case EFFECT_PLEDGE:
if (gBattleStruct->pledgeMove)
@ -8242,18 +8243,15 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData
|| gDisableStructs[battlerDef].isFirstTurn == 2)
basePower *= 2;
break;
case EFFECT_ROUND:
for (i = 0; i < gBattlersCount; i++)
{
if (i != battlerAtk && IsBattlerAlive(i) && GetMoveEffect(gLastUsedMove) == EFFECT_ROUND)
{
basePower *= 2;
break;
}
}
break;
case EFFECT_FUSION_COMBO:
if (GetMoveEffect(gLastUsedMove) == EFFECT_FUSION_COMBO && move != gLastUsedMove)
if (move == gLastUsedMove)
break;
// fallthrough
case EFFECT_ROUND:
// don't double power due to previous turn's Round/Fusion move
if (gCurrentTurnActionNumber != 0
&& gActionsByTurnOrder[gCurrentTurnActionNumber - 1] == B_ACTION_USE_MOVE
&& GetMoveEffect(gLastUsedMove) == moveEffect)
basePower *= 2;
break;
case EFFECT_LASH_OUT: