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

Fly from Pokenav #5679

Open
wants to merge 11 commits into
base: upcoming
Choose a base branch
from
Open

Fly from Pokenav #5679

wants to merge 11 commits into from

Conversation

khbsd
Copy link

@khbsd khbsd commented Nov 18, 2024

Lets the player press 'R' over locations they have visited to fly to them from the PokeNav Region Map.

Description

  • refactored some logic from CB_ExitFlyMap() to allow setting the fly destination correctly from other files
  • added OW_FLAG_POKE_RIDER to allow this feature to be disabled
  • added gSkipShowMonAnim as an EWRAM variable to control whether the ShowMon animation plays or not
  • added new Looped Task in pokenav_region_map.c to handle flying
  • added new function UpdateRegionMapHelpBarText() so the HelpBarText can be easily synced with cursor movement and loading the map from the menu
  • added new inputs to both ProcessRegionMapInput_* functions
  • added new zoomed in and out text strings with the R button and the text 'FLY' for when the cursor is over a flyable location in the region map
  • adjusted some #includes and changed some static functions to non-static so they could be declared in the header files
  • uhhhhh probs more but i forgor

remade the branch and manually copy-pasted the correct changes. cleaned, compiled, tested.

Feature(s) this PR does NOT handle:

Adding other interactions in the overworld to handle other HM moves, this is specifically for Fly

Discord contact info

@khbsd

@AlexOn1ine AlexOn1ine added the new-feature Adds a feature label Nov 18, 2024
@AlexOn1ine AlexOn1ine added this to the 1.11 milestone Nov 18, 2024
@AlexOn1ine AlexOn1ine self-assigned this Nov 18, 2024
@AlexOn1ine AlexOn1ine removed their assignment Dec 3, 2024
@AlexOn1ine
Copy link
Collaborator

Could you also make it work with the Town Map item?

@hedara90
Copy link
Collaborator

Currently, you can use the PokeNav to fly while indoors (and I'm assuming other areas where flying is usually not possible).

Comment on lines 84 to 88
#define OW_FLAG_PAUSE_TIME 0 // If this flag is set and OW_USE_FAKE_RTC is enabled, seconds on the in-game clock will not advance.
#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled.
#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to.
#define OW_FLAG_NO_COLLISION 0 // If this flag is set, the player will be able to walk over tiles with collision. Mainly intended for debugging purposes.
#define OW_FLAG_POKE_RIDER 0 // If this flag is set, the player will be able to use fly from the Pokenav Region Map section by pressing 'R' on a city/location they have been to.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define OW_FLAG_PAUSE_TIME 0 // If this flag is set and OW_USE_FAKE_RTC is enabled, seconds on the in-game clock will not advance.
#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled.
#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to.
#define OW_FLAG_NO_COLLISION 0 // If this flag is set, the player will be able to walk over tiles with collision. Mainly intended for debugging purposes.
#define OW_FLAG_POKE_RIDER 0 // If this flag is set, the player will be able to use fly from the Pokenav Region Map section by pressing 'R' on a city/location they have been to.
#define OW_FLAG_PAUSE_TIME 0 // If this flag is set and OW_USE_FAKE_RTC is enabled, seconds on the in-game clock will not advance.
#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled.
#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to.
#define OW_FLAG_NO_COLLISION 0 // If this flag is set, the player will be able to walk over tiles with collision. Mainly intended for debugging purposes.
#define OW_FLAG_POKE_RIDER 0 // If this flag is set, the player will be able to use fly from the Pokenav Region Map section by pressing 'R' on a city/location they have been to.

Match previous alignment

{
struct RegionMap* regionMap = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP);

if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER)
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER && Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType))

Handling for prevention of flying indoors etc.

@@ -215,6 +222,9 @@ static u32 HandleRegionMapInput(struct Pokenav_RegionMapMenu *state)
case MAP_INPUT_B_BUTTON:
state->callback = GetExitRegionMapMenuId;
return POKENAV_MAP_FUNC_EXIT;
case MAP_INPUT_R_BUTTON:
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER)
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER && Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType) == TRUE)

@khbsd
Copy link
Author

khbsd commented Dec 19, 2024

addressed @hedara90's comments, looking into the town map item functionality now!

@khbsd
Copy link
Author

khbsd commented Dec 20, 2024

added the prompt for flying from the town map. it replaces HOENN in the region title at the top right; this was the most space-efficient solution i could think of that didnt mean covering up more of the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants