From ca2fffc5d0a5c97e31d7f84cfdf0259353738f7a Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Fri, 1 Nov 2024 16:57:57 +0000 Subject: [PATCH] Fix explicitSpeed check Add 'Speed(...)' calls where required. --- test/battle/ability/sap_sipper.c | 2 +- test/battle/weather/hail.c | 2 +- test/battle/weather/sandstorm.c | 2 +- test/test_runner_battle.c | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/battle/ability/sap_sipper.c b/test/battle/ability/sap_sipper.c index b253bfaa84..9d0ee7eaca 100644 --- a/test/battle/ability/sap_sipper.c +++ b/test/battle/ability/sap_sipper.c @@ -46,7 +46,7 @@ SINGLE_BATTLE_TEST("Sap Sipper does not increase Attack if already maxed") { GIVEN { PLAYER(SPECIES_MARILL) { Ability(ABILITY_SAP_SIPPER); } - OPPONENT(SPECIES_WOBBUFFET) { Speed(1); } + OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_BELLY_DRUM); MOVE(opponent, MOVE_VINE_WHIP); } } SCENE { diff --git a/test/battle/weather/hail.c b/test/battle/weather/hail.c index 4210a22d9e..f5ccf3cc99 100644 --- a/test/battle/weather/hail.c +++ b/test/battle/weather/hail.c @@ -57,7 +57,7 @@ SINGLE_BATTLE_TEST("Hail fails if Desolate Land or Primordial Sea are active") DOUBLE_BATTLE_TEST("Hail deals damage based on turn order") { GIVEN { - PLAYER(SPECIES_GLALIE); + PLAYER(SPECIES_GLALIE) { Speed(4); } PLAYER(SPECIES_WYNAUT) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } OPPONENT(SPECIES_WYNAUT) { Speed(3); } diff --git a/test/battle/weather/sandstorm.c b/test/battle/weather/sandstorm.c index 1673c26f99..6059d2c224 100644 --- a/test/battle/weather/sandstorm.c +++ b/test/battle/weather/sandstorm.c @@ -69,7 +69,7 @@ SINGLE_BATTLE_TEST("Sandstorm damage does not hurt Ground, Rock, and Steel-type DOUBLE_BATTLE_TEST("Sandstorm deals damage based on turn order") { GIVEN { - PLAYER(SPECIES_PHANPY); + PLAYER(SPECIES_PHANPY) { Speed(4); } PLAYER(SPECIES_WYNAUT) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } OPPONENT(SPECIES_WYNAUT) { Speed(3); } diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index b95fe49774..b74e8e6d2e 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -330,8 +330,10 @@ static void BattleTest_Run(void *data) if (DATA.hasExplicitSpeeds) { + // TODO: If a battler is taking the default action maybe it + // should not require an explicit speed? if (DATA.explicitSpeeds[B_SIDE_PLAYER] != (1 << DATA.playerPartySize) - 1 - && DATA.explicitSpeeds[B_SIDE_OPPONENT] != (1 << DATA.opponentPartySize) - 1) + || DATA.explicitSpeeds[B_SIDE_OPPONENT] != (1 << DATA.opponentPartySize) - 1) { Test_ExitWithResult(TEST_RESULT_INVALID, SourceLine(0), ":LSpeed required for all PLAYERs and OPPONENTs"); }