diff --git a/include/constants/flags.h b/include/constants/flags.h index b7388d6bd0..4863c0980a 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -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) diff --git a/include/follower_helper.h b/include/follower_helper.h index 4d316ba1a3..e5787de5c7 100644 --- a/include/follower_helper.h +++ b/include/follower_helper.h @@ -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, }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index e0bc0619ae..630e3dffb3 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -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])); diff --git a/src/follower_helper.c b/src/follower_helper.c index be52877c5f..3df1cfa0a9 100644 --- a/src/follower_helper.c +++ b/src/follower_helper.c @@ -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