mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
X item tests
This commit is contained in:
parent
94cb569c47
commit
1cc28c89ef
@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("X-Attack sharply raises battler's Attack stat", s16 damage)
|
||||
SINGLE_BATTLE_TEST("X Attack sharply raises battler's Attack stat", s16 damage)
|
||||
{
|
||||
u16 useItem;
|
||||
PARAMETRIZE { useItem = FALSE; }
|
||||
@ -23,3 +23,126 @@ SINGLE_BATTLE_TEST("X-Attack sharply raises battler's Attack stat", s16 damage)
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("X Defense sharply raises battler's Defense stat", s16 damage)
|
||||
{
|
||||
u16 useItem;
|
||||
PARAMETRIZE { useItem = FALSE; }
|
||||
PARAMETRIZE { useItem = TRUE; }
|
||||
GIVEN {
|
||||
ASSUME(gItems[ITEM_X_DEFENSE].battleUsage == EFFECT_ITEM_INCREASE_STAT);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
if (useItem) TURN { USE_ITEM(player, ITEM_X_DEFENSE); }
|
||||
TURN { MOVE(opponent, MOVE_TACKLE); }
|
||||
} SCENE {
|
||||
MESSAGE("Foe Wobbuffet used Tackle!");
|
||||
HP_BAR(player, captureDamage: &results[i].damage);
|
||||
} FINALLY {
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
|
||||
else
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.66), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("X Sp. Atk sharply raises battler's Sp. Attack stat", s16 damage)
|
||||
{
|
||||
u16 useItem;
|
||||
PARAMETRIZE { useItem = FALSE; }
|
||||
PARAMETRIZE { useItem = TRUE; }
|
||||
GIVEN {
|
||||
ASSUME(gItems[ITEM_X_SP_ATK].battleUsage == EFFECT_ITEM_INCREASE_STAT);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
if (useItem) TURN { USE_ITEM(player, ITEM_X_SP_ATK); }
|
||||
TURN { MOVE(player, MOVE_DISARMING_VOICE); }
|
||||
} SCENE {
|
||||
MESSAGE("Wobbuffet used DisrmngVoice!");
|
||||
HP_BAR(opponent, captureDamage: &results[i].damage);
|
||||
} FINALLY {
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2.0), results[1].damage);
|
||||
else
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("X Sp. Def sharply raises battler's Sp. Defense stat", s16 damage)
|
||||
{
|
||||
u16 useItem;
|
||||
PARAMETRIZE { useItem = FALSE; }
|
||||
PARAMETRIZE { useItem = TRUE; }
|
||||
GIVEN {
|
||||
ASSUME(gItems[ITEM_X_SP_DEF].battleUsage == EFFECT_ITEM_INCREASE_STAT);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
if (useItem) TURN { USE_ITEM(player, ITEM_X_SP_DEF); }
|
||||
TURN { MOVE(opponent, MOVE_DISARMING_VOICE); }
|
||||
} SCENE {
|
||||
MESSAGE("Foe Wobbuffet used DisrmngVoice!");
|
||||
HP_BAR(player, captureDamage: &results[i].damage);
|
||||
} FINALLY {
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
|
||||
else
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.66), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("X Speed sharply raises battler's Speed stat", s16 damage)
|
||||
{
|
||||
u16 useItem;
|
||||
PARAMETRIZE { useItem = FALSE; }
|
||||
PARAMETRIZE { useItem = TRUE; }
|
||||
GIVEN {
|
||||
ASSUME(gItems[ITEM_X_SPEED].battleUsage == EFFECT_ITEM_INCREASE_STAT);
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
{
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(3); };
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(4); };
|
||||
}
|
||||
else
|
||||
{
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(4); };
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Speed(5); };
|
||||
}
|
||||
} WHEN {
|
||||
if (useItem) TURN { USE_ITEM(player, ITEM_X_SPEED); }
|
||||
TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_TACKLE); }
|
||||
} SCENE {
|
||||
if (useItem)
|
||||
{
|
||||
MESSAGE("Wobbuffet used Tackle!");
|
||||
MESSAGE("Foe Wobbuffet used Tackle!");
|
||||
} else
|
||||
{
|
||||
MESSAGE("Foe Wobbuffet used Tackle!");
|
||||
MESSAGE("Wobbuffet used Tackle!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("X Accuracy sharply raises battler's Accuracy stat", s16 damage)
|
||||
{
|
||||
|
||||
ASSUME(gBattleMoves[MOVE_SING].accuracy == 55);
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
PASSES_RANDOMLY(gBattleMoves[MOVE_SING].accuracy * 5 / 3, 100, RNG_ACCURACY);
|
||||
else
|
||||
PASSES_RANDOMLY(gBattleMoves[MOVE_SING].accuracy * 4 / 3, 100, RNG_ACCURACY);
|
||||
GIVEN {
|
||||
ASSUME(gItems[ITEM_X_ACCURACY].battleUsage == EFFECT_ITEM_INCREASE_STAT);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { USE_ITEM(player, ITEM_X_ACCURACY); }
|
||||
TURN { MOVE(player, MOVE_SING); }
|
||||
} SCENE {
|
||||
MESSAGE("Wobbuffet used Sing!");
|
||||
MESSAGE("Foe Wobbuffet fell asleep!");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user