mirror of
https://github.com/pret/pokeemerald.git
synced 2026-06-02 22:05:46 -05:00
Ability imposter (#6552)
This commit is contained in:
parent
1ade433028
commit
3d8b912087
|
|
@ -4763,16 +4763,21 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_IMPOSTER:
|
case ABILITY_IMPOSTER:
|
||||||
if (IsBattlerAlive(BATTLE_OPPOSITE(battler))
|
|
||||||
&& !(gBattleMons[BATTLE_OPPOSITE(battler)].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE))
|
|
||||||
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
|
|
||||||
&& !(gBattleStruct->illusion[BATTLE_OPPOSITE(battler)].on)
|
|
||||||
&& !(gStatuses3[BATTLE_OPPOSITE(battler)] & STATUS3_SEMI_INVULNERABLE_NO_COMMANDER))
|
|
||||||
{
|
{
|
||||||
gBattlerAttacker = battler;
|
u32 diagonalBattler = BATTLE_OPPOSITE(battler);
|
||||||
gBattlerTarget = BATTLE_OPPOSITE(battler);
|
if (IsDoubleBattle())
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_ImposterActivates);
|
diagonalBattler = BATTLE_PARTNER(diagonalBattler);
|
||||||
effect++;
|
if (IsBattlerAlive(diagonalBattler)
|
||||||
|
&& !(gBattleMons[diagonalBattler].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE))
|
||||||
|
&& !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)
|
||||||
|
&& !(gBattleStruct->illusion[diagonalBattler].on)
|
||||||
|
&& !(gStatuses3[diagonalBattler] & STATUS3_SEMI_INVULNERABLE_NO_COMMANDER))
|
||||||
|
{
|
||||||
|
gBattlerAttacker = battler;
|
||||||
|
gBattlerTarget = diagonalBattler;
|
||||||
|
BattleScriptPushCursorAndCallback(BattleScript_ImposterActivates);
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITY_MOLD_BREAKER:
|
case ABILITY_MOLD_BREAKER:
|
||||||
|
|
|
||||||
|
|
@ -245,11 +245,11 @@ DOUBLE_BATTLE_TEST("Commander doesn't prevent Imposter from working on a Command
|
||||||
OPPONENT(SPECIES_DITTO) { Ability(ABILITY_IMPOSTER); }
|
OPPONENT(SPECIES_DITTO) { Ability(ABILITY_IMPOSTER); }
|
||||||
} WHEN {
|
} WHEN {
|
||||||
TURN { }
|
TURN { }
|
||||||
TURN { SWITCH(opponentRight, 2); }
|
TURN { SWITCH(opponentLeft, 2); }
|
||||||
} SCENE {
|
} SCENE {
|
||||||
ABILITY_POPUP(playerRight, ABILITY_COMMANDER);
|
ABILITY_POPUP(playerRight, ABILITY_COMMANDER);
|
||||||
MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!");
|
MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!");
|
||||||
ABILITY_POPUP(opponentRight, ABILITY_IMPOSTER);
|
ABILITY_POPUP(opponentLeft, ABILITY_IMPOSTER);
|
||||||
MESSAGE("The opposing Ditto transformed into Tatsugiri using Imposter!");
|
MESSAGE("The opposing Ditto transformed into Tatsugiri using Imposter!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user