This commit is contained in:
AnonymousRandomPerson
2024-11-16 12:18:40 -05:00
155 changed files with 9595 additions and 10733 deletions

View File

@@ -84,7 +84,12 @@ struct axObject
u8 unk45_orientation;
u8 unk46;
u8 unk47;
/* 0x48 */ struct EntityInfo* info;
/* 0x48 */ union
{
struct Item* item;
struct EntityInfo* monster;
struct Trap* trap;
} info;
};
// size: 0x80? (assuming it's the last sub-struct of GroundLives)

View File

@@ -1,14 +1,16 @@
#ifndef GUARD_DUNGEON_ENTITY_H
#define GUARD_DUNGEON_ENTITY_H
#include "constants/dungeon_action.h"
#include "constants/global.h"
#include "structs/str_position.h"
#include "sprite.h"
#include "constants/status.h"
#include "structs/axdata.h"
#include "structs/str_items.h"
#include "structs/str_moves.h"
#include "structs/axdata.h"
#include "structs/str_position.h"
#include "math.h"
#include "number_util.h"
#include "sprite.h"
#define MAX_STAT_STAGE 20
#define STAT_MULTIPLIER_THRESHOLD 63
@@ -26,10 +28,13 @@
#define STAT_STAGE_ACCURACY 0
#define STAT_STAGE_EVASION 1
#define NUM_PICKED_IQ_SKILLS 3
// size: 0x8
typedef struct unkStruct_8044CC8
{
u8 actionUseIndex;
Position lastItemThrowPosition;
/* 0x0 */ u8 actionUseIndex;
/* 0x4 */ Position lastItemThrowPosition;
} unkStruct_8044CC8;
// size: 0x18
@@ -37,25 +42,28 @@ typedef struct ActionContainer
{
/* 0x0 */ u16 action;
/* 0x2 */ u8 direction;
u8 fill3;
u8 unk3;
// Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset.
/* 0x4 */ unkStruct_8044CC8 unk4[2];
// Position of the target that the Pokémon wants throw an item at.
/* 0x14 */ Position itemTargetPosition;
} ActionContainer;
// size: 0x4
typedef struct HiddenPower
{
/* 0x0 */ s16 hiddenPowerBasePower;
/* 0x2 */ u8 hiddenPowerType;
} HiddenPower;
// size: 0x4
typedef struct JoinedAt
{
/* 0x0 */ u8 joinedAt;
/* 0x1 */ u8 unk1;
} JoinedAt;
// size: 0x14
typedef struct AITarget
{
/* 0x0 */ u8 aiObjective;
@@ -66,15 +74,16 @@ typedef struct AITarget
/* 0x8 */ struct Entity *aiTarget;
/* 0xC */ u32 unkC;
/* 0x10 */ Position aiTargetPos;
} AITarget;
// size: 0x4
typedef struct SleepClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} SleepClassStatus;
// size: 0x4
typedef struct BurnClassStatus
{
/* 0x0 */ u8 status;
@@ -83,6 +92,7 @@ typedef struct BurnClassStatus
/* 0x3 */ u8 unk4;
} BurnClassStatus;
// size: 0xC
typedef struct FrozenClassStatus
{
/* 0x0 */ u8 status;
@@ -91,12 +101,14 @@ typedef struct FrozenClassStatus
/* 0x9 */ u8 damageCountdown;
} FrozenClassStatus;
// size: 0x4
typedef struct CringeClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} CringeClassStatus;
// size: 0x4
typedef struct BideClassStatus
{
/* 0x0 */ u8 status;
@@ -104,60 +116,68 @@ typedef struct BideClassStatus
/* 0x2 */ u8 moveSlot; // The position of the move in the Pokémon's moveset that triggered the status.
} BideClassStatus;
// size: 0x4
typedef struct ReflectClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} ReflectClassStatus;
// size: 0x8
typedef struct CurseClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ bool8 applierNonTeamMemberFlag; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon).
u8 unk2;
/* 0x2 */ bool8 unk2;
/* 0x3 */ u8 turns;
/* 0x4 */ u8 damageCountdown;
} CurseClassStatus;
// size: 0xC
typedef struct LeechSeedClassStatus
{
/* 0x0 */ u8 status;
/* 0x4 */ u32 unkD4;
/* 0x8 */ u8 unkD8;
/* 0x4 */ u32 unk4;
/* 0x8 */ u8 unk8;
/* 0x9 */ u8 turns;
/* 0xA */ u8 damageCountdown;
} LeechSeedClassStatus;
// size: 0x4
typedef struct SureShotClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} SureShotClassStatus;
// size: 0x4
typedef struct LongTossClassStatus
{
/* 0x0 */ u8 status;
} LongTossClassStatus;
// size: 0x4
typedef struct InvisibleClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} InvisibleClassStatus;
// size: 0x4
typedef struct BlinkerClassStatus
{
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} BlinkerClassStatus;
// size: 0x4
typedef struct Muzzled
{
/* 0x0 */ bool8 muzzled;
/* 0x1 */ u8 turns;
} Muzzled;
// size: 0x1C
typedef struct Unk_Entity_x184
{
/* 0x184 - 0x0 */ Position previousTargetMovePosition1;
@@ -167,12 +187,13 @@ typedef struct Unk_Entity_x184
/* 0x194 - 0x10*/ Position32 lastMoveIncrement;
/* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the Pokémon starts moving, and counts down until the Pokémon's walk animation stops.
/* 0x19e - 0x1a */ u8 unk1A;
} Unk_Entity_x184 ;
} Unk_Entity_x184;
// size: 0x24
typedef struct Moves
{
/* 0x118 */ Move moves[MAX_MON_MOVES];
/* 0x138 */ u8 struggleMoveFlags;
/* 0x0 */ Move moves[MAX_MON_MOVES];
/* 0x20 */ u8 struggleMoveFlags;
} Moves;
// size: 0x208
@@ -211,9 +232,9 @@ typedef struct EntityInfo
/* 0x28 */ s16 flashFireBoost;
// These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat.
// Index 0 is Attack. Index 1 is Special Attack.
/* 0x2C */ s32 offensiveMultipliers[2];
/* 0x2C */ s24_8 offensiveMultipliers[2];
// Index 0 is Defense. Index 1 is Special Defense.
/* 0x34 */ s32 defensiveMultipliers[2];
/* 0x34 */ s24_8 defensiveMultipliers[2];
/* 0x3C */ HiddenPower hiddenPower;
/* 0x40 */ JoinedAt joinedAt; // Uses the dungeon index in dungeon.h.
/* 0x44 */ ActionContainer action;
@@ -224,8 +245,10 @@ typedef struct EntityInfo
/* 0x68 */ Position prevPos[NUM_PREV_POS];
/* 0x78 */ AITarget aiTarget;
// Bitwise flags corresponding to selected IQ skills.
/* 0x8C */ u8 IQSkillMenuFlags[4]; // IQ skills selected in the IQ skills menu.
/* 0x90 */ u8 IQSkillFlags[4];
/* 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;
/* 0x94 */ u8 tactic;
u8 fill95[0x98 - 0x95];
/* 0x98 */ u32 unk98;
@@ -242,7 +265,7 @@ typedef struct EntityInfo
/* 0xC0 */ BideClassStatus bideClassStatus;
/* 0xC4 */ ReflectClassStatus reflectClassStatus;
/* 0xC8 */ CurseClassStatus curseClassStatus;
/* 0xD0 */ LeechSeedClassStatus linked;
/* 0xD0 */ LeechSeedClassStatus leechSeedClassStatus;
/* 0xDC */ SureShotClassStatus sureShotClassStatus;
/* 0xE0 */ LongTossClassStatus longTossClassStatus;
/* 0xE4 */ InvisibleClassStatus invisibleClassStatus;
@@ -316,7 +339,7 @@ typedef struct EntityInfo
/* 0x169 */ u8 turnsSinceWarpScarfActivation;
/* 0x16C */ Position targetPos;
/* 0x170 */ Position pixelPos;
u32 unk174;
s24_8 unk174;
u16 abilityEffectFlags; // See enum AbilityEffectFlags
/* 0x17A */ u16 mimicMoveIDs[MAX_MON_MOVES]; // All moves that Mimic has copied (not sure on size...)
// Previous value of targetPosition for movement, 1 and 2 moves ago.
@@ -480,9 +503,4 @@ static inline void SetExpMultplier(EntityInfo *info)
SetRegularExpMultiplier(info);
}
static inline EntityInfo *GetEntInfo(Entity *ent)
{
return ent->axObj.info;
}
#endif

View File

@@ -1,7 +1,8 @@
#ifndef GUARD_STR_DAMAGE_H
#define GUARD_STR_DAMAGE_H
struct DamageStruct
// size: 0x10
typedef struct DamageStruct
{
s32 dmg;
s32 residualDmgType;
@@ -10,6 +11,6 @@ struct DamageStruct
bool8 isCrit;
u8 unkE;
bool8 tookNoDamage;
};
} DamageStruct;
#endif
#endif // GUARD_STR_DAMAGE_H

View File

@@ -7,6 +7,7 @@
#include "structs/map.h"
#include "structs/rgb.h"
#include "structs/str_position.h"
#include "structs/str_traps.h"
#include "sprite.h"
#define DUNGEON_MAX_SIZE_X 56
@@ -24,17 +25,17 @@ typedef struct DungeonLocation
/* 0x1 */ u8 floor;
} DungeonLocation;
// size: 0x18
typedef struct Weather
{
/* 0xE264 */ u8 weather; // Uses the weather constants in weather.h.
u8 unkE265; // Uses the weather constants in weather.h
/* 0xE266 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically.
/* 0xE267 */ u8 unkE267[8];
/* 0xE26F */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather.
/* 0xE277 */ u8 mudSportTurns;
/* 0xE278 */ u8 waterSportTurns;
/* 0xE279 */ bool8 nullifyWeather; // Air Lock and Cloud Nine toggle this to disable weather effects
/* 0x0 */ u8 weather; // Uses the weather constants in weather.h.
/* 0x1 */ u8 unkE265; // Uses the weather constants in weather.h
/* 0x2 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically.
/* 0x3 */ u8 unkE267[8];
/* 0xB */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather.
/* 0x13 */ u8 mudSportTurns;
/* 0x14 */ u8 waterSportTurns;
/* 0x15 */ bool8 nullifyWeather; // Air Lock and Cloud Nine toggle this to disable weather effects
} Weather;
// size: 0x30
@@ -66,6 +67,8 @@ typedef struct DungeonMusicPlayer
/* 0x0 */ u32 state;
/* 0x4 */ u32 fadeOutSpeed;
/* 0x8 */ u16 fadeInSpeed;
// dungeon_serializer.c refers to these 3 as s16, but they are almost always handled as u16
/* 0xA */ u16 songIndex;
/* 0xC */ u16 pastSongIndex;
/* 0xE */ u16 queuedSongIndex;
@@ -85,15 +88,15 @@ typedef struct UnkDungeonGlobal_unk181E8_sub
u8 unk18208; // x20
/* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level.
/* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status.
u8 unk1820B; // x23
u8 unk1820C; // x24
u8 unk1820D; // x25
u8 unk1820E; // x26
u8 unk1820F; // x27
bool8 unk1820B; // x23
bool8 unk1820C; // x24
bool8 unk1820D; // x25
bool8 unk1820E; // x26
bool8 unk1820F; // x27
/* 0x18210 */ bool8 hallucinating; // x28 Displays Substitute and flower sprites when the player has the Cross-Eyed status.
u8 unk18211; // x29
bool8 unk18211; // x29
u8 unk18212; // x2A
u8 unk18213; // x2B
bool8 unk18213; // x2B
u8 unk18214; // x2C
u8 unk18215; // x2D
u8 unk18216; // x2E
@@ -196,12 +199,13 @@ struct unkStruct_Dungeon5C4_sub
Entity *unkC;
};
struct unkStruct_Dungeon64C
// size: 0x8
typedef struct unkStruct_Dungeon64C
{
u8 unk0;
u8 unk1;
u32 unk4;
};
} unkStruct_Dungeon64C;
#define UNK_1BBD4_STR_COUNT 10
@@ -230,6 +234,72 @@ struct MessageLogString
u8 str[MESSAGE_LOG_BUFFER_SIZE];
};
// size: 0x58
typedef struct unkDungeon644
{
/* 0x0 */ DungeonLocation dungeonLocation;
/* 0x4 */ DungeonLocation dungeonLocation2;
/* 0x8 */ unkStruct_Dungeon64C unk8;
/* 0x10 */ u8 unk10;
/* 0x11 */ u8 fill11[3];
/* 0x14 */ u8 unk14;
/* 0x15 */ u8 unk15;
/* 0x16 */ u8 unk16;
/* 0x17 */ u8 unk17;
/* 0x18 */ u8 unk18;
/* 0x19 */ u8 unk19;
/* 0x1A */ u8 fill1A[2];
/* 0x1C */ s16 fractionalTurn; // Handles turn order when Pokémon have different movement speeds.
/* 0x1E */ s16 unk1E;
/* 0x20 */ s16 unk20;
/* 0x22 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon.
/* 0x24 */ u16 unk24;
/* 0x26 */ u16 bossSongIndex;
/* 0x28 */ u8 unk28;
/* 0x29 */ u8 unk29;
/* 0x2A */ u8 unk2A;
/* 0x2B */ u8 unk2B;
/* 0x2C */ u8 unk2C;
/* 0x2D */ bool8 monsterHouseTriggered;
/* 0x2E */ bool8 monsterHouseTriggeredEvent;
/* 0x2F */ u8 unk2F;
/* 0x30 */ u8 unk30;
/* 0x31 */ u8 unk31;
/* 0x32 */ bool8 itemHoldersIdentified;
/* 0x33 */ u8 fill33;
/* 0x34 */ u8 unk34;
/* 0x35 */ u8 unk35;
/* 0x36 */ u8 unk36;
/* 0x37 */ s8 unk37;
/* 0x38 */ u32 unk38;
/* 0x3C */ u32 unk3C;
/* 0x40 */ s16 unk40;
/* 0x42 */ s16 unk42;
/* 0x44 */ s16 unk44;
/* 0x46 */ u8 unk46;
/* 0x48 */ s32 unk48;
/* 0x4C */ s32 unk4C;
/* 0x50 */ s32 unk50;
/* 0x54 */ u8 unk54;
/* 0x55 */ u8 unk55;
} unkDungeon644;
// size: 0x10
typedef struct unkDungeonE240
{
/* 0x0 */ u32 unk0;
/* 0x4 */ u32 unk4;
/* 0x8 */ u32 unk8;
/* 0xC */ u32 unkC;
} unkDungeonE240;
// size: 0x4
typedef struct unkDungeonE260
{
/* 0x0 */ u16 unk0;
/* 0x2 */ u16 unk2;
} unkDungeonE260;
// size: 0x1CEDC
typedef struct Dungeon
{
@@ -264,58 +334,10 @@ typedef struct Dungeon
/* 0x5C0 */ s32 unk5C0;
/* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3];
/* 0x5F4 */ u8 faintStringBuffer[80];
/* 0x644 */ DungeonLocation dungeonLocation;
/* 0x648 */ DungeonLocation dungeonLocation2;
struct unkStruct_Dungeon64C unk64C;
u8 unk654;
u8 fill655;
u8 fill656;
u8 fill657;
u8 unk658;
u8 unk659;
u8 unk65A;
u8 unk65B;
u8 unk65C;
u8 unk65D;
u8 fill65e[0x660 - 0x65e];
/* 0x660 */ s16 fractionalTurn; // Handles turn order when Pokémon have different movement speeds.
s16 unk662;
s16 unk664;
/* 0x666 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon.
/* 0x668 */ u16 unk668;
u16 bossSongIndex;
u8 unk66C;
u8 unk66D;
/* 0x66E */ u8 unk66E;
u8 unk66F;
u8 unk670;
/* 0x671 */ bool8 monsterHouseTriggered;
/* 0x672 */ bool8 monsterHouseTriggeredEvent;
u8 unk673;
u8 unk674;
u8 unk675;
/* 0x676 */ bool8 itemHoldersIdentified;
u8 unk677;
u8 unk678;
u8 unk679;
u8 unk67A;
s8 unk67B;
u32 unk67C;
u32 unk680;
s16 unk684;
s16 unk686;
s16 unk688;
/* 0x68A */ u8 unk68A;
u8 fill68B;
s32 unk68C;
s32 unk690;
s32 unk694;
u8 unk698;
u8 unk699;
u8 fill69A[0x69C - 0x69A];
EntityInfo unk69C[4];
EntityInfo unkEBC[1]; // Unsure about the size... See sub_8082A08()
u8 fill10C4[0x343C - 0x10C4];
unkDungeon644 unk644;
EntityInfo unk69C[MAX_TEAM_MEMBERS];
EntityInfo unkEBC[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE];
u8 fill2F3C[0x343C - 0x2F3C];
/* 0x343C */ UnkDungeonGlobal_unk1CD98 unk343C[32];
u8 fill353C[0x363c-0x353c];
/* 0x363C */ u8 expYieldRankings[NUM_MONSTERS];
@@ -328,17 +350,18 @@ typedef struct Dungeon
/* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FC */ bool8 decoyIsActive;
/* 0x37FD */ u8 unk37FD;
/* 0x37FD */ bool8 unk37FD;
/* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave
/* 0x37FE */ u8 unk37FF;
s16 unk3800;
u8 fill3802[0x3904 - 0x3802];
/* 0x37FE */ bool8 unk37FF;
// dungeon_serializer.c refers to this as a u16 but elsewhere it's handled as a s16
/* 0x3800 */ s16 deoxysForm;
Item unk3804[DUNGEON_MAX_ITEMS];
/* 0x3904 */ s16 unk3904;
u8 fill3906[0x3A08 - 0x3906];
/* 0x3A08 */ u8 unk3A08;
/* 0x3A09 */ u8 unk3A09;
/* 0x3A0A */ u8 unk3A0A;
/* 0x3A0B */ u8 unk3A0B;
Trap unk3908[DUNGEON_MAX_TRAPS];
/* 0x3A08 */ bool8 unk3A08;
/* 0x3A09 */ bool8 unk3A09;
/* 0x3A0A */ bool8 unk3A0A;
/* 0x3A0B */ bool8 unk3A0B;
u8 unk3A0C;
/* 0x3A0D */ u8 unk3A0D;
/* 0x3A0E */ s16 tileset;
@@ -350,11 +373,9 @@ typedef struct Dungeon
Position unkE218;
Position unkE21C; // stair location?
Position unkE220[8];
u32 unkE240;
u8 fillE244[0xE250 - 0xE244];
u32 unkE250;
u8 fillE254[0xE260 - 0xE254];
u32 unkE260;
unkDungeonE240 unkE240;
unkDungeonE240 unkE250;
unkDungeonE260 unkE260;
/* 0xE264 */ Weather weather; // Uses the weather constants in weather.h.
/* 0xE27C */ Tile unkE27C[8][8];
/* 0xE87C */ u8 unkE87C[8][8];

View File

@@ -23,7 +23,7 @@ typedef struct unkPokeSubStruct_C
// size: 0x58
typedef struct PokemonStruct1
{
u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited??
u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited?? "sub_80954CC" only loads 2 bits of info
/* 0x2 */ bool8 isTeamLeader;
/* 0x3 */ u8 level;
/* 0x4 */ DungeonLocation dungeonLocation;
@@ -71,8 +71,8 @@ typedef struct PokemonStruct2
/* 0x18 */ u32 currExp;
/* 0x1C */ Moves moves;
/* 0x40 */ Item itemSlot; // heldItem
FixedPoint belly; // some struct
FixedPoint maxBelly; // some struct (same type as 44)
/* 0x44 */ FixedPoint belly;
/* 0x48 */ FixedPoint maxBelly;
/* 0x4C */ u32 IQSkills; // unk20
/* 0x50 */ u8 tacticIndex;
/* 0x54 */ HiddenPower hiddenPower;

View File

@@ -3,10 +3,11 @@
#include "constants/trap.h"
typedef struct Trap
// size: 0x4
typedef struct Trap
{
/* 0x0 */ u8 id;
/* 0x1 */ u8 unk1;
} Trap;
#endif // GUARD_STR_TRAPS_H
#endif // GUARD_STR_TRAPS_H

View File

@@ -64,8 +64,8 @@ typedef struct unkStruct_203B480
u32 unk10;
u16 unk10_u16;
} unk10;
/* 0x14 */ u8 playerName[0x20 - 0x14];
Item item;
/* 0x14 */ u8 playerName[10];
/* 0x20 */ Item item;
u32 unk24;
u32 unk28;
/* 0x2C */ s8 rescuesAllowed;