mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-27 11:28:33 -05:00
merge with master
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move);
|
||||
bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move);
|
||||
// checkCharge = Check for the move named Charge.
|
||||
bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ bool8 sub_800E9A8(s32);
|
||||
void sub_800DAC0(u32);
|
||||
void sub_800DB7C(void);
|
||||
void sub_800DBBC(void);
|
||||
void sub_800E90C(Position *);
|
||||
void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be Position
|
||||
void sub_800E90C(DungeonPos *);
|
||||
void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be DungeonPos
|
||||
|
||||
#endif // GUARD_CODE_800DAC0_H
|
||||
|
||||
8
include/code_800F958.h
Normal file
8
include/code_800F958.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef GUARD_CODE_800F958_H
|
||||
#define GUARD_CODE_800F958_H
|
||||
|
||||
#include "structs/str_position.h"
|
||||
|
||||
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32);
|
||||
|
||||
#endif // GUARD_CODE_800F958_H
|
||||
8
include/code_803E724.h
Normal file
8
include/code_803E724.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef GUARD_CODE_803E724_H
|
||||
#define GUARD_CODE_803E724_H
|
||||
|
||||
#include "structs/str_position.h"
|
||||
|
||||
bool8 sub_803F428(DungeonPos *pos);
|
||||
|
||||
#endif // GUARD_CODE_803E724_H
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "structs/str_damage.h"
|
||||
|
||||
void sub_80420E8(Entity *pokemon, struct DamageStruct *dmgStruct);
|
||||
void sub_80420E8(Entity *pokemon, DamageStruct *dmgStruct);
|
||||
void sub_80421C0(Entity *pokemon, u16);
|
||||
|
||||
#endif
|
||||
#endif // GUARD_CODE_8041AD0_H
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef GUARD_CODE_8044CC8_H
|
||||
#define GUARD_CODE_8044CC8_H
|
||||
|
||||
struct unkStruct_202EE44
|
||||
// size: 0x4
|
||||
typedef struct unkStruct_202EE44
|
||||
{
|
||||
u16 unk0;
|
||||
u8 unk2;
|
||||
bool8 unk3;
|
||||
};
|
||||
} unkStruct_202EE44;
|
||||
|
||||
extern struct unkStruct_202EE44 gUnknown_202EE44[10];
|
||||
extern unkStruct_202EE44 gUnknown_202EE44[10];
|
||||
|
||||
#endif // GUARD_CODE_8044CC8_H
|
||||
|
||||
10
include/code_80450F8.h
Normal file
10
include/code_80450F8.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef GUARD_CODE_80227B8_H
|
||||
#define GUARD_CODE_80227B8_H
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
Entity *sub_8045684(u8 trapID, DungeonPos *pos, u8 c);
|
||||
Entity *sub_8045708(DungeonPos *pos);
|
||||
void sub_80457DC(Entity* ent);
|
||||
|
||||
#endif // GUARD_CODE_80227B8_H
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3);
|
||||
void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3);
|
||||
|
||||
#endif // GUARD_CODE_8045A00_H
|
||||
void sub_8045ACC(void);
|
||||
|
||||
#endif // GUARD_CODE_8045A00_H
|
||||
@@ -14,7 +14,7 @@ struct unkStruct_8069D4C_sub
|
||||
struct unkStruct_8069D4C
|
||||
{
|
||||
s16 id;
|
||||
Position pos;
|
||||
DungeonPos pos;
|
||||
s16 HP;
|
||||
struct unkStruct_8069D4C_sub offense;
|
||||
u16 level;
|
||||
|
||||
@@ -35,13 +35,13 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target);
|
||||
void VitalThrowStatusTarget(Entity * pokemon, Entity * target);
|
||||
void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4);
|
||||
void sub_807A0CC(Entity * pokemon, Entity * target);
|
||||
void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4);
|
||||
void SendNonVolatileEndMessage(Entity * pokemon, Entity * target);
|
||||
void SendImmobilizeEndMessage(Entity * pokemon, Entity *target);
|
||||
void SendVolatileEndMessage(Entity * pokemon, Entity *target);
|
||||
void SendProtectionEndMessage(Entity * pokemon, Entity *target);
|
||||
void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus);
|
||||
void SendLinkedEndMessage(Entity * pokemon, Entity * target);
|
||||
void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4);
|
||||
void EndBurnClassStatus(Entity * pokemon, Entity * target);
|
||||
void EndFrozenClassStatus(Entity * pokemon, Entity *target);
|
||||
void EndCringeClassStatus(Entity * pokemon, Entity *target);
|
||||
void EndReflectClassStatus(Entity * pokemon, Entity *target);
|
||||
void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus);
|
||||
void EndLeechSeedClassStatus(Entity * pokemon, Entity * target);
|
||||
void SendMoveEndMessage(Entity * pokemon, Entity * target);
|
||||
void SendTransformEndMessage(Entity * pokemon, Entity *target);
|
||||
void SendEyesightEndMessage(Entity * pokemon,Entity * target);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define CODE_807CD9C_H
|
||||
|
||||
void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction);
|
||||
void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos);
|
||||
void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos);
|
||||
void sub_807D3CC(Entity *param_1);
|
||||
|
||||
#endif /* ifndef CODE_807CD9C_H */
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
#ifndef GUARD_CODE_8092334_H
|
||||
#define GUARD_CODE_8092334_H
|
||||
|
||||
// size: 0x10?
|
||||
typedef struct unkStruct_8094924
|
||||
{
|
||||
u8 *unk0; // head?
|
||||
u8 *unk4; // tail?
|
||||
u32 unk8;
|
||||
u32 unkC;
|
||||
} unkStruct_8094924;
|
||||
#include "data_serializer.h"
|
||||
|
||||
void nullsub_102(unkStruct_8094924 *);
|
||||
void RestoreIntegerBits(unkStruct_8094924 *, void *, s32 size);
|
||||
void SaveIntegerBits(unkStruct_8094924 *, void *, s32 size);
|
||||
void xxx_init_struct_8094924_restore_809485C(unkStruct_8094924 *, u8 *, s32 size);
|
||||
void xxx_init_struct_8094924_save_809486C(unkStruct_8094924 *, u8 *, s32 size);
|
||||
|
||||
void sub_80948E4(unkStruct_8094924 *, u8 *, s32 size);
|
||||
void FinishBitSerializer(DataSerializer *seri);
|
||||
void InitBitReader(DataSerializer *seri, u8 *buffer, s32 bufLen);
|
||||
void InitBitWriter(DataSerializer *seri, u8 *buffer, s32 bufLen);
|
||||
void ReadBits(DataSerializer *seri, void *dst, s32 numBits);
|
||||
void WriteBits(DataSerializer *seri, void *src, s32 numBits);
|
||||
|
||||
#endif // GUARD_CODE_8092334_H
|
||||
@@ -46,7 +46,7 @@ u32 CountAllMail(void);
|
||||
s32 sub_8095374(void);
|
||||
s32 GetMailIndex(u8 mailType, u32);
|
||||
s32 GetFirstIndexofMailType(u8 mailType);
|
||||
void sub_8095824(struct unkStruct_8094924 *a, unkStruct_203B480 *b);
|
||||
void sub_8095774(struct unkStruct_8094924 *a, unkStruct_203B480 *b);
|
||||
void sub_8095824(DataSerializer *a, unkStruct_203B480 *b);
|
||||
void sub_8095774(DataSerializer *a, unkStruct_203B480 *b);
|
||||
|
||||
#endif // GUARD_CODE_8094F88_H
|
||||
@@ -68,7 +68,7 @@ u8 *sub_8096DD8(void);
|
||||
u8 *sub_8096DE8(void);
|
||||
u8 sub_8096E2C(void);
|
||||
void sub_8096EEC(WonderMail *mail);
|
||||
void SaveWonderMail(unkStruct_8094924 *a, WonderMail *b);
|
||||
void RestoreWonderMail(unkStruct_8094924 *a, WonderMail *b);
|
||||
void WriteWonderMailBits(DataSerializer *a, WonderMail *b);
|
||||
void ReadWonderMailBits(DataSerializer *a, WonderMail *b);
|
||||
|
||||
#endif // GUARD_CODE_80958E8_H
|
||||
|
||||
@@ -3,21 +3,59 @@
|
||||
|
||||
#include "structs/str_dungeon.h"
|
||||
|
||||
// See gAdventureLogText
|
||||
enum AdventureAchievement
|
||||
{
|
||||
AA_HILL_OF_ANCIENTS,
|
||||
AA_FUGITIVE,
|
||||
AA_PREVENT_METEOR,
|
||||
AA_BROKE_CURSE,
|
||||
AA_TEAM_BASE_DONE,
|
||||
AA_SMEARGLE,
|
||||
AA_SPOTTED_MUNCHLAX,
|
||||
AA_NUM_MOVES_LEARNED,
|
||||
AA_NUM_FRIEND_RESCUE_SUCCESSES,
|
||||
AA_NUM_POKEMON_EVOLVED,
|
||||
AA_NUM_POKEMON_JOINED,
|
||||
AA_NUM_THIEVING_SUCCESSES,
|
||||
AA_NUM_FLOORS_EXPLORED,
|
||||
AA_ALL_FRIEND_AREAS,
|
||||
AA_ALL_POKEMON_LEADERS,
|
||||
AA_ALL_POKEMON_JOINED,
|
||||
AA_RECRUIT_MOLTRES,
|
||||
AA_RECRUIT_ZAPDOS,
|
||||
AA_RECRUIT_ARTICUNO,
|
||||
AA_RECRUIT_DEOXYS,
|
||||
AA_RECRUIT_ENTEI,
|
||||
AA_RECRUIT_RAIKOU,
|
||||
AA_RECRUIT_SUICUNE,
|
||||
AA_RECRUIT_HO_OH,
|
||||
AA_RECRUIT_KYOGRE,
|
||||
AA_RECRUIT_GROUDON,
|
||||
AA_RECRUIT_RAYQUAZA,
|
||||
AA_RECRUIT_LUGIA,
|
||||
AA_RECRUIT_CELEBI,
|
||||
AA_RECRUIT_MEW,
|
||||
AA_RECRUIT_MEWTWO,
|
||||
AA_RECRUIT_JIRACHI,
|
||||
AA_MAX
|
||||
};
|
||||
|
||||
// size: 0xC4
|
||||
struct unkStruct_203B494
|
||||
{
|
||||
u32 unk0; // 32 bit bitfield, I think
|
||||
/* 0x0 */ u32 achievements; // Adventure achievement flags
|
||||
/* 0x4 */ s32 numAdventures;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
/* 0x8 */ s32 friendRescueSuccesses;
|
||||
/* 0xC */ s32 numEvolved;
|
||||
/* 0x10 */ DungeonLocation dungeonLocation;
|
||||
s16 unk14;
|
||||
s16 unk16;
|
||||
s16 unk18;
|
||||
/* 0x14 */ s16 thievingSuccesses;
|
||||
/* 0x16 */ s16 numJoined;
|
||||
/* 0x18 */ s16 adventureMovesLearned;
|
||||
u32 unk1C[14];
|
||||
u32 unk54[14];
|
||||
u32 unk8C[13];
|
||||
s32 unkC0;
|
||||
/* 0x8C */ u32 learnedMoves[13]; // Get with `learnedMoves[move / 32] & 1 << move % 32` ... Set with `learnedMoves[move / 32] |= 1 << move % 32`
|
||||
/* 0xC0 */ s32 numFloorsExplored;
|
||||
};
|
||||
|
||||
extern struct unkStruct_203B494 *gUnknown_203B494;
|
||||
@@ -29,20 +67,20 @@ void ResetNumAdventures(void);
|
||||
|
||||
void sub_8097670(void);
|
||||
struct unkStruct_203B494 *sub_8097680(void);
|
||||
void sub_80976A8(void);
|
||||
void sub_80976F8(u8);
|
||||
bool8 sub_8097710(u8);
|
||||
void sub_8097790(void);
|
||||
s32 sub_80977B8(void);
|
||||
void sub_80977D0(void);
|
||||
s32 sub_80977F8(void);
|
||||
s16 sub_8097838(void);
|
||||
void sub_8097848(void);
|
||||
s16 sub_8097870(void);
|
||||
s16 sub_8097880(void);
|
||||
s16 sub_80978B8(void);
|
||||
void sub_8097944(void);
|
||||
u32 sub_8097D60(u8 *r0, u32 size);
|
||||
u32 sub_8097D98(u8 *r0, u32 size);
|
||||
void ResetAdventureInfo(void);
|
||||
void SetAdventureAchievement(u8);
|
||||
bool8 GetAdventureAchievement(u8);
|
||||
void IncrementFriendRescueSuccesses(void);
|
||||
s32 GetFriendRescueSuccesses(void);
|
||||
void IncrementNumEvolved(void);
|
||||
s32 GetAdventureNumEvolved(void);
|
||||
s16 GetThievingSuccesses(void);
|
||||
void IncrementAdventureNumJoined(void);
|
||||
s16 GetAdventureNumJoined(void);
|
||||
s16 GetAdventureMovesLearned(void);
|
||||
s16 GetAdventureFloorsExplored(void);
|
||||
void UpdateAdventureAchievements(void);
|
||||
u32 SaveAdventureData(u8 *r0, u32 size);
|
||||
u32 RestoreAdventureData(u8 *r0, u32 size);
|
||||
|
||||
#endif // GUARD_CODE_8097670_H
|
||||
|
||||
@@ -33,6 +33,6 @@ extern const u8* const gCommonKecleonBros[KECLEON_BROS_MODE_COUNT][KECLEON_DLG_M
|
||||
extern const u8* const gCommonWigglytuff[WIGGLYTUFF_SHOP_MODE_COUNT][WIGGLY_DLG_MAX];
|
||||
extern const u8* const gCommonGulpin[GULPIN_SHOP_MODE_DIALOGUE_COUNT][GULPIN_DLG_MAX];
|
||||
extern const u8* const gCommonMakuhita[MAKUHITA_DOJO_MODE_COUNT][MAKUHITA_DLG_MAX];
|
||||
extern const Hints gCommonHints[NUM_HINTS];
|
||||
extern const Hints gCommonHints[HINT_MAX];
|
||||
|
||||
#endif // GUARD_COMMON_STRINGS_H
|
||||
@@ -8,6 +8,14 @@ typedef struct Hints
|
||||
const u8 *body;
|
||||
} Hints;
|
||||
|
||||
#define NUM_HINTS 5
|
||||
enum HintKind
|
||||
{
|
||||
HINT_TOWN_CONTROLS_1,
|
||||
HINT_TOWN_CONTROLS_2,
|
||||
HINT_SAVING,
|
||||
HINT_ADVENTURES_WITH_FRIENDS,
|
||||
HINT_BUILDING_A_TEAM,
|
||||
HINT_MAX
|
||||
};
|
||||
|
||||
#endif // GUARD_COMMON_STRINGS_HINTS_H
|
||||
@@ -24,9 +24,9 @@ enum KangaskhanStorageDialogue
|
||||
KANG_DLG_WITHDRAW_CONFIRMATION,
|
||||
KANG_DLG_YOU_HAVE_NOTHING,
|
||||
KANG_DLG_YOU_ARE_FULL,
|
||||
KANG_DLG_STORAGE_HAS_NOTHING,
|
||||
KANG_DLG_DEPOSIT__INVALID_ITEM,
|
||||
KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM,
|
||||
KANG_DLG_STORAGE_EMPTY,
|
||||
KANG_DLG_DEPOSIT_INVALID_ITEM,
|
||||
KANG_DLG_DEPOSIT_TOO_MANY_OF_ITEM,
|
||||
KANG_DLG_STORAGE_FULL,
|
||||
KANG_DLG_HOW_IT_WORKS,
|
||||
KANG_DLG_MAX
|
||||
|
||||
@@ -418,4 +418,6 @@
|
||||
#define MOVE_MD1_2 0x19B // Unused
|
||||
#define MOVE_PIERCE 0x19C
|
||||
|
||||
#define NUM_MOVE_IDS (MOVE_PIERCE + 1)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,15 +17,14 @@ enum NaturePersonalities
|
||||
LONELY,
|
||||
QUIRKY,
|
||||
MISC,
|
||||
|
||||
};
|
||||
|
||||
#define NUM_PARTNERS 10
|
||||
#define NUM_QUIZ_QUESTIONS 55
|
||||
#define MAX_ASKED_QUESTIONS 8
|
||||
#define NUM_PERSONALITIES MISC
|
||||
#define NUM_PERSONALITY_TEST_EFFECTS (NUM_PERSONALITIES+3)
|
||||
#define NUM_PERSONALITY_TEST_EFFECTS (NUM_PERSONALITIES + 3)
|
||||
|
||||
#define BRAVE_2B_TRIGGER 99
|
||||
|
||||
#endif // GUARD_CONSTANTS_PERSONALITY_TEST_H
|
||||
#endif // GUARD_CONSTANTS_PERSONALITY_TEST_H
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_CONSTANTS_STATUS_H
|
||||
#define GUARD_CONSTANTS_STATUS_H
|
||||
|
||||
// Sleep statuses
|
||||
// Sleep class statuses
|
||||
#define STATUS_NONE 0
|
||||
#define STATUS_SLEEP 1
|
||||
#define STATUS_SLEEPLESS 2
|
||||
@@ -9,13 +9,13 @@
|
||||
#define STATUS_YAWNING 4
|
||||
#define STATUS_NAPPING 5
|
||||
|
||||
// Non-volatile statuses
|
||||
// Burn class statuses
|
||||
#define STATUS_BURN 1
|
||||
#define STATUS_POISONED 2
|
||||
#define STATUS_BADLY_POISONED 3
|
||||
#define STATUS_PARALYSIS 4
|
||||
|
||||
// Immobilize statuses
|
||||
// Frozen class statuses
|
||||
#define STATUS_FROZEN 1
|
||||
#define STATUS_SHADOW_HOLD 2
|
||||
#define STATUS_WRAP 3
|
||||
@@ -24,7 +24,7 @@
|
||||
#define STATUS_PETRIFIED 6
|
||||
#define STATUS_CONSTRICTION 7
|
||||
|
||||
// Volatile statuses
|
||||
// Cringe class statuses
|
||||
#define STATUS_CRINGE 1
|
||||
#define STATUS_CONFUSED 2
|
||||
#define STATUS_PAUSED 3
|
||||
@@ -33,7 +33,7 @@
|
||||
#define STATUS_ENCORE 6
|
||||
#define STATUS_INFATUATED 7
|
||||
|
||||
// Charging statuses
|
||||
// Bide class statuses
|
||||
#define STATUS_BIDE 1
|
||||
#define STATUS_SOLARBEAM 2
|
||||
#define STATUS_SKY_ATTACK 3
|
||||
@@ -47,7 +47,7 @@
|
||||
#define STATUS_CHARGING 11
|
||||
#define STATUS_ENRAGED 12
|
||||
|
||||
// Protection statuses
|
||||
// ReflectClassStatus statuses
|
||||
#define STATUS_REFLECT 1
|
||||
#define STATUS_SAFEGUARD 2
|
||||
#define STATUS_LIGHT_SCREEN 3
|
||||
@@ -63,31 +63,31 @@
|
||||
#define STATUS_VITAL_THROW 13
|
||||
#define STATUS_MIST 14
|
||||
|
||||
// Waiting statuses
|
||||
// Curse class statuses
|
||||
#define STATUS_CURSED 1
|
||||
#define STATUS_DECOY 2
|
||||
#define STATUS_SNATCH 3
|
||||
|
||||
// Linked statuses
|
||||
// Leech Seed class statuses
|
||||
#define STATUS_LEECH_SEED 1
|
||||
#define STATUS_DESTINY_BOND 2
|
||||
|
||||
// Move statuses
|
||||
// Sure Shot class statuses
|
||||
#define STATUS_SURE_SHOT 1
|
||||
#define STATUS_WHIFFER 2
|
||||
#define STATUS_SET_DAMAGE 3
|
||||
#define STATUS_FOCUS_ENERGY 4
|
||||
|
||||
// Item statuses
|
||||
// Long Toss class statuses
|
||||
#define STATUS_LONG_TOSS 1
|
||||
#define STATUS_PIERCE 2
|
||||
|
||||
// Transform statuses
|
||||
// Invisible class statuses
|
||||
#define STATUS_INVISIBLE 1
|
||||
#define STATUS_TRANSFORMED 2
|
||||
#define STATUS_MOBILE 3
|
||||
|
||||
// Eyesight statuses
|
||||
// Blinker class statuses
|
||||
#define STATUS_BLINKER 1
|
||||
#define STATUS_CROSS_EYED 2
|
||||
#define STATUS_EYEDROPS 3
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef GUARD_CONSTANTS_TARGETING_H
|
||||
#define GUARD_CONSTANTS_TARGETING_H
|
||||
|
||||
#define TARGETING_DECOY_NONE 0
|
||||
#define TARGETING_DECOY_TEAM 1
|
||||
#define TARGETING_DECOY_WILD 2
|
||||
#define DECOY_AI_NONE 0
|
||||
#define DECOY_AI_TEAM 1
|
||||
#define DECOY_AI_WILD 2
|
||||
|
||||
#define TREATMENT_TREAT_AS_ALLY 0
|
||||
#define TREATMENT_TREAT_AS_ENEMY 1
|
||||
|
||||
13
include/data_serializer.h
Normal file
13
include/data_serializer.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef GUARD_DATA_SERIALIZER_H
|
||||
#define GUARD_DATA_SERIALIZER_H
|
||||
|
||||
// size: 0x10
|
||||
typedef struct DataSerializer
|
||||
{
|
||||
u8 *stream;
|
||||
u8 *end; // Exclusive end of the stream
|
||||
u32 count; // Used to count bits between ReadBits functions, or count bytes between ReadBytes functions
|
||||
u32 unkC; // Seems to be a temporary 32 bit storage
|
||||
} DataSerializer;
|
||||
|
||||
#endif // GUARD_DATA_SERIALIZER_H
|
||||
@@ -13,7 +13,7 @@ struct AIPossibleMove
|
||||
s32 weight;
|
||||
};
|
||||
|
||||
void DecideAttack(Entity *pokemon);
|
||||
void ChooseAIMove(Entity *pokemon);
|
||||
s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move);
|
||||
bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range);
|
||||
s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
void AIDecideUseItem(Entity *pokemon);
|
||||
void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item *item, bool8 ignoreRollChance);
|
||||
void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potentialTargets[], bool8 ignoreRollChance);
|
||||
void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, DungeonPos potentialTargets[], bool8 ignoreRollChance);
|
||||
void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 targetingFlags, bool8 ignoreRollChance);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect);
|
||||
void AIMovement(Entity *pokemon, bool8 showRunAwayEffect);
|
||||
bool8 CanTakeItem(Entity *pokemon);
|
||||
bool8 ChooseTargetPosition(Entity *pokemon);
|
||||
void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect);
|
||||
|
||||
@@ -114,9 +114,9 @@ void sub_808AC3C(void);
|
||||
void sub_808ACC0(void);
|
||||
void sub_808AD48(void);
|
||||
void sub_808ADCC(void);
|
||||
void sub_808AE54(u8, u8, Position *pos);
|
||||
void sub_808AEC8(u8, u8, Position *pos);
|
||||
void sub_808AF3C(u8, u8, Position *pos);
|
||||
void sub_808AE54(u8, u8, DungeonPos *pos);
|
||||
void sub_808AEC8(u8, u8, DungeonPos *pos);
|
||||
void sub_808AF3C(u8, u8, DungeonPos *pos);
|
||||
void sub_808AFB0(u8);
|
||||
void sub_808B030(u8);
|
||||
void sub_808B0B0(u8);
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
|
||||
#include "structs/map.h"
|
||||
|
||||
typedef struct unkStruct_202F190
|
||||
{
|
||||
Tile *unk0[6];
|
||||
} unkStruct_202F190;
|
||||
const Tile *GetTile(s32 x, s32 y);
|
||||
Tile *GetTileMut(s32 x, s32 y);
|
||||
|
||||
Tile *GetTile(s32 x, s32 y);
|
||||
Tile *GetTileSafe(s32 x, s32 y);
|
||||
void sub_804AC20(Position *pos);
|
||||
void sub_8049ED4(void);
|
||||
void sub_804AC20(DungeonPos *pos);
|
||||
|
||||
#endif
|
||||
#endif // GUARD_DUNGEON_MAP_ACCESS_H
|
||||
|
||||
@@ -24,11 +24,11 @@ void sub_80521D0(void);
|
||||
void sub_8052210(bool8 a0);
|
||||
|
||||
// These functions display the string if certain conditions are met. The conditions differ depending on the function. The string is then saved to the message log.
|
||||
void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str);
|
||||
void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str);
|
||||
void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str);
|
||||
void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str);
|
||||
void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str);
|
||||
void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 *str);
|
||||
void TryDisplayDungeonLoggableMessage5(Entity *pokemon, DungeonPos *pos, const u8 *str);
|
||||
|
||||
// As opposed to the above - these always display the string and save it in the message log. False/True stand for an unknown argument. Not sure what the practical difference is between these.
|
||||
void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str);
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
extern u8 gWalkableTileToCrossableTerrain[8];
|
||||
|
||||
u8 GetCrossableTerrain(s16 species);
|
||||
u8 sub_807034C(s16 id, struct Tile *tile);
|
||||
u8 sub_80703A0(Entity *pokemon, Position *pos);
|
||||
u8 sub_807034C(s16 id, const Tile *tile);
|
||||
u8 sub_80703A0(Entity *pokemon, DungeonPos *pos);
|
||||
bool8 CanCrossWalls(Entity *pokemon);
|
||||
bool8 sub_807049C(Entity *pokemon, Position *pos);
|
||||
bool8 sub_8070564(Entity *pokemon, Position *pos);
|
||||
bool8 sub_80705F0(Entity *pokemon, Position *pos);
|
||||
bool8 sub_80706A4(Entity *pokemon, Position *pos);
|
||||
bool8 sub_807049C(Entity *pokemon, DungeonPos *pos);
|
||||
bool8 sub_8070564(Entity *pokemon, DungeonPos *pos);
|
||||
bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos);
|
||||
bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos);
|
||||
s32 CalcSpeedStage(Entity *pokemon);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,8 +20,8 @@ typedef struct DungeonPokemonSprite
|
||||
/* 0xC */ u32 status;
|
||||
/* 0x10 */ u8 visible;
|
||||
/* 0x11 */ u8 unk11;
|
||||
/* 0x14 */ Position pos;
|
||||
/* 0x18 */ Position statusOffsets[2];
|
||||
/* 0x14 */ DungeonPos pos;
|
||||
/* 0x18 */ DungeonPos statusOffsets[2];
|
||||
/* 0x20 */ u32 unk20;
|
||||
/* 0x24 */ u32 unk24;
|
||||
/* 0x28 */ DungeonPokemonStatusSprite statusSprites[2];
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include "structs/str_position.h"
|
||||
|
||||
bool8 IsPositionActuallyInSight(Position *pos1, Position *pos2);
|
||||
bool8 IsPositionInSight(Position *pos1, Position *pos2);
|
||||
bool8 IsTargetTwoTilesAway(Position *pos1, Position *pos2);
|
||||
bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2);
|
||||
bool8 IsPositionInSight(DungeonPos *pos1, DungeonPos *pos2);
|
||||
bool8 IsTargetTwoTilesAway(DungeonPos *pos1, DungeonPos *pos2);
|
||||
|
||||
#endif
|
||||
|
||||
11
include/dungeon_serializer.h
Normal file
11
include/dungeon_serializer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef GUARD_DUNGEON_SERIALIZER_H
|
||||
#define GUARD_DUNGEON_SERIALIZER_H
|
||||
|
||||
#include "data_serializer.h"
|
||||
|
||||
void ReadDungeonState(u8 *buffer, u32 bufLen);
|
||||
void SaveDungeonState(u8 *buffer, u32 bufLen);
|
||||
|
||||
void sub_8082B40(void);
|
||||
|
||||
#endif // GUARD_DUNGEON_SERIALIZER_H
|
||||
@@ -5,19 +5,25 @@
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "structs/str_position.h"
|
||||
#include "structs/str_traps.h"
|
||||
#include "structs/map.h"
|
||||
|
||||
extern const Position gAdjacentTileOffsets[NUM_DIRECTIONS];
|
||||
extern const DungeonPos gAdjacentTileOffsets[NUM_DIRECTIONS];
|
||||
|
||||
bool8 EntityExists(Entity *pokemon);
|
||||
u32 GetEntityType(Entity *entity);
|
||||
u8 GetEntityRoom(Entity *entity);
|
||||
Trap *GetTrapData(Entity *entity);
|
||||
Trap* GetTrapData_1(Entity *entity);
|
||||
Item *GetItemData(Entity *entity);
|
||||
struct Tile *GetTileAtEntitySafe(Entity *entity);
|
||||
Item *GetItemData_1(Entity *entity);
|
||||
void sub_804535C(Entity *entity, Position32 *pos);
|
||||
Tile *GetTileAtEntitySafe(Entity *entity);
|
||||
void sub_804535C(Entity *entity, PixelPos *pos);
|
||||
void SetEntityPixelPos(Entity *entity, s32 x, s32 y);
|
||||
void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y);
|
||||
|
||||
#endif
|
||||
static inline EntityInfo *GetEntInfo(Entity *entity)
|
||||
{
|
||||
return entity->axObj.info.monster;
|
||||
}
|
||||
Item *GetItemData(Entity *entity);
|
||||
Item *GetItemData_1(Entity *entity);
|
||||
Trap *GetTrapData(Entity *entity);
|
||||
Trap* GetTrapData_1(Entity *entity);
|
||||
|
||||
#endif // GUARD_DUNGEON_UTIL_H
|
||||
|
||||
@@ -16,17 +16,17 @@ Entity *GetPartnerEntity(void);
|
||||
void sub_80854D4(void);
|
||||
void sub_80855E4(DungeonCallback func);
|
||||
void sub_808563C(DungeonCallback func);
|
||||
Entity *GetEntityFromClientType(u8 entityType);
|
||||
Entity *GetEntityFromMonsterBehavior(u8 entityType);
|
||||
void sub_80856C8(Entity * pokemon, s32 x, s32 y);
|
||||
void sub_80856E0(Entity * pokemon, s32 direction);
|
||||
void sub_8085764(void);
|
||||
void sub_8085860(s32 x, s32 y);
|
||||
void sub_8085890(s32 x, s32 y);
|
||||
void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps);
|
||||
void ShiftCameraToPosition(PixelPos *posStruct, s32 cameraSteps);
|
||||
void SetFacingDirection(Entity *pokemon, s32 direction);
|
||||
void sub_8085930(s32 direction);
|
||||
void sub_80859F0(s32 direction);
|
||||
bool8 IsMovingClient(Entity *entity);
|
||||
bool8 ShouldRunMonsterAI(Entity *entity);
|
||||
void sub_8085B0C(Entity *pokemon);
|
||||
void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3);
|
||||
void sub_80857B8(void);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
bool8 CanSeeTarget(Entity *entity, Entity *targetEntity);
|
||||
bool8 CanTargetEntity(Entity *entity, Entity *targetEntity);
|
||||
bool8 sub_8045A70(Entity *entity, Entity *targetEntity);
|
||||
bool8 sub_8045AAC(Entity *entity, Position *pos);
|
||||
bool8 CanTargetPosition(Entity *entity, Position *pos);
|
||||
bool8 sub_8045AAC(Entity *entity, DungeonPos *pos);
|
||||
bool8 CanTargetPosition(Entity *entity, DungeonPos *pos);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ void SetTutorialFlag(s32 param_1);
|
||||
bool32 GetTutorialFlag(s32 param_1);
|
||||
bool8 IsExclusivePokemonUnlocked(s16 pokeID);
|
||||
void UnlockExclusivePokemon(s16 pokeID);
|
||||
void WriteExclusivePokemon(struct unkStruct_8094924 *r0);
|
||||
void ReadExclusivePokemon(struct unkStruct_8094924 *r0);
|
||||
void WriteExclusivePokemon(DataSerializer *r0);
|
||||
void ReadExclusivePokemon(DataSerializer *r0);
|
||||
|
||||
#endif // GUARD_EXCLUSIVE_POKEMON_H
|
||||
|
||||
@@ -57,8 +57,8 @@ typedef struct ScriptData
|
||||
/* 0x2C */ u16 unk2C;
|
||||
// padding
|
||||
/* 0x30 */ s32 unk30;
|
||||
/* 0x34 */ Position32 pos1;
|
||||
/* 0x3C */ Position32 pos2;
|
||||
/* 0x34 */ PixelPos pos1;
|
||||
/* 0x3C */ PixelPos pos2;
|
||||
/* 0x44 */ u8 unk44[4];
|
||||
/* 0x48 */ s32 unk48;
|
||||
/* 0x4C */ u8 unk4C;
|
||||
@@ -78,14 +78,14 @@ typedef struct CallbackData
|
||||
// padding
|
||||
// All callbacks take the parentObject as first parameter
|
||||
/* 0x04 */ s16 (*getIndex)(void*); // id related
|
||||
/* 0x08 */ void (*getSize)(void*, Position32 *out);
|
||||
/* 0x0C */ void (*getHitboxCenter)(void*, Position32 *out);
|
||||
/* 0x08 */ void (*getSize)(void*, PixelPos *out);
|
||||
/* 0x0C */ void (*getHitboxCenter)(void*, PixelPos *out);
|
||||
/* 0x10 */ void (*getPosHeightAndUnk)(void*, u32 *height, u32 *unk);
|
||||
/* 0x14 */ void (*getDirection)(void*, s8 *dir);
|
||||
/* 0x18 */ void (*getFlags)(void*, u32 *flags);
|
||||
/* 0x1C */ void (*setHitboxPos)(void*, Position32 *posOrNull);
|
||||
/* 0x20 */ void (*setPositionBounds)(void*, Position32 *from, Position32 *to);
|
||||
/* 0x24 */ bool8 (*moveReal)(void*, Position32*);
|
||||
/* 0x1C */ void (*setHitboxPos)(void*, PixelPos *posOrNull);
|
||||
/* 0x20 */ void (*setPositionBounds)(void*, PixelPos *from, PixelPos *to);
|
||||
/* 0x24 */ bool8 (*moveReal)(void*, PixelPos*);
|
||||
/* 0x28 */ void (*setPosHeight)(void*, u32 height);
|
||||
/* 0x2C */ void (*setDirection)(void*, s8 dir); // direction must be signed char!
|
||||
/* 0x30 */ void (*setEventIndex)(void*, u16);
|
||||
@@ -94,7 +94,7 @@ typedef struct CallbackData
|
||||
/* 0x3C */ void (*setFlags)(void*, u32 bits);
|
||||
/* 0x40 */ void (*clearFlags)(void*, u32 bits);
|
||||
/* 0x44 */ void (*func44_livesOnlySpriteRelated)(void*, u32);
|
||||
/* 0x48 */ void (*moveRelative)(void*, Position32*);
|
||||
/* 0x48 */ void (*moveRelative)(void*, PixelPos*);
|
||||
/* 0x4C */ bool8 (*func4C_spriteRelatedCheck)(void*);
|
||||
/* 0x50 */ bool8 (*func50_spriteRelated)(void*);
|
||||
} CallbackData;
|
||||
@@ -135,14 +135,8 @@ typedef struct ScriptRef
|
||||
|
||||
extern const ScriptRef gFunctionScriptTable[];
|
||||
|
||||
struct CompactPos {
|
||||
u8 xTiles;
|
||||
u8 yTiles;
|
||||
u8 xFlags;
|
||||
u8 yFlags;
|
||||
};
|
||||
struct GroundLink {
|
||||
struct CompactPos pos;
|
||||
CompactPos pos;
|
||||
u8 width;
|
||||
u8 height;
|
||||
u8 ret;
|
||||
@@ -153,7 +147,7 @@ typedef struct GroundLivesData {
|
||||
u8 unk1;
|
||||
u8 width;
|
||||
u8 height;
|
||||
struct CompactPos pos;
|
||||
CompactPos pos;
|
||||
const ScriptCommand *scripts[4];
|
||||
} GroundLivesData;
|
||||
typedef struct GroundObjectData {
|
||||
@@ -161,7 +155,7 @@ typedef struct GroundObjectData {
|
||||
u8 unk1;
|
||||
u8 width;
|
||||
u8 height;
|
||||
struct CompactPos pos;
|
||||
CompactPos pos;
|
||||
const ScriptCommand *scripts[4];
|
||||
} GroundObjectData;
|
||||
typedef struct GroundEffectData {
|
||||
@@ -169,7 +163,7 @@ typedef struct GroundEffectData {
|
||||
u8 unk1;
|
||||
u8 width;
|
||||
u8 height;
|
||||
struct CompactPos pos;
|
||||
CompactPos pos;
|
||||
const ScriptCommand *script;
|
||||
} GroundEffectData;
|
||||
typedef struct GroundEventData {
|
||||
@@ -177,7 +171,7 @@ typedef struct GroundEventData {
|
||||
u8 unk1;
|
||||
u8 width;
|
||||
u8 height;
|
||||
struct CompactPos pos;
|
||||
CompactPos pos;
|
||||
const ScriptRef *script;
|
||||
} GroundEventData;
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@ bool8 IsInvalidItemReward(u8 itemID);
|
||||
bool8 HasGummiItem(void);
|
||||
void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi);
|
||||
|
||||
void RestoreHeldItem(unkStruct_8094924 *, BulkItem *);
|
||||
void SaveHeldItem(unkStruct_8094924 *, BulkItem *);
|
||||
void RestoreItemSlot(unkStruct_8094924 *, Item *);
|
||||
void SaveItemSlot(unkStruct_8094924 *, Item *);
|
||||
void ReadHeldItemBits(DataSerializer *, BulkItem *);
|
||||
void WriteHeldItemBits(DataSerializer *, BulkItem *);
|
||||
void ReadItemSlotBits(DataSerializer *, Item *);
|
||||
void WriteItemSlotBits(DataSerializer *, Item *);
|
||||
s32 RestoreTeamInventory(u8 *, u32 size);
|
||||
s32 SaveTeamInventory(u8 *, u32 size);
|
||||
|
||||
|
||||
128
include/math.h
128
include/math.h
@@ -2,33 +2,19 @@
|
||||
#define GUARD_MATH_H
|
||||
|
||||
#include "gba/types.h"
|
||||
#include "number_util.h"
|
||||
|
||||
/**
|
||||
* This type represents a signed 24.8 fixed-point number, where the 24 most
|
||||
* significant bits are the integer part and the 8 least significant bits are
|
||||
* the fractional part.
|
||||
*/
|
||||
typedef s32 s24_8;
|
||||
|
||||
/**
|
||||
* This type represents an unsigned 24.8 fixed-point number, where the 24 most
|
||||
* significant bits are the integer part and the 8 least significant bits are
|
||||
* the fractional part.
|
||||
*/
|
||||
typedef u32 u24_8;
|
||||
|
||||
/**
|
||||
* This function computes a value modulo 3, using a lookup table for values less
|
||||
* than 0x100.
|
||||
* This function computes the cosine of of `x` using a lookup table. The period of
|
||||
* the function is `4096`, and the range is `[-256, 256]`.
|
||||
*
|
||||
* @warning This function performs an invalid memory access if x < 0.
|
||||
* Hopefully it's never actually used.
|
||||
* @note Mathematically, `cos(abs(t)) = cos(t)`, unlike the case in `sin_4096()` above.
|
||||
*
|
||||
* @param[in] x The value to get modulo 3. Must be non-negative.
|
||||
* @param[in] x The value to get the cosine of.
|
||||
*
|
||||
* @return The value of x modulo 3.
|
||||
* @return `floor(256 * cos(pi * x / 2048))` as a signed 32-bit integer.
|
||||
*/
|
||||
u32 fast_mod_3(s32 x);
|
||||
s32 cos_4096(s32 x);
|
||||
|
||||
/**
|
||||
* This function computes the sine of the absolute value of `x` using a lookup
|
||||
@@ -38,36 +24,7 @@ u32 fast_mod_3(s32 x);
|
||||
*
|
||||
* @return `floor(256 * sin(pi * abs(x) / 2048))` as a signed 32-bit integer.
|
||||
*/
|
||||
s32 sin_abs_4096(s32 x);
|
||||
|
||||
/**
|
||||
* This function computes the cosine of of `x` using a lookup table. The period of
|
||||
* the function is `4096`, and the range is `[-256, 256]`.
|
||||
*
|
||||
* @note Mathematically, `cos(abs(t)) = cos(t)`, unlike the case in `sin_abs_4096()` above.
|
||||
*
|
||||
* @param[in] x The value to get the cosine of.
|
||||
*
|
||||
* @return `floor(256 * cos(pi * x / 2048))` as a signed 32-bit integer.
|
||||
*/
|
||||
s32 cos_4096(s32 x);
|
||||
|
||||
/**
|
||||
* This function lexicographically compares two pairs of u32s.
|
||||
*
|
||||
* @note The call signature of this might change if it makes sense to pack the
|
||||
* inputs into a struct representing, say, a 64-bit unsigned integer. Doing
|
||||
* so does affect the generated assembly; the current approach is the simplest
|
||||
* match.
|
||||
*
|
||||
* @param[in] x_hi The high 32 bits of the first pair.
|
||||
* @param[in] x_lo The low 32 bits of the first pair.
|
||||
* @param[in] y_hi The high 32 bits of the second pair.
|
||||
* @param[in] y_lo The low 32 bits of the second pair.
|
||||
*
|
||||
* @return `TRUE` if `x < y`, `FALSE` otherwise.
|
||||
*/
|
||||
bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo);
|
||||
s32 sin_4096(s32 x);
|
||||
|
||||
/**
|
||||
* This function multiplies two signed 24.8 fixed-point numbers.
|
||||
@@ -79,35 +36,50 @@ bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo);
|
||||
*/
|
||||
s24_8 s24_8_mul(s24_8 x, s24_8 y);
|
||||
|
||||
/**
|
||||
* This function divides two signed 24.8 fixed-point numbers.
|
||||
*
|
||||
* @param[in] x The dividend.
|
||||
* @param[in] y The divisor.
|
||||
*
|
||||
* @returns The quotient `x/y` as a signed 24.8 fixed-point number.
|
||||
*/
|
||||
s32 s24_8_div(s32 x, s32 y);
|
||||
bool8 F48_16_IsZero(s48_16 *a);
|
||||
void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b);
|
||||
void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b);
|
||||
|
||||
/**
|
||||
* This function multiplies two unsigned 24.8 fixed-point numbers.
|
||||
*
|
||||
* @param[in] x The first factor.
|
||||
* @param[in] y The second factor.
|
||||
*
|
||||
* @return The product `x*y` as an unsigned 24.8 fixed-point number.
|
||||
*/
|
||||
u24_8 u24_8_mul(u24_8 x, u24_8 y);
|
||||
s24_8 FP24_8_Hypot(s24_8 x, s24_8 y);
|
||||
void FP48_16_FromS32(s48_16 *dst, s32 src);
|
||||
u32 FP48_16_ToS32(s48_16 *a);
|
||||
void FP48_16_FromF248(s48_16 *a, s24_8 b);
|
||||
bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b);
|
||||
void FP48_16_Add(s48_16 *dst, s48_16 *a, s48_16 *b);
|
||||
void FP48_16_Subtract(s48_16 *dst, s48_16 *a, s48_16 *b);
|
||||
|
||||
/**
|
||||
* This function divides two unsigned 24.8 fixed-point numbers.
|
||||
*
|
||||
* @param[in] x The first factor.
|
||||
* @param[in] y The second factor.
|
||||
*
|
||||
* @return The quotient `x/y` as an unsigned 24.8 fixed-point number.
|
||||
*/
|
||||
u24_8 u24_8_div(u24_8 x, u24_8 y);
|
||||
//static inline bool8 F248Equal(s24_8 x, s24_8 y) {
|
||||
// return x.raw == y.raw;
|
||||
//}
|
||||
|
||||
#define F248LessThanInt(x, y) (x.raw < 0x100 * y)
|
||||
#define F248LessThanFloat(x, y) (x.raw < (int)(y * 0x100))
|
||||
#define FloatLessThanF248(x, y) ((int)(x * 0x100) < y.raw)
|
||||
//static inline bool8 F248LessThanOne(s24_8 x) {
|
||||
// return x.raw < 0x100;
|
||||
//}
|
||||
#define F248LessThan(x, y) (x.raw < y.raw)
|
||||
#define F248GreaterThan(x, y) (x.raw > y.raw)
|
||||
#define F248Equal(x, y) (x.raw == y.raw)
|
||||
#define F248EqualsInt(x, y) (x.raw == 0x100 * y)
|
||||
|
||||
//static inline bool8 F248LessThan(s24_8 x, s24_8 y) {
|
||||
// return x.raw < y.raw;
|
||||
//}
|
||||
|
||||
#define F248_AddInt(x, y) ((s24_8){x.raw + 0x100 * y})
|
||||
#define F248_SubInt(x, y) ((s24_8){x.raw - 0x100 * y})
|
||||
|
||||
static inline s24_8 F248_Add(s24_8 x, s24_8 y) {
|
||||
return (s24_8){x.raw + y.raw};
|
||||
}
|
||||
|
||||
static inline s24_8 F248_Sub(s24_8 x, s24_8 y) {
|
||||
return (s24_8){x.raw - y.raw};
|
||||
}
|
||||
|
||||
static inline s24_8 F248_MulInt(s24_8 x, s32 y) {
|
||||
return (s24_8){x.raw * y};
|
||||
}
|
||||
|
||||
#endif // GUARD_MATH_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns);
|
||||
u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns);
|
||||
void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage);
|
||||
bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage);
|
||||
void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
u32 sub_8057144(Entity * pokemon);
|
||||
bool8 sub_80571F0(Entity * pokemon, Move *move);
|
||||
bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance);
|
||||
bool8 sub_8057308(Entity *pokemon, s32 chance);
|
||||
bool8 RollSecondaryEffect(Entity *pokemon, s32 chance);
|
||||
bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker);
|
||||
bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker);
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ void LoadWazaParameters(void);
|
||||
bool8 MoveCannotHitFrozen(Move *move);
|
||||
bool8 MoveIgnoresTaunted(Move *move);
|
||||
void RemoveLinkSequenceFromMoves8(Move *moves, s32 index);
|
||||
void RestorePokemonMoves(struct unkStruct_8094924 *, Move *moveSet);
|
||||
void SavePokemonMoves(struct unkStruct_8094924 *, Move *moveSet);
|
||||
void ReadPoke1MovesBits(DataSerializer *, Move *moveSet);
|
||||
void WritePoke1MovesBits(DataSerializer *, Move *moveSet);
|
||||
bool8 ToggleMoveEnabled(s32 index, Move *moves);
|
||||
bool8 ToggleSetMove(s32 index, Move *moves);
|
||||
bool8 TryLinkMovesAfter(s32 index, Move *moves);
|
||||
@@ -86,8 +86,8 @@ bool8 sub_8093318(s32, Move *moves);
|
||||
bool8 sub_809333C(s32, Move *moves);
|
||||
s32 sub_80935B8(Move *moves, s32 index);
|
||||
void sub_8094060(Move *srcMoves, Move *destMoves);
|
||||
void sub_8094184(struct unkStruct_8094924 *, struct Moves *);
|
||||
void sub_80941FC(struct unkStruct_8094924 *, struct Moves *);
|
||||
void WritePoke2MovesBits(DataSerializer *, struct Moves *);
|
||||
void ReadPoke2MovesBits(DataSerializer *, struct Moves *);
|
||||
|
||||
static inline bool8 MoveFlagExists(Move *move)
|
||||
{
|
||||
|
||||
@@ -1,17 +1,44 @@
|
||||
#ifndef GUARD_NUMBER_UTIL_H
|
||||
#define GUARD_NUMBER_UTIL_H
|
||||
|
||||
/**
|
||||
* This type represents a decimal, signed fixed-point number, where the first
|
||||
* 16-bit field is the integer part and the second 16-bit field is the fraction,
|
||||
* expressed in thousandths.
|
||||
*/
|
||||
typedef struct FixedPoint
|
||||
{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
} FixedPoint;
|
||||
|
||||
struct unkStruct_80943A8
|
||||
/**
|
||||
* This type represents a signed 24.8 fixed-point number, where the 24 most
|
||||
* significant bits are the integer part and the 8 least significant bits are
|
||||
* the fractional part.
|
||||
*/
|
||||
typedef struct s24_8 {
|
||||
// It's almost certainly not an actual struct, but keep it as one until we decomp all structures that include it
|
||||
s32 raw;
|
||||
} s24_8;
|
||||
|
||||
#define F248_ZERO ((s24_8){})
|
||||
#define F248_ONE ((s24_8){0x100})
|
||||
#define F248_MAX ((s24_8){0x7FFFFFFF})
|
||||
|
||||
/**
|
||||
* This type represents a signed 48.16 fixed-point number, where the 48 most
|
||||
* significant bits are the integer part and the 16 least significant bits are
|
||||
* the fractional part.
|
||||
*/
|
||||
typedef struct s48_16
|
||||
{
|
||||
s32 s0;
|
||||
s32 s4;
|
||||
} unkStruct_80943A8;
|
||||
s32 hi;
|
||||
u32 lo; // some math.c funcs require this to be a u32, but other funcs check if it's negative (aka >= INT32_MAX)
|
||||
} s48_16;
|
||||
#define F4816_ZERO ((s48_16){})
|
||||
#define F4816_ONE ((s48_16){0, 0x10000})
|
||||
#define F4816_MAX ((s48_16){0x7FFFFFFF, 0xFFFFFFFF})
|
||||
|
||||
FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b);
|
||||
FixedPoint FixedPoint_Subtract(FixedPoint a, FixedPoint b);
|
||||
@@ -19,8 +46,23 @@ FixedPoint FixedPoint_Min(FixedPoint a, FixedPoint b);
|
||||
FixedPoint FixedPoint_Max(FixedPoint a, FixedPoint b);
|
||||
FixedPoint sub_8094370(FixedPoint param_1, FixedPoint param_2);
|
||||
FixedPoint IntToFixedPoint(s32 a);
|
||||
FixedPoint FixedPoint_SetFromUnk(struct unkStruct_80943A8* param_1);
|
||||
FixedPoint FixedPoint_SetFromUnk(s48_16* param_1);
|
||||
FixedPoint FixedPoint_Div(FixedPoint a, FixedPoint b);
|
||||
s32 FixedPointToInt(FixedPoint a); // Always rounded up
|
||||
|
||||
#define IntToF248_2(x) ((s24_8){x * 0x100})
|
||||
#define FloatToF248_2(x) ((s24_8){(int)(x * 0x100)})
|
||||
static inline s24_8 IntToF248(s32 x) {
|
||||
return (s24_8){x * 256};
|
||||
}
|
||||
|
||||
static inline s24_8 FloatToF248(float x) {
|
||||
return (s24_8){(int)(x * 256)};
|
||||
}
|
||||
|
||||
static inline s32 F248ToInt(s24_8 x) {
|
||||
return x.raw / 256;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
enum PokemonUnk0Flags
|
||||
{
|
||||
FLAG_ON_TEAM = 2,
|
||||
FLAG_NONE = 0,
|
||||
FLAG_UNK_1 = 1,
|
||||
FLAG_ON_TEAM = 2, // Mon is not on "standby"
|
||||
};
|
||||
|
||||
// size: 0x1A4
|
||||
@@ -34,12 +36,12 @@ void LoadMonsterParameters(void);
|
||||
unkStruct_203B45C *GetRecruitedPokemon(void);
|
||||
void InitializeRecruitedPokemon(void);
|
||||
|
||||
// These two need to be overridden in status_actions.c
|
||||
// This needs to be overridden in status_actions.c
|
||||
// Uncomment when fixed
|
||||
//u8 GetBodySize(s16 index);
|
||||
|
||||
|
||||
void CopyMonsterNametoBuffer(u8 * buffer, s16 index);
|
||||
void CopyMonsterNameToBuffer(u8 * buffer, s16 index);
|
||||
void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index);
|
||||
void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum);
|
||||
void sub_808D930(u8 *buffer, s32 index);
|
||||
@@ -56,7 +58,7 @@ char * GetMonSpecies(s16 index);
|
||||
s32 GetMovementSpeed(s16 index);
|
||||
u8 GetMovementType(s16 index);
|
||||
u8 GetRegenSpeed(s16 index);
|
||||
bool8 CanMove(s16 index);
|
||||
bool8 GetCanMoveFlag(s16 index);
|
||||
u8 GetChanceAsleep(s16 index);
|
||||
u32 GetWeight(s16 index);
|
||||
u32 GetSize(s16 index);
|
||||
@@ -83,8 +85,8 @@ s32 GetUnownIndex(s16 index);
|
||||
void GenerateHiddenPower(HiddenPower *);
|
||||
s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *);
|
||||
void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32);
|
||||
void SavePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *pokemon);
|
||||
void RestorePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *);
|
||||
void WritePoke1Bits(DataSerializer *, PokemonStruct1 *pokemon);
|
||||
void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *);
|
||||
s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon);
|
||||
void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID);
|
||||
void sub_808D0D8(PokemonStruct1 *pokemon);
|
||||
@@ -100,12 +102,12 @@ extern s32 sub_808D580(s32 *);
|
||||
|
||||
static inline bool8 PokemonFlag1(PokemonStruct1 *mon)
|
||||
{
|
||||
return ((mon->unk0 & 1));
|
||||
return (mon->unk0 >> (FLAG_UNK_1 - 1)) & 1;
|
||||
}
|
||||
|
||||
static inline bool8 PokemonFlag2(PokemonStruct1 *mon)
|
||||
{
|
||||
return (((mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1));
|
||||
return (mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1;
|
||||
}
|
||||
|
||||
static inline void SetPokemonFlag2(PokemonStruct1 *mon)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "structs/str_position.h"
|
||||
|
||||
s32 GetDirectionTowardsPosition(Position *originPos, Position *targetPos);
|
||||
s32 GetDistance(Position *pos1, Position *pos2);
|
||||
s32 GetDirectionTowardsPosition(DungeonPos *originPos, DungeonPos *targetPos);
|
||||
s32 GetDistance(DungeonPos *pos1, DungeonPos *pos2);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@ void BlinkSavingIcon(void);
|
||||
void CopySpritesToOam(void);
|
||||
void InitSprites(void);
|
||||
void ResetSprites(bool8);
|
||||
void SetSavingIconCoords(Position *);
|
||||
void SetSavingIconCoords(DungeonPos *);
|
||||
void sub_8004E8C(unkStruct_2039DB0 *);
|
||||
void sub_8005180(void);
|
||||
void sub_8005304(void);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define GUARD_STATUS_H
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "number_util.h"
|
||||
|
||||
#define FLASH_FIRE_STATUS_NONE 0
|
||||
#define FLASH_FIRE_STATUS_MAXED 1
|
||||
@@ -9,8 +10,8 @@
|
||||
|
||||
u8 GetFlashFireStatus(Entity *pokemon);
|
||||
void UpdateFlashFireBoost(Entity * pokemon, Entity *target);
|
||||
void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage);
|
||||
void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage);
|
||||
void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage);
|
||||
void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage);
|
||||
void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage);
|
||||
void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, bool8 displayMessage);
|
||||
void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage);
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
extern const s16 gConfusedAttackChance;
|
||||
|
||||
bool8 HasStatusAffectingActions(Entity *pokemon);
|
||||
bool8 HasStatusThatPreventsActing(Entity *pokemon);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@ struct MonPortraitMsg
|
||||
{
|
||||
OpenedFile *faceFile;
|
||||
struct PortraitGfx *faceData;
|
||||
Position pos;
|
||||
DungeonPos pos;
|
||||
u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple.
|
||||
bool8 flip; // Whether the mon's sprite is flipped.
|
||||
u8 unkE;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#define DUNGEON_WATER_TYPE_LAVA 1
|
||||
#define DUNGEON_WATER_TYPE_WATER 2
|
||||
|
||||
extern const u8 gDungeonWaterType[];
|
||||
extern const u8 gDungeonWaterType[76];
|
||||
|
||||
void sub_804AE84(Position *pos);
|
||||
void sub_804AE84(DungeonPos *pos);
|
||||
bool8 IsTileGround(Tile *tile);
|
||||
bool8 IsWaterTileset();
|
||||
|
||||
#endif
|
||||
#endif // GUARD_TILE_TYPES_H
|
||||
@@ -5,17 +5,17 @@
|
||||
#include "structs/map.h"
|
||||
#include "structs/str_position.h"
|
||||
|
||||
bool8 CanLayTrap(Position *pos);
|
||||
bool8 LayTrap(Position *pos, u8 trapID, u8 param_3);
|
||||
bool8 CanLayTrap(DungeonPos *pos);
|
||||
bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3);
|
||||
bool8 sub_807FD84(Entity *entity);
|
||||
bool8 sub_807FE04(Position *pos, char param_2);
|
||||
bool8 sub_807FE44(Position *pos, char param_2);
|
||||
bool8 sub_807FE04(DungeonPos *pos, char param_2);
|
||||
bool8 sub_807FE44(DungeonPos *pos, char param_2);
|
||||
void GetTrapName(u8 *buffer, u8 trapIndex);
|
||||
void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4);
|
||||
void sub_807FE9C(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
|
||||
void HandleMudTrap(Entity *pokemon, Entity *target);
|
||||
void HandleStickyTrap(Entity *pokemon, Entity *target);
|
||||
void HandleGrimyTrap(Entity *pokemon, Entity *target);
|
||||
void HandleSummonTrap(Entity *pokemon, Position *pos);
|
||||
void HandleSummonTrap(Entity *pokemon, DungeonPos *pos);
|
||||
void HandlePitfallTrap(Entity *pokemon,Entity *target,Tile *tile);
|
||||
void HandleWarpTrap(Entity *pokemon, Entity *target);
|
||||
void HandleSpinTrap(Entity *pokemon, Entity *target);
|
||||
@@ -30,7 +30,7 @@ void HandleWonderTile(Entity *pokemon, Entity *target);
|
||||
// code_807FCD4.s
|
||||
extern void HandleSealTrap(Entity *pokemon, Entity *target);
|
||||
extern void HandleWhirlwindTrap(Entity *entity, Entity *target);
|
||||
extern void HandlePokemonTrap(Entity *pokemon, Position *pos);
|
||||
extern void HandlePokemonTrap(Entity *pokemon, DungeonPos *pos);
|
||||
|
||||
// trap_1.c
|
||||
void HandleTripTrap(Entity *pokemon, Entity *target);
|
||||
|
||||
Reference in New Issue
Block a user