Inline uses of macros in tests

This commit is contained in:
Martin Griffin 2023-06-22 17:24:35 +01:00
parent 0b43f5ab0e
commit b357d5b1b8
12 changed files with 120 additions and 153 deletions

View file

@ -1,18 +1,16 @@
#include "global.h"
#include "test_battle.h"
#define TEST_MAX_HP (200)
SINGLE_BATTLE_TEST("Dry Skin causes 1/8th Max HP damage in Sun")
{
GIVEN {
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SUNNY_DAY); }
} SCENE {
ABILITY_POPUP(player, ABILITY_DRY_SKIN);
HP_BAR(player, damage: TEST_MAX_HP / 8);
HP_BAR(player, damage: 200 / 8);
MESSAGE("The Parasect's Dry Skin takes its toll!");
}
}
@ -20,14 +18,14 @@ SINGLE_BATTLE_TEST("Dry Skin causes 1/8th Max HP damage in Sun")
SINGLE_BATTLE_TEST("Dry Skin heals 1/8th Max HP in Rain")
{
GIVEN {
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_RAIN_DANCE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_DRY_SKIN);
MESSAGE("Parasect's Dry Skin restored its HP a little!");
HP_BAR(player, hp: TEST_MAX_HP / 8 + 100);
HP_BAR(player, damage: -(200 / 8));
}
}
@ -54,13 +52,13 @@ SINGLE_BATTLE_TEST("Dry Skin heals 25% when hit by water type moves")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BUBBLE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_DRY_SKIN);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 100);
HP_BAR(player, damage: -50);
MESSAGE("Parasect restored HP using its Dry Skin!");
}
}
@ -69,7 +67,7 @@ SINGLE_BATTLE_TEST("Dry Skin does not activate if protected")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); }
@ -83,13 +81,13 @@ SINGLE_BATTLE_TEST("Dry Skin is only triggered once on multi strike moves")
GIVEN {
ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].type == TYPE_WATER);
ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].effect == EFFECT_MULTI_HIT);
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); }
} SCENE {
ABILITY_POPUP(player, ABILITY_DRY_SKIN);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 100);
HP_BAR(player, damage: -50);
MESSAGE("Parasect restored HP using its Dry Skin!");
}
}
@ -101,13 +99,13 @@ SINGLE_BATTLE_TEST("Dry Skin prevents Absorb Bulb and Luminous Moss from activat
PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; }
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); Item(item); };
PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); Item(item); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BUBBLE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_DRY_SKIN);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 100);
HP_BAR(player, damage: -50);
MESSAGE("Parasect restored HP using its Dry Skin!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);

View file

@ -1,8 +1,6 @@
#include "global.h"
#include "test_battle.h"
#define TEST_MAX_HP (100)
SINGLE_BATTLE_TEST("Ice Body prevents damage from hail")
{
GIVEN {
@ -18,13 +16,13 @@ SINGLE_BATTLE_TEST("Ice Body prevents damage from hail")
SINGLE_BATTLE_TEST("Ice Body recovers 1/16th of Max HP in hail.")
{
GIVEN {
PLAYER(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HAIL); }
} SCENE {
ABILITY_POPUP(player, ABILITY_ICE_BODY);
MESSAGE("Glalie's Ice Body healed it a little bit!");
HP_BAR(player, hp: TEST_MAX_HP / 16 + 1);
HP_BAR(player, damage: -(100 / 16));
}
}

View file

@ -1,18 +1,16 @@
#include "global.h"
#include "test_battle.h"
#define TEST_MAX_HP (100)
SINGLE_BATTLE_TEST("Rain Dish recovers 1/16th of Max HP in Rain")
{
GIVEN {
PLAYER(SPECIES_LUDICOLO) { Ability(ABILITY_RAIN_DISH); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_LUDICOLO) { Ability(ABILITY_RAIN_DISH); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_RAIN_DANCE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_RAIN_DISH);
MESSAGE("Ludicolo's Rain Dish restored its HP a little!");
HP_BAR(player, hp: TEST_MAX_HP / 16 + 1);
HP_BAR(player, damage: -(100 / 16));
}
}

View file

@ -1,19 +1,17 @@
#include "global.h"
#include "test_battle.h"
#define TEST_MAX_HP (100)
SINGLE_BATTLE_TEST("Volt Absorb heals 25% when hit by electric type moves")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC);
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_THUNDER_SHOCK); }
} SCENE {
ABILITY_POPUP(player, ABILITY_VOLT_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Jolteon restored HP using its Volt Absorb!");
}
}
@ -22,7 +20,7 @@ SINGLE_BATTLE_TEST("Volt Absorb does not activate if protected")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC);
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_THUNDER_SHOCK); }
@ -36,13 +34,13 @@ SINGLE_BATTLE_TEST("Volt Absorb activates on status moves")
GIVEN {
ASSUME(gBattleMoves[MOVE_THUNDER_WAVE].type == TYPE_ELECTRIC);
ASSUME(gBattleMoves[MOVE_THUNDER_WAVE].split == SPLIT_STATUS);
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_THUNDER_WAVE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_VOLT_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Jolteon restored HP using its Volt Absorb!");
}
}
@ -52,13 +50,13 @@ SINGLE_BATTLE_TEST("Volt Absorb is only triggered once on multi strike moves")
GIVEN {
ASSUME(gBattleMoves[MOVE_FURY_SWIPES].type == TYPE_NORMAL);
ASSUME(gBattleMoves[MOVE_FURY_SWIPES].effect == EFFECT_MULTI_HIT);
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_GRAVELER_ALOLAN) { Ability(ABILITY_GALVANIZE); };
} WHEN {
TURN { MOVE(opponent, MOVE_FURY_SWIPES); }
} SCENE {
ABILITY_POPUP(player, ABILITY_VOLT_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Jolteon restored HP using its Volt Absorb!");
}
}
@ -69,7 +67,7 @@ DOUBLE_BATTLE_TEST("Volt Absorb does not stop Electric Typed Explosion from dama
GIVEN {
ASSUME(gBattleMoves[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION);
ASSUME(gBattleMoves[MOVE_EXPLOSION].type == TYPE_NORMAL);
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); }
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); }
PLAYER(SPECIES_ABRA);
OPPONENT(SPECIES_GRAVELER_ALOLAN) { Ability(ABILITY_GALVANIZE); }
OPPONENT(SPECIES_WYNAUT);
@ -77,7 +75,7 @@ DOUBLE_BATTLE_TEST("Volt Absorb does not stop Electric Typed Explosion from dama
TURN { MOVE(opponentLeft, MOVE_EXPLOSION); }
} SCENE {
ABILITY_POPUP(playerLeft, ABILITY_VOLT_ABSORB);
HP_BAR(playerLeft, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(playerLeft, damage: -25);
MESSAGE("Jolteon restored HP using its Volt Absorb!");
HP_BAR(playerRight, captureDamage: &damage1);
HP_BAR(opponentRight, captureDamage: &damage2);
@ -91,13 +89,13 @@ SINGLE_BATTLE_TEST("Volt Absorb prevents Cell Battery from activating")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC);
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(TEST_MAX_HP); Item(ITEM_CELL_BATTERY); };
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); Item(ITEM_CELL_BATTERY); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_THUNDER_SHOCK); }
} SCENE {
ABILITY_POPUP(player, ABILITY_VOLT_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Jolteon restored HP using its Volt Absorb!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);

View file

@ -1,19 +1,17 @@
#include "global.h"
#include "test_battle.h"
#define TEST_MAX_HP (100)
SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BUBBLE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Poliwag restored HP using its Water Absorb!");
}
}
@ -22,7 +20,7 @@ SINGLE_BATTLE_TEST("Water Absorb does not activate if protected")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); }
@ -36,13 +34,13 @@ SINGLE_BATTLE_TEST("Water Absorb activates on status moves")
GIVEN {
ASSUME(gBattleMoves[MOVE_SOAK].type == TYPE_WATER);
ASSUME(gBattleMoves[MOVE_SOAK].split == SPLIT_STATUS);
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SOAK); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Poliwag restored HP using its Water Absorb!");
}
}
@ -52,13 +50,13 @@ SINGLE_BATTLE_TEST("Water Absorb is only triggered once on multi strike moves")
GIVEN {
ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].type == TYPE_WATER);
ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].effect == EFFECT_MULTI_HIT);
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Poliwag restored HP using its Water Absorb!");
}
}
@ -70,13 +68,13 @@ SINGLE_BATTLE_TEST("Water Absorb prevents Absorb Bulb and Luminous Moss from act
PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; }
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); Item(item); };
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); Item(item); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BUBBLE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
HP_BAR(player, damage: -25);
MESSAGE("Poliwag restored HP using its Water Absorb!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);

View file

@ -1,19 +1,16 @@
#include "global.h"
#include "test_battle.h"
#define TEST_HP 1
#define MAX_HP 400
SINGLE_BATTLE_TEST("Potion restores a battler's HP by 20")
{
GIVEN {
ASSUME(gItems[ITEM_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_POTION, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 20);
HP_BAR(player, damage: -20);
}
}
@ -21,12 +18,12 @@ SINGLE_BATTLE_TEST("Super Potion restores a battler's HP by 60")
{
GIVEN {
ASSUME(gItems[ITEM_SUPER_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_SUPER_POTION, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 60);
HP_BAR(player, damage: -60);
}
}
@ -34,12 +31,12 @@ SINGLE_BATTLE_TEST("Hyper Potion restores a battler's HP by 120")
{
GIVEN {
ASSUME(gItems[ITEM_HYPER_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_HYPER_POTION, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 120);
HP_BAR(player, damage: -120);
}
}
@ -47,12 +44,12 @@ SINGLE_BATTLE_TEST("Max Potion restores a battler's HP fully")
{
GIVEN {
ASSUME(gItems[ITEM_MAX_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_MAX_POTION, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: MAX_HP);
HP_BAR(player, hp: 400);
}
}
@ -60,12 +57,12 @@ SINGLE_BATTLE_TEST("Fresh Water restores a battler's HP by 30")
{
GIVEN {
ASSUME(gItems[ITEM_FRESH_WATER].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_FRESH_WATER, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 30);
HP_BAR(player, damage: -30);
}
}
@ -73,12 +70,12 @@ SINGLE_BATTLE_TEST("Soda Pop restores a battler's HP by 50")
{
GIVEN {
ASSUME(gItems[ITEM_SODA_POP].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_SODA_POP, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 50);
HP_BAR(player, damage: -50);
}
}
@ -86,12 +83,12 @@ SINGLE_BATTLE_TEST("Lemonade restores a battler's HP by 70")
{
GIVEN {
ASSUME(gItems[ITEM_LEMONADE].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_LEMONADE, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 70);
HP_BAR(player, damage: -70);
}
}
@ -99,44 +96,44 @@ SINGLE_BATTLE_TEST("Moomoo Milk restores a battler's HP by 100")
{
GIVEN {
ASSUME(gItems[ITEM_MOOMOO_MILK].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_MOOMOO_MILK, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 100);
HP_BAR(player, damage: -100);
}
}
SINGLE_BATTLE_TEST("Energy Powder restores a battler's HP by 60(50)")
SINGLE_BATTLE_TEST("Energy Powder restores a battler's HP by 60 (/50)")
{
GIVEN {
ASSUME(gItems[ITEM_ENERGY_POWDER].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_ENERGY_POWDER, partyIndex: 0); }
} SCENE {
if (I_HEALTH_RECOVERY >= GEN_7)
HP_BAR(player, hp: TEST_HP + 60);
HP_BAR(player, damage: -60);
else
HP_BAR(player, hp: TEST_HP + 50);
HP_BAR(player, damage: -50);
}
}
SINGLE_BATTLE_TEST("Energy Root restores a battler's HP by 120(200)")
SINGLE_BATTLE_TEST("Energy Root restores a battler's HP by 120 (/200)")
{
GIVEN {
ASSUME(gItems[ITEM_ENERGY_ROOT].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_ENERGY_ROOT, partyIndex: 0); }
} SCENE {
if (I_HEALTH_RECOVERY >= GEN_7)
HP_BAR(player, hp: TEST_HP + 120);
HP_BAR(player, damage: -120);
else
HP_BAR(player, hp: TEST_HP + 200);
HP_BAR(player, damage: -200);
}
}
@ -144,12 +141,12 @@ SINGLE_BATTLE_TEST("Sweet Heart restores a battler's HP by 20")
{
GIVEN {
ASSUME(gItems[ITEM_SWEET_HEART].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_SWEET_HEART, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 20);
HP_BAR(player, damage: -20);
}
}
@ -157,30 +154,27 @@ SINGLE_BATTLE_TEST("Oran Berry restores a battler's HP by 10")
{
GIVEN {
ASSUME(gItems[ITEM_ORAN_BERRY].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_ORAN_BERRY, partyIndex: 0); }
} SCENE {
HP_BAR(player, hp: TEST_HP + 10);
HP_BAR(player, damage: -10);
}
}
SINGLE_BATTLE_TEST("Sitrus Berry restores a battler's HP by 25% of its max HP(30HP flat)")
SINGLE_BATTLE_TEST("Sitrus Berry restores a battler's HP by 25% of its max HP (/30HP flat)")
{
GIVEN {
ASSUME(gItems[ITEM_SITRUS_BERRY].battleUsage == EFFECT_ITEM_RESTORE_HP);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { USE_ITEM(player, ITEM_SITRUS_BERRY, partyIndex: 0); }
} SCENE {
if (I_SITRUS_BERRY_HEAL >= GEN_4)
HP_BAR(player, hp: TEST_HP + MAX_HP * 0.25);
HP_BAR(player, damage: -100); // 25%.
else
HP_BAR(player, hp: TEST_HP + 30);
HP_BAR(player, damage: -30); // 30.
}
}
#undef TEST_HP
#undef MAX_HP

View file

@ -1,13 +1,11 @@
#include "global.h"
#include "test_battle.h"
#define MAX_HP 200
SINGLE_BATTLE_TEST("Revive restores a fainted battler's HP to half")
{
GIVEN {
ASSUME(gItems[ITEM_REVIVE].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(MAX_HP); }
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -17,7 +15,7 @@ SINGLE_BATTLE_TEST("Revive restores a fainted battler's HP to half")
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, MAX_HP/2);
EXPECT_EQ(player->hp, 100);
}
}
@ -25,7 +23,7 @@ SINGLE_BATTLE_TEST("Max Revive restores a fainted battler's HP fully")
{
GIVEN {
ASSUME(gItems[ITEM_MAX_REVIVE].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(MAX_HP); }
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -35,7 +33,7 @@ SINGLE_BATTLE_TEST("Max Revive restores a fainted battler's HP fully")
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, MAX_HP);
EXPECT_EQ(player->hp, 200);
}
}
@ -43,7 +41,7 @@ SINGLE_BATTLE_TEST("Revival Herb restores a fainted battler's HP fully")
{
GIVEN {
ASSUME(gItems[ITEM_REVIVAL_HERB].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(MAX_HP); }
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -53,7 +51,7 @@ SINGLE_BATTLE_TEST("Revival Herb restores a fainted battler's HP fully")
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, MAX_HP);
EXPECT_EQ(player->hp, 200);
}
}
@ -61,7 +59,7 @@ SINGLE_BATTLE_TEST("Max Honey restores a fainted battler's HP fully")
{
GIVEN {
ASSUME(gItems[ITEM_MAX_HONEY].battleUsage == EFFECT_ITEM_REVIVE);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(MAX_HP); }
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(200); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -71,8 +69,6 @@ SINGLE_BATTLE_TEST("Max Honey restores a fainted battler's HP fully")
} SCENE {
MESSAGE("Wynaut had its HP restored!");
} THEN {
EXPECT_EQ(player->hp, MAX_HP);
EXPECT_EQ(player->hp, 200);
}
}
#undef MAX_HP

