mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Fix Synchronize
This commit is contained in:
parent
10c27ac6a6
commit
48c801245c
@ -474,7 +474,7 @@ struct BattleStruct
|
||||
u32 savedBattleTypeFlags;
|
||||
u8 abilityPreventingSwitchout;
|
||||
u8 hpScale;
|
||||
u8 synchronizeMoveEffect;
|
||||
u16 synchronizeMoveEffect;
|
||||
bool8 anyMonHasTransformed;
|
||||
void (*savedCallback)(void);
|
||||
u16 usedHeldItems[MAX_BATTLERS_COUNT];
|
||||
|
@ -3527,32 +3527,42 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT))
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
|
||||
gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN);
|
||||
if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC)
|
||||
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON;
|
||||
|
||||
gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER;
|
||||
gBattleScripting.battler = gBattlerTarget;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
effect++;
|
||||
if (!(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY))
|
||||
{
|
||||
gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN);
|
||||
if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC)
|
||||
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON;
|
||||
|
||||
gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER;
|
||||
gBattleScripting.battler = gBattlerAbility = gBattlerTarget;
|
||||
PREPARE_ABILITY_BUFFER(gBattleTextBuff1, ABILITY_SYNCHRONIZE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ABILITYEFFECT_ATK_SYNCHRONIZE: // 8
|
||||
if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT))
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
|
||||
gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN);
|
||||
if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC)
|
||||
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON;
|
||||
|
||||
gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect;
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
effect++;
|
||||
if (!(gBattleMons[gBattlerTarget].status1 & STATUS1_ANY))
|
||||
{
|
||||
gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN);
|
||||
if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC)
|
||||
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON;
|
||||
|
||||
gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect;
|
||||
gBattleScripting.battler = gBattlerAbility = gBattlerAttacker;
|
||||
PREPARE_ABILITY_BUFFER(gBattleTextBuff1, ABILITY_SYNCHRONIZE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
|
||||
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ABILITYEFFECT_INTIMIDATE1: // 9
|
||||
@ -3635,7 +3645,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
gBattleResources->flags->flags[i] &= ~(RESOURCE_FLAG_INTIMIDATED);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_IntimidateActivates;
|
||||
gBattleStruct->intimidateBattler = i;
|
||||
gBattlerAbility = gBattleStruct->intimidateBattler = i;
|
||||
effect++;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user