summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-12-27 09:33:58 -0600
committerGitHub <noreply@github.com>2017-12-27 09:33:58 -0600
commit86a36767dba19e84297047addf1d1d776e2efdec (patch)
treef2aaa9e93f8b8671491eda458963aee1027924c2 /include
parente3078400bbdb3e8416806127290b9a2d68cfb3b8 (diff)
parentd34de50d34d18ee64c95232202751532534c2ed9 (diff)
Merge pull request #501 from huderlem/event_macros
New map event macros
Diffstat (limited to 'include')
-rw-r--r--include/constants/flags.h105
-rw-r--r--include/constants/secret_bases.h110
-rw-r--r--include/constants/weather.h39
-rw-r--r--include/field_weather.h12
-rw-r--r--include/global.fieldmap.h4
5 files changed, 254 insertions, 16 deletions
diff --git a/include/constants/flags.h b/include/constants/flags.h
index 40bac89a0..a8067f6ca 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -255,8 +255,109 @@
#define FLAG_RIVAL_LEFT_FOR_ROUTE103 0x12D
#define FLAG_OMIT_DIVE_FROM_STEVEN_LETTER 0x12E
-#define FLAG_UNKNOWN_2B8 0x2B8 // TODO: pokemon storage system?
-
+// hidden item flags
+#define FLAG_HIDDEN_ITEMS_START 0x258
+#define FLAG_HIDDEN_ITEM_0 0x258
+#define FLAG_HIDDEN_ITEM_1 0x259
+#define FLAG_HIDDEN_ITEM_2 0x25A
+#define FLAG_HIDDEN_ITEM_3 0x25B
+#define FLAG_HIDDEN_ITEM_4 0x25C
+#define FLAG_HIDDEN_ITEM_5 0x25D
+#define FLAG_HIDDEN_ITEM_6 0x25E
+#define FLAG_HIDDEN_ITEM_7 0x25F
+#define FLAG_HIDDEN_ITEM_8 0x260
+#define FLAG_HIDDEN_ITEM_9 0x261
+#define FLAG_HIDDEN_ITEM_A 0x262
+#define FLAG_HIDDEN_ITEM_B 0x263
+#define FLAG_HIDDEN_ITEM_C 0x264
+#define FLAG_HIDDEN_ITEM_D 0x265
+#define FLAG_HIDDEN_ITEM_E 0x266
+#define FLAG_HIDDEN_ITEM_F 0x267
+#define FLAG_HIDDEN_ITEM_10 0x268
+#define FLAG_HIDDEN_ITEM_11 0x269
+#define FLAG_HIDDEN_ITEM_12 0x26A
+#define FLAG_HIDDEN_ITEM_13 0x26B
+#define FLAG_HIDDEN_ITEM_14 0x26C
+#define FLAG_HIDDEN_ITEM_15 0x26D
+#define FLAG_HIDDEN_ITEM_16 0x26E
+#define FLAG_HIDDEN_ITEM_17 0x26F
+#define FLAG_HIDDEN_ITEM_18 0x270
+#define FLAG_HIDDEN_ITEM_19 0x271
+#define FLAG_HIDDEN_ITEM_1A 0x272
+#define FLAG_HIDDEN_ITEM_1B 0x273
+#define FLAG_HIDDEN_ITEM_1C 0x274
+#define FLAG_HIDDEN_ITEM_1D 0x275
+#define FLAG_HIDDEN_ITEM_1E 0x276
+#define FLAG_HIDDEN_ITEM_1F 0x277
+#define FLAG_HIDDEN_ITEM_20 0x278
+#define FLAG_HIDDEN_ITEM_21 0x279
+#define FLAG_HIDDEN_ITEM_22 0x27A
+#define FLAG_HIDDEN_ITEM_23 0x27B
+#define FLAG_HIDDEN_ITEM_24 0x27C
+#define FLAG_HIDDEN_ITEM_25 0x27D
+#define FLAG_HIDDEN_ITEM_26 0x27E
+#define FLAG_HIDDEN_ITEM_27 0x27F
+#define FLAG_HIDDEN_ITEM_28 0x280
+#define FLAG_HIDDEN_ITEM_29 0x281
+#define FLAG_HIDDEN_ITEM_2A 0x282
+#define FLAG_HIDDEN_ITEM_2B 0x283
+#define FLAG_HIDDEN_ITEM_2C 0x284
+#define FLAG_HIDDEN_ITEM_2D 0x285
+#define FLAG_HIDDEN_ITEM_2E 0x286
+#define FLAG_HIDDEN_ITEM_2F 0x287
+#define FLAG_HIDDEN_ITEM_30 0x288
+#define FLAG_HIDDEN_ITEM_31 0x289
+#define FLAG_HIDDEN_ITEM_32 0x28A
+#define FLAG_HIDDEN_ITEM_33 0x28B
+#define FLAG_HIDDEN_ITEM_34 0x28C
+#define FLAG_HIDDEN_ITEM_35 0x28D
+#define FLAG_HIDDEN_ITEM_36 0x28E
+#define FLAG_HIDDEN_ITEM_37 0x28F
+#define FLAG_HIDDEN_ITEM_38 0x290
+#define FLAG_HIDDEN_ITEM_39 0x291
+#define FLAG_HIDDEN_ITEM_3A 0x292
+#define FLAG_HIDDEN_ITEM_3B 0x293
+#define FLAG_HIDDEN_ITEM_3C 0x294
+#define FLAG_HIDDEN_ITEM_3D 0x295
+#define FLAG_HIDDEN_ITEM_3E 0x296
+#define FLAG_HIDDEN_ITEM_3F 0x297
+#define FLAG_HIDDEN_ITEM_40 0x298
+#define FLAG_HIDDEN_ITEM_41 0x299
+#define FLAG_HIDDEN_ITEM_42 0x29A
+#define FLAG_HIDDEN_ITEM_43 0x29B
+#define FLAG_HIDDEN_ITEM_44 0x29C
+#define FLAG_HIDDEN_ITEM_45 0x29D
+#define FLAG_HIDDEN_ITEM_46 0x29E
+#define FLAG_HIDDEN_ITEM_47 0x29F
+#define FLAG_HIDDEN_ITEM_48 0x2A0
+#define FLAG_HIDDEN_ITEM_49 0x2A1
+#define FLAG_HIDDEN_ITEM_4A 0x2A2
+#define FLAG_HIDDEN_ITEM_4B 0x2A3
+#define FLAG_HIDDEN_ITEM_4C 0x2A4
+#define FLAG_HIDDEN_ITEM_4D 0x2A5
+#define FLAG_HIDDEN_ITEM_4E 0x2A6
+#define FLAG_HIDDEN_ITEM_4F 0x2A7
+#define FLAG_HIDDEN_ITEM_50 0x2A8
+#define FLAG_HIDDEN_ITEM_51 0x2A9
+#define FLAG_HIDDEN_ITEM_52 0x2AA
+#define FLAG_HIDDEN_ITEM_53 0x2AB
+#define FLAG_HIDDEN_ITEM_54 0x2AC
+#define FLAG_HIDDEN_ITEM_55 0x2AD
+#define FLAG_HIDDEN_ITEM_56 0x2AE
+#define FLAG_HIDDEN_ITEM_57 0x2AF
+#define FLAG_HIDDEN_ITEM_58 0x2B0
+#define FLAG_HIDDEN_ITEM_59 0x2B1
+#define FLAG_HIDDEN_ITEM_5A 0x2B2
+#define FLAG_HIDDEN_ITEM_5B 0x2B3
+#define FLAG_HIDDEN_ITEM_5C 0x2B4
+#define FLAG_HIDDEN_ITEM_5D 0x2B5
+#define FLAG_HIDDEN_ITEM_5E 0x2B6
+#define FLAG_HIDDEN_ITEM_5F 0x2B7
+#define FLAG_HIDDEN_ITEM_BLACK_GLASSES 0x2B8
+#define FLAG_HIDDEN_ITEM_61 0x2B9
+
+
+// map object hide/show flags
#define FLAG_HIDE_BIRCH_STARTERS_BAG 0x2BC
#define FLAG_HIDE_BIRCH_BATTLE_POOCHYENA 0x2D0
diff --git a/include/constants/secret_bases.h b/include/constants/secret_bases.h
new file mode 100644
index 000000000..0f51054a8
--- /dev/null
+++ b/include/constants/secret_bases.h
@@ -0,0 +1,110 @@
+#ifndef GUARD_CONSTANTS_SECRET_BASES_H
+#define GUARD_CONSTANTS_SECRET_BASES_H
+
+// Each secret base location is assigned an identifier value.
+// The secret base's map is determined by (id / 10). The ones
+// digit is used to differentiate secret bases using the same map.
+// Therefore, each secret base map can be used by up to 10 different
+// secret bases in the game. These ids are 1-based, but there is no
+// apparent reason for that.
+
+#define SECRET_BASE_RED_CAVE1_1 1
+#define SECRET_BASE_RED_CAVE1_2 2
+#define SECRET_BASE_RED_CAVE1_3 3
+
+#define SECRET_BASE_RED_CAVE2_1 11
+#define SECRET_BASE_RED_CAVE2_2 12
+#define SECRET_BASE_RED_CAVE2_3 13
+
+#define SECRET_BASE_RED_CAVE3_1 21
+#define SECRET_BASE_RED_CAVE3_2 22
+#define SECRET_BASE_RED_CAVE3_3 23
+
+#define SECRET_BASE_RED_CAVE4_1 31
+#define SECRET_BASE_RED_CAVE4_2 32
+#define SECRET_BASE_RED_CAVE4_3 33
+
+#define SECRET_BASE_BROWN_CAVE1_1 41
+#define SECRET_BASE_BROWN_CAVE1_2 42
+#define SECRET_BASE_BROWN_CAVE1_3 43
+
+#define SECRET_BASE_BROWN_CAVE2_1 51
+#define SECRET_BASE_BROWN_CAVE2_2 52
+#define SECRET_BASE_BROWN_CAVE2_3 53
+
+#define SECRET_BASE_BROWN_CAVE3_1 61
+#define SECRET_BASE_BROWN_CAVE3_2 62
+#define SECRET_BASE_BROWN_CAVE3_3 63
+
+#define SECRET_BASE_BROWN_CAVE4_1 71
+#define SECRET_BASE_BROWN_CAVE4_2 72
+#define SECRET_BASE_BROWN_CAVE4_3 73
+
+#define SECRET_BASE_BLUE_CAVE1_1 81
+#define SECRET_BASE_BLUE_CAVE1_2 82
+#define SECRET_BASE_BLUE_CAVE1_3 83
+
+#define SECRET_BASE_BLUE_CAVE2_1 91
+#define SECRET_BASE_BLUE_CAVE2_2 92
+#define SECRET_BASE_BLUE_CAVE2_3 93
+
+#define SECRET_BASE_BLUE_CAVE3_1 101
+#define SECRET_BASE_BLUE_CAVE3_2 102
+#define SECRET_BASE_BLUE_CAVE3_3 103
+
+#define SECRET_BASE_BLUE_CAVE4_1 111
+#define SECRET_BASE_BLUE_CAVE4_2 112
+#define SECRET_BASE_BLUE_CAVE4_3 113
+
+#define SECRET_BASE_YELLOW_CAVE1_1 121
+#define SECRET_BASE_YELLOW_CAVE1_2 122
+#define SECRET_BASE_YELLOW_CAVE1_3 123
+
+#define SECRET_BASE_YELLOW_CAVE2_1 131
+#define SECRET_BASE_YELLOW_CAVE2_2 132
+#define SECRET_BASE_YELLOW_CAVE2_3 133
+
+#define SECRET_BASE_YELLOW_CAVE3_1 141
+#define SECRET_BASE_YELLOW_CAVE3_2 142
+#define SECRET_BASE_YELLOW_CAVE3_3 143
+
+#define SECRET_BASE_YELLOW_CAVE4_1 151
+#define SECRET_BASE_YELLOW_CAVE4_2 152
+#define SECRET_BASE_YELLOW_CAVE4_3 153
+
+#define SECRET_BASE_TREE1_1 161
+#define SECRET_BASE_TREE1_2 162
+#define SECRET_BASE_TREE1_3 163
+#define SECRET_BASE_TREE1_4 164
+
+#define SECRET_BASE_TREE2_1 171
+#define SECRET_BASE_TREE2_2 172
+#define SECRET_BASE_TREE2_3 173
+#define SECRET_BASE_TREE2_4 174
+
+#define SECRET_BASE_TREE3_1 181
+#define SECRET_BASE_TREE3_2 182
+#define SECRET_BASE_TREE3_3 183
+
+#define SECRET_BASE_TREE4_1 191
+#define SECRET_BASE_TREE4_2 192
+#define SECRET_BASE_TREE4_3 193
+
+#define SECRET_BASE_SHRUB1_1 201
+#define SECRET_BASE_SHRUB1_2 202
+#define SECRET_BASE_SHRUB1_3 203
+#define SECRET_BASE_SHRUB1_4 204
+
+#define SECRET_BASE_SHRUB2_1 211
+#define SECRET_BASE_SHRUB2_2 212
+#define SECRET_BASE_SHRUB2_3 213
+
+#define SECRET_BASE_SHRUB3_1 221
+#define SECRET_BASE_SHRUB3_2 222
+#define SECRET_BASE_SHRUB3_3 223
+
+#define SECRET_BASE_SHRUB4_1 231
+#define SECRET_BASE_SHRUB4_2 232
+#define SECRET_BASE_SHRUB4_3 233
+
+#endif // GUARD_CONSTANTS_SECRET_BASES_H
diff --git a/include/constants/weather.h b/include/constants/weather.h
new file mode 100644
index 000000000..946316984
--- /dev/null
+++ b/include/constants/weather.h
@@ -0,0 +1,39 @@
+#ifndef GUARD_CONSTANTS_WEATHER_H
+#define GUARD_CONSTANTS_WEATHER_H
+
+#define WEATHER_NONE 0
+#define WEATHER_CLOUDS 1
+#define WEATHER_SUNNY 2
+#define WEATHER_RAIN_LIGHT 3
+#define WEATHER_SNOW 4
+#define WEATHER_RAIN_MED 5
+#define WEATHER_FOG_1 6
+#define WEATHER_ASH 7
+#define WEATHER_SANDSTORM 8
+#define WEATHER_FOG_2 9
+#define WEATHER_FOG_3 10
+#define WEATHER_DARK 11
+#define WEATHER_DROUGHT 12
+#define WEATHER_RAIN_HEAVY 13
+#define WEATHER_BUBBLES 14
+#define WEATHER_ROUTE119_CYCLE 20
+#define WEATHER_ROUTE123_CYCLE 21
+
+// These are used in maps' coord_weather_event entries.
+// They are not a one-to-one mapping with the engine's
+// internal weather constants above.
+#define COORD_EVENT_WEATHER_CLOUDS 1
+#define COORD_EVENT_WEATHER_SUNNY 2
+#define COORD_EVENT_WEATHER_RAIN_LIGHT 3
+#define COORD_EVENT_WEATHER_SNOW 4
+#define COORD_EVENT_WEATHER_RAIN_MED 5
+#define COORD_EVENT_WEATHER_FOG_1 6
+#define COORD_EVENT_WEATHER_FOG_2 7
+#define COORD_EVENT_WEATHER_ASH 8
+#define COORD_EVENT_WEATHER_SANDSTORM 9
+#define COORD_EVENT_WEATHER_DARK 10
+#define COORD_EVENT_WEATHER_DROUGHT 11
+#define COORD_EVENT_WEATHER_ROUTE119_CYCLE 20
+#define COORD_EVENT_WEATHER_ROUTE123_CYCLE 21
+
+#endif // GUARD_CONSTANTS_WEATHER_H
diff --git a/include/field_weather.h b/include/field_weather.h
index ed16b2bf6..c96d4055e 100644
--- a/include/field_weather.h
+++ b/include/field_weather.h
@@ -1,18 +1,6 @@
#ifndef GUARD_WEATHER_H
#define GUARD_WEATHER_H
-#define WEATHER_NONE 0
-#define WEATHER_CLOUDS 1
-#define WEATHER_RAIN_LIGHT 3
-#define WEATHER_SNOW 4
-#define WEATHER_RAIN_MED 5
-#define WEATHER_FOG_1 6
-#define WEATHER_ASH 7
-#define WEATHER_FOG_2 9
-#define WEATHER_DROUGHT 12
-#define WEATHER_RAIN_HEAVY 13
-#define WEATHER_BUBBLES 14
-
struct Sprite;
struct Weather
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index 20190dcb7..a828cf131 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -119,9 +119,9 @@ struct BgEvent
// in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union.
u8 *script;
- // hidden item type probably
+ // hidden item type
struct {
- u8 filler6[0x2];
+ u16 item;
u16 hiddenItemId; // flag offset to determine flag lookup
} hiddenItem;