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

[Enhancement] Allow Starters to Remember Egg Moves #2482

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

xsn34kzx
Copy link
Collaborator

@xsn34kzx xsn34kzx commented Jun 21, 2024

What are the changes?

Fixes #1337; allows original party members picked at the start of a run to relearn their egg moves, if applicable, using a Memory Mushroom regardless of whether they've evolved or not.

Why am I doing these changes?

Currently, egg moves only stay in a party member's moveset for as long as they're not replaced, which makes having egg moves hard to coordinate with how dynamic runs are and puts a lot of weight on the decision to replace those moves in situations where its unavoidable (move-related evolutions like Steenee) or accidental (misinputs or lapses in judgement). A good example of this comes from issue #1337, where you find uses for egg moves later when previously there may not have been a reason to keep it over another move or TM but now you're effectively locked out of it and any other egg move for the rest of the run.

To alleviate the fear of losing those egg moves and the opportunity to make use of those egg moves, it would only make sense to add them to the list of learnable moves provided by Memory Mushroom but only for party members you started with, maintaining the intention of egg moves being exclusive to starters while removing the need to potentially hoard egg moves.

What did change?

getLearnableLevelMoves was changed such that it still gets a list of learnable level moves, but, in the case that the Pokemon being used to call the function is a starter (if metBiome is -1), then all applicable egg moves are appended to the list before filtering out any already known moves within the Pokemon's moveset. Getting the unlocked egg moves is done through a new function getUnlockedEggMoves, which mostly uses the logic from starter-select-ui-handler.ts that determines what egg moves are unlocked. Within this function, however, a new field was added for Pokemon, metSpecies.

The context for this field is due to an edge case where several Pokemon in a single evolution line can be selected at a given time (i.e., Pikachu and Pichu). In all other cases, all that's needed is to call getRootSpeciesId to get, for example, Charmander from Charizard. However, because Pikachu does not have any egg moves and Pichu does, it would curb the trade-off of picking Pichu for his egg moves if Pikachu can just inherit those egg moves without having to start as Pichu. getRootSpeciesId is still used, but it's limited in that it, when forStarter is set to true, it'll stop if the Pokemon can be used as a starter. This means that, if a starting Pichu evolves, it would then get locked out of its own egg moves since getRootSpeciesId can't tell the difference between a starting Pikachu and an evolved Pichu.

This leads to the necessity of a metSpecies field, which essentially notes down what Species the Pokemon was at the time it was captured/put into the party. To accommodate the addition of this field, lines were added to the Pokemon constructor to either make an educated guess for loading Pokemon from an existing save (for example, if your run has a Charizard you started with, it'll use getRootSpeciesId to fill in the field with Species.CHARMANDER) but otherwise store the current species in metSpecies since it would be impossible to know if, for example, you caught a Fearow or evolved a Spearow in a run that's already progressed. For new saves however, metSpecies is set correctly for both caught Pokemon and starters. The application of this field is most readily shown in the Pikachu example in the Screenshots section.

PokemonData was changed to include the field and save it properly.

Screenshots/Videos

General Example

For a starter Charizard with Dragon Dance already in its moveset,

rememberEggMoveBefore rememberEggMoveStarter
Before After

Note that the coloring comes from the logic already used for making inherited fusion moves stand out from standard level moves.

Edge Cases - Differentiating Starters and Catches

Using the same species,

rememberEggMovesExStarter rememberEggMovesExNonStarter
Starter Caught

Note that the second Charmander's move list does not include any of the egg moves present in the first one's move list.

Edge Cases - Differentiating Multiple Starters in an Evolution Line

Using metSpecies between two starters of the same species,

rememberEggMovesEvolvedPichu rememberEggMovesStarterPikachu
Evolved Pichu Pikachu

Note that metSpecies allows Pichu to retain the ability to relearn his egg moves but keeps Pikachu from having access to those egg moves despite being a starter as well.

How to test the changes?

To test if egg moves are visible in Memory Mushroom's list, the following override can be used to force a Memory Mushroom roll so that it can be used immediately:

export const ITEM_REWARD_OVERRIDE: Array<String> = [ "MEMORY_MUSHROOM" ];

STARTER_SPECIES_OVERRIDE can be changed to any Species that has egg moves already or evolves from a starter that does.

Additionally, to test the absence of egg moves in Memory Mushroom's list, catch any wild Pokemon (which can be combined with OPP_SPECIES_OVERRIDE to force a Species you know has egg moves) and use the Memory Mushroom on them.

Comments

A few things worth noting:

  • Because metSpecies is a new field and will be null for old saves, the Pichu-Pikachu edge case will affect all evolution lines with selectable baby Pokemon starters. This means that old saves won't be able to take advantage of this change for those specific Pokemon (i.e., an existing Raichu evolved from a Pichu will not be able to relearn its egg moves). However, the use of getRootSpeciesId works well for standard evolutionary lines, so this change would allow, for example, existing Charizards that were in the starting party to access their egg moves.
  • metSpecies was purely introduced to address the last edge case. Without it, balance would definitely be hurt (the aforementioned case where Pikachu is just always the better pick over Pichu if he can use Pichu's egg moves). This being its only use is a bit cumbersome, especially since it adds a data point, but I can see applications for knowing the species you met a Pokemon ([Feature] Add run info #2374 immediately comes to mind) in the future.
  • For simplicity, fusions do not add their own egg moves into the learnable move pool as of right now, even if the fused Pokemon is also a starter. This can be added if desired, but I figured I would aim to get the base Pokemon's egg moves only first before trying to include more.

Checklist

  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

@CodeTappert CodeTappert added (Legacy) Bug Legacy Label, don't apply to new issues/PRs Enhancement New feature or request and removed (Legacy) Bug Legacy Label, don't apply to new issues/PRs labels Jun 21, 2024
@damocleas damocleas added the Balance Team Specifically a balance team change label Jun 21, 2024
@Fontbane
Copy link
Contributor

I actually made a PR to do this a month ago (#1143). I didn’t consider the baby edge case though, that’s an annoying one.

@xsn34kzx
Copy link
Collaborator Author

xsn34kzx commented Jun 21, 2024

I actually made a PR to do this a month ago (#1143). I didn’t consider the baby edge case though, that’s an annoying one.

My bad, I searched the issues sections right before writing things but forgot to double check the PRs section. That edge case though is definitely throwing a wrench in how much cleaner and clear cut this would've been.

@Xavion3
Copy link
Contributor

Xavion3 commented Jul 17, 2024

This has been discussed before and as far as I know the current plan is to not though, although the possibility of making a distinct item used for regaining egg moves has been raised. This will need review by head devs at least because it is potentially a significant change to game balance.

@damocleas
Copy link
Collaborator

damocleas commented Jul 17, 2024

This has been discussed before and as far as I know the current plan is to not though, although the possibility of making a distinct item used for regaining egg moves has been raised. This will need review by head devs at least because it is potentially a significant change to game balance.

This is simply a feature to allow starter pokemon to remember their Pokerogue* 4 egg moves, as they are the only ones that use the specified met location this uses.

This is not a major balancing concern, as it is fully expected these are available to these pokemon once they are unlocked anyways if you choose them as a starter. This should alleviate some pressure on players currently feeling like it's not good to remove them for some time in fear of not being able to access the move again in a classic/endless run.

@HighMans
Copy link
Contributor

(Me not hoping this gets implemented because I accidentally overwrote conversion on my smeargle 2hrs in to a endless run... 💀)

@Xavion3 Xavion3 added the Game Balance Changes that heavily impact the game label Jul 28, 2024
@f-fsantos f-fsantos merged commit 302f1e5 into pagefaultgames:beta Aug 2, 2024
4 checks passed
@xsn34kzx xsn34kzx deleted the remember_egg_moves branch August 8, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance Team Specifically a balance team change Enhancement New feature or request Game Balance Changes that heavily impact the game
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants