feat: added abnormal weather follower message
Includes support for follower matching != species
This commit is contained in:
parent
07fd8a28fb
commit
1f2fe7396b
@ -1397,6 +1397,7 @@
|
||||
|
||||
#define FLAG_SYS_USE_FLASH (SYSTEM_FLAGS + 0x28)
|
||||
#define FLAG_SYS_USE_STRENGTH (SYSTEM_FLAGS + 0x29)
|
||||
// Sets abnormal weather on maps that check for it
|
||||
#define FLAG_SYS_WEATHER_CTRL (SYSTEM_FLAGS + 0x2A)
|
||||
#define FLAG_SYS_CYCLING_ROAD (SYSTEM_FLAGS + 0x2B)
|
||||
#define FLAG_SYS_SAFARI_MODE (SYSTEM_FLAGS + 0x2C)
|
||||
|
||||
@ -62,7 +62,8 @@ struct FollowerMsgInfoExtended {
|
||||
#define MATCH_U16(type, value1, value2) {type, {.split = {.hw = value1, .b = value2}}}
|
||||
#define MATCH_U8(type, v1, v2, v3) {type, {.bytes = {v1, v2, v3}}}
|
||||
|
||||
#define MATCH_SPECIES(species) MATCH_U24(MSG_COND_SPECIES, species)
|
||||
#define MATCH_SPECIES(species) MATCH_U16(MSG_COND_SPECIES, species, 0)
|
||||
#define MATCH_NOT_SPECIES(species) MATCH_U16(MSG_COND_SPECIES, species, 1)
|
||||
#define MATCH_TYPES(type1, type2) MATCH_U8(MSG_COND_TYPE, type1, type2, 0)
|
||||
// Checks that follower has *neither* of the two types
|
||||
#define MATCH_NOT_TYPES(type1, type2) MATCH_U8(MSG_COND_TYPE, type1, type2, TYPE_NONE | 1)
|
||||
@ -107,6 +108,7 @@ enum {
|
||||
COND_MSG_LEAVES,
|
||||
COND_MSG_ICE,
|
||||
COND_MSG_BURN,
|
||||
COND_MSG_ABNORMAL_WEATHER,
|
||||
COND_MSG_COUNT,
|
||||
};
|
||||
|
||||
|
||||
@ -2125,7 +2125,12 @@ bool32 CheckMsgCondition(const struct MsgCondition *cond, struct Pokemon *mon, u
|
||||
switch (cond->type)
|
||||
{
|
||||
case MSG_COND_SPECIES:
|
||||
return (cond->data.raw == species);
|
||||
multi = cond->data.split.hw;
|
||||
// if byte nonzero, invert; check != species!
|
||||
if (cond->data.split.b)
|
||||
return (cond->data.split.hw != species);
|
||||
else
|
||||
return (cond->data.split.hw == species);
|
||||
case MSG_COND_TYPE:
|
||||
multi = (SpeciesHasType(species, cond->data.bytes[0]) ||
|
||||
SpeciesHasType(species, cond->data.bytes[1]));
|
||||
|
||||
@ -65,6 +65,7 @@ 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!");
|
||||
static const u8 sCondMsg50[] = _("{STR_VAR_1} is disturbed by the\nabnormal weather!");
|
||||
|
||||
// See the struct definition in follower_helper.h for more info
|
||||
const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT] = {
|
||||
@ -276,6 +277,17 @@ const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT
|
||||
.emotion = FOLLOWER_EMOTION_SAD,
|
||||
.conditions = {MATCH_STATUS(STATUS1_BURN)},
|
||||
},
|
||||
[COND_MSG_ABNORMAL_WEATHER] =
|
||||
{
|
||||
.text = sCondMsg50,
|
||||
.emotion = FOLLOWER_EMOTION_SURPRISE,
|
||||
.conditions = {
|
||||
MATCH_MUSIC(MUS_ABNORMAL_WEATHER),
|
||||
MATCH_NOT_SPECIES(SPECIES_KYOGRE),
|
||||
MATCH_NOT_SPECIES(SPECIES_GROUDON),
|
||||
MATCH_NOT_SPECIES(SPECIES_RAYQUAZA),
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// Pool of "unconditional" follower messages
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user