From 3bbb6035e746cdb83b128b1d6153436756cb3be0 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 13 Feb 2022 22:30:25 -0500 Subject: Decomped GetMoveTargetingFlagsForPokemon() --- src/targeting_flags.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/targeting_flags.c (limited to 'src/targeting_flags.c') diff --git a/src/targeting_flags.c b/src/targeting_flags.c new file mode 100644 index 0000000..d342d51 --- /dev/null +++ b/src/targeting_flags.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "targeting_flags.h" + +#include "constants/move_id.h" +#include "constants/type.h" +#include "moves.h" + +extern bool8 HasType(struct DungeonEntity *pokemon, u8 type); + +s16 GetMoveTargetingFlagsForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *move, u32 isAI) +{ + if (move->moveID == MOVE_CURSE && !isAI && !HasType(pokemon, TYPE_GHOST)) + { + return TARGETING_FLAG_BOOST_SELF | TARGETING_FLAG_TARGET_SELF; + } + return GetMoveTargetingFlags(move, isAI); +} -- cgit v1.2.3 From 2a2a0805b481b8425b4d1047d868fb1159993e6c Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 13 Feb 2022 23:13:47 -0500 Subject: Decomped HasType() --- src/targeting_flags.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/targeting_flags.c') diff --git a/src/targeting_flags.c b/src/targeting_flags.c index d342d51..f315cdf 100644 --- a/src/targeting_flags.c +++ b/src/targeting_flags.c @@ -3,10 +3,9 @@ #include "constants/move_id.h" #include "constants/type.h" +#include "dungeon_pokemon_attributes.h" #include "moves.h" -extern bool8 HasType(struct DungeonEntity *pokemon, u8 type); - s16 GetMoveTargetingFlagsForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *move, u32 isAI) { if (move->moveID == MOVE_CURSE && !isAI && !HasType(pokemon, TYPE_GHOST)) -- cgit v1.2.3