diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2019-10-03 20:57:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-03 20:57:28 -0400 |
commit | 0cf4c9f25c2fe165c53a0c24f93a31a27ea42d6a (patch) | |
tree | b88f7cf114f3f0c79ba6816255f27cda21f335d7 /include | |
parent | d9ab841b0d72a52676131846447de26e59e7a16d (diff) | |
parent | aa0ac46b7145951f1d6f65e7af005a3fe561ff63 (diff) |
Merge pull request #108 from PikalaxALT/itemfinder
Itemfinder
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/flags.h | 2 | ||||
-rw-r--r-- | include/event_scripts.h | 2 | ||||
-rw-r--r-- | include/field_specials.h | 9 | ||||
-rw-r--r-- | include/fieldmap.h | 2 | ||||
-rw-r--r-- | include/global.fieldmap.h | 36 | ||||
-rw-r--r-- | include/itemfinder.h | 2 | ||||
-rw-r--r-- | include/strings.h | 5 |
7 files changed, 42 insertions, 16 deletions
diff --git a/include/constants/flags.h b/include/constants/flags.h index de9a98b43..7f4655d4e 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -668,7 +668,7 @@ #define FLAG_0x240 0x240 #define FLAG_0x241 0x241 #define FLAG_0x242 0x242 -#define FLAG_0x243 0x243 +#define FLAG_GOT_COIN_CASE 0x243 #define FLAG_0x244 0x244 #define FLAG_0x245 0x245 #define FLAG_0x246 0x246 diff --git a/include/event_scripts.h b/include/event_scripts.h index 91612c06b..310335196 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -1153,4 +1153,6 @@ extern const u8 EventScript_SafariRetire[]; extern const u8 EventScript_SafariWarpOut[]; extern const u8 EventScript_SafariOutOfBalls[]; +extern const u8 EventScript_ItemfinderDigUpUnderfootItem[]; + #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_specials.h b/include/field_specials.h index 9a85a8b49..b48dd34a5 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -3,6 +3,14 @@ #include "global.h" +enum HiddenItemAttr +{ + HIDDEN_ITEM_ID = 0, + HIDDEN_ITEM_FLAG, + HIDDEN_ITEM_QUANTITY, + HIDDEN_ITEM_UNDERFOOT +}; + u8 GetLeadMonIndex(void); u8 CountDigits(u16 number); void TV_PrintIntToStringVar(u8, int); @@ -14,5 +22,6 @@ u8 ContextNpcGetTextColor(void); void set_unknown_box_id(u8); u16 get_unknown_box_id(void); bool8 sub_80CC7B4(void); +u16 GetHiddenItemAttr(struct HiddenItemStruct hiddenItem, u8 attr); #endif // GUARD_FIELD_SPECIALS_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 9903962a1..7bedb1d94 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -23,5 +23,7 @@ bool8 MapGridIsImpassableAt(s32, s32); s32 GetMapBorderIdAt(s32, s32); bool32 CanCameraMoveInDirection(s32); u32 GetBehaviorByMetatileIdAndMapData(struct MapData *mapData, u16 metatile, u8 attr); +const struct MapHeader * mapconnection_get_mapheader(struct MapConnection * connection); +struct MapConnection * GetMapConnectionAtPos(s16 x, s16 y); #endif //GUARD_FIELDMAP_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 3623737ea..bf142d265 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -120,26 +120,34 @@ struct CoordEvent u8 *script; }; +struct HiddenItemStruct +{ + u32 itemId:16; + u32 hiddenItemId:8; // flag offset to determine flag lookup + u32 quantity:7; + u32 isUnderfoot:1; +}; + +union BgUnion +{ // carried over from diego's FR/LG work, seems to be the same struct + // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. + u8 *script; + + // hidden item type probably + struct HiddenItemStruct hiddenItem; + + // secret base type + u32 secretBaseId; + +}; + struct BgEvent { u16 x, y; u8 unk4; u8 kind; // 0x2 padding for the union beginning. - union { // carried over from diego's FR/LG work, seems to be the same struct - // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. - u8 *script; - - // hidden item type probably - struct { - u8 filler6[0x2]; - u16 hiddenItemId; // flag offset to determine flag lookup - } hiddenItem; - - // secret base type - u32 secretBaseId; - - } bgUnion; + union BgUnion bgUnion; }; struct MapEvents diff --git a/include/itemfinder.h b/include/itemfinder.h index 2b882b144..de63e9362 100644 --- a/include/itemfinder.h +++ b/include/itemfinder.h @@ -1,6 +1,6 @@ #ifndef GUARD_ITEMFINDER_H #define GUARD_ITEMFINDER_H -void sub_813EC8C(u8 taskId); +void ItemUseOnFieldCB_Itemfinder(u8 taskId); #endif //GUARD_ITEMFINDER_H diff --git a/include/strings.h b/include/strings.h index b0221b8e9..9ddce6044 100644 --- a/include/strings.h +++ b/include/strings.h @@ -324,4 +324,9 @@ extern const u8 gText_ThrowAwayStrVar2OfThisItemQM[]; extern const u8 gText_BerryPouch[]; extern const u8 gText_TheBerryPouchWillBePutAway[]; +// itemfinder +extern const u8 gText_ItemfinderResponding[]; +extern const u8 gText_ItemfinderShakingWildly[]; +extern const u8 gText_NopeTheresNoResponse[]; + #endif //GUARD_STRINGS_H |