* Commit old stashed changes
* Complete basic implementation of Tera
* Fix effectiveness test
* Make tera retain until forced recall or faint, regain on biome change
* Experimental sparkle fix
* Fix champion teras
* Attempted fix for double battles tera UI bug
* Fix the fix
* Fix linting and test issues
* Fix more tests
* Change int type
* Implement tera for ME trainers
* Cleanup species inclusivity check
* Make tera instant recharge if terapagos in party
* Make useless tera shards not generate
* Implement stellar tera damage boost
* Improve tera selection UI
* Tidy up animation and localisation
* Improve tera button sprite
* Fix Lance tera
* Make tera instant recharge during E4 in classic modes.
* Fix formatting in the tera common animation
The animation was also not playing due to `frameTimedEvents` being missing as well.
* Make tera effect start after animation
* Implement save migration
* Update version number for migration code
---------
Co-authored-by: Madmadness65 <blaze.the.fireman@gmail.com>
Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
* full implementation of supreme overlord + test
* removed unused import
* changed documentation since Battle.playerFaints is not used in supreme overlord
* Update faint-phase.ts
* changed supreme overlords power calculation function and adjusted tests
* added changes to Last Respects too
* added playerFaints to SessionSaveData to make the counter saveable
* Apply Kev's suggestions
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Reset enemy faint counter per battle
* Re-mark supreme overlord as partial
* added automated test case
* moved playerFaints reset to resetArenaEffects
* removed resetEnemyFaintCount() function since it is unused
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Working ui, missing logic, logs
* Filtering starters by name is working
* Filtering moves and abilities correctly
* Opening starter page on button.action
* Removed ugly leftover from title
* Added container for text with different colors and titles
* Showing all species in pokedex with no decorations and shinies
* Filtering includes extra forms; moving cursor from filterText to starters does not reset scrollIndex; toggle button for decorations
* Can access evolution page
* Abilities are colored properly (still missing info overlay)
* Biome filter; displays for baseStats, biomes and evolutions
* Removed lockable select ui handler, replaced by changes to standard ui handler.
* Evolutions are selectable from list and displayed properly
* Keeps shiny variant, gender and form when switching to evolutions; show ability descriptions; properly displaying sprites for megas and other forms
* Listing prevolutions and base forms
* Fixed filtering of baby forms with no biome assigned; Caught filter is ALL by default
* Highlighting text filters, resetting all filters when starting up
* No error messag when cursor on uncaught species, showing sprite again after toggling stats
* Simplified Pokemon Scan logic, accepts separate words as input
* Dynamically resizing ability box, showing ability description on first hover. Removed debug logs.
* Removed some more debug messages.
* Filter bar can adjust cursorOffset and x padding
* Fixed some type definitions
* Fixed more warnings; added localization strings in the pokedex scan overlay.
* Fixed fatal bug due to using Object.keys
* Removed debug messages
* Added try catch construct to prevent error that was breaking reloadHelper tests
* Added filter for starters / evolutions
* Biome filter option for uncatchable mons
* C and V buttons snap cursor to filters
* Changing background to make instructions visible
* Can buy candy upgrades through pokedex
* Displaying base stats as bars in an overlay
* Including baby forms among uncatchable mons
* Including evolutions when filtering by biome
* Working logic for select ui handler with skips and scroll
* -Pokedex page showing biomes from prevolutions; displaying correct biomes for forms of Rotom, Burmy and Lycanroc
* Fixed bug in base stats overlay
* Regional forms display name of region in evolutions and prevolutions
* Better messages for evolution conditions
* Showing proper descriptions for menu
* Adding sound effects to menu, and pokemon cry when opening page
* Changing menu colors to textstyle options supporting a legacy version.
* Fix to getStarterSpeciesId to work with all-unlocks files
* Passing a TextStyle to option select ui handler to allow for shadowed text
* Fixed bug of overlapping labels in text filters
* Fixed bug with supportHover and skipped indices in option select ui handler
* Localization of pokemon number label
* Fix to pokemon number localization
* Fix to pokemon number localization
* Adding some comments, removing useless elements
* More cleanup
* Removed candy upgrade instructions from evolved pokemon; attempting to buy candies from evolution now gives error sound instead of crashing the game
* Attempting to exit from filter text is now allowed if current option is empty
* UI changes to make dex pages work in legacy style
* Pokemon name shown while in alt form is no more capitalized
* Handling uncaught pokemon
* Showing types on Pokémon page
* Introducing globalScene everywhere
* Showing evolution requirements in message box
* Displaying form changing items; now using pokemonFormChanges to only show reachable forms
* Playing correct cry
* Pokemon cry in setSpeciesDetails
* Left and right buttons to turn previous or next pokedex page
* Cleaned up "last" from this.species; turning pages now preserves memories of unlocks
* Pokerus cursor is now treated as decoration
* Correctly displaying prevolutions for Pikachu and Gholdengo
* Uncaught forms can be cycled through (with black sprite and no options available)
* Filtering by moves now shows icons to distinguish egg and tm moves
* Added icons for passive abilities
* Added icons to legacy mode; fixed bug that caused game to hang when switching to or from legacy mode
* Pokedex entries are accessible through party screen
* Adding sort criteria for consistency with starter select screen
* Added options to cost reduction filter for consistency with starter select screen
* Updating optionSelectUiHandler to simplify logic and fix bug of autocomplete showing options incorrectly
* Adding Pokedéx option in starter select screen
* Prevolutions are shown properly again; battle forms are considered caught as long as the base form is caught
* Small fixes to evolution and form change descriptions
* Reworked evolutions menu to incorporate condition descriptions
* Moving evolution condition description logic entirely to the SpeciesEvolution class
* Removed extra Miraidon and Koraidon forms
* Properly showing evolution text for Dunsparce and Maushold
* Displaying uncaught forms for Dudunsparce and Maushold properly
* Displaying correct forms for Urshifu and Toxicitry after evolution
* Cleared up comments
* Updating test for tandemaus evolution
* Localized labels for egg moves and abilities
* Added button to show back sprites
* Back to showing only caught battleforms; added dexForDevs option
* Merging shiny and variant buttons
* Uncaught battle forms options are shown in dark text, like evolutions
* Showing proper gender for mons that can only be (or have only caught in) one gender
* Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Removed unused options from base-stats-overlay
* Fixed import of BaseStatsOverlay
* Displaying form-specific TMs properly; adjusting for passives rework
* Removed logging messages
* resetting containers to prevent memory leaks
* Updating integer to number in pokedex
* Implemented suggestion
* Removed some stray comments
* Fixed logic for cursor coming down from filter bar
* Transition from filters to dex box now works in a visually pleasing way
---------
Co-authored-by: Lugiad <2070109+Adri1@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>
* Implement Flip Stat Challange
* Add Achivement
* Update challenge code to block other challenges.
* Add Achievment Image
* Add FLIP_STAT to enum ChallengeType
* Fix comment for FlipStatChallenge
* Add applyFlipStat override to Challenge Class, and add override inside of FlipStatsChallenge
* Add ChallengeType.FLIP_STAT case to export function applyChallenges (Master Switch Function)
* Properly block other challange achviements
* Change the way achivements are blocked by challenge modes to a more flexible method
* Adjust the image for Flip Stat, and add an additional achivement for completing both Flip and Inverse
* Fix FLIP_INVERSE achivement to check ALL challanges are met, not SOME
* Remove outdated image
* Fix FlipStat applyChallenges inside calculateBaseStats
* Update locales
---------
Co-authored-by: Scooom <na@na.na>
Co-authored-by: Scooom <jerry@hosterslice.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Replace various `scene` pass-arounds with global scene variable
* Modify tests
* Add scene back to `fade[in|out]()` calls
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Fix Bug Superfan ME test
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Re-enable fixed test
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Rename `gScene` to `globalScene`
* Move `globalScene` to its own file to fix import/async issues
* Fix `SelectModifierPhase` tests
* Fix ME tests by removing `scene` from `expect()`s
* Resolve merge issues
* Remove tsdocs referencing `scene` params
Remove missed instances of `.scene`
* Remove unnecessary `globalScene` usage in `loading-scene.ts`
* Fix merge conflicts
* Attempt to fix circular import issue
* Found the source of the import issue
* Fix merge issues
---------
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Adding a new key determining whether the command cursor resets at the beginning of each new battle.
* Allowing user to toggle commandCursorReset on and off.
* Changing option name to commandCursorMemory
* Fixed caps in settings.ts
* Moved Command_Cursor_Memory from Display settings to General settings
* [ME] Fix GTS Wonder Trade shiny not giving luck
* [ME] Shiny Magikarp from Pokemon Salesman can have any variant
* [ME] Shiny lock MEs with custom or special sprites
* [ME] GTS shows shiny sparkle for received Pokemon
* [ME] Shiny lock 'Slumbering Snorlax' and 'The Strong Stuff'
* [ME] Dancing Lessson: show shiny sparkle for Oricorio in intro
* [ME] Show shiny sparkles for Pokemon in ME intro
* fix tests
* Ensure shiny sparkle animation is initialized before playing it (Fixes#3924)
* make loading variant assets cleaner
* cleanup EnemyPokemon shiny initialization
* test fixes and final cleanup
* Make 'getSpeciesFilterRandomPartyMemberFunc' more readable
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* [UI] Ask Confirmation before disabling touch controls
* show a message when asking for confirmation in settings
* small cleanup
* change settings message box to display 2 lines with word wrap
* [P1] Fix System Data Conversion Failure 3
* Use `isNullOrUndefined`, Clean Up Imports
* fix pre candy update save data migration for candy
* fix pre candy update save data migration for candy part 2...
---------
Co-authored-by: Moka <millennium.stitcher@gmail.com>
* start migrating Utils.apiFetch to api class
* move dailyranking to api
* use api in title-ui-handler
* remove: Utils.apiFetch
* migrate `updateSystemSavedata` to api
* migrate clear session savedata to api
* migrate updateAllSavedata to api
* migrate `updateSessionSavedata` to api
* rename `api` to `pokerogue-api`
* migrate unlink discord to pokerogue-api
* migrate unlink google to pokerogue-api
* update pokerogue-api login
* migrate register account to pokerogue-api
* remove Utils.apiPost
* reset overrides.ts
* chore: cleanup
* fix env.development
* fix circular dependencies with api
* fix gamedata verify missing await
* fix daily api calls in daily-run-scorebard
* fix discord-link request body being empty
there was a double `toUrlSearchParams()` call involved
* add pokerogue-api test coverge
* add test-utils `getApiBaseUrl()` method
* add pokerogue-admin-api test coverage
* add pokerogue-account-api test coverage
* add pokerogue-daily-api test coverage
* add pokerogue-savedata-api test coverage
* fix some test describes
* add pokerogue-session-savedata-api test coverage
* add pokerogue-system-savedata-api test coverage
* fix tests
* fix tryExportData
thanks @MokaStitcher
* chore: fix menu-ui-handlers.ts
* fix admin-ui-handler (types)
* extend test-coverage for admin-api
* remove outdated code
* skip some clowning-around-encounter tests if events are active
this is not a permanent solution
* Update src/system/game-data.ts
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* Revert "skip some clowning-around-encounter tests if events are active"
This reverts commit a97dafe8b2479e9b2ddd49d4dc9710814d7c7b67.
* mark `localServerUrl` and `apiUrl` as deprecated
in `utils.ts`
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* Clean up some code related to SSUI
Replace a few nested ternaries with if blocks
Remove some `undefined`s with destructuring
* Add comment, use `v === 0` instead of `!v`
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
---------
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Update `battle-scene.ts` and `data/field/pokemon.ts`
`battle-scene.ts` changes:
- `getParty()` renamed to `getPlayerParty()` for clarity
- `getNonSwitchedXPokemon()` consolidated into `getXPokemon()`
- Some tsdocs were added/updated for
`getXParty()`, `getXField()` and `getXPokemon()`;
and those functions were explicitly marked as `public`
- Helper function `getPokemonAllowedInBattle()` added
`pokemon.ts` changes:
- `isAllowed()` renamed to `isAllowedInChallenge()` for clarity
- A redundant check for an active scene is removed in `isActive()`
- Some tsdocs were added/updated for `isFainted()`,
`isAllowedInChallenge()`, `isAllowedInBattle()` and `isActive()`;
and those functions were explicitly marked as `public`
- `isFainted()` now checks for `hp <= 0` instead of `!hp`
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* Backport eslint change to reduce merge conflicts
* Fix merge issues
---------
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
* Fix Early Bird, add tests
* Update tsdocs for Early Bird's `AbAttr`
Rename `turnCount` to `toxicTurnCount` and
`turnsRemaining` to `sleepTurnsRemaining` in `status-effect.ts`
* Fix Toxic Orb test
* Redundant code :despair:
* Fix status override to set the number of sleep turns
* Mystery Encounter bugfixes
* more ME bug fixes
* update allowed pokemon in ME requirements
* some unit test cleanup and general tidying
* fix null exception on isBattleMysteryEncounter
* clean up tsdocs and fix pokemon hasAbility check
* fix double battle crash in challenge mode with a single eligible pokemon
* apply suggestions from PR#4619's code reviews
* revert fix for Keldeo crashes + implement fix suggestion from PR #4619
* fix session migration for PokemonCustomData
* prevent test failure due to keldeo fix
---------
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
* [Bug] Toxic Spikes implementation issues fixed
Adjusted MoveEffectPhase.start() so that ENEMY_SIDE targeted moves no longer occur twice per use in double battles.
Updated Toxic Orb test to no longer expect a tick of damage turn 1.
Fixed Toxic/Poison dealing damage immediately when applied.
Fixed Hazards not persisting through save
Added unit tests
Fixed flyout not displaying correct number of Spikes/Toxic Spikes after a refresh
* Update Toxic Orb test
* Updates Toxic Spikes tests
* Apply suggestions from code review
* Fix merge issues
Replace `integer` with `number` in `arena-tag.ts`
* Remove partial Magic Bounce implementation
* Remove stray newline
* Remove extra change in safeguard test
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* sanitize all money when saving session data to server
* update money sanitization
---------
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
* major/minor ME bug fixes
* potential fix for failed save with rental pokemon
* Update src/system/game-data.ts
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* Update src/system/game-data.ts
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* more bug fix cleanup and PR feedback
* fix Uncommon Breed ME crash
* real fix to Fun and Games force switch issues
* add isBattleMysteryEncounter() helper function
* add isBattleMysteryEncounter() helper function
* fix unintentional replace all errors
* fix catches not updating dex
---------
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* Disable Luck in Daily Runs
If the Game Mode is Daily Run, the player's Luck is set to 0, and the Luck value is hidden.
* Give free map in daily
Adds a Map to the player's pool of starting items for Daily Runs.
* Disable Eviolite in Daily Runs
Disables Eviolite spawning in Daily Run mode.
* Write shop test and add new overrides
Adds new overrides that allow you to force content to be locked or unlocked
These overrides were also added to the OverridesHelper to make them available to tests
Adds a new check function for content unlocks, which returns `true` if it is overrode to be unlocked, `false` if it is overrode to be locked, and the unlock data mapped to a Boolean otherwise
All existing checks (other than the ones that involve actually unlocking things) for unlockables have been changed to use this
Added a pair of new exporting booleans, specifically for my test, that check if Eviolite or Mini Black Hole are in the loot table
* Prevent shinies from altering runs
Places variant rolls inside of an ExecuteWithSeedOffset block, using the current floor's RNG seed as the seed and the Pokémon's ID as the offset.
---------
Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
* various bug fixes for MEs
* various bug fixes for MEs
* fix final isTransferable rename that was missed
* change Trainer's test vouchers for second option
* change unit test skips
* cut down excess ME track length and loop properly
* ME bug fix cleanup
* updating AI for Slumbering Snorlax ME, and small ME balance changes
* fix ts error
* fix bug type superfan dialogue discrepancy
* ME bug fixes PR feedback
* ME PR nits and fixes
* update naming convention of sprites
* ME balance changes and bug fixes
* fix tests
* fix An Offer You Can't Refuse ME requirements
* clean up post-battle logic for Breeder ME
* party size requirement cleanup
* clean up challenge requirements for disabling certain MEs
---------
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
* Adds Expert Breeder Mystery Encounter to the game
* add achievement for Breeders in Space and remove redundant tests
* rename to Expert Pokemon Breeder
* remove unintentional test code
* remove unintentional test code
* test fix with breeder rename
---------
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>