2024-06-14 08:31:21 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "event_data.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
|
|
|
|
#if B_VAR_STARTING_STATUS != 0
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("B_VAR_STARTING_STATUS starts a chosen terrain at the beginning of battle and lasts infinitely long")
|
|
|
|
{
|
|
|
|
u16 terrain;
|
|
|
|
|
|
|
|
PARAMETRIZE { terrain = STARTING_STATUS_GRASSY_TERRAIN; }
|
|
|
|
PARAMETRIZE { terrain = STARTING_STATUS_PSYCHIC_TERRAIN; }
|
|
|
|
PARAMETRIZE { terrain = STARTING_STATUS_MISTY_TERRAIN; }
|
|
|
|
PARAMETRIZE { terrain = STARTING_STATUS_ELECTRIC_TERRAIN; }
|
|
|
|
|
|
|
|
VarSet(B_VAR_STARTING_STATUS, terrain);
|
|
|
|
VarSet(B_VAR_STARTING_STATUS_TIMER, 0);
|
|
|
|
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
// More than 5 turns
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
} SCENE {
|
|
|
|
switch (terrain) {
|
|
|
|
case STARTING_STATUS_GRASSY_TERRAIN:
|
|
|
|
MESSAGE("Grass grew to cover the battlefield!");
|
|
|
|
break;
|
|
|
|
case STARTING_STATUS_PSYCHIC_TERRAIN:
|
|
|
|
MESSAGE("The battlefield got weird!");
|
|
|
|
break;
|
|
|
|
case STARTING_STATUS_MISTY_TERRAIN:
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Mist swirled around the battlefield!");
|
2024-06-14 08:31:21 +01:00
|
|
|
break;
|
|
|
|
case STARTING_STATUS_ELECTRIC_TERRAIN:
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("An electric current is running across the battlefield!");
|
2024-06-14 08:31:21 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_RESTORE_BG);
|
|
|
|
NONE_OF {
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_RESTORE_BG);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The weirdness disappeared from the battlefield!");
|
2024-06-14 08:31:21 +01:00
|
|
|
MESSAGE("The electricity disappeared from the battlefield.");
|
|
|
|
MESSAGE("The mist disappeared from the battlefield.");
|
|
|
|
MESSAGE("The grass disappeared from the battlefield.");
|
|
|
|
}
|
|
|
|
} THEN {
|
|
|
|
VarSet(B_VAR_STARTING_STATUS, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Terrain started after the one which started the battle lasts only 5 turns")
|
|
|
|
{
|
|
|
|
bool32 viaMove;
|
|
|
|
|
|
|
|
PARAMETRIZE { viaMove = TRUE; }
|
|
|
|
PARAMETRIZE { viaMove = FALSE; }
|
|
|
|
|
|
|
|
VarSet(B_VAR_STARTING_STATUS, STARTING_STATUS_ELECTRIC_TERRAIN);
|
|
|
|
VarSet(B_VAR_STARTING_STATUS_TIMER, 0);
|
|
|
|
|
|
|
|
GIVEN {
|
2024-10-27 09:36:31 +00:00
|
|
|
PLAYER(SPECIES_TAPU_BULU) { Ability(viaMove == TRUE ? ABILITY_TELEPATHY : ABILITY_GRASSY_SURGE); }
|
2024-06-14 08:31:21 +01:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
// More than 5 turns
|
|
|
|
TURN { MOVE(player, viaMove == TRUE ? MOVE_GRASSY_TERRAIN : MOVE_CELEBRATE); }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
TURN { ; }
|
|
|
|
} SCENE {
|
|
|
|
// Electric Terrain at battle's start
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("An electric current is running across the battlefield!");
|
2024-06-14 08:31:21 +01:00
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_RESTORE_BG);
|
|
|
|
// Player uses Grassy Terrain
|
|
|
|
if (viaMove) {
|
2024-10-27 09:36:31 +00:00
|
|
|
MESSAGE("Tapu Bulu used Grassy Terrain!");
|
2024-06-14 08:31:21 +01:00
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASSY_TERRAIN, player);
|
|
|
|
MESSAGE("Grass grew to cover the battlefield!");
|
|
|
|
} else {
|
|
|
|
ABILITY_POPUP(player, ABILITY_GRASSY_SURGE);
|
|
|
|
MESSAGE("Grass grew to cover the battlefield!");
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_RESTORE_BG);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 5 turns
|
2024-10-27 09:36:31 +00:00
|
|
|
MESSAGE("Tapu Bulu used Celebrate!");
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet used Celebrate!");
|
2024-06-14 08:31:21 +01:00
|
|
|
|
2024-10-27 09:36:31 +00:00
|
|
|
MESSAGE("Tapu Bulu used Celebrate!");
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet used Celebrate!");
|
2024-06-14 08:31:21 +01:00
|
|
|
|
2024-10-27 09:36:31 +00:00
|
|
|
MESSAGE("Tapu Bulu used Celebrate!");
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet used Celebrate!");
|
2024-06-14 08:31:21 +01:00
|
|
|
|
|
|
|
MESSAGE("The grass disappeared from the battlefield.");
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_RESTORE_BG);
|
|
|
|
} THEN {
|
|
|
|
VarSet(B_VAR_STARTING_STATUS, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // B_VAR_STARTING_STATUS
|