merge with master

This commit is contained in:
DizzyEggg
2024-11-18 12:00:41 +01:00
246 changed files with 24094 additions and 16897 deletions

View File

@@ -14,9 +14,9 @@ typedef struct UnkSpriteMem
// size: 0x20
typedef struct axdata1
{
/* 0x0 */ Position pos;
/* 0x4 */ Position offset;
/* 0x8 */ Position shadow;
/* 0x0 */ DungeonPos pos;
/* 0x4 */ DungeonPos offset;
/* 0x8 */ DungeonPos shadow;
u32 unkC;
u32 unk10;
/* 0x14 */ s16 vramTileOrMaybeAnimTimer;
@@ -43,8 +43,8 @@ typedef struct ax_anim
/* 0x0 */ u8 frames;
/* 0x1 */ u8 unkFlags;
/* 0x2 */ s16 poseId;
/* 0x4 */ Position offset;
/* 0x8 */ Position shadow;
/* 0x4 */ DungeonPos offset;
/* 0x8 */ DungeonPos shadow;
} ax_anim;
// size: 0x3C
@@ -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,19 +1,20 @@
#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
#define STAT_MULTIPLIER_THRESHOLD 0.249 // one tick less than 0.25
#define DEFAULT_STAT_STAGE 10
#define DEFAULT_STAT_MULTIPLIER 256
#define MAX_SPEED_STAGE 4
#define MAX_STOCKPILE_STAGE 3
#define NUM_SPEED_COUNTERS 5
@@ -26,10 +27,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 */ DungeonPos lastItemThrowPosition;
} unkStruct_8044CC8;
// size: 0x18
@@ -37,25 +41,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;
/* 0x14 */ DungeonPos 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;
@@ -65,114 +72,127 @@ typedef struct AITarget
/* 0x4 */ u16 aiTargetSpawnGenID;
/* 0x8 */ struct Entity *aiTarget;
/* 0xC */ u32 unkC;
/* 0x10 */ Position aiTargetPos;
/* 0x10 */ DungeonPos aiTargetPos;
} AITarget;
typedef struct Sleep
// size: 0x4
typedef struct SleepClassStatus
{
/* 0x0 */ u8 sleep;
/* 0x1 */ u8 sleepTurns;
} Sleep;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} SleepClassStatus;
typedef struct NonVolatile
// size: 0x4
typedef struct BurnClassStatus
{
/* 0x0 */ u8 nonVolatileStatus;
/* 0x1 */ u8 nonVolatileStatusTurns;
/* 0x2 */ u8 nonVolatileStatusDamageCountdown;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
/* 0x2 */ u8 damageCountdown;
/* 0x3 */ u8 unk4;
} NonVolatile;
} BurnClassStatus;
typedef struct Immobilize
// size: 0xC
typedef struct FrozenClassStatus
{
/* 0x0 */ u8 immobilizeStatus;
/* 0x0 */ u8 status;
/* 0x4 */ s32 unk4;
/* 0x8 */ u8 immobilizeStatusTurns;
/* 0x9 */ u8 immobilizeStatusDamageCountdown;
} Immobilize;
/* 0x8 */ u8 turns;
/* 0x9 */ u8 damageCountdown;
} FrozenClassStatus;
typedef struct Volatile
// size: 0x4
typedef struct CringeClassStatus
{
/* 0x0 */ u8 volatileStatus;
/* 0x1 */ u8 volatileStatusTurns;
} Volatile;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} CringeClassStatus;
typedef struct Charging
// size: 0x4
typedef struct BideClassStatus
{
/* 0x0 */ u8 chargingStatus;
/* 0x1 */ u8 chargingStatusTurns;
/* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the Pokémon's moveset that triggered the status.
} Charging;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
/* 0x2 */ u8 moveSlot; // The position of the move in the Pokémon's moveset that triggered the status.
} BideClassStatus;
typedef struct Protection
// size: 0x4
typedef struct ReflectClassStatus
{
/* 0x0 */ u8 protectionStatus;
/* 0x1 */ u8 protectionStatusTurns;
} Protection;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} ReflectClassStatus;
typedef struct Waiting
// size: 0x8
typedef struct CurseClassStatus
{
/* 0xC8 */ u8 waitingStatus;
/* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon).
u8 unkCA;
/* 0xCB */ u8 waitingStatusTurns;
/* 0xCC */ u8 curseDamageCountdown;
} Waiting;
/* 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).
/* 0x2 */ bool8 unk2;
/* 0x3 */ u8 turns;
/* 0x4 */ u8 damageCountdown;
} CurseClassStatus;
typedef struct Linked
// size: 0xC
typedef struct LeechSeedClassStatus
{
/* 0xD0 */ u8 linkedStatus;
/* 0xD4 */ u32 unkD4;
/* 0xD8 */ u8 unkD8;
/* 0xD9 */ u8 linkedStatusTurns;
/* 0xDA */ u8 linkedStatusDamageCountdown;
} Linked;
/* 0x0 */ u8 status;
/* 0x4 */ u32 unk4;
/* 0x8 */ u8 unk8;
/* 0x9 */ u8 turns;
/* 0xA */ u8 damageCountdown;
} LeechSeedClassStatus;
typedef struct MoveStatus
// size: 0x4
typedef struct SureShotClassStatus
{
/* 0xDC */ u8 moveStatus;
/* 0xDD */ u8 moveStatusTurns;
} MoveStatus;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} SureShotClassStatus;
typedef struct ItemStatus
// size: 0x4
typedef struct LongTossClassStatus
{
/* 0xE0 */ u8 itemStatus;
} ItemStatus;
/* 0x0 */ u8 status;
} LongTossClassStatus;
typedef struct TransformStatus
// size: 0x4
typedef struct InvisibleClassStatus
{
/* 0xE4 */ u8 transformStatus;
/* 0xE5 */ u8 transformStatusTurns;
} TransformStatus;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} InvisibleClassStatus;
typedef struct EyesightStatus
// size: 0x4
typedef struct BlinkerClassStatus
{
/* 0xE8 */ u8 eyesightStatus;
/* 0xE9 */ u8 eyesightStatusTurns;
} EyesightStatus;
/* 0x0 */ u8 status;
/* 0x1 */ u8 turns;
} BlinkerClassStatus;
// size: 0x4
typedef struct Muzzled
{
/* 0xEC */ bool8 muzzled;
/* 0xED */ u8 muzzledTurns;
/* 0x0 */ bool8 muzzled;
/* 0x1 */ u8 turns;
} Muzzled;
// size: 0x1C
typedef struct Unk_Entity_x184
{
/* 0x184 - 0x0 */ Position previousTargetMovePosition1;
/* 0x188 - 0x4 */ Position32 previousTargetMovePosition2;
/* 0x184 - 0x0 */ DungeonPos previousTargetMovePosition1;
/* 0x188 - 0x4 */ PixelPos previousTargetMovePosition2;
/* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the Pokémon moved in.
// Number of tiles that the Pokémon moved last, multiplied by 0x100.
/* 0x194 - 0x10*/ Position32 lastMoveIncrement;
/* 0x194 - 0x10*/ PixelPos 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
@@ -196,10 +216,8 @@ typedef struct EntityInfo
/* 0x10 */ s16 maxHPStat;
// Bosses have higher HP than normal for their level. This is the max HP they would normally have given their level.
/* 0x12 */ s16 originalHP;
/* 0x14 */ u8 atk;
/* 0x15 */ u8 spAtk;
/* 0x16 */ u8 def;
/* 0x17 */ u8 spDef;
/* 0x14 */ u8 atk[2]; // Index 0 is Attack. Index 1 is Special Attack.
/* 0x16 */ u8 def[2]; // Index 0 is Defense. Index 1 is Special Defense.
/* 0x18 */ u32 exp;
// Temporary stat boosts/drops from effects like Growl or Swords Dance.
// These start at 10 and are in the range [1, 19].
@@ -213,9 +231,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;
@@ -223,32 +241,34 @@ typedef struct EntityInfo
/* 0x5E */ u8 abilities[2];
/* 0x60 */ Item heldItem;
/* 0x64 */ u8 unk64;
/* 0x68 */ Position prevPos[NUM_PREV_POS];
/* 0x68 */ DungeonPos 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;
/* 0x9C */ u32 unk9C;
/* 0xA0 */ s32 unkA0;
/* 0xA4 */ u8 clientType;
/* 0xA4 */ u8 monsterBehavior;
u8 fillA5[0xA8 - 0xA5];
// Statuses are split into groups based on which ones can't overlap.
// See status.h for which statuses are in each group.
/* 0xA8 */ Sleep sleep;
/* 0xAC */ NonVolatile nonVolatile;
/* 0xB0 */ Immobilize immobilize;
/* 0xBC */ Volatile volatileStatus;
/* 0xC0 */ Charging charging;
/* 0xC4 */ Protection protection;
/* 0xC8 */ Waiting waitingStruct;
/* 0xD0 */ Linked linked;
/* 0xDC */ MoveStatus moveStatus;
/* 0xE0 */ ItemStatus itemStatus;
/* 0xE4 */ TransformStatus transformStatus;
/* 0xE8 */ EyesightStatus eyesightStatus;
/* 0xA8 */ SleepClassStatus sleepClassStatus;
/* 0xAC */ BurnClassStatus burnClassStatus;
/* 0xB0 */ FrozenClassStatus frozenClassStatus;
/* 0xBC */ CringeClassStatus cringeClassStatus;
/* 0xC0 */ BideClassStatus bideClassStatus;
/* 0xC4 */ ReflectClassStatus reflectClassStatus;
/* 0xC8 */ CurseClassStatus curseClassStatus;
/* 0xD0 */ LeechSeedClassStatus leechSeedClassStatus;
/* 0xDC */ SureShotClassStatus sureShotClassStatus;
/* 0xE0 */ LongTossClassStatus longTossClassStatus;
/* 0xE4 */ InvisibleClassStatus invisibleClassStatus;
/* 0xE8 */ BlinkerClassStatus blinkerClassStatus;
/* 0xEC */ Muzzled muzzled;
/* 0xF0 */ bool8 powerEars;
/* 0xF1 */ bool8 scanning;
@@ -268,7 +288,7 @@ typedef struct EntityInfo
/* 0xFD */ u8 perishSongTurns; // 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 unkFE;
u8 unkFF;
/* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon.
/* 0x100 */ u8 decoyAITracker; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon.
/* 0x104 */ s32 speedStage;
// 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.
@@ -282,7 +302,7 @@ typedef struct EntityInfo
/* 0x118 */ Moves moves;
/* 0x13C */ FixedPoint belly;
/* 0x140 */ FixedPoint maxBelly;
/* 0x144 */ bool8 aiNextToTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them.
/* 0x144 */ bool8 aiAllySkip; // True if an AI Pokémon is following another Pokémon and is already adjacent to them.
/* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved.
/* 0x146 */ u8 unk146;
/* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn.
@@ -316,9 +336,9 @@ typedef struct EntityInfo
/* 0x167 */ u8 unk167;
/* 0x168 */ u8 unk168;
/* 0x169 */ u8 turnsSinceWarpScarfActivation;
/* 0x16C */ Position targetPos;
/* 0x170 */ Position pixelPos;
u32 unk174;
/* 0x16C */ DungeonPos targetPos;
/* 0x170 */ DungeonPos pixelPos;
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.
@@ -336,12 +356,12 @@ typedef struct EntityInfo
typedef struct Entity
{
/* 0x0 */ u32 type;
/* 0x4 */ Position pos;
/* 0x8 */ Position prevPos;
/* 0x4 */ DungeonPos pos;
/* 0x8 */ DungeonPos prevPos;
// The center of the entity acccording to pixel-space coordinates, using the same origin as posWorld.
// X = (posWorld * 24 + 16) * 256, while Y = (posWorld * 24 + 12) * 256.
/* 0xC */ Position32 pixelPos;
/* 0x14 */ Position32 prevPixelPos;
/* 0xC */ PixelPos pixelPos;
/* 0x14 */ PixelPos prevPixelPos;
s32 unk1C;
/* 0x20 */ bool8 isVisible; // Turned off when a Pokémon faints.
u8 fill21;
@@ -409,13 +429,45 @@ enum AIObjective
AI_TAKE_ITEM
};
enum ClientType
enum MonsterBehavior
{
CLIENT_TYPE_NONE,
CLIENT_TYPE_CLIENT, // Used for mission clients that need rescuing.
CLIENT_TYPE_PARTNER,
// 3
CLIENT_TYPE_DONT_MOVE = 4 // Used for Diglett in the Skarmory boss fight.
BEHAVIOR_FIXED_ENEMY,
BEHAVIOR_RESCUE_TARGET, // Used for mission clients that need rescuing.
BEHAVIOR_ALLY,
BEHAVIOR_SKARMORY,
BEHAVIOR_DIGLETT, // Used for Diglett in the Skarmory boss fight.
BEHAVIOR_5, // 5 and 6 are probably Gengar and Ekans, but not sure which is which.
BEHAVIOR_6,
BEHAVIOR_MEDICHAM,
BEHAVIOR_ZAPDOS,
BEHAVIOR_MOLTRES,
BEHAVIOR_ALAKAZAM_1,
BEHAVIOR_GROUDON_1,
BEHAVIOR_ALAKAZAM_2,
BEHAVIOR_ARTICUNO,
BEHAVIOR_GROUDON_2,
BEHAVIOR_RAYQUAZA,
BEHAVIOR_16,
BEHAVIOR_MEWTWO,
BEHAVIOR_ENTEI,
BEHAVIOR_RAIKOU,
BEHAVIOR_SUICUNE,
BEHAVIOR_HO_OH,
BEHAVIOR_LATIOS,
BEHAVIOR_REGIROCK,
BEHAVIOR_REGICE,
BEHAVIOR_REGISTEEL,
BEHAVIOR_JIRACHI,
BEHAVIOR_LUGIA,
BEHAVIOR_KYOGRE,
BEHAVIOR_29,
BEHAVIOR_CELEBI,
BEHAVIOR_SMEARGLE,
BEHAVIOR_32,
BEHAVIOR_33,
BEHAVIOR_34,
BEHAVIOR_35,
BEHAVIOR_36,
};
enum VisualFlag
@@ -450,9 +502,4 @@ static inline void SetExpMultplier(EntityInfo *info)
SetRegularExpMultiplier(info);
}
static inline EntityInfo *GetEntInfo(Entity *ent)
{
return ent->axObj.info;
}
#endif

