Skip to content

Commit

Permalink
Order Up test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine committed Sep 29, 2024
1 parent 5be10ed commit 30eecf2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 4 deletions.
3 changes: 3 additions & 0 deletions include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,13 @@ struct ProtectStruct
u16 eatMirrorHerb:1;
u16 activateOpportunist:2; // 2 - to copy stats. 1 - stats copied (do not repeat). 0 - no stats to copy
u16 usedAllySwitch:1;
u16 padding:2;
// End of 16-bit bitfield
u32 physicalDmg;
u32 specialDmg;
u8 physicalBattlerId;
u8 specialBattlerId;

};

struct SpecialStatus
Expand Down
1 change: 1 addition & 0 deletions include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ enum {
EFFECT_DRAGON_DARTS,
EFFECT_GUARDIAN_OF_ALOLA,
EFFECT_SHELL_SIDE_ARM,
EFFECT_ORDER_UP,
NUM_BATTLE_MOVE_EFFECTS,
};

Expand Down
7 changes: 4 additions & 3 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -2862,9 +2862,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
INCREMENT_RESET_RETURN

if (!(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)
&& !primary
&& gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING)
&& TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)
&& !(gMovesInfo[gCurrentMove].effect == EFFECT_ORDER_UP && gBattleStruct->commanderActive[gBattlerAttacker])
&& !primary
&& gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING)
INCREMENT_RESET_RETURN

if (!IsBattlerAlive(gEffectBattler) && !activateAfterFaint)
Expand Down
6 changes: 6 additions & 0 deletions src/data/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -2255,4 +2255,10 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
.battleScript = BattleScript_EffectHit,
.battleTvScore = 0, // TODO: Assign points
},

[EFFECT_ORDER_UP] =
{
.battleScript = BattleScript_EffectHit,
.battleTvScore = 0, // TODO: Assign points
},
};
2 changes: 1 addition & 1 deletion src/data/moves_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -19320,7 +19320,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.description = COMPOUND_STRING(
"Boosts a user's stats\n"
"depending on Tatsugiri."),
.effect = EFFECT_HIT,
.effect = EFFECT_ORDER_UP,
.power = 80,
.type = TYPE_DRAGON,
.accuracy = 100,
Expand Down
51 changes: 51 additions & 0 deletions test/battle/move_effect_secondary/order_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,54 @@ DOUBLE_BATTLE_TEST("Order up does not boosts any stats if Dondozo is not affecte
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
}
}

DOUBLE_BATTLE_TEST("Order Up is boosted by Sheer Force without removing the stat boosting effect")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT);
PLAYER(SPECIES_DONDOZO) { Speed(10); }
PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(8); }
OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); }
} WHEN {
TURN { MOVE(opponentRight, MOVE_ENTRAINMENT, target: playerLeft); MOVE(playerLeft, MOVE_ORDER_UP, target: opponentLeft); }
} SCENE {
MESSAGE("Foe Tauros used Entrainment!");
MESSAGE("Dondozo acquired Sheer Force!");
MESSAGE("Dondozo used Order Up!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
}
}
DOUBLE_BATTLE_TEST("Order Up is always boosted by Sheer Force", s16 damage)
{
u32 move;
u32 ability;
PARAMETRIZE(move = MOVE_CELEBRATE, ability = ABILITY_STORM_DRAIN);
PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_STORM_DRAIN);
PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_COMMANDER);

GIVEN {
ASSUME(gMovesInfo[MOVE_HAZE].effect == EFFECT_HAZE);
ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT);
PLAYER(SPECIES_DONDOZO) { Speed(10); }
PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); Ability(ability); }
OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(22); }
} WHEN {
TURN { MOVE(opponentRight, MOVE_HAZE);
MOVE(opponentLeft, move, target: playerLeft);
MOVE(playerLeft, MOVE_ORDER_UP, target: opponentRight); }
} SCENE {
MESSAGE("Foe Wobbuffet used Haze!");
if (move == MOVE_ENTRAINMENT)
{
MESSAGE("Foe Tauros used Entrainment!");
MESSAGE("Dondozo acquired Sheer Force!");
}
MESSAGE("Dondozo used Order Up!");
HP_BAR(opponentRight, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.3), results[1].damage);
EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.3), results[2].damage);
}
}

0 comments on commit 30eecf2

Please sign in to comment.