mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
INVALID if FINALLY without PARAMETRIZE
This commit is contained in:
parent
3cee3b18c8
commit
e0bed6776b
@ -80,8 +80,7 @@ DOUBLE_BATTLE_TEST("Volt Absorb does not stop Electric Typed Explosion from dama
|
||||
MESSAGE("Jolteon restored HP using its Volt Absorb!");
|
||||
HP_BAR(playerRight, captureDamage: &results->damage1);
|
||||
HP_BAR(opponentRight, captureDamage: &results->damage2);
|
||||
}
|
||||
FINALLY {
|
||||
} THEN {
|
||||
EXPECT_NE(results[0].damage1, 0);
|
||||
EXPECT_NE(results[0].damage2, 0);
|
||||
}
|
||||
|
@ -183,4 +183,4 @@ SINGLE_BATTLE_TEST("Sitrus Berry restores a battler's HP by 25% of its max HP(30
|
||||
}
|
||||
|
||||
#undef TEST_HP
|
||||
#undef MAX_HP
|
||||
#undef MAX_HP
|
||||
|
@ -28,7 +28,7 @@ SINGLE_BATTLE_TEST("Bide deals twice the taken damage over two turns")
|
||||
MESSAGE("Wobbuffet unleashed energy!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_BIDE, player);
|
||||
HP_BAR(opponent, captureDamage: &bideDamage);
|
||||
} FINALLY {
|
||||
EXPECT_EQ(bideDamage, damage1 + damage2);
|
||||
} THEN {
|
||||
EXPECT_EQ(bideDamage, 2 * (damage1 + damage2));
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ ASSUMPTIONS
|
||||
ASSUME(gBattleMoves[MOVE_TRIPLE_KICK].effect & EFFECT_TRIPLE_KICK);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Triple Kick damage is increaased by its base damage for each hit")
|
||||
SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each hit")
|
||||
{
|
||||
s16 firstHit;
|
||||
s16 secondHit;
|
||||
@ -24,8 +24,8 @@ SINGLE_BATTLE_TEST("Triple Kick damage is increaased by its base damage for each
|
||||
HP_BAR(opponent, captureDamage: &secondHit);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_KICK, player);
|
||||
HP_BAR(opponent, captureDamage: &thirdHit);
|
||||
} FINALLY {
|
||||
EXPECT_EQ(secondHit, firstHit * 2);
|
||||
EXPECT_EQ(thirdHit, firstHit * 3);
|
||||
} THEN {
|
||||
EXPECT_MUL_EQ(firstHit, Q_4_12(2.0), secondHit);
|
||||
EXPECT_MUL_EQ(firstHit, Q_4_12(3.0), thirdHit);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Three-strike flag turns a move into a 3-hit move")
|
||||
HP_BAR(opponent, captureDamage: &secondHit);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
|
||||
HP_BAR(opponent, captureDamage: &thirdHit);
|
||||
} FINALLY {
|
||||
} THEN {
|
||||
EXPECT_EQ(firstHit, secondHit);
|
||||
EXPECT_EQ(secondHit, thirdHit);
|
||||
EXPECT_EQ(firstHit, thirdHit);
|
||||
@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Surging Strikes hits 3 times with each hit being a critical
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
|
||||
HP_BAR(opponent, captureDamage: &thirdHit);
|
||||
MESSAGE("A critical hit!");
|
||||
} FINALLY {
|
||||
} THEN {
|
||||
EXPECT_EQ(firstHit, secondHit);
|
||||
EXPECT_EQ(secondHit, thirdHit);
|
||||
EXPECT_EQ(firstHit, thirdHit);
|
||||
|
@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Electric Terrain activates Electric Seed and Mimicry")
|
||||
MESSAGE("Using Electric Seed, the Defense of Wobbuffet rose!");
|
||||
ABILITY_POPUP(opponent);
|
||||
MESSAGE("Foe Stunfisk's type changed to Electr!");
|
||||
} FINALLY {
|
||||
} THEN {
|
||||
EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].type1, TYPE_ELECTRIC);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ SINGLE_BATTLE_TEST("Grassy Terrain activates Grassy Seed and Mimicry")
|
||||
MESSAGE("Using Grassy Seed, the Defense of Wobbuffet rose!");
|
||||
ABILITY_POPUP(opponent);
|
||||
MESSAGE("Foe Stunfisk's type changed to Grass!");
|
||||
} FINALLY {
|
||||
} THEN {
|
||||
EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].type1, TYPE_GRASS);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Misty Terrain activates Misty Seed and Mimicry")
|
||||
MESSAGE("Using Misty Seed, the Sp. Def of Wobbuffet rose!");
|
||||
ABILITY_POPUP(opponent);
|
||||
MESSAGE("Foe Stunfisk's type changed to Fairy!");
|
||||
} FINALLY {
|
||||
} THEN {
|
||||
EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].type1, TYPE_FAIRY);
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain activates Psychic Seed and Mimicry")
|
||||
MESSAGE("Using Psychic Seed, the Sp. Def of Wobbuffet rose!");
|
||||
ABILITY_POPUP(opponent);
|
||||
MESSAGE("Foe Stunfisk's type changed to Psychc!");
|
||||
} FINALLY {
|
||||
} THEN {
|
||||
EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].type1, TYPE_PSYCHIC);
|
||||
}
|
||||
}
|
||||
|
@ -897,7 +897,9 @@ void QueueStatus(u32 sourceLine, struct BattlePokemon *battler, struct StatusEve
|
||||
|
||||
/* Finally */
|
||||
|
||||
#define FINALLY for (; gBattleTestRunnerState->runFinally; gBattleTestRunnerState->runFinally = FALSE) if ((gBattleTestRunnerState->runningFinally = TRUE))
|
||||
#define FINALLY for (ValidateFinally(__LINE__); gBattleTestRunnerState->runFinally; gBattleTestRunnerState->runFinally = FALSE) if ((gBattleTestRunnerState->runningFinally = TRUE))
|
||||
|
||||
void ValidateFinally(u32 sourceLine);
|
||||
|
||||
/* Expect */
|
||||
|
||||
|
@ -1719,7 +1719,6 @@ void QueueMessage(u32 sourceLine, const u8 *pattern)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void QueueStatus(u32 sourceLine, struct BattlePokemon *battler, struct StatusEventContext ctx)
|
||||
{
|
||||
s32 battlerId = battler - gBattleMons;
|
||||
@ -1759,3 +1758,11 @@ void QueueStatus(u32 sourceLine, struct BattlePokemon *battler, struct StatusEve
|
||||
}},
|
||||
};
|
||||
}
|
||||
|
||||
void ValidateFinally(u32 sourceLine)
|
||||
{
|
||||
// Defer this error until after estimating the cost.
|
||||
if (STATE->results == NULL)
|
||||
return;
|
||||
INVALID_IF(STATE->parametersCount == 0, "FINALLY without PARAMETRIZE");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user