View file

@ -7,14 +7,12 @@ ASSUMPTIONS
ASSUME(gBattleMoves[MOVE_LUNAR_DANCE].effect == EFFECT_HEALING_WISH);
}
#define TEST_MAX_HP (100)
SINGLE_BATTLE_TEST("Healing Wish causes the user to faint and fully heals the replacement")
{
GIVEN {
ASSUME(B_HEALING_WISH_SWITCH >= GEN_5);
PLAYER(SPECIES_GARDEVOIR);
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(TEST_MAX_HP); Status1(STATUS1_POISON); }
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(100); Status1(STATUS1_POISON); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_HEALING_WISH); SEND_OUT(player, 1); }
@ -23,7 +21,7 @@ SINGLE_BATTLE_TEST("Healing Wish causes the user to faint and fully heals the re
HP_BAR(player, hp: 0);
MESSAGE("Gardevoir fainted!");
MESSAGE("The healing wish came true for Wynaut!");
HP_BAR(player, hp: TEST_MAX_HP);
HP_BAR(player, hp: 100);
STATUS_ICON(player, none: TRUE);
MESSAGE("Wynaut regained health!");
}
@ -35,7 +33,7 @@ DOUBLE_BATTLE_TEST("Lunar Dance causes the user to faint and fully heals the rep
ASSUME(B_HEALING_WISH_SWITCH >= GEN_5);
PLAYER(SPECIES_GARDEVOIR) { Speed(300); }
PLAYER(SPECIES_WOBBUFFET) { Speed(50); }
PLAYER(SPECIES_WYNAUT) { HP(TEST_MAX_HP - 1); MaxHP(TEST_MAX_HP); Status1(STATUS1_BURN); Speed(50); }
PLAYER(SPECIES_WYNAUT) { HP(99); MaxHP(100); Status1(STATUS1_BURN); Speed(50); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(50); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(50); }
} WHEN {
@ -45,7 +43,7 @@ DOUBLE_BATTLE_TEST("Lunar Dance causes the user to faint and fully heals the rep
HP_BAR(playerLeft, hp: 0);
MESSAGE("Gardevoir fainted!");
MESSAGE("Wynaut became cloaked in mystical moonlight!");
HP_BAR(playerLeft, hp: TEST_MAX_HP);
HP_BAR(playerLeft, hp: 100);
STATUS_ICON(playerLeft, none: TRUE);
MESSAGE("Wynaut regained health!");
}
@ -57,7 +55,7 @@ SINGLE_BATTLE_TEST("Healing Wish effect activates only if the switched pokemon c
ASSUME(B_HEALING_WISH_SWITCH >= GEN_8);
PLAYER(SPECIES_GARDEVOIR) { Speed(300); }
PLAYER(SPECIES_NINJASK) { Speed(400); }
PLAYER(SPECIES_WYNAUT) { HP(TEST_MAX_HP / 2); MaxHP(TEST_MAX_HP); Status1(STATUS1_PARALYSIS); Speed(50); }
PLAYER(SPECIES_WYNAUT) { HP(50); MaxHP(100); Status1(STATUS1_PARALYSIS); Speed(50); }
OPPONENT(SPECIES_WOBBUFFET) {Speed(50); }
} WHEN {
TURN { MOVE(player, MOVE_HEALING_WISH); SEND_OUT(player, 1); }
@ -73,7 +71,7 @@ SINGLE_BATTLE_TEST("Healing Wish effect activates only if the switched pokemon c
ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, player);
MESSAGE("Do it! Wynaut!");
MESSAGE("The healing wish came true for Wynaut!");
HP_BAR(player, hp: TEST_MAX_HP);
HP_BAR(player, hp: 100);
STATUS_ICON(player, none: TRUE);
MESSAGE("Wynaut regained health!");
}

View file

@ -6,17 +6,15 @@ ASSUMPTIONS
ASSUME(gBattleMoves[MOVE_MIND_BLOWN].effect == EFFECT_MIND_BLOWN);
}
#define HP_TEST (400)
SINGLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its HP")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST); MaxHP(HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(400); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_MIND_BLOWN); }
} SCENE {
HP_BAR(player, hp: HP_TEST / 2);
HP_BAR(player, damage: 200);
ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, player);
NOT MESSAGE("Wobbuffet fainted!"); // Wobb had more than 1/2 of its HP, so it can't faint.
}
@ -25,14 +23,14 @@ SINGLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its HP")
DOUBLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its HP in a double battle")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST); MaxHP(HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(400); MaxHP(400); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(playerLeft, MOVE_MIND_BLOWN); }
} SCENE {
HP_BAR(playerLeft, hp: HP_TEST / 2);
HP_BAR(playerLeft, damage: 200);
ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, playerLeft);
NOT MESSAGE("Wobbuffet fainted!"); // Wobb had more than 1/2 of its HP, so it can't faint.
}
@ -41,7 +39,7 @@ DOUBLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its HP in a double bat
SINGLE_BATTLE_TEST("Mind Blown causes the user to faint when below 1/2 of its HP")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2); MaxHP(HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(200); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_MIND_BLOWN); }
@ -55,7 +53,7 @@ SINGLE_BATTLE_TEST("Mind Blown causes the user to faint when below 1/2 of its HP
DOUBLE_BATTLE_TEST("Mind Blown causes the user to faint when below 1/2 of its HP in a double battle")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2); MaxHP(HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(200); MaxHP(400); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
@ -71,7 +69,7 @@ DOUBLE_BATTLE_TEST("Mind Blown causes the user to faint when below 1/2 of its HP
SINGLE_BATTLE_TEST("Mind Blown causes the user & the target to faint when below 1/2 of its HP")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2) ; MaxHP(HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(200) ; MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -88,7 +86,7 @@ SINGLE_BATTLE_TEST("Mind Blown causes the user & the target to faint when below
DOUBLE_BATTLE_TEST("Mind Blown causes everyone to faint in a double battle")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(HP_TEST / 2); MaxHP(HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(200); MaxHP(400); }
PLAYER(SPECIES_WYNAUT) { HP(1); }
OPPONENT(SPECIES_ABRA) { HP(1); }
OPPONENT(SPECIES_KADABRA) { HP(1); }

View file

@ -5,13 +5,11 @@
// behaviors. These have been tested in-game, in double, in multi, and in link battles. AI will always
// revive their first fainted party member in order.
#define MOVE_MESSAGE(name) \
do { \
if (B_EXPANDED_MOVE_NAMES == FALSE) \
MESSAGE(name" used RevivlBlesng!"); \
else \
MESSAGE(name" used Revival Blessing!"); \
} while (0); \
#if B_EXPANDED_MOVE_NAMES
#define REVIVAL_BLESSING "Revival Blessing"
#else
#define REVIVAL_BLESSING "RevivlBlesng"
#endif
ASSUMPTIONS
{
@ -28,7 +26,7 @@ SINGLE_BATTLE_TEST("Revival Blessing revives a chosen fainted party member for t
} WHEN {
TURN { MOVE(player, MOVE_REVIVAL_BLESSING); SEND_OUT(player, 2); }
} SCENE {
MOVE_MESSAGE("Wobbuffet")
MESSAGE("Wobbuffet used " REVIVAL_BLESSING "!");
MESSAGE("Wynaut was revived and is ready to fight again!");
}
}
@ -43,7 +41,7 @@ SINGLE_BATTLE_TEST("Revival Blessing revives a fainted party member for an oppon
} WHEN {
TURN { MOVE(opponent, MOVE_REVIVAL_BLESSING); SEND_OUT(opponent, 1); }
} SCENE {
MOVE_MESSAGE("Foe Raichu")
MESSAGE("Foe Raichu used " REVIVAL_BLESSING "!");
MESSAGE("Pichu was revived and is ready to fight again!");
}
}
@ -56,7 +54,7 @@ SINGLE_BATTLE_TEST("Revival Blessing fails if no party members are fainted")
} WHEN {
TURN { MOVE(player, MOVE_REVIVAL_BLESSING); }
} SCENE {
MOVE_MESSAGE("Wobbuffet")
MESSAGE("Wobbuffet used " REVIVAL_BLESSING "!");
MESSAGE("But it failed!");
}
}
@ -84,10 +82,10 @@ TO_DO_BATTLE_TEST("Revival Blessing cannot revive a partner's party member");
// TURN { MOVE(user, MOVE_REVIVAL_BLESSING); }
// } SCENE {
// if (user == opponentLeft) {
// MOVE_MESSAGE(Foe Wobbuffet)
// MESSAGE("Foe Wobbuffet used " REVIVAL_BLESSING "!");
// MESSAGE("But it failed!");
// } else {
// MOVE_MESSAGE(Foe Wynaut)
// MESSAGE("Foe Wynaut used " REVIVAL_BLESSING "!");
// MESSAGE("Wynaut was revived and is ready to fight again!");
// }
// }
@ -110,7 +108,7 @@ TO_DO_BATTLE_TEST("Revived battlers still lose their turn");
// } SCENE {
// MESSAGE("Wobbuffet used Tackle!");
// MESSAGE("Foe Wynaut fainted!");
// MOVE_MESSAGE("Foe Wobbuffet")
// MESSAGE("Foe Wobbuffet used " REVIVAL_BLESSING "!");
// MESSAGE("Wynaut was revived and is ready to fight again!");
// NOT { MESSAGE("Wynaut used Celebrate!"); }
// }

View file

@ -34,14 +34,13 @@ SINGLE_BATTLE_TEST("Stockpile's count can go up only to 3")
}
}
#define MAX_HP_TEST 400
SINGLE_BATTLE_TEST("Spit Up and Swallow don't work if used without Stockpile")
{
u32 move;
PARAMETRIZE {move = MOVE_SWALLOW ;}
PARAMETRIZE {move = MOVE_SPIT_UP ;}
GIVEN {
PLAYER(SPECIES_WOBBUFFET) {HP(10), MaxHP(MAX_HP_TEST) ;}
PLAYER(SPECIES_WOBBUFFET) { HP(10), MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, move); }
@ -107,11 +106,11 @@ SINGLE_BATTLE_TEST("Spit Up's power raises depending on Stockpile's count", s16
SINGLE_BATTLE_TEST("Swallow heals HP depending on Stockpile's count", s16 hpHeal)
{
u8 count;
PARAMETRIZE { count = 1;}
PARAMETRIZE { count = 2;}
PARAMETRIZE { count = 3;}
PARAMETRIZE { count = 1; }
PARAMETRIZE { count = 2; }
PARAMETRIZE { count = 3; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) {HP(1), MaxHP(MAX_HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) { HP(1), MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_STOCKPILE); }
@ -136,9 +135,9 @@ SINGLE_BATTLE_TEST("Swallow heals HP depending on Stockpile's count", s16 hpHeal
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWALLOW, player);
HP_BAR(player, captureDamage: &results[i].hpHeal);
} FINALLY {
EXPECT_EQ(results[0].hpHeal, -(MAX_HP_TEST / 4));
EXPECT_EQ(results[1].hpHeal, -(MAX_HP_TEST / 2));
EXPECT_EQ(results[2].hpHeal, -(MAX_HP_TEST - 1));
EXPECT_EQ(results[0].hpHeal, -100);
EXPECT_EQ(results[1].hpHeal, -200);
EXPECT_EQ(results[2].hpHeal, -399); // 400 - 1.
}
}
@ -187,10 +186,10 @@ DOUBLE_BATTLE_TEST("Stockpile's Def and Sp. Def boost is lost after using Spit U
ASSUME(B_STOCKPILE_RAISES_DEFS >= GEN_4);
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
ASSUME(gBattleMoves[MOVE_GUST].split == SPLIT_SPECIAL);
PLAYER(SPECIES_WOBBUFFET) {Speed(4); HP(MAX_HP_TEST - 1); MaxHP(MAX_HP_TEST); }
PLAYER(SPECIES_WOBBUFFET) {Speed(3); }
OPPONENT(SPECIES_WOBBUFFET) {Speed(2); }
OPPONENT(SPECIES_WOBBUFFET) {Speed(1); }
PLAYER(SPECIES_WOBBUFFET) { Speed(4); HP(399); MaxHP(400); }
PLAYER(SPECIES_WOBBUFFET) { Speed(3); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(2); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(1); }
} WHEN {
TURN { MOVE(opponentLeft, MOVE_TACKLE, target:playerLeft, criticalHit:FALSE); MOVE(opponentRight, MOVE_GUST, criticalHit:FALSE, target:playerLeft);}
TURN { MOVE(playerLeft, MOVE_STOCKPILE);}

View file

@ -1,9 +1,6 @@
#include "global.h"
#include "test_battle.h"
#define TEST_HP 1
#define MAX_HP 400
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE);
@ -105,12 +102,12 @@ SINGLE_BATTLE_TEST("Snow causes Moonlight to recover 1/4 of the user's max HP")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_MOONLIGHT].effect == EFFECT_MOONLIGHT);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, hp: TEST_HP + (MAX_HP/4));
HP_BAR(player, damage: -(400 / 4));
}
}
@ -118,12 +115,12 @@ SINGLE_BATTLE_TEST("Snow causes Moonlight to recover 1/4 of the user's max HP")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_MOONLIGHT].effect == EFFECT_MOONLIGHT);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, hp: TEST_HP + (MAX_HP/4));
HP_BAR(player, damage: -(400 / 4));
}
}
@ -131,12 +128,12 @@ SINGLE_BATTLE_TEST("Snow causes Synthesis to recover 1/4 of the user's max HP")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_SYNTHESIS].effect == EFFECT_SYNTHESIS);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_SYNTHESIS); }
} SCENE {
HP_BAR(player, hp: TEST_HP + (MAX_HP/4));
HP_BAR(player, damage: -(400 / 4));
}
}
@ -144,14 +141,11 @@ SINGLE_BATTLE_TEST("Snow causes Morning Sun to recover 1/4 of the user's max HP"
{
GIVEN {
ASSUME(gBattleMoves[MOVE_MORNING_SUN].effect == EFFECT_MORNING_SUN);
PLAYER(SPECIES_WOBBUFFET) { HP(TEST_HP); MaxHP(MAX_HP); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MORNING_SUN); }
} SCENE {
HP_BAR(player, hp: TEST_HP + (MAX_HP/4));
HP_BAR(player, damage: -(400 / 4));
}
}
#undef MAX_HP
#undef TEST_HP