View File

@@ -72,7 +72,7 @@ typedef struct RoomData
u8 unk0;
u8 unk1;
// All coordinates are inclusive.
// These are not aligned properly to use the Position struct.
// These are not aligned properly to use the DungeonPos struct.
/* 0x2 */ s16 bottomRightCornerX;
/* 0x4 */ s16 bottomRightCornerY;
/* 0x6 */ s16 topLeftCornerX;

View File

@@ -25,11 +25,11 @@ typedef struct MenuInputStruct
s32 unk0;
u16 unk4;
s16 unk6;
Position unk8; // Maybe Position
s16 unkC; // Maybe Position
DungeonPos unk8; // Maybe DungeonPos
s16 unkC; // Maybe DungeonPos
s16 unkE;
u32 unk10;
Position unk14; // Maybe Position
DungeonPos unk14; // Maybe DungeonPos
/* 0x18 */ s16 menuIndex;
s16 unk1A;
s16 unk1C;

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;
@@ -9,7 +10,7 @@ struct DamageStruct
u8 type;
bool8 isCrit;
u8 unkE;
u8 unkF;
};
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;
@@ -74,10 +77,10 @@ typedef struct DungeonMusicPlayer
// Size unknown?
typedef struct UnkDungeonGlobal_unk181E8_sub
{
/* 0x181E8 */ Position cameraPos; // x0
/* 0x181EC */ Position cameraPosMirror; // x4
/* 0x181F0 */ Position cameraPixelPos; // x8
/* 0x181F4 */ Position cameraPixelPosMirror; // xC
/* 0x181E8 */ DungeonPos cameraPos; // x0
/* 0x181EC */ DungeonPos cameraPosMirror; // x4
/* 0x181F0 */ DungeonPos cameraPixelPos; // x8
/* 0x181F4 */ DungeonPos cameraPixelPosMirror; // xC
/* 0x181F8 */ Entity *cameraTarget; // x10
u32 unk181FC; // x14
u32 unk18200; // x18
@@ -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
@@ -170,7 +173,7 @@ struct unkStruct_Dungeon134_sub
u32 unk150;
u32 unk154;
u32 unk158;
u32 unk15C;
s24_8 unk15C;
u8 unk160;
u8 unk161;
u8 unk162;
@@ -199,12 +202,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
@@ -242,6 +246,63 @@ struct MinMaxPosition
s32 maxY;
};
// 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: 0x4
typedef struct unkDungeonE260
{
/* 0x0 */ u16 unk0;
/* 0x2 */ u16 unk2;
} unkDungeonE260;
// size: 0x1CEDC
typedef struct Dungeon
{
@@ -276,58 +337,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];
@@ -339,18 +352,19 @@ typedef struct Dungeon
/* 0x37F4 */ s32 unk37F4;
/* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FC */ bool8 decoyActive;
/* 0x37FD */ u8 unk37FD;
/* 0x37FC */ bool8 decoyIsActive;
/* 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 numItems;
u8 fill3906[0x3A08 - 0x3906];
Trap unk3908[DUNGEON_MAX_TRAPS];
/* 0x3A08 */ bool8 forceMonsterHouse; // Forces the current floor to have monster house
/* 0x3A09 */ u8 unk3A09;
/* 0x3A0A */ u8 unk3A0A;
/* 0x3A0B */ u8 unk3A0B;
/* 0x3A09 */ bool8 unk3A09;
/* 0x3A0A */ bool8 unk3A0A;
/* 0x3A0B */ bool8 unk3A0B;
/* 0x3A0C */ u8 monsterHouseRoom; // room index of monster house
/* 0x3A0D */ u8 unk3A0D;
/* 0x3A0E */ s16 tileset;
@@ -359,12 +373,12 @@ typedef struct Dungeon
/* 0x3A14 */ s16 fixedRoomId;
/* 0x3A16 */ s16 unk3A16;
/* 0x3A18 */ Tile tiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
/* 0xEA18 */ Position playerSpawn;
Position stairsSpawn; // stairs location
Position unkE220[8];
/* 0xEA18 */ DungeonPos playerSpawn;
DungeonPos stairsSpawn; // stairs location
DungeonPos unkE220[8];
struct MinMaxPosition kecleonShopPos;
struct MinMaxPosition unkE250;
Position unkE260;
unkDungeonE260 unkE260;
/* 0xE264 */ Weather weather; // Uses the weather constants in weather.h.
/* 0xE27C */ Tile unkE27C[8][8];
/* 0xE87C */ u8 unkE87C[8][8];
@@ -373,7 +387,7 @@ typedef struct Dungeon
u8 unk104C0;
/* 0x104C4 */ RoomData roomData[MAX_ROOM_COUNT];
/* 0x10844 */ s16 naturalJunctionListCounts[MAX_ROOM_COUNT];
/* 0x10884 */ Position naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room.
/* 0x10884 */ DungeonPos naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room.
u16 unk11884[250][9];
u16 unk12A18[20][9];
u16 unk12B80[9];
@@ -388,13 +402,13 @@ typedef struct Dungeon
u8 fill1356D[0x13570 - 0x1356D];
/* 0x13570 */ u8 unk13570;
u8 fill13571[0x13574 - 0x13571];
/* 0x13574 */ Position trapPos;
/* 0x13574 */ DungeonPos trapPos;
/* 0x13578 */ u8 trapID;
/* 0x13579 */ u8 unk13579;
u8 fill1357A[0x1357C - 0x1357A];
/* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS];
/* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON];
/* 0x135CC */ Entity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon
/* 0x135CC */ Entity *activePokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon
/* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS];
/* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS];
/* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS];

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

@@ -2,17 +2,34 @@
#define GUARD_STR_POSITION_H
// size: 0x4
typedef struct Position
typedef struct DungeonPos
{
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
} Position;
} DungeonPos;
/**
* Precise position expressed in pixel units, as s24_8 fixpoint.
* This type has subpixel precision to 1/256th of a pixel.
*/
// size: 0x8
typedef struct Position32
typedef struct PixelPos
{
/* 0x0 */ s32 x;
/* 0x0 */ s32 x; // TODO: convert to s24_8 across the codebase
/* 0x4 */ s32 y;
} Position32;
} PixelPos;
#endif // GUARD_STR_POSITION_H
/**
* Currently only used in script data, for entities and GroundLink data.
* DungeonPos expressed in terms of *graphics* tiles, 8 pixels per unit.
* Flags allow expressing half-tile offsets and allow using a current/default coordinate.
*/
// size: 0x4
typedef struct CompactPos {
u8 xTiles;
u8 yTiles;
u8 xFlags;
u8 yFlags;
} CompactPos;
#endif // GUARD_STR_POSITION_H

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;