summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-02-26 13:21:40 -0500
committerAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-03-10 22:32:17 -0500
commit17a6ab37944e3cc9fc98ee93262bd4385bf4e626 (patch)
tree45a9dd41f29f59c762b379f1845a03a52cf727e6 /include
parentea1aa9c0c5c3a4167912d1078fffdd5e69cbbe98 (diff)
Decomped CanUseOnTargetWithStatusChecker()
Diffstat (limited to 'include')
-rw-r--r--include/dungeon_entity.h33
-rw-r--r--include/moves.h2
-rw-r--r--include/status_checker.h2
3 files changed, 24 insertions, 13 deletions
diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h
index 2567f79..8a5a032 100644
--- a/include/dungeon_entity.h
+++ b/include/dungeon_entity.h
@@ -7,10 +7,20 @@
#include "position.h"
#define MAX_STAT_STAGE 20
+#define STAT_MULTIPLIER_THRESHOLD 63
+#define DEFAULT_STAT_STAGE 10
+#define DEFAULT_STAT_MULTIPLIER 256
#define MAX_MOVEMENT_SPEED 4
#define MAX_STOCKPILE_COUNT 3
#define NUM_SPEED_TURN_COUNTERS 5
+#define STAT_STAGE_ATTACK 0
+#define STAT_STAGE_SPECIAL_ATTACK 1
+#define STAT_STAGE_DEFENSE 0
+#define STAT_STAGE_SPECIAL_DEFENSE 1
+#define STAT_STAGE_ACCURACY 0
+#define STAT_STAGE_EVASION 1
+
struct DungeonActionContainer
{
/* 0x0 */ u16 action;
@@ -52,20 +62,20 @@ struct DungeonEntityData
/* 0x18 */ u32 expPoints;
// Temporary stat boosts/drops from effects like Growl or Swords Dance.
// These start at 10 and are in the range [1, 19].
- /* 0x1C */ s16 attackStage;
- /* 0x1E */ s16 specialAttackStage;
- /* 0x20 */ s16 defenseStage;
- /* 0x22 */ s16 specialDefenseStage;
- /* 0x24 */ s16 accuracyStage;
- /* 0x26 */ s16 evasionStage;
+ // Index 0 is Attack. Index 1 is Special Attack.
+ /* 0x1C */ s16 attackStages[2];
+ // Index 0 is Defense. Index 1 is Special Defense.
+ /* 0x20 */ s16 defenseStages[2];
+ // Index 0 is accuracy. Index 1 is evasion.
+ /* 0x24 */ s16 accuracyStages[2];
// // When a Fire-type move is used on a Pokémon with Flash Fire, this value increases the power of the Pokémon's Fire-type moves.
/* 0x28 */ s16 flashFireBoost;
u8 fill2A[0x2C - 0x2A];
// These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat.
- /* 0x2C */ s32 attackMultiplier;
- /* 0x30 */ s32 specialAttackMultiplier;
- /* 0x34 */ s32 defenseMultiplier;
- /* 0x38 */ s32 specialDefenseMultiplier;
+ // Index 0 is Attack. Index 1 is Special Attack.
+ /* 0x2C */ s32 attackMultipliers[2];
+ // Index 0 is Defense. Index 1 is Special Defense.
+ /* 0x34 */ s32 defenseMultipliers[2];
/* 0x3C */ s16 hiddenPowerPower;
/* 0x3E */ u8 hiddenPowerType;
u8 fill3F;
@@ -77,8 +87,7 @@ struct DungeonEntityData
/* 0x58 */ struct Position itemTargetPosition;
/* 0x5C */ u8 type1;
/* 0x5D */ u8 type2;
- /* 0x5E */ u8 ability1;
- /* 0x5F */ u8 ability2;
+ /* 0x5E */ u8 abilities[2];
/* 0x60 */ struct ItemSlot heldItem;
u8 fill64[0x68 - 0x64];
/* 0x68 */ struct Position previousPosition1;
diff --git a/include/moves.h b/include/moves.h
index 44b324b..b612e69 100644
--- a/include/moves.h
+++ b/include/moves.h
@@ -18,7 +18,7 @@ s32 GetMoveAccuracy(struct PokemonMove *move, u32 accuracyType);
u32 GetMoveMaxPP(struct PokemonMove *move);
u8 GetMoveUnk12(struct PokemonMove *move);
u8 GetMoveCriticalHitChance(struct PokemonMove *move);
-u8 GetMoveCannotHitFrozen(struct PokemonMove *move);
+u8 MoveCannotHitFrozen(struct PokemonMove *move);
u8 MoveDealsDirectDamage(struct PokemonMove *move);
u32 GetMoveRangeType(struct PokemonMove *move);
void sub_8092C84(u8 *buffer, u16 moveID);
diff --git a/include/status_checker.h b/include/status_checker.h
index 1b65030..4538af1 100644
--- a/include/status_checker.h
+++ b/include/status_checker.h
@@ -6,5 +6,7 @@
// 0x5C498
bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move);
+// 0x5CEB8
+bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move);
#endif