Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRLG+ whiteout message #4967

Merged
merged 8 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,37 @@ EventScript_WhiteOut::
goto EventScript_ResetMrBriney
end

EventScript_AfterWhiteOutHeal::
lockall
msgbox gText_FirstShouldRestoreMonsHealth
call EventScript_PkmnCenterNurse_TakeAndHealPkmn
call_if_unset FLAG_DEFEATED_RUSTBORO_GYM, EventScript_AfterWhiteOutHealMsgPreRoxanne
call_if_set FLAG_DEFEATED_RUSTBORO_GYM, EventScript_AfterWhiteOutHealMsg
applymovement VAR_LAST_TALKED, Movement_PkmnCenterNurse_Bow
waitmovement 0
fadedefaultbgm
releaseall
end

EventScript_AfterWhiteOutHealMsgPreRoxanne::
msgbox gText_MonsHealedShouldBuyPotions
return

EventScript_AfterWhiteOutHealMsg::
msgbox gText_MonsHealed
return

EventScript_AfterWhiteOutMomHeal::
lockall
applymovement LOCALID_MOM, Common_Movement_WalkInPlaceFasterDown
waitmovement 0
msgbox gText_HadQuiteAnExperienceTakeRest
call Common_EventScript_OutOfCenterPartyHeal
msgbox gText_MomExplainHPGetPotions
fadedefaultbgm
releaseall
end

EventScript_ResetMrBriney::
goto_if_eq VAR_BRINEY_LOCATION, 1, EventScript_MoveMrBrineyToHouse
goto_if_eq VAR_BRINEY_LOCATION, 2, EventScript_MoveMrBrineyToDewford
Expand Down Expand Up @@ -887,6 +918,48 @@ gText_PlayerWhitedOut::
.string "{PLAYER} is out of usable\n"
.string "POKéMON!\p{PLAYER} whited out!$"

gText_FirstShouldRestoreMonsHealth::
.string "First, you should restore your\n"
.string "POKéMON to full health.$"

gText_MonsHealedShouldBuyPotions::
.string "Your POKéMON have been healed\n"
.string "to perfect health.\p"
.string "If your POKéMON's energy, HP,\n"
.string "is down, please come see us.\p"
.string "If you're planning to go far in the\n"
.string "field, you should buy some POTIONS\l"
.string "at the POKéMON MART.\p"
.string "We hope you excel!$"

gText_MonsHealed::
.string "Your POKéMON have been healed\n"
.string "to perfect health.\p"
.string "We hope you excel!$"

gText_HadQuiteAnExperienceTakeRest::
.string "MOM: {PLAYER}!\n"
.string "Welcome home.\p"
.string "It sounds like you had quite\n"
.string "an experience.\p"
.string "Maybe you should take a quick\n"
.string "rest.$"

gText_MomExplainHPGetPotions::
.string "MOM: Oh, good! You and your\n"
.string "POKéMON are looking great.\p"
.string "I just heard from PROF. BIRCH.\p"
.string "He said that POKéMON's energy is\n"
.string "measured in HP.\p"
.string "If your POKéMON lose their HP,\n"
.string "you can restore them at any\l"
.string "POKéMON CENTER.\p"
.string "If you're going to travel far away,\n"
.string "the smart TRAINER stocks up on\l"
.string "POTIONS at the POKéMON MART.\p"
.string "Make me proud, honey!\p"
.string "Take care!$"

gText_RegisteredTrainerinPokeNav::
.string "Registered {STR_VAR_1} {STR_VAR_2}\n"
.string "in the POKéNAV.$"
Expand Down
1 change: 1 addition & 0 deletions include/config/overworld.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all.
#define OW_DOUBLE_APPROACH_WITH_ONE_MON FALSE // If enabled, you can be spotted by two trainers at the same time even if you only have one eligible Pokémon in your party.
#define OW_HIDE_REPEAT_MAP_POPUP FALSE // If enabled, map popups will not appear if entering a map with the same Map Section Id as the last.
#define OW_FRLG_WHITEOUT FALSE // If enabled, shows an additional whiteout message and post whiteout event script with healing NPC
cawtds marked this conversation as resolved.
Show resolved Hide resolved

// These generational defines only make a distinction for Berries and the OW_PC_MOVE_ORDER
#define GEN_6_XY GEN_6
Expand Down
1 change: 1 addition & 0 deletions include/constants/heal_locations.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
#define HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE 20
#define HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR 21
#define HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST 22
#define HEAL_LOCATION_COUNT 23

#endif // GUARD_CONSTANTS_HEAL_LOCATIONS_H
2 changes: 2 additions & 0 deletions include/event_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,8 @@ extern const u8 EventScript_SelectWithoutRegisteredItem[];

// overworld
extern const u8 EventScript_WhiteOut[];
extern const u8 EventScript_AfterWhiteOutMomHeal[];
extern const u8 EventScript_AfterWhiteOutHeal[];
extern const u8 EventScript_ResetMrBriney[];
extern const u8 EventScript_DoLinkRoomExit[];
extern const u8 CableClub_EventScript_TooBusyToNotice[];
Expand Down
1 change: 1 addition & 0 deletions include/field_screen_effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void FieldCB_ReturnToFieldWirelessLink(void);
void FieldCB_DefaultWarpExit(void);
void FieldCB_WarpExitFadeFromBlack(void);
void FieldCB_WarpExitFadeFromWhite(void);
void FieldCB_RushInjuredPokemonToCenter(void);
bool8 FieldCB_ReturnToFieldOpenStartMenu(void);
void ReturnToFieldOpenStartMenu(void);
void FieldCB_ReturnToFieldNoScript(void);
Expand Down
4 changes: 4 additions & 0 deletions include/heal_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ struct HealLocation
};

u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum);
u32 GetHealLocationIndexByWarpData(struct WarpData *warp);
const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum);
const struct HealLocation *GetHealLocation(u32 index);
bool32 IsLastHealLocationPlayerHouse();
void SetWhiteoutRespawnWarpAndHealerNPC(struct WarpData * warp);
bool32 HasHealNPC(u32 healLocationId);
cawtds marked this conversation as resolved.
Show resolved Hide resolved

#endif // GUARD_HEAL_LOCATION_H
4 changes: 4 additions & 0 deletions include/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3046,4 +3046,8 @@ extern const u8 gText_PlantBerry[];
extern const u8 gText_AM[];
extern const u8 gText_PM[];

// FRLG whiteout
extern const u8 gText_PlayerScurriedToCenter[];
extern const u8 gText_PlayerScurriedBackHome[];

#endif // GUARD_STRINGS_H
175 changes: 175 additions & 0 deletions src/data/heal_locations_pkm_center.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#define DEFAULT_POKEMON_CENTER_COORDS .x = 7, .y = 4

