Ability imposter (#6552)

This commit is contained in:
wiz1989 2025-04-12 00:01:29 +02:00 committed by GitHub
parent 1ade433028
commit 3d8b912087
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 11 deletions

View File

@ -4763,16 +4763,21 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
}
break;
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;
gBattlerTarget = BATTLE_OPPOSITE(battler);
BattleScriptPushCursorAndCallback(BattleScript_ImposterActivates);
effect++;
u32 diagonalBattler = BATTLE_OPPOSITE(battler);
if (IsDoubleBattle())
diagonalBattler = BATTLE_PARTNER(diagonalBattler);
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;
case ABILITY_MOLD_BREAKER:

View File

@ -245,11 +245,11 @@ DOUBLE_BATTLE_TEST("Commander doesn't prevent Imposter from working on a Command
OPPONENT(SPECIES_DITTO) { Ability(ABILITY_IMPOSTER); }
} WHEN {
TURN { }
TURN { SWITCH(opponentRight, 2); }
TURN { SWITCH(opponentLeft, 2); }
} SCENE {
ABILITY_POPUP(playerRight, ABILITY_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!");
}
}