Skip to content

Commit

Permalink
Fixes Eject Pack / Intimidate issue (#5902)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Dec 29, 2024
1 parent a10f63e commit e64da06
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8322,6 +8322,18 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn)
gBattlescriptCurrInstr = BattleScript_WhiteHerbRet;
}
break;
case HOLD_EFFECT_EJECT_PACK:
if (gProtectStructs[battler].statFell
&& gProtectStructs[battler].disableEjectPack == 0
&& CountUsablePartyMons(battler) > 0)
{
gBattleScripting.battler = battler;
gPotentialItemEffectBattler = battler;
effect = ITEM_STATS_CHANGE;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_EjectPackActivates;
}
break;
}
break;
}
Expand Down
16 changes: 16 additions & 0 deletions test/battle/hold_effect/eject_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,19 @@ SINGLE_BATTLE_TEST("Eject Pack will miss timing to switch out user if Emergency
EXPECT(opponent->species == SPECIES_WYNAUT);
}
}

SINGLE_BATTLE_TEST("Eject Pack activates once intimidate mon switches in")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }
} WHEN {
TURN { SWITCH(opponent, 1); SEND_OUT(player, 1); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
}
}

0 comments on commit e64da06

Please sign in to comment.