static const struct HealLocation sHealLocationsPokemonCenter[HEAL_LOCATION_COUNT - 1] =
{
[HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F - 1] =
{
.group = MAP_GROUP(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F),
.map = MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F),
.x = 2,
.y = 7,
},
[HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F - 1] =
{
.group = MAP_GROUP(LITTLEROOT_TOWN_MAYS_HOUSE_1F),
.map = MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_1F),
.x = 8,
.y = 7,
},
[HEAL_LOCATION_PETALBURG_CITY - 1] =
{
.group = MAP_GROUP(PETALBURG_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(PETALBURG_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_SLATEPORT_CITY - 1] =
{
.group = MAP_GROUP(SLATEPORT_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(SLATEPORT_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_MAUVILLE_CITY - 1] =
{
.group = MAP_GROUP(MAUVILLE_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(MAUVILLE_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_RUSTBORO_CITY - 1] =
{
.group = MAP_GROUP(RUSTBORO_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(RUSTBORO_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_FORTREE_CITY - 1] =
{
.group = MAP_GROUP(FORTREE_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(FORTREE_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_LILYCOVE_CITY - 1] =
{
.group = MAP_GROUP(LILYCOVE_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(LILYCOVE_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_MOSSDEEP_CITY - 1] =
{
.group = MAP_GROUP(MOSSDEEP_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(MOSSDEEP_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_SOOTOPOLIS_CITY - 1] =
{
.group = MAP_GROUP(SOOTOPOLIS_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(SOOTOPOLIS_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_EVER_GRANDE_CITY - 1] =
{
.group = MAP_GROUP(EVER_GRANDE_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(EVER_GRANDE_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE - 1] =
{
.group = MAP_GROUP(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F),
.map = MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F),
.x = 2,
.y = 7,
},
[HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE - 1] =
{
.group = MAP_GROUP(LITTLEROOT_TOWN_MAYS_HOUSE_1F),
.map = MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_1F),
.x = 8,
.y = 7,
},
[HEAL_LOCATION_OLDALE_TOWN - 1] =
{
.group = MAP_GROUP(OLDALE_TOWN_POKEMON_CENTER_1F),
.map = MAP_NUM(OLDALE_TOWN_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_DEWFORD_TOWN - 1] =
{
.group = MAP_GROUP(DEWFORD_TOWN_POKEMON_CENTER_1F),
.map = MAP_NUM(DEWFORD_TOWN_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_LAVARIDGE_TOWN - 1] =
{
.group = MAP_GROUP(LAVARIDGE_TOWN_POKEMON_CENTER_1F),
.map = MAP_NUM(LAVARIDGE_TOWN_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_FALLARBOR_TOWN - 1] =
{
.group = MAP_GROUP(FALLARBOR_TOWN_POKEMON_CENTER_1F),
.map = MAP_NUM(FALLARBOR_TOWN_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_VERDANTURF_TOWN - 1] =
{
.group = MAP_GROUP(VERDANTURF_TOWN_POKEMON_CENTER_1F),
.map = MAP_NUM(VERDANTURF_TOWN_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_PACIFIDLOG_TOWN - 1] =
{
.group = MAP_GROUP(PACIFIDLOG_TOWN_POKEMON_CENTER_1F),
.map = MAP_NUM(PACIFIDLOG_TOWN_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
[HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE - 1] =
{
.group = MAP_GROUP(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F),
.map = MAP_NUM(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F),
.x = 3,
.y = 4,
},
[HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR - 1] =
{
.group = MAP_GROUP(SOUTHERN_ISLAND_EXTERIOR),
.map = MAP_NUM(SOUTHERN_ISLAND_EXTERIOR),
.x = 15,
.y = 20,
},
[HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST - 1] =
{
.group = MAP_GROUP(BATTLE_FRONTIER_POKEMON_CENTER_1F),
.map = MAP_NUM(BATTLE_FRONTIER_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
};

#undef DEFAULT_POKEMON_CENTER_COORDS

// localIds can be found in the generated events.inc file for the specific heal location map
// e.g. for OldaleTown_PokemonCenter1F/events.inc the following entry gets generated:
// object_event 1, OBJ_EVENT_GFX_NURSE, 7, 2, 3, MOVEMENT_TYPE_FACE_DOWN, 0, 0, TRAINER_TYPE_NONE, 0, OldaleTown_PokemonCenter_1F_EventScript_Nurse, 0
// In this case the localId is 1.
static const u8 sWhiteoutRespawnHealerNpcLocalIds[HEAL_LOCATION_COUNT - 1] =
cawtds marked this conversation as resolved.
Show resolved Hide resolved
{
[HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F - 1] = 1,
pkmnsnfrn marked this conversation as resolved.
Show resolved Hide resolved
[HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F - 1] = 1,
[HEAL_LOCATION_PETALBURG_CITY - 1] = 1,
[HEAL_LOCATION_SLATEPORT_CITY - 1] = 1,
[HEAL_LOCATION_MAUVILLE_CITY - 1] = 1,
[HEAL_LOCATION_RUSTBORO_CITY - 1] = 1,
[HEAL_LOCATION_FORTREE_CITY - 1] = 1,
[HEAL_LOCATION_LILYCOVE_CITY - 1] = 1,
[HEAL_LOCATION_MOSSDEEP_CITY - 1] = 1,
[HEAL_LOCATION_SOOTOPOLIS_CITY - 1] = 1,
[HEAL_LOCATION_EVER_GRANDE_CITY - 1] = 1,
[HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE - 1] = 1,
[HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE - 1] = 1,
[HEAL_LOCATION_OLDALE_TOWN - 1] = 1,
[HEAL_LOCATION_DEWFORD_TOWN - 1] = 1,
[HEAL_LOCATION_LAVARIDGE_TOWN - 1] = 1,
[HEAL_LOCATION_FALLARBOR_TOWN - 1] = 1,
[HEAL_LOCATION_VERDANTURF_TOWN - 1] = 1,
[HEAL_LOCATION_PACIFIDLOG_TOWN - 1] = 1,
[HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE - 1] = 1,
[HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR - 1] = 0, // no heal npc
[HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST - 1] = 1,
pkmnsnfrn marked this conversation as resolved.
Show resolved Hide resolved
};
Loading
Loading