mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
Merge branch 'upcoming' into RHH/content/gen9SnowWeather
This commit is contained in:
commit
a877266400
@ -3985,6 +3985,9 @@ BattleScript_EffectRest::
|
||||
jumpifuproarwakes BattleScript_RestCantSleep
|
||||
jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects
|
||||
jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects
|
||||
.if B_LEAF_GUARD_PREVENTS_REST >= GEN_5
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardPreventsRest
|
||||
.endif
|
||||
trysetrest BattleScript_AlreadyAtFullHp
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printfromtable gRestUsedStringIds
|
||||
@ -4006,6 +4009,12 @@ BattleScript_RestIsAlreadyAsleep::
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_LeafGuardPreventsRest::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
printstring STRINGID_BUTITFAILED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectOHKO::
|
||||
attackcanceler
|
||||
attackstring
|
||||
|
@ -120,6 +120,7 @@
|
||||
#define B_SYMBIOSIS_GEMS GEN_LATEST // In Gen7+, Symbiosis passes an item after a gem-boosted attack. Previously, items are passed before the gem-boosted attack hits, making the item effect apply.
|
||||
#define B_CHECK_IF_CHARGED_UP TRUE // If set to TRUE, certain abilities such as Electromorphosis WILL check if the STATUS3_CHARGED_UP status flag is applied.
|
||||
#define B_ABSORBING_ABILITY_STRING GEN_LATEST // In Gen5+, the abilities that absorb moves of a certain type use a generic string for stat increases and decreases.
|
||||
#define B_LEAF_GUARD_PREVENTS_REST GEN_LATEST // In Gen5+, Leaf Guard prevents the use of Rest in harsh sunlight.
|
||||
#define B_SNOW_WARNING GEN_LATEST // In Gen9+, Snow Warning will summon snow instead of hail.
|
||||
|
||||
// Item settings
|
||||
|
@ -242,8 +242,9 @@
|
||||
#define FLAG_THAW_USER (1 << 25)
|
||||
#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury
|
||||
#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit
|
||||
#define FLAG_WIND_MOVE (1 << 28)
|
||||
#define FLAG_SLICING_MOVE (1 << 29)
|
||||
#define FLAG_THREE_STRIKES (1 << 28) // A move with this flag will strike thrice, and may apply its effect on each hit
|
||||
#define FLAG_WIND_MOVE (1 << 29)
|
||||
#define FLAG_SLICING_MOVE (1 << 30)
|
||||
|
||||
// Split defines.
|
||||
#define SPLIT_PHYSICAL 0x0
|
||||
|
@ -857,7 +857,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
|
||||
// Handle other multi-strike moves
|
||||
if (gBattleMoves[move].flags & FLAG_TWO_STRIKES)
|
||||
dmg *= 2;
|
||||
else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
||||
else if (gBattleMoves[move].flags & FLAG_THREE_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
|
||||
dmg *= 3;
|
||||
|
||||
if (dmg == 0)
|
||||
|
@ -3801,7 +3801,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gCurrentMove == MOVE_SURGING_STRIKES)
|
||||
else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gBattleMoves[gCurrentMove].flags & FLAG_THREE_STRIKES)
|
||||
{
|
||||
gMultiHitCounter = 3;
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0)
|
||||
|
@ -12338,7 +12338,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.secondaryEffectChance = 0,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST,
|
||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_THREE_STRIKES,
|
||||
.split = SPLIT_PHYSICAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
},
|
||||
@ -13106,7 +13106,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
|
||||
[MOVE_TRIPLE_DIVE] =
|
||||
{
|
||||
.effect = EFFECT_TRIPLE_KICK,
|
||||
.effect = EFFECT_HIT,
|
||||
.power = 30,
|
||||
.type = TYPE_WATER,
|
||||
.accuracy = 95,
|
||||
@ -13114,7 +13114,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.secondaryEffectChance = 0,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
|
||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THREE_STRIKES,
|
||||
.split = SPLIT_PHYSICAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
},
|
||||
|
114
test/ability_dry_skin.c
Normal file
114
test/ability_dry_skin.c
Normal file
@ -0,0 +1,114 @@
|
||||
#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); };
|
||||
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);
|
||||
MESSAGE("The Parasect's Dry Skin takes its toll!");
|
||||
}
|
||||
}
|
||||
|
||||
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); };
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dry Skin increases damage taken from Fire-type moves by 25%", s16 damage)
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); };
|
||||
} WHEN {
|
||||
TURN {MOVE(player, MOVE_EMBER); }
|
||||
} SCENE {
|
||||
MESSAGE("Wobbuffet used Ember!");
|
||||
HP_BAR(opponent, captureDamage: &results[i].damage);
|
||||
} FINALLY {
|
||||
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.25), results[1].damage);
|
||||
}
|
||||
}
|
||||
|
||||
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); };
|
||||
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);
|
||||
MESSAGE("Parasect restored HP using its Dry Skin!");
|
||||
}
|
||||
}
|
||||
|
||||
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); };
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); }
|
||||
} SCENE {
|
||||
NONE_OF { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player); MESSAGE("Parasect restored HP using its Dry Skin!"); }
|
||||
}
|
||||
}
|
||||
|
||||
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); };
|
||||
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);
|
||||
MESSAGE("Parasect restored HP using its Dry Skin!");
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dry Skin prevents Absorb Bulb and Luminous Moss from activating")
|
||||
{
|
||||
u32 item;
|
||||
PARAMETRIZE { item = ITEM_ABSORB_BULB; }
|
||||
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); };
|
||||
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);
|
||||
MESSAGE("Parasect restored HP using its Dry Skin!");
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
||||
}
|
||||
}
|
||||
}
|
16
test/ability_hydration.c
Normal file
16
test/ability_hydration.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("Hydration cures non-volatile Status conditions if it is raining")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_VAPOREON) { Ability(ABILITY_HYDRATION); Status1(STATUS1_BURN); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_RAIN_DANCE); }
|
||||
} SCENE {
|
||||
ABILITY_POPUP(player, ABILITY_HYDRATION);
|
||||
MESSAGE("Vaporeon's Hydration cured its burn problem!");
|
||||
STATUS_ICON(player, none: TRUE);
|
||||
}
|
||||
}
|
30
test/ability_ice_body.c
Normal file
30
test/ability_ice_body.c
Normal file
@ -0,0 +1,30 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
#define TEST_MAX_HP (100)
|
||||
|
||||
SINGLE_BATTLE_TEST("Ice Body prevents damage from hail")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); };
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_HAIL); MOVE(opponent, MOVE_SKILL_SWAP); }
|
||||
} SCENE {
|
||||
NONE_OF { HP_BAR(player); }
|
||||
}
|
||||
}
|
||||
|
||||
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); };
|
||||
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);
|
||||
}
|
||||
}
|
95
test/ability_leaf_guard.c
Normal file
95
test/ability_leaf_guard.c
Normal file
@ -0,0 +1,95 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions in sun")
|
||||
{
|
||||
u32 move;
|
||||
PARAMETRIZE { move = MOVE_WILL_O_WISP; }
|
||||
PARAMETRIZE { move = MOVE_HYPNOSIS; }
|
||||
PARAMETRIZE { move = MOVE_THUNDER_WAVE; }
|
||||
PARAMETRIZE { move = MOVE_TOXIC; }
|
||||
PARAMETRIZE { move = MOVE_POWDER_SNOW; }
|
||||
GIVEN {
|
||||
ASSUME(gBattleMoves[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP);
|
||||
ASSUME(gBattleMoves[MOVE_HYPNOSIS].effect == EFFECT_SLEEP);
|
||||
ASSUME(gBattleMoves[MOVE_THUNDER_WAVE].effect == EFFECT_PARALYZE);
|
||||
ASSUME(gBattleMoves[MOVE_TOXIC].effect == EFFECT_TOXIC);
|
||||
ASSUME(gBattleMoves[MOVE_POWDER_SNOW].effect == EFFECT_FREEZE_HIT);
|
||||
PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, move); }
|
||||
} SCENE {
|
||||
switch (move)
|
||||
{
|
||||
case MOVE_WILL_O_WISP:
|
||||
MESSAGE("Foe Wobbuffet used Will-o-Wisp!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, opponent);
|
||||
ABILITY_POPUP(player, ABILITY_LEAF_GUARD);
|
||||
MESSAGE("It doesn't affect Leafeon…");
|
||||
break;
|
||||
case MOVE_HYPNOSIS:
|
||||
MESSAGE("Foe Wobbuffet used Hypnosis!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPNOSIS, opponent);
|
||||
ABILITY_POPUP(player, ABILITY_LEAF_GUARD);
|
||||
MESSAGE("It doesn't affect Leafeon…");
|
||||
break;
|
||||
case MOVE_THUNDER_WAVE:
|
||||
MESSAGE("Foe Wobbuffet used Thunder Wave!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDER_WAVE, opponent);
|
||||
ABILITY_POPUP(player, ABILITY_LEAF_GUARD);
|
||||
MESSAGE("It doesn't affect Leafeon…");
|
||||
break;
|
||||
case MOVE_TOXIC:
|
||||
MESSAGE("Foe Wobbuffet used Toxic!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, opponent);
|
||||
ABILITY_POPUP(player, ABILITY_LEAF_GUARD);
|
||||
MESSAGE("It doesn't affect Leafeon…");
|
||||
break;
|
||||
case MOVE_POWDER_SNOW:
|
||||
MESSAGE("Foe Wobbuffet used Powder Snow!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER_SNOW, opponent);
|
||||
MESSAGE("It's super effective!");
|
||||
break;
|
||||
}
|
||||
NONE_OF {STATUS_ICON(player, status1: TRUE);}
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Leaf Guard prevents status conditions from Flame Orb and Toxic Orb")
|
||||
{
|
||||
u32 item;
|
||||
PARAMETRIZE { item = ITEM_FLAME_ORB; }
|
||||
PARAMETRIZE { item = ITEM_TOXIC_ORB; }
|
||||
GIVEN {
|
||||
ASSUME(gItems[ITEM_FLAME_ORB].holdEffect == HOLD_EFFECT_FLAME_ORB);
|
||||
ASSUME(gItems[ITEM_TOXIC_ORB].holdEffect == HOLD_EFFECT_TOXIC_ORB);
|
||||
PLAYER(SPECIES_LEAFEON) {Ability(ABILITY_LEAF_GUARD); Item(item); };
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SUNNY_DAY); }
|
||||
} SCENE {
|
||||
if (item == ITEM_FLAME_ORB) {
|
||||
NONE_OF { MESSAGE("Leafeon was burned!"); STATUS_ICON(player, burn: TRUE);}
|
||||
}
|
||||
else {
|
||||
NONE_OF { MESSAGE("Leafeon is badly poisoned!"); STATUS_ICON(player, poison: TRUE);}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Leaf Guard prevents Rest during sun")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(B_LEAF_GUARD_PREVENTS_REST >= GEN_5);
|
||||
ASSUME(gBattleMoves[MOVE_REST].effect == EFFECT_REST);
|
||||
PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); HP(100); MaxHP(200); };
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_SUNNY_DAY); MOVE(player, MOVE_REST); }
|
||||
} SCENE {
|
||||
MESSAGE("But it failed!");
|
||||
NOT STATUS_ICON(player, sleep: TRUE);
|
||||
NONE_OF {HP_BAR(player);}
|
||||
}
|
||||
}
|
18
test/ability_rain_dish.c
Normal file
18
test/ability_rain_dish.c
Normal file
@ -0,0 +1,18 @@
|
||||
#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); };
|
||||
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);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
SINGLE_BATTLE_TEST("Sand Veil prevents damage from sandstorm")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_SANDSHREW) { Ability(ABILITY_SAND_VEIL); };
|
||||
PLAYER(SPECIES_CACNEA) { Ability(ABILITY_SAND_VEIL); };
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_SANDSTORM); }
|
||||
@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Sand Veil prevents damage from sandstorm")
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Sand Veil reduces accuracy during sandstorm")
|
||||
SINGLE_BATTLE_TEST("Sand Veil increases evasion during sandstorm")
|
||||
{
|
||||
PASSES_RANDOMLY(4, 5, RNG_ACCURACY);
|
||||
GIVEN {
|
||||
|
29
test/ability_snow_cloak.c
Normal file
29
test/ability_snow_cloak.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("Snow Cloak prevents damage from hail")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_GLACEON) { Ability(ABILITY_SNOW_CLOAK); };
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_HAIL); MOVE(opponent, MOVE_SKILL_SWAP); }
|
||||
} SCENE {
|
||||
NONE_OF { HP_BAR(player); }
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Snow Cloak increases evasion during hail")
|
||||
{
|
||||
PASSES_RANDOMLY(4, 5, RNG_ACCURACY);
|
||||
GIVEN {
|
||||
ASSUME(gBattleMoves[MOVE_POUND].accuracy == 100);
|
||||
PLAYER(SPECIES_GLACEON) { Ability(ABILITY_SNOW_CLOAK); };
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_HAIL); }
|
||||
TURN { MOVE(opponent, MOVE_POUND); }
|
||||
} SCENE {
|
||||
HP_BAR(player);
|
||||
}
|
||||
}
|
@ -63,7 +63,7 @@ SINGLE_BATTLE_TEST("Water Absorb is only triggered once on multi strike moves")
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Water Absorb prevents Items from activating")
|
||||
SINGLE_BATTLE_TEST("Water Absorb prevents Absorb Bulb and Luminous Moss from activating")
|
||||
{
|
||||
u32 item;
|
||||
PARAMETRIZE { item = ITEM_ABSORB_BULB; }
|
||||
|
31
test/move_effect_triple_kick.c
Normal file
31
test/move_effect_triple_kick.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
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")
|
||||
{
|
||||
s16 firstHit;
|
||||
s16 secondHit;
|
||||
s16 thirdHit;
|
||||
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_TRIPLE_KICK); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_KICK, player);
|
||||
HP_BAR(opponent, captureDamage: &firstHit);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_KICK, player);
|
||||
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);
|
||||
}
|
||||
}
|
57
test/move_flag_three_strikes.c
Normal file
57
test/move_flag_three_strikes.c
Normal file
@ -0,0 +1,57 @@
|
||||
#include "global.h"
|
||||
#include "test_battle.h"
|
||||
|
||||
SINGLE_BATTLE_TEST("Three-strike flag turns a move into a 3-hit move")
|
||||
{
|
||||
s16 firstHit;
|
||||
s16 secondHit;
|
||||
s16 thirdHit;
|
||||
|
||||
GIVEN {
|
||||
ASSUME(gBattleMoves[MOVE_TRIPLE_DIVE].flags & FLAG_THREE_STRIKES);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_TRIPLE_DIVE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
|
||||
HP_BAR(opponent, captureDamage: &firstHit);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
|
||||
HP_BAR(opponent, captureDamage: &secondHit);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
|
||||
HP_BAR(opponent, captureDamage: &thirdHit);
|
||||
} FINALLY {
|
||||
EXPECT_EQ(firstHit, secondHit);
|
||||
EXPECT_EQ(secondHit, thirdHit);
|
||||
EXPECT_EQ(firstHit, thirdHit);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Surging Strikes hits 3 times with each hit being a critical hit")
|
||||
{
|
||||
s16 firstHit;
|
||||
s16 secondHit;
|
||||
s16 thirdHit;
|
||||
|
||||
GIVEN {
|
||||
ASSUME(gBattleMoves[MOVE_SURGING_STRIKES].flags & FLAG_THREE_STRIKES);
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SURGING_STRIKES); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
|
||||
HP_BAR(opponent, captureDamage: &firstHit);
|
||||
MESSAGE("A critical hit!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
|
||||
HP_BAR(opponent, captureDamage: &secondHit);
|
||||
MESSAGE("A critical hit!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
|
||||
HP_BAR(opponent, captureDamage: &thirdHit);
|
||||
MESSAGE("A critical hit!");
|
||||
} FINALLY {
|
||||
EXPECT_EQ(firstHit, secondHit);
|
||||
EXPECT_EQ(secondHit, thirdHit);
|
||||
EXPECT_EQ(firstHit, thirdHit);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user