forked from rh-hideout/pokeemerald-expansion
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfollower_helper.c
370 lines (366 loc) · 12.9 KB
/
follower_helper.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
#include "global.h"
#include "data.h"
#include "event_scripts.h"
#include "follower_helper.h"
#include "constants/battle.h"
#include "constants/followers.h"
#include "constants/metatile_behaviors.h"
#include "constants/pokemon.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
#include "constants/weather.h"
#define TYPE_NOT_TYPE1 NUMBER_OF_MON_TYPES
// difficult conditional messages follow
static const u8 sCondMsg00[] = _("{STR_VAR_1} danced happily.");
static const u8 sCondMsg01[] = _("{STR_VAR_1} danced beautifully.");
static const u8* const sCelebiTexts[] = {sCondMsg00, sCondMsg01, NULL};
static const u8 sCondMsg02[] = _("{STR_VAR_1} emitted fire and shouted.");
static const u8 sCondMsg03[] = _("{STR_VAR_1} is vigorously producing\nfire!");
static const u8 sCondMsg04[] = _("{STR_VAR_1} spat fire!");
static const u8 sCondMsg05[] = _("{STR_VAR_1} is vigorously breathing\nfire!");
static const u8* const sFireTexts[] = {sCondMsg02, sCondMsg03, sCondMsg04, sCondMsg05, NULL};
static const u8 sCondMsg06[] = _("{STR_VAR_1} is staring straight at\nthe Pokémon LEAGUE.");
static const u8 sCondMsg07[] = _("Your Pokémon is staring intently at\nthe mountain peak.");
static const u8 sCondMsg08[] = _("Sniff sniff, something smells good!");
static const u8 sCondMsg09[] = _("Your Pokémon is surveying the\nshelves restlessly.");
static const u8 sCondMsg10[] = _("{STR_VAR_1} is staring intently at\nthe shelves.");
static const u8* const sShopTexts[] = {sCondMsg09, sCondMsg10, NULL};
static const u8 sCondMsg11[] = _("{STR_VAR_1} focused with a sharp\ngaze!");
static const u8 sCondMsg12[] = _("{STR_VAR_1} seems very interested in\nthe bicycles.");
static const u8 sCondMsg13[] = _("{STR_VAR_1} seems to want to touch\nthe machines!");
static const u8 sCondMsg14[] = _("{STR_VAR_1} is swaying with the\nboat!");
static const u8 sCondMsg15[] = _("{STR_VAR_1} is dancing along with\nthe rolling of the ship.");
static const u8 sCondMsg16[] = _("{STR_VAR_1} doesn't want to get off\nthe boat yet!");
static const u8* const sBoatTexts[] = {sCondMsg14, sCondMsg15, sCondMsg16, NULL};
static const u8 sCondMsg17[] = _("{STR_VAR_1} is listening to the\nsound of the machines.");
static const u8* const sMachineTexts[] = {sCondMsg13, sCondMsg17, NULL};
static const u8 sCondMsg18[] = _("Waah! your Pokémon suddenly splashed\nwater!");
static const u8 sCondMsg19[] = _("Your Pokémon is blowing sand in the\nair!");
static const u8 sCondMsg20[] = _("{STR_VAR_1} is playing around,\nplucking bits of grass.");
static const u8 sCondMsg21[] = _("Your Pokémon is happily looking at\nyour footprints!");
static const u8 sCondMsg22[] = _("{STR_VAR_1} is feeling nervous and a\ntouch claustrophobic.");
static const u8 sCondMsg23[] = _("{STR_VAR_1} is cautious about the\nconfined area!");
static const u8* const sElevatorTexts[] = {sCondMsg22, sCondMsg23, NULL};
static const u8 sCondMsg24[] = _("A cold wind suddenly blew by!");
static const u8 sCondMsg25[] = _("Your Pokémon almost slipped and fell\nover!");
static const u8 sCondMsg26[] = _("Your Pokémon seems surprised to\ntouch ice.");
static const u8* const sColdTexts[] = {sCondMsg24, sCondMsg25, sCondMsg26, NULL};
static const u8 sCondMsg27[] = _("Your Pokémon has a flower petal on\nits face!");
static const u8 sCondMsg28[] = _("{STR_VAR_1} is growling softly.");
static const u8 sCondMsg29[] = _("{STR_VAR_1} is trembling with fear.");
static const u8 sCondMsg30[] = _("{STR_VAR_1} seems somehow sad…");
static const u8* const sFearTexts[] = {sCondMsg29, sCondMsg30, NULL};
static const u8 sCondMsg31[] = _("{STR_VAR_1} is taking shelter in the\ngrass from the rain.");
static const u8 sCondMsg32[] = _("{STR_VAR_1} seems very cold.");
static const u8 sCondMsg33[] = _("{STR_VAR_1} is staring at the sea.");
static const u8 sCondMsg34[] = _("Your Pokémon is staring intently at\nthe sea!");
static const u8 sCondMsg35[] = _("{STR_VAR_1} is looking at the\nsurging sea.");
static const u8* const sSeaTexts[] = {sCondMsg33, sCondMsg34, sCondMsg35, NULL};
static const u8 sCondMsg36[] = _("{STR_VAR_1} is listening to the\nsound of the waterfall.");
static const u8 sCondMsg37[] = _("{STR_VAR_1} seems to be happy about\nthe rain!");
static const u8 sCondMsg38[] = _("{STR_VAR_1} is staring at its\nreflection in the water.");
static const u8 sCondMsg39[] = _("{STR_VAR_1} seems to relax as it\nhears the sound of rustling leaves…");
static const u8 sCondMsg40[] = _("{STR_VAR_1} is gnawing at the ice.");
static const u8 sCondMsg41[] = _("{STR_VAR_1} is touching the ice.");
static const u8* const sIceTexts[] = {sCondMsg26, sCondMsg40, sCondMsg41, NULL};
static const u8 sCondMsg42[] = _("{STR_VAR_1}'s burn looks painful!");
// See the struct definition in follower_helper.h for more info
const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT] =
{
[COND_MSG_CELEBI] =
{
.text = (u8*)sCelebiTexts,
.textSpread = 1,
.script = EventScript_FollowerDance,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_SPECIES(SPECIES_CELEBI),
},
},
[COND_MSG_FIRE] =
{
.text = (u8*)sFireTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_TYPES(TYPE_FIRE, TYPE_FIRE),
},
},
[COND_MSG_EVER_GRANDE] =
{
.text = sCondMsg06,
.script = EventScript_FollowerFaceUp,
.emotion = FOLLOWER_EMOTION_HAPPY,
.conditions =
{
MATCH_MAP(EVER_GRANDE_CITY),
},
},
[COND_MSG_ROUTE_112] =
{
.text = sCondMsg07,
.emotion = FOLLOWER_EMOTION_HAPPY,
.conditions =
{
MATCH_MAP(ROUTE112),
},
},
[COND_MSG_DAY_CARE] =
{
.text = sCondMsg08,
.script = EventScript_FollowerNostalgia,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_MAP(ROUTE117_POKEMON_DAY_CARE)
},
},
[COND_MSG_MART] =
{
.text = (u8*)sShopTexts,
.textSpread = 1,
.script = EventScript_FollowerLookAround,
.emotion = FOLLOWER_EMOTION_NEUTRAL,
.conditions =
{
MATCH_MUSIC(MUS_POKE_MART)
},
},
[COND_MSG_VICTORY_ROAD] =
{
.text = sCondMsg11,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_MUSIC(MUS_VICTORY_ROAD)
},
},
[COND_MSG_BIKE_SHOP] =
{
.text = sCondMsg12,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_MAP(MAUVILLE_CITY_BIKE_SHOP)
},
},
[COND_MSG_MACHINES] =
{
.text = (u8*)sMachineTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_MUSIC,
.orFlag = 1, // match any of these maps
.conditions =
{
MATCH_MAP(NEW_MAUVILLE_INSIDE),
MATCH_MAP(SLATEPORT_CITY_STERNS_SHIPYARD_1F),
MATCH_MAP(SLATEPORT_CITY_STERNS_SHIPYARD_2F),
},
},
[COND_MSG_SAILING] =
{
.text = (u8*)sBoatTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_MUSIC,
.script = EventScript_FollowerLookAround,
.conditions =
{
MATCH_MUSIC(MUS_SAILING),
},
},
[COND_MSG_PUDDLE] =
{
.text = sCondMsg18,
.script = EventScript_FollowerHopping,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_SHALLOW_WATER, MB_PUDDLE),
MATCH_ON_MB(MB_STAIRS_OUTSIDE_ABANDONED_SHIP, MB_SHALLOW_WATER_WITH_ENCOUNTERS)
},
},
[COND_MSG_SAND] =
{
.text = sCondMsg19,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_SAND, MB_DEEP_SAND),
},
},
[COND_MSG_GRASS] =
{
.text = sCondMsg20,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_TALL_GRASS, MB_LONG_GRASS),
},
},
[COND_MSG_FOOTPRINTS] =
{
.text = sCondMsg21,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_ON_MB(MB_SAND, MB_FOOTPRINTS),
},
},
[COND_MSG_ELEVATOR] =
{
.text = (u8*)sElevatorTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions =
{
MATCH_MAP(LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR),
},
},
[COND_MSG_ICE_ROOM] =
{
.text = (u8*)sColdTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions =
{
MATCH_MAP(SHOAL_CAVE_LOW_TIDE_ICE_ROOM),
},
},
[COND_MSG_ROUTE_117] =
{
.text = sCondMsg27,
.emotion = FOLLOWER_EMOTION_SURPRISE,
.conditions =
{
MATCH_MAP(ROUTE117),
},
},
[COND_MSG_DRAGON_GROWL] =
{
.text = sCondMsg28,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_TYPES(TYPE_DRAGON, TYPE_DRAGON),
MATCH_MAPSEC(MAPSEC_SKY_PILLAR),
},
},
[COND_MSG_FEAR] =
{
.text = (u8*)sFearTexts,
.textSpread = 1,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_NOT_TYPES(TYPE_GHOST, TYPE_GHOST),
MATCH_MAPSEC(MAPSEC_MT_PYRE),
MATCH_MUSIC(MUS_MT_PYRE),
},
},
[COND_MSG_FIRE_RAIN] =
{
.text = sCondMsg31,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_TYPES(TYPE_FIRE, TYPE_FIRE),
MATCH_WEATHER(WEATHER_RAIN, WEATHER_RAIN_THUNDERSTORM),
},
},
[COND_MSG_FROZEN] =
{
.text = sCondMsg32,
.emotion = FOLLOWER_EMOTION_UPSET,
.conditions =
{
MATCH_STATUS(STATUS1_FREEZE),
},
},
[COND_MSG_SEASIDE] =
{
.text = (u8*)sSeaTexts,
.textSpread = 1,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_NEAR_MB(MB_OCEAN_WATER, 5),
},
},
[COND_MSG_WATERFALL] =
{
.text = sCondMsg36,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_NEAR_MB(MB_WATERFALL, 5),
},
},
[COND_MSG_RAIN] =
{
.text = sCondMsg37,
.emotion = FOLLOWER_EMOTION_MUSIC,
.conditions =
{
MATCH_NOT_TYPES(TYPE_FIRE, TYPE_FIRE),
MATCH_WEATHER(WEATHER_RAIN, WEATHER_RAIN_THUNDERSTORM)
}
},
[COND_MSG_REFLECTION] =
{
.text = sCondMsg38,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_NEAR_MB(MB_POND_WATER, 1),
},
},
[COND_MSG_LEAVES] =
{
.text = sCondMsg39,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_MAPSEC(MAPSEC_PETALBURG_WOODS),
},
},
[COND_MSG_ICE] =
{
.text = (u8*)sIceTexts,
.textSpread = 1,
.script = EventScript_FollowerFaceResult,
.emotion = FOLLOWER_EMOTION_PENSIVE,
.conditions =
{
MATCH_NEAR_MB(MB_ICE, 1),
},
},
[COND_MSG_BURN] =
{
.text = sCondMsg42,
.emotion = FOLLOWER_EMOTION_SAD,
.conditions =
{
MATCH_STATUS(STATUS1_BURN),
},
},
};
// Pool of "unconditional" follower messages
const struct FollowerMessagePool gFollowerBasicMessages[FOLLOWER_EMOTION_LENGTH] =
{
[FOLLOWER_EMOTION_HAPPY] = {gFollowerHappyMessages, EventScript_FollowerGeneric, FOLLOWER_HAPPY_MESSAGE_COUNT},
[FOLLOWER_EMOTION_NEUTRAL] = {gFollowerNeutralMessages, EventScript_FollowerGeneric, FOLLOWER_NEUTRAL_MESSAGE_COUNT},
[FOLLOWER_EMOTION_SAD] = {gFollowerSadMessages, EventScript_FollowerGeneric, FOLLOWER_SAD_MESSAGE_COUNT},
[FOLLOWER_EMOTION_UPSET] = {gFollowerUpsetMessages, EventScript_FollowerGeneric, FOLLOWER_UPSET_MESSAGE_COUNT},
[FOLLOWER_EMOTION_ANGRY] = {gFollowerAngryMessages, EventScript_FollowerGeneric, FOLLOWER_ANGRY_MESSAGE_COUNT},
[FOLLOWER_EMOTION_PENSIVE] = {gFollowerPensiveMessages, EventScript_FollowerGeneric, FOLLOWER_PENSIVE_MESSAGE_COUNT},
[FOLLOWER_EMOTION_LOVE] = {gFollowerLoveMessages, EventScript_FollowerGeneric, FOLLOWER_LOVE_MESSAGE_COUNT},
[FOLLOWER_EMOTION_SURPRISE] = {gFollowerSurpriseMessages, EventScript_FollowerGeneric, FOLLOWER_SURPRISE_MESSAGE_COUNT},
[FOLLOWER_EMOTION_CURIOUS] = {gFollowerCuriousMessages, EventScript_FollowerGeneric, FOLLOWER_CURIOUS_MESSAGE_COUNT},
[FOLLOWER_EMOTION_MUSIC] = {gFollowerMusicMessages, EventScript_FollowerGeneric, FOLLOWER_MUSIC_MESSAGE_COUNT},
[FOLLOWER_EMOTION_POISONED] = {gFollowerPoisonedMessages, EventScript_FollowerGeneric, FOLLOWER_POISONED_MESSAGE_COUNT},
};