diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/global.h | 2 | ||||
-rw-r--r-- | include/constants/mevent.h | 5 | ||||
-rw-r--r-- | include/global.h | 4 | ||||
-rwxr-xr-x | include/mevent.h | 14 |
4 files changed, 15 insertions, 10 deletions
diff --git a/include/constants/global.h b/include/constants/global.h index 7fca5453c..12d6178b2 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -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 diff --git a/include/constants/mevent.h b/include/constants/mevent.h index 91eacd801..636043fdb 100644 --- a/include/constants/mevent.h +++ b/include/constants/mevent.h @@ -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 diff --git a/include/global.h b/include/global.h index 36fbfc38d..8681f7289 100644 --- a/include/global.h +++ b/include/global.h @@ -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 diff --git a/include/mevent.h b/include/mevent.h index 9b7ef3ab5..c3e14f1f3 100755 --- a/include/mevent.h +++ b/include/mevent.h @@ -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 |