diff --git a/data/scripts/follower.inc b/data/scripts/follower.inc index bc4d2f4d34..0f467c1e7f 100644 --- a/data/scripts/follower.inc +++ b/data/scripts/follower.inc @@ -13,6 +13,9 @@ gText_FollowerHasWetFeet:: gText_FollowerSplashesAround:: .string "{STR_VAR_1} splashes around happily!$" +gText_WantsToFly:: + .string "{STR_VAR_1} looks adventurous.\nWould you like to use FLY?$" + .macro playfirstmoncry callfunc ScrFunc_playfirstmoncry .endm @@ -27,7 +30,18 @@ EventScript_Follower:: lock faceplayer callfunc ScrFunc_getfolloweraction - msgbox gText_FollowerDefault, MSGBOX_DEFAULT + checkpartymove MOVE_FLY + compare VAR_RESULT 6 + goto_if_eq EventScript_FollowerEnd + bufferlivemonspeciesname 0 + msgbox gText_WantsToFly, MSGBOX_YESNO + switch VAR_RESULT + case NO, EventScript_FollowerEnd + case YES, EventScript_FollowerFly + case MULTI_B_PRESSED, EventScript_FollowerEnd +EventScript_FollowerFly:: + callfunc ScrFunc_followerfly +EventScript_FollowerEnd:: release end @@ -36,8 +50,7 @@ EventScript_FollowerHasWetFeet:: playfirstmoncry msgbox gText_FollowerHasWetFeet, MSGBOX_DEFAULT waitmoncry - release - end + return EventScript_FollowerSplashesAbout:: bufferlivemonspeciesname 0 @@ -45,8 +58,7 @@ EventScript_FollowerSplashesAbout:: applymovement 0xFE FollowerSplashMovement waitmovement 0xFE msgbox gText_FollowerSplashesAround, MSGBOX_DEFAULT - release - end + return EnterPokeballMovement:: .byte 0x9F @ EnterPokeball @@ -65,5 +77,4 @@ EventScript_FollowerLovesYou:: waitmoncry bufferlivemonspeciesname 0 msgbox gText_FollowerLovesYou, MSGBOX_DEFAULT - release - end + return diff --git a/src/event_object_movement.c b/src/event_object_movement.c index f0c1e58015..8e3634bc39 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -21,6 +21,7 @@ #include "palette.h" #include "pokemon.h" #include "random.h" +#include "region_map.h" #include "script.h" #include "sprite.h" #include "task.h" @@ -1679,23 +1680,30 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big struct ObjectEvent *objEvent = &gObjectEvents[GetObjectEventIdByLocalIdAndMap(OBJ_EVENT_ID_FOLLOWER, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup)]; struct Pokemon *follower = GetFirstLiveMon(); if (follower == NULL) { + ScriptCall(ctx, EventScript_FollowerLovesYou); return FALSE; } behavior = MapGridGetMetatileBehaviorAt(objEvent->currentCoords.x, objEvent->currentCoords.y); species = GetMonData(follower, MON_DATA_SPECIES); if (MetatileBehavior_IsPuddle(behavior) || MetatileBehavior_IsShallowFlowingWater(behavior)) { if (gBaseStats[species].type1 == TYPE_FIRE || gBaseStats[species].type2 == TYPE_FIRE) { - ScriptJump(ctx, EventScript_FollowerHasWetFeet); + ScriptCall(ctx, EventScript_FollowerHasWetFeet); return FALSE; } else if (GetObjectEventGraphicsInfo(objEvent->graphicsId)->tracks) { // if follower leaves tracks - ScriptJump(ctx, EventScript_FollowerSplashesAbout); + ScriptCall(ctx, EventScript_FollowerSplashesAbout); return FALSE; } } if (GetCurrentWeather() == WEATHER_RAIN || GetCurrentWeather() == WEATHER_RAIN_THUNDERSTORM) { - ScriptJump(ctx, EventScript_FollowerLovesYou); + ScriptCall(ctx, EventScript_FollowerLovesYou); } - ScriptJump(ctx, EventScript_FollowerLovesYou); + // SetMainCallback2(CB2_OpenFlyMap); + ScriptCall(ctx, EventScript_FollowerLovesYou); + return FALSE; +} + +bool8 ScrFunc_followerfly(struct ScriptContext *ctx) { + SetMainCallback2(CB2_OpenFlyMap); return FALSE; }