Fixes Dancer original attacker/target being overwritten (#9515)
Some checks are pending
CI / build (push) Waiting to run
CI / docs_validate (push) Waiting to run
CI / allcontributors (push) Waiting to run
Docs / deploy (push) Waiting to run

This commit is contained in:
PhallenTree 2026-03-13 18:20:31 +00:00 committed by GitHub
parent 022507a7f2
commit 5714ee6758
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

@ -706,6 +706,9 @@ struct BattleStruct
u8 magicCoatActive:1;
u8 magicBounceActive:1;
u8 moveBouncer;
u8 dancerSavedAttacker:3;
u8 dancerSavedTarget:3;
u8 padding:2;
};
struct AiBattleData

View File

@ -3790,8 +3790,8 @@ static enum MoveEndResult MoveEndDancer(void)
// Set target for other Dancer mons; set bit so that mon cannot activate Dancer off of its own move
if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove)
{
gBattleScripting.savedBattler = gBattlerTarget | 0x4;
gBattleScripting.savedBattler |= (gBattlerAttacker << 4);
gBattleStruct->dancerSavedTarget = gBattlerTarget;
gBattleStruct->dancerSavedAttacker = gBattlerAttacker;
gSpecialStatuses[gBattlerAttacker].dancerUsedMove = TRUE;
}

View File

@ -2817,8 +2817,6 @@ void SetMoveEffect(enum BattlerId battlerAtk, enum BattlerId effectBattler, enum
s32 recoil = (gBattleMons[gEffectBattler].maxHP) / 4;
if (recoil == 0)
recoil = 1;
if (abilities[gEffectBattler] == ABILITY_PARENTAL_BOND)
recoil *= 2;
SetPassiveDamageAmount(gEffectBattler, recoil);
TryUpdateEvolutionTracker(IF_RECOIL_DAMAGE_GE, gBattleStruct->passiveHpUpdate[gBattlerAttacker], MOVE_NONE);
BattleScriptPush(battleScript);

View File

@ -4442,11 +4442,11 @@ u32 AbilityBattleEffects(enum AbilityEffect caseID, enum BattlerId battler, enum
gCalledMove = move;
// Set the target to the original target of the mon that first used a Dance move
gBattlerTarget = gBattleScripting.savedBattler & 0x3;
gBattlerTarget = gBattleStruct->dancerSavedTarget;
// Make sure that the target isn't an ally - if it is, target the original user
if (IsBattlerAlly(gBattlerTarget, gBattlerAttacker))
gBattlerTarget = (gBattleScripting.savedBattler & 0xF0) >> 4;
gBattlerTarget = gBattleStruct->dancerSavedAttacker;
BattleScriptExecute(BattleScript_DancerActivates);
effect++;
}