axObject info union

This commit is contained in:
Kermalis
2024-11-10 19:43:27 -05:00
parent 2ec9296cc5
commit afa4b04abc
16 changed files with 551 additions and 679 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 EntTrapInfo* trap;
} info;
};
// size: 0x80? (assuming it's the last sub-struct of GroundLives)

View File

@@ -1,15 +1,15 @@
#ifndef GUARD_DUNGEON_ENTITY_H
#define GUARD_DUNGEON_ENTITY_H
#include "constants/global.h"
#include "constants/dungeon_action.h"
#include "structs/str_position.h"
#include "sprite.h"
#include "constants/global.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 "number_util.h"
#include "sprite.h"
#define MAX_STAT_STAGE 20
#define STAT_MULTIPLIER_THRESHOLD 63
@@ -352,6 +352,13 @@ typedef struct EntityInfo
u8 unk204;
} EntityInfo;
// size: 0x4
typedef struct EntTrapInfo
{
/* 0x0 */ u8 unk0;
/* 0x0 */ u8 unk1;
} EntTrapInfo;
// size: 0x74 | Used for Pokémon, items, and traps.
typedef struct Entity
{
@@ -472,7 +479,7 @@ static inline void SetExpMultplier(EntityInfo *info)
static inline EntityInfo *GetEntInfo(Entity *ent)
{
return ent->axObj.info;
return ent->axObj.info.monster;
}
#endif

View File

@@ -354,9 +354,9 @@ typedef struct Dungeon
/* 0x37FE */ bool8 unk37FF;
// dungeon_serializer.c refers to this as a u16 but elsewhere it's handled as a s16
/* 0x3800 */ s16 deoxysForm;
EntityInfo *unk3804[DUNGEON_MAX_ITEMS]; // TODO: ItemInfo[DUNGEON_MAX_ITEMS]
Item unk3804[DUNGEON_MAX_ITEMS];
/* 0x3904 */ s16 unk3904;
EntityInfo *unk3908[DUNGEON_MAX_TRAPS]; // TODO: TrapInfo[DUNGEON_MAX_TRAPS]
EntTrapInfo unk3908[DUNGEON_MAX_TRAPS];
/* 0x3A08 */ bool8 unk3A08;
/* 0x3A09 */ bool8 unk3A09;
/* 0x3A0A */ bool8 unk3A0A;