Fix Intimidate targetting dead sides and false postpones (#2850)
This commit is contained in:
commit
a0b95ae27e
3 changed files with 40 additions and 2 deletions
|
@ -8627,6 +8627,7 @@ BattleScript_IntimidateActivates::
|
||||||
BattleScript_IntimidateLoop:
|
BattleScript_IntimidateLoop:
|
||||||
jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_IntimidateLoopIncrement
|
jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_IntimidateLoopIncrement
|
||||||
jumpiftargetally BattleScript_IntimidateLoopIncrement
|
jumpiftargetally BattleScript_IntimidateLoopIncrement
|
||||||
|
jumpifabsent BS_TARGET, BattleScript_IntimidateLoopIncrement
|
||||||
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_IntimidateLoopIncrement
|
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_IntimidateLoopIncrement
|
||||||
jumpifholdeffect BS_TARGET, HOLD_EFFECT_CLEAR_AMULET, BattleScript_IntimidatePrevented_Item
|
jumpifholdeffect BS_TARGET, HOLD_EFFECT_CLEAR_AMULET, BattleScript_IntimidatePrevented_Item
|
||||||
jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_IntimidatePrevented
|
jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_IntimidatePrevented
|
||||||
|
|
|
@ -6985,9 +6985,9 @@ bool32 ShouldPostponeSwitchInAbilities(u32 battlerId)
|
||||||
// Checks for double battle, so abilities like Intimidate wait until all battlers are switched-in before activating.
|
// Checks for double battle, so abilities like Intimidate wait until all battlers are switched-in before activating.
|
||||||
if (IsDoubleBattle())
|
if (IsDoubleBattle())
|
||||||
{
|
{
|
||||||
if (aliveOpposing1 && !aliveOpposing2 && !HasNoMonsToSwitch(BATTLE_OPPOSITE(battlerId), PARTY_SIZE, PARTY_SIZE))
|
if (aliveOpposing1 && !aliveOpposing2 && !HasNoMonsToSwitch(BATTLE_PARTNER(BATTLE_OPPOSITE(battlerId)), PARTY_SIZE, PARTY_SIZE))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (!aliveOpposing1 && aliveOpposing2 && !HasNoMonsToSwitch(BATTLE_PARTNER(BATTLE_OPPOSITE(battlerId)), PARTY_SIZE, PARTY_SIZE))
|
if (!aliveOpposing1 && aliveOpposing2 && !HasNoMonsToSwitch(BATTLE_OPPOSITE(battlerId), PARTY_SIZE, PARTY_SIZE))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,3 +122,40 @@ SINGLE_BATTLE_TEST("Intimidate and Eject Button force the opponent to Attack")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DOUBLE_BATTLE_TEST("Intimidate activates on an empty slot")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_CROAGUNK);
|
||||||
|
PLAYER(SPECIES_WYNAUT);
|
||||||
|
PLAYER(SPECIES_HITMONTOP) { Ability(ABILITY_INTIMIDATE); };
|
||||||
|
OPPONENT(SPECIES_RALTS);
|
||||||
|
OPPONENT(SPECIES_AZURILL);
|
||||||
|
} WHEN {
|
||||||
|
TURN {
|
||||||
|
SWITCH(playerLeft, 2);
|
||||||
|
MOVE(playerRight, MOVE_GUNK_SHOT, target: opponentLeft);
|
||||||
|
MOVE(opponentRight, MOVE_SPLASH);
|
||||||
|
}
|
||||||
|
TURN {
|
||||||
|
SWITCH(playerLeft, 3);
|
||||||
|
MOVE(playerRight, MOVE_SPLASH);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Wobbuffet, that's enough! Come back!");
|
||||||
|
MESSAGE("Go! Wynaut!");
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_GUNK_SHOT, playerRight);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SPLASH, opponentRight);
|
||||||
|
MESSAGE("Wynaut, that's enough! Come back!");
|
||||||
|
MESSAGE("Go! Hitmontop!");
|
||||||
|
ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE);
|
||||||
|
NONE_OF {
|
||||||
|
MESSAGE("Hitmontop's Intimidate cuts Foe Ralts's attack!");
|
||||||
|
}
|
||||||
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
|
||||||
|
MESSAGE("Hitmontop's Intimidate cuts Foe Azurill's attack!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue