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

[Challenge] Add Nuzlocke-related challenges #4311

Draft
wants to merge 2 commits into
base: beta
Choose a base branch
from

Conversation

DayKev
Copy link
Collaborator

@DayKev DayKev commented Sep 18, 2024

Todo:

  • Change method of "one catch per biome" restriction
  • Prevent fusions with fainted Pokémon in hardcore challenge
    • Would also affect splicing in other challenges, needs balance team discussion
  • Restrict MEs that call PartyHealPhase from appearing during no autoheal challenge?

What are the changes the user will see?

Adds 3 new challenges:

  • "No Free Heal": Disables the automatic healing that occurs after every 10th wave, replacing it with a normal shop phase
  • "Hardcore": Fainted Pokémon can't be revived
  • "Limited Catch": Only the first wild Pokémon encounter
    of every biome can be added to your current party (ie: from waves 1, 11, 21, ...)
    • Takes into account if the X1 wave was a ME, allowing you to catch the Pokémon on wave X2 instead

Why am I making these changes?

Nuzlocke mode is a popular request/on the roadmap.

What are the changes from a developer perspective?

6 new ChallengeTypes were added:

  • NO_HEAL_PHASE
    Checks if the heal phase after every 10th wave should be activated. See src/phases/party-heal-phase.ts

  • SHOP_ITEM_BLACKLIST
    Filters the shop for specific items. See src/modifier/modifier-type.ts and src/ui/modifier-select-ui-handler.ts

  • RANDOM_ITEM_BLACKLIST
    Filters the random item selection for specific items. See src/modifier/modifier-type.ts

  • ADD_POKEMON_TO_PARTY
    Checks if the current caught Pokémon can be added to the party. See src/phases/attempt-capture-phase.ts

  • MOVE_BLACKLIST
    Checks if move the user wants to use is illegal for this challenge. See src/phases/command-phase.ts

  • PREVENT_REVIVE
    Checks if Pokémon can be revived. See src/phases/party-heal-phase.ts

Screenshots/Videos

Starter filter with "No Legends" challenge active

image

Shop with "Hardcore" challenge active

image

Lack of auto-heal with "No Free Heal" challenge active
no.auto.heal.challenge.mp4
Caught Pokémon not going to party with "Limited Catch" challenge active
pokemon.doesn.t.go.to.party.mp4

How to test the changes?

Start a new challenge run with one or more of the challenges active.

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
    • The individual challenges are related to a common overarching challenge
  • Have I provided a clear explanation of the changes?
  • Have I considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • 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?

@DayKev DayKev added Enhancement New feature or request Challenges Challenge mode/s related labels Sep 18, 2024
@DayKev DayKev marked this pull request as ready for review September 19, 2024 13:38
@DayKev DayKev requested review from a team as code owners September 19, 2024 13:38
@DayKev
Copy link
Collaborator Author

DayKev commented Sep 19, 2024

I see it picks 3 random people to request for review now lmao.

Anyway, more or less ready (still need to figure out some tests). Could use some opinions on the challenge names/descriptions, I didn't spend long on them.

Copy link
Collaborator

@frutescens frutescens left a comment

Choose a reason for hiding this comment

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

Could you edit challengeParser() in run-info-ui-handler to process these new challenges?

@Adri1
Copy link
Contributor

Adri1 commented Sep 20, 2024

Question: "Hardcore" mode also prevent the Pokémon to be heald every 10 waves, or it only applies to reviving items?

@DayKev
Copy link
Collaborator Author

DayKev commented Sep 21, 2024

Question: "Hardcore" mode also prevent the Pokémon to be heald every 10 waves, or it only applies to reviving items?

It only prevents reviving, non-fainted Pokémon will still be healed if only Hardcore is active.

src/data/challenge.ts Show resolved Hide resolved
src/data/challenge.ts Outdated Show resolved Hide resolved
src/data/challenge.ts Outdated Show resolved Hide resolved
src/data/challenge.ts Outdated Show resolved Hide resolved
src/modifier/modifier-type.ts Outdated Show resolved Hide resolved
src/data/challenge.ts Outdated Show resolved Hide resolved
SangaraSorama
SangaraSorama previously approved these changes Sep 30, 2024
Copy link
Contributor

@SangaraSorama SangaraSorama left a comment

Choose a reason for hiding this comment

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

Approval for the locales folder.

src/modifier/modifier-type.ts Outdated Show resolved Hide resolved
src/data/challenge.ts Outdated Show resolved Hide resolved
@f-fsantos f-fsantos added Game Balance Changes focused on game balance Balance Team Specifically a balance team change labels Oct 13, 2024
damocleas
damocleas previously approved these changes Oct 16, 2024
damocleas
damocleas previously approved these changes Oct 16, 2024
}

