Skip to content

Commit

Permalink
Fixes Mycelium Might speed bracker (rh-hideout#4146)
Browse files Browse the repository at this point in the history
Co-authored-by: Bassoonian <[email protected]>
  • Loading branch information
AlexOn1ine and Bassoonian authored Feb 6, 2024
1 parent 6a71e14 commit fa5f507
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4728,9 +4728,9 @@ u32 GetWhichBattlerFasterArgs(u32 battler1, u32 battler2, bool32 ignoreChosenMov
strikesFirst = 1;
else if (ability2 == ABILITY_STALL && ability1 != ABILITY_STALL)
strikesFirst = 0;
else if (ability1 == ABILITY_MYCELIUM_MIGHT && ability2 != ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gCurrentMove))
else if (ability1 == ABILITY_MYCELIUM_MIGHT && ability2 != ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gChosenMoveByBattler[battler1]))
strikesFirst = 1;
else if (ability2 == ABILITY_MYCELIUM_MIGHT && ability1 != ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gCurrentMove))
else if (ability2 == ABILITY_MYCELIUM_MIGHT && ability1 != ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gChosenMoveByBattler[battler2]))
strikesFirst = 0;
else
{
Expand Down
45 changes: 45 additions & 0 deletions test/battle/ability/mycelium_might.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Mycelium Might causes the user to move last in the priority bracket if it uses a status move")
{
GIVEN {
PLAYER(SPECIES_TOEDSCOOL) { Speed(100); Ability(ABILITY_MYCELIUM_MIGHT); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(1); }
} WHEN {
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_SPORE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SPORE, player);
STATUS_ICON(opponent, sleep: TRUE);
}
}

SINGLE_BATTLE_TEST("Mycelium Might will respect the speed if both battlers have the ability")
{
GIVEN {
PLAYER(SPECIES_TOEDSCOOL) { Speed(100); Ability(ABILITY_MYCELIUM_MIGHT); }
OPPONENT(SPECIES_TOEDSCOOL) { Speed(1); Ability(ABILITY_MYCELIUM_MIGHT); }
} WHEN {
TURN { MOVE(opponent, MOVE_WILL_O_WISP); MOVE(player, MOVE_WILL_O_WISP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, player);
STATUS_ICON(opponent, burn: TRUE);
ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, opponent);
STATUS_ICON(player, burn: TRUE);
}
}

SINGLE_BATTLE_TEST("Mycelium Might ignores opposing abilities")
{
GIVEN {
PLAYER(SPECIES_TOEDSCOOL) { Speed(100); Ability(ABILITY_MYCELIUM_MIGHT); }
OPPONENT(SPECIES_BELDUM) { Speed(1); Ability(ABILITY_CLEAR_BODY);}
} WHEN {
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_SCREECH); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCREECH, player);
NOT ABILITY_POPUP(opponent, ABILITY_CLEAR_BODY);
}
}

0 comments on commit fa5f507

Please sign in to comment.