* Miscellaneous code cleanup:
- Update `overrides.ts` imports
- Add missing comment and `;` in `eslint.config.js`
- `field/pokemon.ts`:
Rename `generateVariant` to `generateShinyVariant`
Mark some functions as `public`/etc
Update various tsdocs/comments, add tsdocs to `isOfType`
Turn an unreadable 450+ character line into a
readable block of code
- `utils.ts`:
Remove unused function `randSeedEasedWeightedItem`
Mark `IntegerHolder` and `FixedInt` as deprecated
Update some tsdocs/comments
* Convert to inline anonymous function
* Fix indentation in `move-effect-phase.ts`
Rename `getTarget` to `getFirstTarget` for clarity
Convert namespace import to named imports
Add `public`/etc to methods
* Rename `verifyLang` to `hasAllLocalizedSprite` and update tsdoc
* update locale submodule
* Put missing `null` guards around some uses of `getUserPokemon()`
* Fix locales
* Fix Unburden test
---------
Co-authored-by: Moka <millennium.stitcher@gmail.com>
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
* unburden implemented
* Used tag instead of stat changes for Unburden
* added documentation and neutralizing gas test
* accounted for unburden in getEffectiveStat
* fixed doubling speed in two places
* merge conflict resolve
* changed documentation wording, added test for stuff cheeks
* refactor unburden
* merge
* remove console logs
* Update src/data/ability.ts
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
* add neut gas check
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
* Added test for NeutGas user entering while unburden activated
* add spaces to tests, removed passive and [] from applyPostItemLostAbAttrs
* added line breaks after test cases
---------
Co-authored-by: innerthunder <168692175+innerthunder@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>
* Setting species-variables to read only
* set generations to protected
* formIndex set to protected
* quick fix
* typedocs fixes
* get / set generation
* wait
* Use get/set for formIndex too
* Fix misplaced line
* Replace a couple `!!` with default params
---------
Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
* the fix... will maybe write a test later
* ughh
* made a test
* moved aorund function
* Update src/test/moves/camouflage.test.ts
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* lalal
---------
Co-authored-by: frutescens <info@laptop>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* fixing the exp bug
* fixing the exp bug
* dont think need to reset turn data there
* changing a little bit
* Update src/phases/faint-phase.ts
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
---------
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
* fixing speed boost for pokemon being switched in and for if failed escape
* adding unit tests
* adding failed run away test case
* adding failed run away test case modification
* refactoring solution to be more consistent with coding style
* more fixes for consistency
* more fixes for consistency
* adding new AbAttr in abiliity.ts for posterity
* removing uneccesary variables
* fixing a merge conflict
* Chloroblast & Struggle should not recoil if no damage was dealt
* Protect against missing move entry
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
---------
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* [BUG] Added frenzy reset function during move phase should move be cancelled (#4227)
* Revert [P2 BUG] Fix since it does not work and is faulty
* [P2 BUG] Implemented correct frenzy Tag and Movequeue reset should frenzy move fail (#4277)
* Cleaned up Bug Fix using frenzyMissFunc
* Added automated test case for frenzy move edge case
* Improvement to frenzy move reset test case speed
* Fix test
* Add missing import
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fix manifest being used before the game is initialized
* bump game version
* make manifest fix more future proof
* Revert "make manifest fix more future proof"
This reverts commit 32591b35d0.
* fix locales path for offline builds
* Fix status damage triggering before berry usage
* Bump version number
* Revert "Bump version number"
This reverts commit 64b194f5a7.
* Bump version number for real this time
* Updated admin panel to allow the concept of unlinking accounts
* Don't look too hard at this commit, nothing to see here
* Admin stuff
* Fixed linking and unlinking and updated menu options
* Undid some changes and cleaned up some code
* Updated some logic and added some comments
* Updates to admin panel logic
* Stupid promises everyone hates them and they deserver to die
* Promise stuff still
* Promises working thanks to Ydarissep on discord - pushing with debug code before it decides to stop working again
* Removed debugging code
* All discord functionality seems to be working here?? Not sure what happened but yay
* Fixed up some bugs and code
* Added registered date to the panel
* Fixed and updated some minor error message related stuff
* Minor changes
* Fixed some minor bugs, made the save related errors have error codes, and added updated icons
* Updated search field error
* Missed a couple of things to push
* Fixed linting and doc errors
* Revert dev related code and clean up dev comments
* Reverting utils
* Updating front end to match back end from Pancakes' comments
* make getFields and getInputFieldConfigs a single function of FormUiHandler
* remove outdated doc
* Apply suggestions from code review
Moka review changes
Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
* Added docs
* eslint fixes
* Fixed error not showing up in certain conditions
---------
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: MokaStitcher <millennium.stitcher@gmail.com>
Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
Co-authored-by: innerthunder <brandonerickson98@gmail.com>
* Adds updateInfo to transform move/ability, mirrors Transform functionality in Imposter
* Implements functionality for reducing pp to 5 or less for each move when transforming
* Refactors to async/await pattern, adds back removed anims/sounds from last commit
* Eslint fix attempt
* Update src/data/ability.ts
per DayKev's suggestion
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Merge and fix conflicts
* Adds unit tests for pp-change with transform/imposter
* Updates to consistency in syntax/deprecated code
---------
Co-authored-by: NightKev <34855794+DayKev@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
* [Refactor] Added ON_GET_HIT BattlerTagLapseType
Adjusted BeakBlastChargingTag and ShellTrapTag to use new lapse type
Adjusted MoveEffectPhase to now lapse all tags with the ON_GET_HIT lapse type
* [Refactor] Added ON_GET_HIT BattlerTagLapseType
Adjusted BeakBlastChargingTag and ShellTrapTag to use new lapse type
Adjusted MoveEffectPhase to now lapse all tags with the ON_GET_HIT lapse type
* Fix nits
* Rename `ON_GET_HIT` to `AFTER_HIT`
Change `isOpponentTo` to `isOpponent`
* Fix a couple minor nits
* Remove single-use function
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* 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>
* Add simulated support for Arena Tag application
* Add type inference to ArenaTag.apply
* Fix screen tests
* back to `any` again lol
* fix missing spread syntax (maybe)
* updated docs
* named imports for `Utils`
* [P1 Bug] Fix softlock when a phazing attack activates a reviver seed
* Polishing tests
* Change approach to respect Parting Shot's targeting
* Tests: Added checks for correct number of Pokemon on field
* some early set up
* localization
* Added Wiglett family to restrictions
* Added Smack Down + 1000 Arrows Interactions
* Added checks for certain tags
* Gravity removes telekinesis from all pokemon on the field
* need to check something else real quick
* mmmmmm
* think this is fine?
* ingrain fixes
* more ingrain
* Telekinesis Test + Move Fix
* Test Name change
* another day another try...
* Test Cleanup
* fsfdsfds
* Revert "fsfdsfds"
This reverts commit cb7abcfd9f.
* whoops
* Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Missed one
* Update src/data/move.ts
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
* Add separate battler tags in move attr
* Update src/data/battler-tags.ts
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
* removed onRemove
* Documentation
* Update src/data/battler-tags.ts
---------
Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.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>
* creates table for tracking species egg tiers
* creates table for tracking species egg tiers
* rename EggTier enum values
* replace clamp util function with Phaser function
---------
Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
* Fixes some Substitute interactions
Specifically with Disguise/Ice Face and Gulp Missile
* Add tests
* Fix linting
* Add `hitsSubstitute()` checks to all `PostDefendAbAttr`s
Also fix comment indentation in `MoveEffectPhase`
* Revert `move-effect-phase.ts` changes
* [Bug] Fix Battle Bond continuing to buff Water Shuriken after Greninja returns to base form
* Test cleanup
* PR feedback
* Update test to use getMultiHitType()
* PR Feedback
* add: i18n backend support
the backend is being supported by using msw which will import the correct file from the local locales folder
* fix: tests to no longer rely on static i18n keys
* Update src/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/test/ui/type-hints.test.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts
Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
* Fix typos
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* Fix linting
* update locales submodule
update reference to `56eeb809eb5a2de40cfc5bc6128a78bef14deea9` (from `3ccef8472dd7cc7c362538489954cb8fdad27e5f`)
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* Triple Arrows effect chance for stat change is now properly 50%
* Add tsdocs to `StatStageChangeAttr`
* Add test for Serene Grace interaction
* Fix linting
---------
Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
* Diamond Storm should only trigger once when hitting multiple pokemon
* Also fix Clangorous Soulblaze just in case
* Fix linting
* Fix linting
Oops missed this one
* Implement Fire/Grass Pledge combo
* Add other Pledge combo effects (untested)
* Fix missing enums
* Pledge moves integration tests
* Add turn order manipulation + more tests
* Safeguarding against weird Instruct interactions
* Update src/test/moves/pledge_moves.test.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fix style issues
* Delete arena-tag.json
* Update package-lock.json
* Use `instanceof` for all arg type inference
* Add Pledge Move sleep test
* Fix linting
* Fix linting
Apparently GitHub has a limit on how many errors it will show
* Pledges now only bypass redirection from abilities
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fix TM compatibility on forms, Tera Blast on Indigo Disk mons
* Additional single strike moves
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Refactor `MovePhase` to improve readability/maintainability
Add tsdocs/comments all over
Mark all functions/fields with public/etc
Fix multi-hit moves called from Metronome/etc, fixes#3914
Remove unused function `BattleScene.pushMovePhase`
Don't use failure text as a condition for move success
A move defining potential failure text doesn't mean it failed
Replace relative imports with absolute imports in `battle-scene.ts`
Change some fields from optional to default `false`
* Fix Whirlwind test
* Fix linting
Ensure that a Pokémon's animation speed is reset properly after saving
and quitting. Previously, if a Pokémon was put to sleep, which slows
its framerate, saving and quitting would result in the slower framerate
persisting even though the Pokémon was no longer asleep. This fix adds
an else condition to reset the frameRate to 12 if the sprite is already
loaded upon resuming the game.
Fixes#4465