pokerogue icon indicating copy to clipboard operation
pokerogue copied to clipboard

Adds ribbon in starter screen if mon has beat classic mode

Open shayebeadling opened this issue 9 months ago • 4 comments

Heard lots of people liking the idea of rewarding classic runs so this is a super simple implementation that could get the ball rolling;

  1. Adds a winCount variable in the starterDataEntry object to keep track of classic wins on a mon.
  2. Adds a red ribbon that shows on an entry if the winCount > 0.

I implore anyone that is more artistically inclined to make a better ribbon if this idea is adopted, cause mine looks a crewmate from among us.

image

UPDATED: Moved the count from dexData to starterData. Incrementation works, but it does seem finicky like Akuma said. Gonna step through and see what the deal is.

UPDATED AGAIN: Incrementation is now working consistently.

shayebeadling avatar May 01 '24 04:05 shayebeadling

Good launching point! Would suggest something like

for (const pokemon of this.scene.getParty()) {
              const speciesId = getPokemonSpecies(pokemon.species.speciesId)
              this.scene.gameData.incrementStarterWinCount(speciesId);
            }

in phases.ts line 3501

and then something like

incrementStarterWinCount(species: PokemonSpecies):void {
  const speciesWinCount = this.dexData[species.speciesId].winCount;

    if(Number.isNaN(speciesWinCount))
      this.dexData[species.speciesId].winCount=0;
    
    this.dexData[species.speciesId].winCount++;
    console.log(this.dexData[species.speciesId].winCount);
  }

at line 1079 of game-data.ts

Played around with those a bit and could make it show the ribbon upon beating classic mode, but it didn't apply it to the last pokemon I think the way around this is by making it async / a promise

Also think that winCount would be better as starterData rather than dexData, so if you win with ivysaur, you get the ribbon on bulbasaur

Akuma-Reiki avatar May 01 '24 07:05 Akuma-Reiki

working with Brain Frog to get a better version of this, but this has the functionality if you pass pokemon, speciesId to whenever incrementStarterWinCount is called

Akuma-Reiki avatar May 01 '24 18:05 Akuma-Reiki

OK the way that this behaves now is winning in classic with a mon will reward them, and any prevolution starters of them with a ribbon. If it is their first win, it displays a phase in the postgame that rewards you with a 5-pull voucher

shayebeadling avatar May 06 '24 21:05 shayebeadling

Looks good on my end. Tested all the combos I could think. I always got the expected tickets including the final 10x for beating classic in general.

Two starters who have never beaten classic. Expected 2 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/49d6d0cf-bd61-47d2-9e99-39da25a5620b

Two starters who have never beaten classic and one that evolved. Expected 3 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/205618fc-a58a-4eda-8bfc-ca6f66ad0aba

No starters who have beaten classic but one that evolved. Expected 1 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/67553422-8304-4d36-8b5e-bf71402f71e2

Six starters who have never beaten classic. Expected 6 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/c49f390e-e334-4ec8-ae04-659d3337f303

One starter that has never beater classic and one that has but has now evolved. Expected 1 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/6926b0d9-bf2c-4632-8165-8ca28287b778

All starters have beaten classic but they are different forms/evolutions. Expected 0 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/c7dffdc8-9fda-4e74-a316-98dcd5b552db

One starter who has never beaten classic and a freshly caught pokemon that has never beaten classic. Expected 2 5x tickets

https://github.com/pagefaultgames/pokerogue/assets/13838608/2d769218-783b-4edf-a58b-0d3f9e3b496d

bennybroseph avatar May 07 '24 01:05 bennybroseph