mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-04-26 02:14:22 -05:00
Fixes Dancer original attacker/target being overwritten (#9515)
This commit is contained in:
parent
022507a7f2
commit
5714ee6758
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user