diff options
Diffstat (limited to 'include')
44 files changed, 105 insertions, 115 deletions
diff --git a/include/charge_move.h b/include/charge_move.h index fd88a62..e1ef306 100644 --- a/include/charge_move.h +++ b/include/charge_move.h @@ -3,9 +3,7 @@ #include "dungeon_entity.h" -// 0x570AC bool8 MoveMatchesChargingStatus(struct DungeonEntity *pokemon, struct PokemonMove *move); -// 0x570F4 // checkCharge = Check for the move named Charge. bool8 IsCharging(struct DungeonEntity *pokemon, bool8 checkCharge); diff --git a/include/code_800D090.h b/include/code_800D090.h new file mode 100644 index 0000000..6f85dd4 --- /dev/null +++ b/include/code_800D090.h @@ -0,0 +1,6 @@ +#ifndef GUARD_CODE_800D090_H +#define GUARD_CODE_800D090_H + +void sprintf_2(char *buffer, const char *text, ...); + +#endif
\ No newline at end of file diff --git a/include/constants/move.h b/include/constants/move.h index 0601969..e5de485 100644 --- a/include/constants/move.h +++ b/include/constants/move.h @@ -1,7 +1,9 @@ #ifndef GUARD_CONSTANTS_MOVE_H #define GUARD_CONSTANTS_MOVE_H -enum MoveFlags +#define STRUGGLE_MOVE_INDEX 4 + +enum MoveFlag { MOVE_FLAG_EXISTS = 1 << 0, MOVE_FLAG_LINKED = 1 << 1, // This move is linked with the previous move in the Pokémon's moveset. @@ -11,6 +13,13 @@ enum MoveFlags MOVE_FLAG_DISABLED = 1 << 5 // Disabled by an effect like Taunt. }; +enum MoveFlag2 +{ + MOVE_FLAG_SEALED = 1 << 0, + MOVE_FLAG_TEMPORARY = 1 << 3, // Used for moves copied by Mimic. + MOVE_FLAG_REPLACE = 1 << 5 // Used for moves copied by Sketch. +}; + enum AccuracyType { // Accuracy used for all moves. @@ -28,7 +37,6 @@ struct MoveData u8 *namePointer; /* 0x4 */ s16 power; u8 type; - u8 fill7; // Determines the range of moves. /* 0x8 */ u16 targetingFlags[2]; // 0 for player and 1 for AI // The AI consider certain moves to have different range than they actually do. @@ -52,7 +60,7 @@ struct MoveData struct PokemonMove { u8 moveFlags; - bool8 sealed; + u8 moveFlags2; u16 moveID; u8 PP; u8 powerBoost; // How much the move is boosted by Ginsengs. diff --git a/include/constants/type.h b/include/constants/type.h index 6ca9177..c6fab07 100644 --- a/include/constants/type.h +++ b/include/constants/type.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_TYPE_H #define GUARD_CONSTANTS_TYPE_H +#define NUM_TYPES 18 + #define TYPE_NONE 0x0 #define TYPE_NORMAL 0x1 #define TYPE_FIRE 0x2 diff --git a/include/dungeon_action.h b/include/dungeon_action.h index 48f81d5..d625ba5 100644 --- a/include/dungeon_action.h +++ b/include/dungeon_action.h @@ -3,9 +3,8 @@ #include "dungeon_entity.h" -// 0x44C94 +void ResetAction(struct DungeonActionContainer *actionPointer); void SetAction(struct DungeonActionContainer *actionPointer, u16 action); -// 0x44CA0 void SetWalkAction(struct DungeonActionContainer *actionPointer, s16 species); #endif diff --git a/include/dungeon_ai_attack.h b/include/dungeon_ai_attack.h index 1878889..cd8d9d8 100644 --- a/include/dungeon_ai_attack.h +++ b/include/dungeon_ai_attack.h @@ -3,6 +3,8 @@ #include "dungeon_entity.h" +#define RANGED_ATTACK_RANGE 10 + struct MoveTargetResults { bool8 moveUsable; @@ -10,9 +12,13 @@ struct MoveTargetResults s32 moveWeight; }; -// 0x7BB94 void DecideAttack(struct DungeonEntity *pokemon); -// 0x7C04C s32 FindMoveTarget(struct MoveTargetResults *moveTargetResults, struct DungeonEntity *pokemon, struct PokemonMove *move); +bool8 IsTargetInLineRange(struct DungeonEntity *user, struct DungeonEntity *target, s32 range); +s32 WeightMoveIfUsable(s32 numPotentialTargets, s32 targetingFlags, struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move, u32 hasStatusChecker); +bool8 CanUseStatusMove(s32 targetingFlags, struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move, bool32 hasStatusChecker); +s32 WeightMove(struct DungeonEntity *user, s32 targetingFlags, struct DungeonEntity *target, u32 moveType); +bool8 TargetRegularAttack(struct DungeonEntity *pokemon, u32 *targetDir, bool8 checkPetrified); +bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange); #endif diff --git a/include/dungeon_ai_attack_1.h b/include/dungeon_ai_attack_1.h deleted file mode 100644 index 7272256..0000000 --- a/include/dungeon_ai_attack_1.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef GUARD_DUNGEON_AI_ATTACK_1_H -#define GUARD_DUNGEON_AI_ATTACK_1_H - -#include "dungeon_entity.h" - -// 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/dungeon_ai_attack_2.h b/include/dungeon_ai_attack_2.h deleted file mode 100644 index 00711b6..0000000 --- a/include/dungeon_ai_attack_2.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef GUARD_DUNGEON_AI_ATTACK_2_H -#define GUARD_DUNGEON_AI_ATTACK_2_H - -#include "dungeon_entity.h" - -// 0x7C9F8 -bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, s32 facingDir, s32 maxRange); - -#endif diff --git a/include/dungeon_ai_item_weight.h b/include/dungeon_ai_item_weight.h index a498744..871e68b 100644 --- a/include/dungeon_ai_item_weight.h +++ b/include/dungeon_ai_item_weight.h @@ -3,9 +3,7 @@ #include "dungeon_entity.h" -// 0x48F28 u32 EvaluateItem(struct DungeonEntity *targetPokemon, struct ItemSlot *item, u32 itemTargetFlags); -// 0x494EC bool8 CanTargetAdjacentPokemon(struct DungeonEntity *pokemon); #endif diff --git a/include/dungeon_ai_items.h b/include/dungeon_ai_items.h index 5daf7b0..91e0a22 100644 --- a/include/dungeon_ai_items.h +++ b/include/dungeon_ai_items.h @@ -4,13 +4,9 @@ #include "dungeon_entity.h" #include "position.h" -// 0x73658 void DecideUseItem(struct DungeonEntity *pokemon); -// 0x739DC void FindStraightThrowableTargets(struct DungeonEntity *pokemon, s32 thrownAIFlag, struct ItemSlot *item, bool8 ignoreRollChance); -// 0x73AA0 void FindRockItemTargets(struct DungeonEntity *pokemon, struct ItemSlot *item, struct Position potentialTargets[], bool8 ignoreRollChance); -// 0x73B78 void TargetThrownItem(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, struct ItemSlot *item, s32 targetingFlags, bool8 ignoreRollChance); #endif diff --git a/include/dungeon_ai_movement.h b/include/dungeon_ai_movement.h index 27bb00f..d53ab06 100644 --- a/include/dungeon_ai_movement.h +++ b/include/dungeon_ai_movement.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x75990 void DecideAction(struct DungeonEntity *pokemon); #endif diff --git a/include/dungeon_ai_targeting.h b/include/dungeon_ai_targeting.h index 945c490..ae5b952 100644 --- a/include/dungeon_ai_targeting.h +++ b/include/dungeon_ai_targeting.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x71138 bool8 CanAttackInFront(struct DungeonEntity *pokemon, s32 direction); #endif diff --git a/include/dungeon_ai_targeting_1.h b/include/dungeon_ai_targeting_1.h index 49b700f..d59a0ee 100644 --- a/include/dungeon_ai_targeting_1.h +++ b/include/dungeon_ai_targeting_1.h @@ -3,9 +3,7 @@ #include "dungeon_entity.h" -// 0x71494 bool8 ShouldAvoidEnemies(struct DungeonEntity *pokemon); -// 0x71518 bool8 ShouldAvoidEnemiesAndShowEffect(struct DungeonEntity *pokemon, bool8 showRunAwayEffect); #endif diff --git a/include/dungeon_ai_targeting_2.h b/include/dungeon_ai_targeting_2.h index c314646..5fe43a3 100644 --- a/include/dungeon_ai_targeting_2.h +++ b/include/dungeon_ai_targeting_2.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x71598 u8 CanTarget(struct DungeonEntity *pokemon, struct DungeonEntity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified); #endif diff --git a/include/dungeon_capabilities.h b/include/dungeon_capabilities.h index 6574b32..f4a0306 100644 --- a/include/dungeon_capabilities.h +++ b/include/dungeon_capabilities.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x70B6C bool8 CannotMove(struct DungeonEntity *pokemon, bool8 checkBlinker); #endif diff --git a/include/dungeon_capabilities_1.h b/include/dungeon_capabilities_1.h index 1319230..5c8e3d0 100644 --- a/include/dungeon_capabilities_1.h +++ b/include/dungeon_capabilities_1.h @@ -3,13 +3,9 @@ #include "dungeon_entity.h" -// 0x70C60 bool8 CannotUseItems(struct DungeonEntity *pokemon); -// 0x70CD0 bool8 CannotAct(struct DungeonEntity *pokemon); -// 0x70d04 bool8 CannotAttack(struct DungeonEntity *pokemon, bool8 skipSleep); -// 0x70D6C bool8 CanMoveInDirection(struct DungeonEntity *pokemon, u32 facingDir); #endif diff --git a/include/dungeon_engine.h b/include/dungeon_engine.h index d2be40b..e4fa7f4 100644 --- a/include/dungeon_engine.h +++ b/include/dungeon_engine.h @@ -1,9 +1,7 @@ #ifndef GUARD_DUNGEON_ENGINE_H #define GUARD_DUNGEON_ENGINE_H -// 0x441BC bool8 IsBossBattle(); -// 0x441E8 bool8 IsFixedDungeon(); #endif diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 2567f79..1e4b884 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; @@ -18,7 +28,6 @@ struct DungeonActionContainer u8 fill3; // Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset. /* 0x4 */ u8 actionUseIndex; - u8 fill5[0x8 - 0x5]; // Position of the Pokémon the last time it threw an item. /* 0x8 */ struct Position lastItemThrowPosition; u8 unkC; @@ -39,7 +48,6 @@ struct DungeonEntityData /* 0x8 */ u8 shopkeeperMode; /* 0x9 */ u8 level; /* 0xA */ u8 partyIndex; // Leader is 0, partner is 1, etc. - u8 fillB; /* 0xC */ s16 IQ; /* 0xE */ s16 HP; /* 0x10 */ s16 maxHP; @@ -52,33 +60,29 @@ 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; /* 0x40 */ u8 joinLocation; // Uses the dungeon index in dungeon.h. - u8 fill41[0x44 - 0x41]; /* 0x44 */ struct DungeonActionContainer action; u8 fill55[0x58 - 0x55]; // Position of the target that the Pokémon wants throw an item at. /* 0x58 */ struct Position itemTargetPosition; - /* 0x5C */ u8 type1; - /* 0x5D */ u8 type2; - /* 0x5E */ u8 ability1; - /* 0x5F */ u8 ability2; + /* 0x5C */ u8 types[2]; + /* 0x5E */ u8 abilities[2]; /* 0x60 */ struct ItemSlot heldItem; u8 fill64[0x68 - 0x64]; /* 0x68 */ struct Position previousPosition1; @@ -90,7 +94,6 @@ struct DungeonEntityData /* 0x7A */ bool8 hasTarget; /* 0x7B */ bool8 turnAround; /* 0x7C */ u16 targetPokemonSpawnIndex; - u8 fill7E[0x80 - 0x7E]; /* 0x80 */ u32 targetPokemon; u8 fill84[0x88 - 0x84]; /* 0x88 */ struct Position targetMovePosition; @@ -168,7 +171,6 @@ struct DungeonEntityData /* 0xFD */ u8 perishSongTimer; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song. u8 fillFE[0x100 - 0xFE]; /* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. - u8 fill101[0x104 - 0x101]; /* 0x104 */ s32 movementSpeed; // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple // speed-up/slow effects at once, like using Agility twice. @@ -179,10 +181,8 @@ struct DungeonEntityData // When true, an AI Pokémon will move in a random direction every turn. // Unclear where this is set in-game; it is not set by statuses (e.g., confusion) or mission clients. /* 0x114 */ bool8 moveRandomly; - u8 fill115[0x118 - 0x115]; /* 0x118 */ struct PokemonMove moves[MAX_MON_MOVES]; /* 0x138 */ u8 struggleMoveFlags; - u8 fill139[0x13C - 0x139]; /* 0x13C */ u32 belly; /* 0x140 */ u32 maxBelly; /* 0x144 */ bool8 movingIntoTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them. @@ -201,7 +201,6 @@ struct DungeonEntityData u8 unk15F; u8 fill160[0x169 - 0x160]; u8 turnsSinceWarpScarfActivation; - u8 fill16A[0x16C - 0x16A]; /* 0x16C */ struct Position targetPosition; /* 0x170 */ struct Position posPixel; u32 unk174; @@ -210,7 +209,6 @@ struct DungeonEntityData /* 0x184 */ struct Position previousTargetMovePosition1; /* 0x188 */ struct Position32 previousTargetMovePosition2; /* 0x190 */ u8 lastMoveDirection; // The last direction that the Pokémon moved in. - u8 fill191[0x194 - 0x191]; // Number of tiles that the Pokémon moved last, multiplied by 0x100. /* 0x194 */ struct Position32 lastMoveIncrement; /* 0x19C */ u8 walkAnimationCounter; // Set when the Pokémon starts moving, and counts down until the Pokémon's walk animation stops. @@ -220,9 +218,7 @@ struct DungeonEntityData /* 0x1F6 */ bool8 notMoving; u8 fill1F7[0x1FA - 0x1F7]; /* 0x1FA */ u8 mobileTurnTimer; // When a Pokémon can pass through walls in a hallway, this counts up to 200 before the Pokémon turns in a random direction. - u8 fill1FB; /* 0x1FC */ u16 expGainedInTurn; // Used to accumulate experience when multiple enemies are defeated in one turn. - u8 fill1FE[0x200 - 0x1FE]; /* 0x200 */ u32 statusSprites; u32 unk204; }; @@ -273,7 +269,6 @@ struct DungeonEntity /* 0x6A */ u8 unk6B; /* 0x6C */ u8 facingDir; /* 0x6D */ u8 facingDir2; // Duplicate of 0x6C? - u8 fill6D[0x70 - 0x6E]; /* 0x70 */ struct DungeonEntityData *entityData; }; diff --git a/include/dungeon_global_data.h b/include/dungeon_global_data.h index 74e052e..924fa9e 100644 --- a/include/dungeon_global_data.h +++ b/include/dungeon_global_data.h @@ -53,7 +53,6 @@ struct DungeonGlobalData /* 0x3A0E */ s16 tileset; u8 fill3A10[0x3A14 - 0x3A10]; /* 0x3A14 */ s16 bossBattleIndex; - u8 fill3A16[0x3A18 - 0x3A16]; /* 0x3A18 */ struct MapTile mapTiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X]; u8 fillE218[0xE23C - 0xE218]; s16 unkE23C; diff --git a/include/dungeon_items.h b/include/dungeon_items.h index 8eb1718..0c227c2 100644 --- a/include/dungeon_items.h +++ b/include/dungeon_items.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x46CB0 bool8 HasItem(struct DungeonEntity *pokemon, u8 itemIndex); #endif diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index c715483..dc5790c 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -8,9 +8,7 @@ struct unkStruct_202F190 struct MapTile* unk0[6]; }; -// 0x4954C struct MapTile* GetMapTile_1(s32 x, s32 y); -// 0x49590 struct MapTile* GetMapTile_2(s32 x, s32 y); #endif diff --git a/include/dungeon_movement.h b/include/dungeon_movement.h index d15ef1b..111d98b 100644 --- a/include/dungeon_movement.h +++ b/include/dungeon_movement.h @@ -1,7 +1,6 @@ #ifndef GUARD_DUNGEON_MOVEMENT_H #define GUARD_DUNGEON_MOVEMENT_H -// 0x70328 u8 GetCrossableTerrain(s16 species); #endif diff --git a/include/dungeon_pokemon_attributes.h b/include/dungeon_pokemon_attributes.h index 40b13ee..c09a657 100644 --- a/include/dungeon_pokemon_attributes.h +++ b/include/dungeon_pokemon_attributes.h @@ -3,22 +3,14 @@ #include "dungeon_entity.h" -// 0x71824 bool8 HasAbility(struct DungeonEntity *pokemon, u8 ability); -// 0x71858 bool8 HasType(struct DungeonEntity *pokemon, u8 type); -// 0x71884 bool8 CanSeeInvisible(struct DungeonEntity *pokemon); -// 0x718AC bool8 HasTactic(struct DungeonEntity *pokemon, u8 tactic); -// 0x718D8 bool8 HasIQSkill(struct DungeonEntity *pokemon, u8 IQSkill); - void LoadIQSkills(struct DungeonEntity *pokemon); bool8 CanSeeTeammate(struct DungeonEntity * pokemon); u8 GetMoveTypeForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove); - -// 0x71A44 s32 CalculateMovePower(struct DungeonEntity *pokemon, struct PokemonMove *pokeMove); bool8 ToolboxEnabled(struct DungeonEntityData *pokemon); diff --git a/include/dungeon_random.h b/include/dungeon_random.h index 5679720..b53b4bb 100644 --- a/include/dungeon_random.h +++ b/include/dungeon_random.h @@ -1,9 +1,7 @@ #ifndef GUARD_DUNGEON_RANDOM_H #define GUARD_DUNGEON_RANDOM_H -// 0x840E8 s32 DungeonRandom(void); -// 0x84100 s32 DungeonRandomCapped(s32 cap); #endif diff --git a/include/dungeon_random_1.h b/include/dungeon_random_1.h index bfc2ecd..c863a7e 100644 --- a/include/dungeon_random_1.h +++ b/include/dungeon_random_1.h @@ -1,7 +1,6 @@ #ifndef GUARD_DUNGEON_RANDOM_1_H #define GUARD_DUNGEON_RANDOM_1_H -// 0x84144 bool8 RollPercentChance(s32 percentChance); #endif diff --git a/include/dungeon_range.h b/include/dungeon_range.h index 3d76011..80cb7e3 100644 --- a/include/dungeon_range.h +++ b/include/dungeon_range.h @@ -3,7 +3,6 @@ #include "position.h" -// 0x83294 bool8 InSameRoom_2(struct Position *pos1, struct Position *pos2); #endif diff --git a/include/dungeon_util.h b/include/dungeon_util.h index b32b85d..77db878 100644 --- a/include/dungeon_util.h +++ b/include/dungeon_util.h @@ -7,13 +7,9 @@ extern const struct Position gAdjacentTileOffsets[NUM_DIRECTIONS]; -// 0x450E0 bool8 EntityExists(struct DungeonEntity *pokemon); -// 0x450F8 u32 GetEntityType(struct DungeonEntity *entity); -// 0x45104 struct DungeonEntityData *GetTrapData(struct DungeonEntity *entity); -// 0x45108 struct ItemSlot *GetItemData(struct DungeonEntity *entity); struct MapTile *GetMapTileForDungeonEntity_2(struct DungeonEntity *entity); diff --git a/include/dungeon_util_1.h b/include/dungeon_util_1.h index cfda253..070e6d8 100644 --- a/include/dungeon_util_1.h +++ b/include/dungeon_util_1.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x85A50 bool8 IsMovingClient(struct DungeonEntity *entity); #endif diff --git a/include/dungeon_visibility.h b/include/dungeon_visibility.h index f94926e..62e7163 100644 --- a/include/dungeon_visibility.h +++ b/include/dungeon_visibility.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x45990 bool8 CanSee(struct DungeonEntity *entity, struct DungeonEntity *targetEntity); #endif diff --git a/include/move_util.h b/include/move_util.h new file mode 100644 index 0000000..2bfc1c6 --- /dev/null +++ b/include/move_util.h @@ -0,0 +1,9 @@ +#ifndef GUARD_MOVE_UTIL_H +#define GUARD_MOVE_UTIL_H + +#include "dungeon_entity.h" + +bool8 IsMoveIndexUsable(struct DungeonEntity *pokemon, s32 moveIndex, bool8 hasPPChecker); +bool8 IsMoveUsable(struct DungeonEntity *pokemon, struct PokemonMove *move, bool8 hasPPChecker); + +#endif diff --git a/include/moves.h b/include/moves.h index 44b324b..24b5249 100644 --- a/include/moves.h +++ b/include/moves.h @@ -18,14 +18,14 @@ 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 MoveDealsDirectDamage(struct PokemonMove *move); +bool8 MoveCannotHitFrozen(struct PokemonMove *move); +bool8 MoveDealsDirectDamage(struct PokemonMove *move); u32 GetMoveRangeType(struct PokemonMove *move); void sub_8092C84(u8 *buffer, u16 moveID); u8 *GetMoveUseText(u16 moveID); -u8 GetMoveAffectedByMagicCoat(u16 moveID); -u8 GetMoveTargetsUser(u16 moveID); -u8 GetMoveAffectedByMuzzled(u16 moveID); +bool8 MoveAffectedByMagicCoat(u16 moveID); +bool8 MoveTargetsUser(u16 moveID); +bool8 MoveAffectedByMuzzled(u16 moveID); bool8 IsBlockedBySoundproof(struct PokemonMove *move); bool8 DoesMoveCharge(u16 move); diff --git a/include/number_util.h b/include/number_util.h index c42ef1c..692fba0 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -1,7 +1,6 @@ #ifndef GUARD_NUMBER_UTIL_H #define GUARD_NUMBER_UTIL_H -// 0x94450 s32 RoundUpFixedPoint(s32 fixedPointNumber); #endif diff --git a/include/position_util.h b/include/position_util.h index 74019b7..9004d10 100644 --- a/include/position_util.h +++ b/include/position_util.h @@ -3,7 +3,6 @@ #include "position.h" -// 0x983D8 s32 CalculateFacingDir(struct Position *originPos, struct Position *targetPos); #endif diff --git a/include/status.h b/include/status.h new file mode 100644 index 0000000..d12170a --- /dev/null +++ b/include/status.h @@ -0,0 +1,12 @@ +#ifndef GUARD_STATUS_H +#define GUARD_STATUS_H + +#include "dungeon_entity.h" + +#define FLASH_FIRE_STATUS_NONE 0 +#define FLASH_FIRE_STATUS_MAXED 1 +#define FLASH_FIRE_STATUS_NOT_MAXED 2 + +u8 GetFlashFireStatus(struct DungeonEntity *pokemon); + +#endif diff --git a/include/status_checker.h b/include/status_checker.h index 1b65030..416b265 100644 --- a/include/status_checker.h +++ b/include/status_checker.h @@ -4,7 +4,10 @@ #include "constants/move.h" #include "dungeon_entity.h" -// 0x5C498 bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move); +bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move); +bool8 HasDisabledMove(struct PokemonMove *moves); +bool8 LastUsedMoveOutOfPP(struct PokemonMove *moves); +bool8 HasLastUsedMove(struct PokemonMove *moves); #endif diff --git a/include/status_checks.h b/include/status_checks.h index 5bc80eb..5253d9d 100644 --- a/include/status_checks.h +++ b/include/status_checks.h @@ -5,7 +5,6 @@ extern const s16 gConfusedAttackChance; -// 0x7001C bool8 HasStatusAffectingActions(struct DungeonEntity *pokemon); #endif diff --git a/include/status_checks_1.h b/include/status_checks_1.h index a90bdb0..306937b 100644 --- a/include/status_checks_1.h +++ b/include/status_checks_1.h @@ -3,11 +3,8 @@ #include "dungeon_entity.h" -// 0x70A58 bool8 HasNegativeStatus(struct DungeonEntity *pokemon); -// 0x70B28 bool8 IsSleeping(struct DungeonEntity *pokemon); -// 0x70B48 bool8 HasQuarterHPOrLess(struct DungeonEntity* pokemon); #endif diff --git a/include/targeting.h b/include/targeting.h index 7330398..89c4d49 100644 --- a/include/targeting.h +++ b/include/targeting.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x69DCC void TargetTileInFront(struct DungeonEntity *pokemon); #endif diff --git a/include/targeting_flags.h b/include/targeting_flags.h index d7d4737..3e1abdd 100644 --- a/include/targeting_flags.h +++ b/include/targeting_flags.h @@ -4,7 +4,6 @@ #include "constants/move.h" #include "dungeon_entity.h" -// 0x7CD64 s16 GetMoveTargetingFlagsForPokemon(struct DungeonEntity *pokemon, struct PokemonMove *move, bool32 isAI); #endif diff --git a/include/tile_types.h b/include/tile_types.h index f1bc412..d1577d4 100644 --- a/include/tile_types.h +++ b/include/tile_types.h @@ -7,9 +7,7 @@ #define DUNGEON_WATER_TYPE_LAVA 1 #define DUNGEON_WATER_TYPE_WATER 2 -// 0x4AF20 bool8 IsTileGround(struct MapTile* tile); -// 0x4AF74 bool8 IsWaterTileset(); #endif diff --git a/include/trap.h b/include/trap.h index 49a5216..fb6855e 100644 --- a/include/trap.h +++ b/include/trap.h @@ -3,7 +3,6 @@ #include "position.h" -// 0x4AF74 bool8 CanLayTrap(struct Position *pos); #endif diff --git a/include/type_chart.h b/include/type_chart.h new file mode 100644 index 0000000..4be0b33 --- /dev/null +++ b/include/type_chart.h @@ -0,0 +1,17 @@ +#ifndef GUARD_TYPE_CHART_H +#define GUARD_TYPE_CHART_H + +#include "global.h" +#include "constants/type.h" + +#define NUM_EFFECTIVENESS 4 + +#define EFFECTIVENESS_IMMUNE 0 +#define EFFECTIVENESS_RESIST 1 +#define EFFECTIVENESS_NEUTRAL 2 +#define EFFECTIVENESS_SUPER 3 + +// [Attacking type][Defending type] +extern const s16 gTypeEffectivenessChart[NUM_TYPES][NUM_TYPES]; + +#endif
\ No newline at end of file diff --git a/include/type_effectiveness.h b/include/type_effectiveness.h new file mode 100644 index 0000000..3502f0e --- /dev/null +++ b/include/type_effectiveness.h @@ -0,0 +1,8 @@ +#ifndef GUARD_TYPE_EFFECTIVENESS_H +#define GUARD_TYPE_EFFECTIVENESS_H + +#include "dungeon_entity.h" + +s32 WeightWeakTypePicker(struct DungeonEntity *user, struct DungeonEntity *target, u8 moveType); + +#endif diff --git a/include/weather.h b/include/weather.h index b7fa725..711007d 100644 --- a/include/weather.h +++ b/include/weather.h @@ -3,7 +3,6 @@ #include "dungeon_entity.h" -// 0x7E580 u8 GetWeather(struct DungeonEntity* pokemon); #endif |