override applyAddPokemonToParty(pokemon: EnemyPokemon, waveIndex: number, canAddToParty: BooleanHolder): boolean {
if (!(waveIndex % 10 === 1) && !(pokemon.scene.lastMysteryEncounter && (waveIndex % 10 === 2))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

lastMysteryEncounter gets cleared upon reload (it's only used for clearing the last wave's ME visuals), so the player would no longer be able to add a wild Pokemon to the party if they reload on wave X2 after an ME.

There's also an edge case of ME on wave X1 and then trainer battle on wave X2, which would not allow the player to add any Pokemon from that biome.

Would it be possible for the session save data to keep track of a mostRecentWildEncounter instead (it would probably also require changes to the backend DB)? If not, then we could use mysteryEncounterSaveData.encounteredEvents to search for wave X1 ME's instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, I'll look into it and see what can be done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding to this, some MEs let you fight and catch a mon (or even several mons, like the Safari Zone) so it probably needs to be considered even with PigeonBar's suggestion
Some MEs also allow to get a mon without needing to catch it like the Oricorio one or the Pokemon Salesman, should that be allowed for this challenge if not on wave X1?

if (!isHealPhaseActive.value) {
this.scene.unshiftPhase(new SelectModifierPhase(this.scene));
return this.end();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some ME's also use PartyHealPhase now. What is the intended behaviour here?

20241017.ME.Party.Heal.mp4

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Uh, hm... I hadn't considered MEs (well, they didn't even exist when the challenge was first added). Will probably have to consult with damo on this.

@PigeonBar
Copy link
Collaborator

Run history entries could start to get crowded with all the available challenge options:

20241017 Challenge Run History

@PigeonBar
Copy link
Collaborator

In the Hardcore challenge, should the player be allowed to splice a fainted Pokemon with an alive Pokemon, which would sort of allow the fainted Pokemon to participate again?

@PigeonBar
Copy link
Collaborator

The Hardcore challenge still allows rewards to contain hardcoded revival items from certain ME's (e.g., A Trainer's Test):

20241017 ME Sacred Ash

@PigeonBar
Copy link
Collaborator

The Hardcore challenge allows Revival Blessing to be used indirectly, such as from Sleep Talk:

20241017.Sleep.Talk.Revival.mp4

RevivalBlessingAttr distinguishes between reviving player Pokemon and reviving enemy Pokemon, so we could probably apply the challenge and have the move fail there instead.

@Adri1
Copy link
Contributor

Adri1 commented Oct 17, 2024

Would it be possible to add "short_name" keys to be used in the Run History?
Like it's already the case for "Inverse Battle" challenge:
image

In order to limit this kind of scenario, when possible:
image

@DayKev
Copy link
Collaborator Author

DayKev commented Oct 17, 2024

Would it be possible to add "short_name" keys to be used in the Run History?

Sure. I'm not sure what the best short names to use are though.

In the Hardcore challenge, should the player be allowed to splice a fainted Pokemon with an alive Pokemon, which would sort of allow the fainted Pokemon to participate again?

Probably not. Ugh, fusions...

Copy link
Collaborator

@MokaStitcher MokaStitcher left a comment

Choose a reason for hiding this comment

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

(not done with reviewing at all, just submitting to share the comments i have so far)

src/data/challenge.ts Outdated Show resolved Hide resolved
}

override applyAddPokemonToParty(pokemon: EnemyPokemon, waveIndex: number, canAddToParty: BooleanHolder): boolean {
if (!(waveIndex % 10 === 1) && !(pokemon.scene.lastMysteryEncounter && (waveIndex % 10 === 2))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding to this, some MEs let you fight and catch a mon (or even several mons, like the Safari Zone) so it probably needs to be considered even with PigeonBar's suggestion
Some MEs also allow to get a mon without needing to catch it like the Oricorio one or the Pokemon Salesman, should that be allowed for this challenge if not on wave X1?

@Adri1
Copy link
Contributor

Adri1 commented Oct 17, 2024

Sure. I'm not sure what the best short names to use are though.

Might not always apply for English, but might apply for some languages

@damocleas
Copy link
Collaborator

Would it be possible to add "short_name" keys to be used in the Run History? Like it's already the case for "Inverse Battle" challenge: image

In order to limit this kind of scenario, when possible: image

Would it not be better to just have this menu show the achievement icons with a hover over for the name? Different PR issue likely.

@damocleas
Copy link
Collaborator

damocleas commented Oct 18, 2024

Or, well, on the above, a small icon to indicate each challenge type will likely be needed in the future as they wouldn't all have achievements associated likely. Unsure how to shorten them though.

@PigeonBar
Copy link
Collaborator

It turns out that after beating Wave X0, PartyHealPhase normally runs after the global RNG gets set for Wave X1. This means that in the No Free Heal challenge, replacing PartyHealPhase with SelectModifierPhase can cause item generation (especially rerolls) to interfere with RNG for generating the wild Pokemon in Wave X1.

To avoid the problem, we could instead have PartyHealPhase simply do nothing if No Free Heal is active, and have SelectModifierPhase activate normally from VictoryPhase (which occurs before RNG gets set for Wave X1) as if it were a non-X0 wave.

@DayKev DayKev marked this pull request as draft October 20, 2024 08:36
- "No Free Heal": Disables the automatic healing
that occurs after every 10th wave,
replacing it with a normal shop phase

- "Hardcore": Fainted Pokémon can't be revived

- "Limited Catch": Only the first wild Pokémon encounter
of every biome can be added to your current party
@DayKev DayKev force-pushed the nuzlocke-update branch 3 times, most recently from d885134 to 9172303 Compare October 24, 2024 08:55
@Blitz425
Copy link
Contributor

Is it possible to reuse the code from Sam's original nuzlocke mode that makes cries longer when a Pokemon faints in permadeath? It's such a small thing but it makes death's feel more impactful

@DayKev
Copy link
Collaborator Author

DayKev commented Oct 26, 2024

Is it possible to reuse the code from Sam's original nuzlocke mode that makes cries longer when a Pokemon faints in permadeath? It's such a small thing but it makes death's feel more impactful

What exactly do you mean by longer? Like, the cry should be slowed down so that it takes a longer time to complete? By how much; and what should be done about pitch shifting, if anything?

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 Challenges Challenge mode/s related Enhancement New feature or request Game Balance Changes focused on game balance
Projects
None yet
Development

Successfully merging this pull request may close these issues.