diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-24 23:38:21 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-02-24 23:38:21 -0500 |
commit | 6e56b9f0341be0a6c960ea9e8db0939e4fa3cdac (patch) | |
tree | 1d2795c706392d5c6d4ce8019bddac2a649e8a2c /include | |
parent | 40a34fafd685b7df6d1777ec335374ea081adad0 (diff) |
Decomped CanUseStatusMove()
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/move.h | 18 | ||||
-rw-r--r-- | include/dungeon_ai_attack_1.h | 2 | ||||
-rw-r--r-- | include/moves.h | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/include/constants/move.h b/include/constants/move.h index 15ae1b9..0601969 100644 --- a/include/constants/move.h +++ b/include/constants/move.h @@ -11,6 +11,18 @@ enum MoveFlags MOVE_FLAG_DISABLED = 1 << 5 // Disabled by an effect like Taunt. }; +enum AccuracyType +{ + // Accuracy used for all moves. + ACCURACY_TYPE_GLOBAL, + // Multiplied with the global accuracy for offensive moves (i.e., not status moves). + ACCURACY_TYPE_OFFENSIVE, + // Used by the AI to determine how often to use Spikes. + // Values exist for all other moves, though they seem to be unused. + ACCURACY_TYPE_USE_CHANCE, + NUM_ACCURACY_TYPES +}; + struct MoveData { u8 *namePointer; @@ -22,10 +34,8 @@ struct MoveData // The AI consider certain moves to have different range than they actually do. /* 0xC */ u8 maxPP; /* 0xD */ u8 weight; - /* 0xE */ u8 accuracy[2]; - // Used by the AI to determine how often to use Spikes. - // Values exist for all other moves, though they seem to be unused. - /* 0x10 */ u8 useChance; + // There are multiple accuracy values. These are define with the AccuracyType enum. + /* 0xE */ u8 accuracy[NUM_ACCURACY_TYPES]; /* 0x11 */ u8 hitCount; // Maximum number of times the move will hit. Used for multi-hit moves like Fury Attack. u8 unk12; /* 0x13 */ u8 criticalHitChance; diff --git a/include/dungeon_ai_attack_1.h b/include/dungeon_ai_attack_1.h index 19969f2..7272256 100644 --- a/include/dungeon_ai_attack_1.h +++ b/include/dungeon_ai_attack_1.h @@ -5,5 +5,7 @@ // 0x7C580 s32 WeightMoveIfUsable(s32 numPotentialTargets, s32 targetingFlags, struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move, u32 hasStatusChecker); +// 0x7C648 +bool8 CanUseStatusMove(s32 targetingFlags, struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move, bool32 hasStatusChecker); #endif diff --git a/include/moves.h b/include/moves.h index ad68320..3bf4344 100644 --- a/include/moves.h +++ b/include/moves.h @@ -11,6 +11,8 @@ u8 GetMoveType(struct PokemonMove *move); // 0x92B90 u8 GetMoveWeight(struct PokemonMove *move); s32 GetMovePower(struct PokemonMove *move); +// 0x92BD8 +s32 GetMoveAccuracy(struct PokemonMove *move, u32 accuracyType); // 0x92BF4 u32 GetMoveMaxPP(struct PokemonMove *move); // 0x92C54 |