From 194f7644b84971f5201bfde9b9f2209e4df54980 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 23 Nov 2024 18:02:40 +0100 Subject: [PATCH] Changes taget bit of Flower Shield (#5698) --- include/constants/battle.h | 2 +- src/data/moves_info.h | 4 +-- test/battle/move_effect/flower_shield.c | 37 +++++++++++++++++++++++++ test/battle/move_effect/protect.c | 1 - 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 test/battle/move_effect/flower_shield.c diff --git a/include/constants/battle.h b/include/constants/battle.h index d337559f1b..ed19a72d9c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -507,7 +507,7 @@ #define MOVE_TARGET_FOES_AND_ALLY (1 << 5) #define MOVE_TARGET_OPPONENTS_FIELD (1 << 6) #define MOVE_TARGET_ALLY (1 << 7) -#define MOVE_TARGET_ALL_BATTLERS ((1 << 8) | MOVE_TARGET_USER) +#define MOVE_TARGET_ALL_BATTLERS ((1 << 8) | MOVE_TARGET_USER) // No functionality for status moves // For the second argument of GetMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 1bde816281..05c8391522 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -8492,7 +8492,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .type = TYPE_NORMAL, .accuracy = 0, .pp = 40, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_USER, // Targeting is handled through the script .priority = 0, .category = DAMAGE_CATEGORY_STATUS, .zMove = { .effect = Z_EFFECT_ATK_UP_1 }, @@ -14421,7 +14421,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .type = TYPE_FAIRY, .accuracy = 0, .pp = 10, - .target = MOVE_TARGET_ALL_BATTLERS, + .target = MOVE_TARGET_USER, // The targeting of Flower Shield is handled through a script .priority = 0, .category = DAMAGE_CATEGORY_STATUS, .zMove = { .effect = Z_EFFECT_DEF_UP_1 }, diff --git a/test/battle/move_effect/flower_shield.c b/test/battle/move_effect/flower_shield.c new file mode 100644 index 0000000000..e31fc9e5cd --- /dev/null +++ b/test/battle/move_effect/flower_shield.c @@ -0,0 +1,37 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_FLOWER_SHIELD].effect == EFFECT_FLOWER_SHIELD); +} + +DOUBLE_BATTLE_TEST("Flower Shield raises the defense of all grass type pokemon") +{ + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_TANGELA].types[0] == TYPE_GRASS); + ASSUME(gSpeciesInfo[SPECIES_TANGROWTH].types[0] == TYPE_GRASS); + ASSUME(gSpeciesInfo[SPECIES_SUNKERN].types[0] == TYPE_GRASS); + ASSUME(gSpeciesInfo[SPECIES_SUNFLORA].types[0] == TYPE_GRASS); + PLAYER(SPECIES_TANGELA); + PLAYER(SPECIES_TANGROWTH); + OPPONENT(SPECIES_SUNKERN); + OPPONENT(SPECIES_SUNFLORA); + } WHEN { + TURN { MOVE(playerLeft, MOVE_FLOWER_SHIELD); MOVE(playerRight, MOVE_CELEBRATE); } + } SCENE { + MESSAGE("Tangela used Flower Shield!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLOWER_SHIELD, playerLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + MESSAGE("Tangela's Defense rose!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLOWER_SHIELD, playerLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + MESSAGE("The opposing Sunkern's Defense rose!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLOWER_SHIELD, playerLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Tangrowth's Defense rose!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLOWER_SHIELD, playerLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + MESSAGE("The opposing Sunflora's Defense rose!"); + } +} diff --git a/test/battle/move_effect/protect.c b/test/battle/move_effect/protect.c index 5b1b0a4e4e..dff486cb00 100644 --- a/test/battle/move_effect/protect.c +++ b/test/battle/move_effect/protect.c @@ -537,7 +537,6 @@ DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from Confide and Decora DOUBLE_BATTLE_TEST("Crafty Shield does not protect against moves that target all battlers") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLOWER_SHIELD].target == MOVE_TARGET_ALL_BATTLERS); ASSUME(gSpeciesInfo[SPECIES_TANGELA].types[0] == TYPE_GRASS); ASSUME(gSpeciesInfo[SPECIES_TANGROWTH].types[0] == TYPE_GRASS); ASSUME(gSpeciesInfo[SPECIES_SUNKERN].types[0] == TYPE_GRASS);