diff --git a/data/scripts/follower.inc b/data/scripts/follower.inc index cf8c063c1b..6e2b8ee3a0 100644 --- a/data/scripts/follower.inc +++ b/data/scripts/follower.inc @@ -161,6 +161,15 @@ EventScript_FollowerGeneric:: @ similar to Std_MsgboxDefault waitbuttonpress return +EventScript_FollowerJump:: + applymovement 0xFE FollowerSplashMovement + waitmovement 0xFE + waitfieldeffect FLDEFF_EMOTE + message 0x0 + waitmessage + waitbuttonpress + return + EnterPokeballMovement:: .byte 0x9F @ EnterPokeball step_end diff --git a/emotions.txt b/emotions.txt index dad46cf113..42beb1d593 100644 --- a/emotions.txt +++ b/emotions.txt @@ -39,10 +39,6 @@ Your pokemon is staring intently at the sea! {STR_VAR_1} is looking outside and frolicking! {STR_VAR_1} spun around in a circle! Sad (Special): -{STR_VAR_1} is going to fall down! (when HP is red). -{STR_VAR_1} is not happy. (During rain if the pokemon is a fire type). -{STR_VAR_1} seems to be about to fall over! (When HP is red.). -{STR_VAR_1} is trying very hard to keep up with you... (When HP is yellow or paralyzed). {STR_VAR_1}'s burn looks painful! (when burnt). Upset (Special): {STR_VAR_1} is taking shelter in the grass from the rain. @@ -54,7 +50,7 @@ It seems to have eaten something strange. It's making an odd face... (Olivine Ca {STR_VAR_1} is a bit nervous about the narrow space! {STR_VAR_1} is splashing around in the grass (must be fire type). Your pokemon doesn't like splashing around on the ground (must be fire type). -{STR_VAR_1} is taking shelter in the grass from the rain (must be fire type). + {STR_VAR_1} seems very cold (when frozen). {STR_VAR_1} seems uneasy and is poking (PLAYER). {STR_VAR_1} is trembling with fear (Cemetery). @@ -83,27 +79,38 @@ Your pokemon is drooling a little (Olivine Cafe). {STR_VAR_1} seems very interested in the bicycles (bike shop). {STR_VAR_1} is preoccupied by the floor, which seems like it may collapse (burnt tower). {STR_VAR_1} is nervous ( in a gym before beating gym leader ) ( must have type disadvantage ). -Music: -{STR_VAR_1} is showing off its agility! -{STR_VAR_1} is moving around happily! -Woah! {STR_VAR_1} suddenly started dancing in happiness! -{STR_VAR_1} is steadily keeping up with you! -{STR_VAR_1} is very happy about the rain. -{STR_VAR_1} seems to want to play with (Player). +Music (Special): {STR_VAR_1} is pulling out the grass. -{STR_VAR_1} is happy skipping about. -{STR_VAR_1} is playing in the puddle. -{STR_VAR_1} is gazing restlessly at the building ( in goldenrod). -{STR_VAR_1} is singing and humming. -{STR_VAR_1} is looking around restlessly at the Forest. -{STR_VAR_1} is playfully nibbling at the ground. -(CYNDAQUIL) blew out a fireball. ( Pokemon Exclusive ). -(CYNDAQUIL) blew out a couple of fireballs. ( Pokemon Exclusive ). -(CHIKORITA) is waving its leaf around ( Pokemon Exclusive ). -(CHIKORITA) is making its leaf twitch ( Pokemon Exclusive ). -(TODADILE) is moving its jaw ( Pokemon Exclusive ). -(TODADILE) is opening and closing its mouth ( Pokemon Exclusive ). -{STR_VAR_1} is nipping at your feet! +Waah! your pokemon suddenly splashed water! (on a shore). +{STR_VAR_1} is happy to see what's out doors! +{STR_VAR_1} seems to want to touch the machine! (Power plant). +{STR_VAR_1} is listening intently to the sound of the waves. +{STR_VAR_1} is swaying with the boat! +{STR_VAR_1} is dancing along with the rolling of the ship. +{STR_VAR_1} doesn't want to get off the boat yet! +{STR_VAR_1} is listening to the sound of the machine. +{STR_VAR_1} seems happy at the sight of water on the window! +Your pokemon is blowing sand in the air! +Your pokemon is staring spellbound at the night sky! +Your pokemon seems to be enjoying sliding around! +{STR_VAR_1} is touching the ice. +{STR_VAR_1} is steadily observing the flow of the river. +{STR_VAR_1} is noticing the scent of the grass. +{STR_VAR_1} is playing around, plucking bits of grass. +{STR_VAR_1} is looking up at the ceiling. +{STR_VAR_1} seems to be enjoying this a little bit! +{STR_VAR_1} is wandering around enjoying the forest scenery. +{STR_VAR_1} is playing around in the fallen leaves. +{STR_VAR_1} is playing around with a leaf. +{STR_VAR_1} is playing around, touching the leaves. +Your pokemon is happily gazing at the beautiful, starry sky! +{STR_VAR_1} is pulling out the grass. +{STR_VAR_1} is rolling around in the grass. +{STR_VAR_1} seems to want to return to the lab (after you receive the Mystery egg). +Your pokemon is staring at the various items. +{STR_VAR_1} is listening to the sound of the waterfall ( Mt. Mortar). +{STR_VAR_1} is looking up the tall mountain... (Mt. Mortar). +{STR_VAR_1} seems concerned about the waterfall. {STR_VAR_1} is sniffing around the room. (Inside Hero's Room). {STR_VAR_1} is dancing around the pillar! (Seems to occur more for Bellsprout)(sprout tower). {STR_VAR_1} swayed around, dancing in a strange manner.(Seems to occur more for Bellsprout)(sprout tower). @@ -117,43 +124,17 @@ Your pokemon is rolling a screw from a bicycle around. {STR_VAR_1} is looking up at the sky. {STR_VAR_1} seems to be happy about the rain! ( during rain, must not have type disadvantage to water). {STR_VAR_1} is clawing the grass! -{STR_VAR_1} turns around and looks at you. -{STR_VAR_1} is listening to the sound of the waterfall ( Mt. Mortar). -{STR_VAR_1} is looking up the tall mountain... (Mt. Mortar). -{STR_VAR_1} seems concerned about the waterfall. -{STR_VAR_1} is working hard to show off its mighty power! -{STR_VAR_1} pulled back to run! -Whoa! {STR_VAR_1} suddenly danced in happiness! -{STR_VAR_1} is rolling around in the grass. -{STR_VAR_1} seems to want to return to the lab (after you receive the Mystery egg). -Your pokemon is staring at the various items. -{STR_VAR_1} is wandering around enjoying the forest scenery. -{STR_VAR_1} is playing around in the fallen leaves. -{STR_VAR_1} is playing around with a leaf. -{STR_VAR_1} is playing around, touching the leaves. -Your pokemon is happily gazing at the beautiful, starry sky! -{STR_VAR_1} is pulling out the grass. -{STR_VAR_1} seems to be enjoying this a little bit! -{STR_VAR_1} is looking up at the ceiling. -{STR_VAR_1} is cheerful! -{STR_VAR_1} is swaying with the boat! -{STR_VAR_1} is dancing along with the rolling of the ship. -{STR_VAR_1} doesn't want to get off the boat yet! -{STR_VAR_1} is listening to the sound of the machine. -{STR_VAR_1} seems happy at the sight of water on the window! -Your pokemon is blowing sand in the air! -Your pokemon is staring spellbound at the night sky! -Your pokemon seems to be enjoying sliding around! -{STR_VAR_1} is touching the ice. -{STR_VAR_1} is steadily observing the flow of the river. -{STR_VAR_1} is noticing the scent of the grass. -{STR_VAR_1} is playing around, plucking bits of grass. -{STR_VAR_1} is happy to see what's out doors! -{STR_VAR_1} seems to want to touch the machine! (Power plant). -{STR_VAR_1} is listening intently to the sound of the waves. -{STR_VAR_1} is jumping around in a carefree way! -Waah! your pokemon suddenly splashed water! (on a shore). -Your pokemon seems to be smelling a nostalgically familiar scent... +{STR_VAR_1} is looking around restlessly at the Forest. +{STR_VAR_1} is playfully nibbling at the ground. +(CYNDAQUIL) blew out a fireball. ( Pokemon Exclusive ). +(CYNDAQUIL) blew out a couple of fireballs. ( Pokemon Exclusive ). +(CHIKORITA) is waving its leaf around ( Pokemon Exclusive ). +(CHIKORITA) is making its leaf twitch ( Pokemon Exclusive ). +(TODADILE) is moving its jaw ( Pokemon Exclusive ). +(TODADILE) is opening and closing its mouth ( Pokemon Exclusive ). +{STR_VAR_1} is playing in the puddle. +{STR_VAR_1} is gazing restlessly at the building ( in goldenrod). + Surprised (Special): Your pokemon has a flower petal on its face! (Newbark Town). {STR_VAR_1} seems to have gotten caught in the clumps of grass. @@ -164,7 +145,6 @@ Careful! seems like the floor could collapse, and it might fall. {STR_VAR_1} gazed surprisingly at the rock! Huh? your pokemon found something in top of the mountain ( outside Mt. Mortar) (!). {STR_VAR_1} is cautious about the confined area! -{STR_VAR_1} seems to be very surprised that it is raining! {STR_VAR_1} got tangled up in the branches and almost fell down! {STR_VAR_1} looked up at the sky and shouted loudly. {STR_VAR_1} seems to have found something! diff --git a/follower_emotions.py b/follower_emotions.py index 6b8393019b..b16409c100 100644 --- a/follower_emotions.py +++ b/follower_emotions.py @@ -47,4 +47,4 @@ def export_messages(infile, outfile, n=None, indent=2): if __name__ == '__main__': - export_messages('emotions.txt', 'emotions.h', n=1) + export_messages('emotions.txt', 'emotions.h', n=15) diff --git a/include/data.h b/include/data.h index 1c258dce17..2fbec8ec06 100644 --- a/include/data.h +++ b/include/data.h @@ -13,6 +13,7 @@ #define N_FOLLOWER_LOVE_MESSAGES 10 #define N_FOLLOWER_SURPRISE_MESSAGES 20 #define N_FOLLOWER_CURIOUS_MESSAGES 7 +#define N_FOLLOWER_MUSIC_MESSAGES 15 #define N_FOLLOWER_POISONED_MESSAGES 1 struct MonCoords @@ -142,6 +143,7 @@ extern const char * const gFollowerPensiveMessages[]; extern const char * const gFollowerLoveMessages[]; extern const char * const gFollowerSurpriseMessages[]; extern const char * const gFollowerCuriousMessages[]; +extern const char * const gFollowerMusicMessages[]; extern const char * const gFollowerPoisonedMessages[]; #endif // GUARD_DATA_H diff --git a/src/data/text/follower_messages.h b/src/data/text/follower_messages.h index ea3c140437..5339a79bab 100644 --- a/src/data/text/follower_messages.h +++ b/src/data/text/follower_messages.h @@ -59,6 +59,11 @@ const char * const gFollowerSadMessages[] = { (const char []) _("{STR_VAR_1} is dizzy."), (const char []) _("{STR_VAR_1} is stepping on your\nfeet!"), (const char []) _("{STR_VAR_1} seems a little tired."), + // Conditional messages begin, index 3 + (const char []) _("{STR_VAR_1} is not happy."), + (const char []) _("{STR_VAR_1} is going to fall down!\n"), + (const char []) _("{STR_VAR_1} seems to be about to\nfall over!"), + (const char []) _("{STR_VAR_1} is trying very hard to\nkeep up with you..."), }; // Unconditional upset messages @@ -66,6 +71,8 @@ const char * const gFollowerUpsetMessages[] = { (const char []) _("{STR_VAR_1} seems unhappy somehow..."), (const char []) _("{STR_VAR_1} is making an unhappy\nface."), (const char []) _(".....Your pokemon seems a little\ncold."), + // Conditional messages, index 3 + (const char []) _("{STR_VAR_1} is taking shelter in the\ngrass from the rain."), }; // Unconditional angry messages @@ -137,6 +144,8 @@ const char * const gFollowerSurpriseMessages[] = { (const char []) _("{STR_VAR_1} is scared and snuggled\nup to you!"), (const char []) _("{STR_VAR_1} is feeling an unusual\npresence..."), (const char []) _("{STR_VAR_1} is getting tense with\nnervous energy."), + // Conditional messages, index 20 + (const char []) _("{STR_VAR_1} seems to be very\nsurprised that it is raining!"), }; // Unconditional curious messages @@ -150,6 +159,25 @@ const char * const gFollowerCuriousMessages[] = { (const char []) _("{STR_VAR_1} seems to be a little\nhesitant..."), }; +// Unconditional music messages +const char * const gFollowerMusicMessages[] = { + (const char []) _("{STR_VAR_1} is showing off its\nagility!"), + (const char []) _("{STR_VAR_1} is moving around\nhappily!"), + (const char []) _("Woah! {STR_VAR_1} suddenly started\ndancing in happiness!"), + (const char []) _("{STR_VAR_1} is steadily keeping up\nwith you!"), + (const char []) _("{STR_VAR_1} is very happy about the\nrain."), + (const char []) _("{STR_VAR_1} seems to want to play\nwith you."), + (const char []) _("{STR_VAR_1} is happy skipping about."), + (const char []) _("{STR_VAR_1} is singing and humming."), + (const char []) _("{STR_VAR_1} is nipping at your feet!"), + (const char []) _("{STR_VAR_1} turns around and looks\nat you."), + (const char []) _("{STR_VAR_1} is working hard to show\noff its mighty power!"), + (const char []) _("Whoa! {STR_VAR_1} suddenly danced in\nhappiness!"), + (const char []) _("{STR_VAR_1} is cheerful!"), + (const char []) _("{STR_VAR_1} is jumping around in a\ncarefree way!"), + (const char []) _("Your pokemon seems to be smelling a\nnostalgically familiar scent..."), +}; + const char * const gFollowerPoisonedMessages[] = { (const char []) _("{STR_VAR_1} is shivering with the\neffects of being poisoned."), }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index b27f988d56..f143353d15 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1749,6 +1749,7 @@ static const struct FollowerMessagePool followerBasicMessages[] = { [FOLLOWER_EMOTION_LOVE] = {gFollowerLoveMessages, EventScript_FollowerGeneric, N_FOLLOWER_LOVE_MESSAGES}, [FOLLOWER_EMOTION_SURPRISE] = {gFollowerSurpriseMessages, EventScript_FollowerGeneric, N_FOLLOWER_SURPRISE_MESSAGES}, [FOLLOWER_EMOTION_CURIOUS] = {gFollowerCuriousMessages, EventScript_FollowerGeneric, N_FOLLOWER_CURIOUS_MESSAGES}, + [FOLLOWER_EMOTION_MUSIC] = {gFollowerMusicMessages, EventScript_FollowerGeneric, N_FOLLOWER_MUSIC_MESSAGES}, [FOLLOWER_EMOTION_POISONED] = {gFollowerPoisonedMessages, EventScript_FollowerGeneric, N_FOLLOWER_POISONED_MESSAGES}, }; @@ -1813,15 +1814,10 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big emotion_weight[FOLLOWER_EMOTION_HAPPY] = 30; else if (friendship > 80) emotion_weight[FOLLOWER_EMOTION_HAPPY] = 20; - if (GetCurrentWeather() == WEATHER_SUNNY || GetCurrentWeather() == WEATHER_SUNNY_CLOUDS) - cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_HAPPY, .index=31}; // Neutral weights emotion_weight[FOLLOWER_EMOTION_NEUTRAL] = 15; // Sad weights emotion_weight[FOLLOWER_EMOTION_SAD] = 5; - health_percent = mon->hp * 100 / mon->maxHP; - if (health_percent < 50 || mon->status & 0x40) // STATUS1_PARALYSIS - emotion_weight[FOLLOWER_EMOTION_SAD] = 30; // Upset weights emotion_weight[FOLLOWER_EMOTION_UPSET] = friendship < 80 ? 15 : 5; // Angry weights @@ -1833,12 +1829,37 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big emotion_weight[FOLLOWER_EMOTION_LOVE] = 30; else if (friendship > 80) emotion_weight[FOLLOWER_EMOTION_LOVE] = 20; - // Surprise weights - // TODO: Scale this with how long the follower has been out + // Surprise weights TODO: Scale this with how long the follower has been out emotion_weight[FOLLOWER_EMOTION_SURPRISE] = 10; - // Curious weights - // TODO: Increase this if there is an item nearby, or if the pokemon has pickup - emotion_weight[FOLLOWER_EMOTION_CURIOUS] = 5; + // Curious weights TODO: Increase this if there is an item nearby, or if the pokemon has pickup + emotion_weight[FOLLOWER_EMOTION_CURIOUS] = 10; + // Music weights TODO: Change this depending on music ? + emotion_weight[FOLLOWER_EMOTION_MUSIC] = friendship > 80 ? 20 : 15; + + // Conditional messages follow + // Weather-related + if (GetCurrentWeather() == WEATHER_SUNNY || GetCurrentWeather() == WEATHER_SUNNY_CLOUDS) + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_HAPPY, .index=31}; + else if (GetCurrentWeather() == WEATHER_RAIN || GetCurrentWeather() == WEATHER_RAIN_THUNDERSTORM) { + if (SpeciesHasType(species, TYPE_FIRE)) { + emotion_weight[FOLLOWER_EMOTION_SAD] = 30; + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_SAD, .index=3}; + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_UPSET, .index=3}; + } + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_SURPRISE, .index=20}; + } + // Health & status-related + health_percent = mon->hp * 100 / mon->maxHP; + if (health_percent < 20) { + emotion_weight[FOLLOWER_EMOTION_SAD] = 30; + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_SAD, .index=4}; + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_SAD, .index=5}; + } + if (health_percent < 50 || mon->status & 0x40) { // STATUS1_PARALYSIS + emotion_weight[FOLLOWER_EMOTION_SAD] = 30; + cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_SAD, .index=6}; + } + emotion = RandomWeightedIndex(emotion_weight, FOLLOWER_EMOTION_LENGTH); if (mon->status & 0x8) // STATUS1_POISON emotion = FOLLOWER_EMOTION_POISONED; @@ -1853,12 +1874,11 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big } } if (choice) { // Only continue if a script was actually chosen + ctx->data[0] = (u32) followerBasicMessages[emotion].messages[choice->index]; if (choice->script) ScriptCall(ctx, choice->script); - else { - ctx->data[0] = (u32) followerBasicMessages[emotion].messages[choice->index]; + else ScriptCall(ctx, followerBasicMessages[emotion].script); - } return FALSE; } } diff --git a/src/trainer_see.c b/src/trainer_see.c index ec4c8e461e..eb0cef4734 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -178,77 +178,77 @@ static const struct SpriteFrameImage sSpriteImageTable_Emotes[] = static const union AnimCmd sSpriteAnim_Emotes0[] = { ANIMCMD_FRAME(0*2, 30), - ANIMCMD_FRAME(0*2+1, 30), + ANIMCMD_FRAME(0*2+1, 25), ANIMCMD_FRAME(0*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes1[] = { ANIMCMD_FRAME(1*2, 30), - ANIMCMD_FRAME(1*2+1, 30), + ANIMCMD_FRAME(1*2+1, 25), ANIMCMD_FRAME(1*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes2[] = { ANIMCMD_FRAME(2*2, 30), - ANIMCMD_FRAME(2*2+1, 30), + ANIMCMD_FRAME(2*2+1, 25), ANIMCMD_FRAME(2*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes3[] = { ANIMCMD_FRAME(3*2, 30), - ANIMCMD_FRAME(3*2+1, 30), + ANIMCMD_FRAME(3*2+1, 25), ANIMCMD_FRAME(3*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes4[] = { ANIMCMD_FRAME(4*2, 30), - ANIMCMD_FRAME(4*2+1, 30), + ANIMCMD_FRAME(4*2+1, 25), ANIMCMD_FRAME(4*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes5[] = { ANIMCMD_FRAME(5*2, 30), - ANIMCMD_FRAME(5*2+1, 30), + ANIMCMD_FRAME(5*2+1, 25), ANIMCMD_FRAME(5*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes6[] = { ANIMCMD_FRAME(6*2, 30), - ANIMCMD_FRAME(6*2+1, 30), + ANIMCMD_FRAME(6*2+1, 25), ANIMCMD_FRAME(6*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes7[] = { ANIMCMD_FRAME(7*2, 30), - ANIMCMD_FRAME(7*2+1, 30), + ANIMCMD_FRAME(7*2+1, 25), ANIMCMD_FRAME(7*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes8[] = { ANIMCMD_FRAME(8*2, 30), - ANIMCMD_FRAME(8*2+1, 30), + ANIMCMD_FRAME(8*2+1, 25), ANIMCMD_FRAME(8*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes9[] = { ANIMCMD_FRAME(9*2, 30), - ANIMCMD_FRAME(9*2+1, 30), + ANIMCMD_FRAME(9*2+1, 25), ANIMCMD_FRAME(9*2, 30), ANIMCMD_END }; static const union AnimCmd sSpriteAnim_Emotes10[] = { ANIMCMD_FRAME(10*2, 30), - ANIMCMD_FRAME(10*2+1, 30), + ANIMCMD_FRAME(10*2+1, 25), ANIMCMD_FRAME(10*2, 30), ANIMCMD_END };