Clean up mevent2

This commit is contained in:
GriffinR
2021-10-17 01:35:26 -04:00
parent c7d550e96c
commit 5f9069628d
8 changed files with 44 additions and 33 deletions

View File

@@ -92,6 +92,8 @@
#define WONDER_CARD_BODY_TEXT_LINES 4
#define WONDER_NEWS_BODY_TEXT_LINES 10
#define MAX_STAMP_CARD_STAMPS 7
#define MALE 0
#define FEMALE 1
#define GENDER_COUNT 2

View File

@@ -13,11 +13,13 @@
#define CARD_STAT_NUM_STAMPS 3
#define CARD_STAT_MAX_STAMPS 4
// Values for the type field of Wonder Card
#define CARD_TYPE_GIFT 0 // Normal "Wonder Card"
#define CARD_TYPE_STAMP 1 // "Stamp Card"
#define CARD_TYPE_LINK_STAT 2 // Referred to as the "Battle Card", shows battle and trade stats
#define CARD_TYPE_COUNT 3
// Values for the sendType field of Wonder Card/News
#define SEND_TYPE_DISALLOWED 0
#define SEND_TYPE_ALLOWED 1
#define SEND_TYPE_ALLOWED_ALWAYS 2
@@ -27,10 +29,9 @@
#define HAS_SAME_CARD 1
#define HAS_DIFF_CARD 2
// The number of battles needed to be recorded on a Battle Card to win a prize
#define REQUIRED_CARD_BATTLES 3
#define MAX_CARD_STAMPS 7
// Stamps are 32 bits. The first 16 bits are the species
// and the second 16 bits are a number (presumably an ID of some kind)
#define STAMP_SPECIES 0

View File

@@ -847,7 +847,7 @@ struct WonderNewsMetadata
struct WonderNews
{
u16 unk_00;
u16 id;
u8 sendType; // SEND_TYPE_*
u8 bgType;
u8 titleText[WONDER_NEWS_TEXT_LENGTH];
@@ -876,7 +876,7 @@ struct WonderCardMetadata
u16 battlesLost;
u16 numTrades;
u16 iconSpecies;
u16 stampData[2][7];
u16 stampData[2][MAX_STAMP_CARD_STAMPS]; // First element is STAMP_SPECIES, second is STAMP_ID
};
struct MysteryGiftSave

View File

@@ -6,11 +6,13 @@
struct MysteryGiftLinkGameData
{
u32 unk_00;
u16 unk_04;
u32 unk_08;
u16 unk_0C;
u32 unk_10;
// It's possible these first 5 fields had some other meaningful purpose,
// but they are only ever set when creating this data and read to validate it.
u32 validationVar;
u16 validationFlag1;
u32 validationFlag2;
u16 validationGiftType1;
u32 validationGiftType2;
u16 flagId;
u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS];
struct WonderCardMetadata cardMetadata;
@@ -50,6 +52,6 @@ u16 MysteryGift_GetCardStatFromLinkData(const struct MysteryGiftLinkGameData *da
u16 MysteryGift_GetCardStat(u32 stat);
void MysteryGift_DisableStats(void);
bool32 MysteryGift_TryEnableStatsByFlagId(u16 flagId);
void TryIncrementMysteryGiftStat(u32 stat, u32 trainerId);
void MysteryGift_TryIncrementStat(u32 stat, u32 trainerId);
#endif //GUARD_MEVENT_H