Fix and unify IQ struct and joinetAt struct

This commit is contained in:
DizzyEggg
2024-11-25 10:41:19 +01:00
parent 59675af1f9
commit 87f623136d
28 changed files with 277 additions and 162 deletions

View File

@@ -8,6 +8,8 @@
#include "structs/str_items.h"
#include "structs/str_moves.h"
#include "structs/str_position.h"
#include "structs/str_dungeon_location.h"
#include "structs/str_iq_skill_flags.h"
#include "math.h"
#include "number_util.h"
#include "sprite.h"
@@ -27,8 +29,6 @@
#define STAT_STAGE_ACCURACY 0
#define STAT_STAGE_EVASION 1
#define NUM_PICKED_IQ_SKILLS 3
// size: 0x8
typedef struct unkStruct_8044CC8
{
@@ -55,13 +55,6 @@ typedef struct HiddenPower
/* 0x2 */ u8 hiddenPowerType;
} HiddenPower;
// size: 0x4
typedef struct JoinedAt
{
/* 0x0 */ u8 joinedAt;
/* 0x1 */ u8 unk1;
} JoinedAt;
// size: 0x14
typedef struct AITarget
{
@@ -238,7 +231,7 @@ typedef struct EntityInfo
// Index 0 is Defense. Index 1 is Special Defense.
/* 0x34 */ s24_8 defensiveMultipliers[2];
/* 0x3C */ HiddenPower hiddenPower;
/* 0x40 */ JoinedAt joinedAt; // Uses the dungeon index in dungeon.h.
/* 0x40 */ DungeonLocation joinedAt; // Uses the dungeon index in dungeon.h.
/* 0x44 */ ActionContainer action;
/* 0x5C */ u8 types[2];
/* 0x5E */ u8 abilities[2];
@@ -247,10 +240,8 @@ typedef struct EntityInfo
/* 0x68 */ DungeonPos prevPos[NUM_PREV_POS];
/* 0x78 */ AITarget aiTarget;
// Bitwise flags corresponding to selected IQ skills.
/* 0x8C */ u8 IQSkillMenuFlags[NUM_PICKED_IQ_SKILLS]; // IQ skills selected in the IQ skills menu.
u8 padding8F;
/* 0x90 */ u8 IQSkillFlags[NUM_PICKED_IQ_SKILLS];
u8 padding93;
/* 0x8C */ IqSkillFlags IQSkillMenuFlags; // IQ skills selected in the IQ skills menu.
/* 0x90 */ IqSkillFlags IQSkillFlags;
/* 0x94 */ u8 tactic;
u8 fill95[0x98 - 0x95];
/* 0x98 */ u32 unk98;

View File

@@ -8,6 +8,7 @@
#include "structs/rgb.h"
#include "structs/str_position.h"
#include "structs/str_traps.h"
#include "structs/str_dungeon_location.h"
#include "sprite.h"
#define DUNGEON_MAX_SIZE_X 56
@@ -18,13 +19,6 @@
#define DUNGEON_MAX_TRAPS 64
#define DUNGEON_MAX_ITEMS 64
// size: 0x4
typedef struct DungeonLocation
{
/* 0x0 */ u8 id;
/* 0x1 */ u8 floor;
} DungeonLocation;
// size: 0x18
typedef struct Weather
{

View File

@@ -0,0 +1,11 @@
#ifndef GUARD_STR_DUNGEON_LOCATION_H
#define GUARD_STR_DUNGEON_LOCATION_H
// size: 0x4
typedef struct DungeonLocation
{
/* 0x0 */ u8 id;
/* 0x1 */ u8 floor;
} DungeonLocation;
#endif // GUARD_STR_DUNGEON_LOCATION_H

View File

@@ -0,0 +1,11 @@
#ifndef GUARD_STR_IQ_SKILL_FLAGS_H
#define GUARD_STR_IQ_SKILL_FLAGS_H
#define NUM_PICKED_IQ_SKILLS 3
typedef struct IqSkillFlags
{
u8 flags[NUM_PICKED_IQ_SKILLS];
} IqSkillFlags;
#endif

View File

@@ -5,6 +5,7 @@
#include "structs/str_dungeon.h"
#include "structs/str_items.h"
#include "structs/str_moves.h"
#include "structs/str_iq_skill_flags.h"
// size: 0x4
typedef struct Offense
@@ -33,7 +34,7 @@ typedef struct PokemonStruct1
/* 0x16 */ s16 pokeHP;
/* 0x18 */ Offense offense;
/* 0x1C */ u32 currExp;
/* 0x20 */ u32 IQSkills;
/* 0x20 */ IqSkillFlags IQSkills;
/* 0x24 */ u8 tacticIndex;
/* 0x28 */ BulkItem heldItem;
/* 0x2C */ Move moves[MAX_MON_MOVES];
@@ -73,7 +74,7 @@ typedef struct PokemonStruct2
/* 0x40 */ Item itemSlot; // heldItem
/* 0x44 */ FixedPoint belly;
/* 0x48 */ FixedPoint maxBelly;
/* 0x4C */ u32 IQSkills; // unk20
/* 0x4C */ IqSkillFlags IQSkills;
/* 0x50 */ u8 tacticIndex;
/* 0x54 */ HiddenPower hiddenPower;
/* 0x58 */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset)