* fix damage calculations. add test code
* define toIntValue function to replace every repeatitive min floor function.
* revert unnecessary minimum boundary
* update function name `toIntValue` -> `toDmgValue`. update comments.
* add missing updates for changing function name
* Update src/utils.ts
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* remove redundant comment
* update import code for test with phase
---------
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* Adds simulated tag support to all abilities
* Fix compiler errors in ability.ts
Most things are still on fire 😢
* Fix errors left over after merge
* Another pass through simulated ability call logic
* Fix leftover errors from merge resolution
* Another gh pages issue :pikamad:
* Simulated call fixes based on Kev's feedback
* RIP phases.ts
---------
Co-authored-by: Xavion3 <xavion333@gmail.com>
* add `hasTag` to arena
* fix flying type damage calculation for grounded states
Before the grounded state would make e.g. electric moves no more very-effective. This is invalid
Co-authored-by: Tristan D Gant <tgant2017@outlook.com>
* add tests for gravity v. ground v. electric
* Update src/test/arena/arena_gravity.test.ts
fix typo
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* use `arena` instead of this.scene.arena
* use `const arena = this.scene.arean` instead of destructoring
* Apply suggestions from code review
Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
* fix es-lint
---------
Co-authored-by: Tristan D Gant <tgant2017@outlook.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
* Fix Jaw Lock not removing TRAPPED tag after enemy faints
* Create tests for Jaw Lock
* Fix overrides import
* Clean up implementation + tests
* minor style change to phases
* Update src/data/move.ts
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* Jaw Lock no longer overlaps its trapping effect
* Friendship ended with JAW_LOCK tag type
Now TRAPPED is my new best friend
---------
Co-authored-by: EmberCM <kooly213@hotmail.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* Fixed issue with falsy issue within condition to get a stat for IV scanner
* add fix setting code to prevent form/variant bug when default form/variant setting is wrong.
in addition, that fix code include gender fix, so i revert old gender fix.
update wrong log message.
* [Hotfix] Fix Memory Mushroom not showing relearner moves (#3619)
* Fix Memory Mushroom not showing relearner moves
* Fix rollout test
* Rewrite player faint logic in FaintPhase (#3614)
* 867 runerigus sprite (#3629)
cropped static frames, fixed cropped sprite
set runerigus exp to use the shiny exp's animation
verified all hex colors are unchanged
- fixed ultra necrozma exp front variant swapped arrays.
- xatu female eye color fix
* [Bug] Preventing the MBH from being stolen in Endless (#3630)
* Endless MBH Fix
* add import
* Revert "add import"
This reverts commit 814a4059c2.
* Revert "Endless MBH Fix"
This reverts commit 8eb4481301.
* removed newline
---------
Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Co-authored-by: frutescens <info@laptop>
* [Bug] Fix type-hints for immunity (#3620)
* enable mock containers to be found by name
* enable mock text to be found by name
* add test coverage for type-hints
Only for "immunity" and "status moves"
* fix wrong message key of curse(ghost type) (#3631)
Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
* [Hotfix] Steal-able Mini Black Hole Pt 2 (#3632)
* Still have no idea where Eternatus is given the MBH....
* typedocs
---------
Co-authored-by: frutescens <info@laptop>
* [Hotfix] Abilities that prevent ATK drops no longer stop other stat drops (#3624)
* Abilities that prevent ATK drops no longer stop other stat drops
* Apply suggestions from code review
Co-authored-by: Mumble <kimjoanne@protonmail.com>
* Add `isNullOrUndefined()` utility function
---------
* Grip Claw now shows the proper pokemon nickname (#3634)
Co-authored-by: frutescens <info@laptop>
---------
Co-authored-by: Opaque02 <66582645+Opaque02@users.noreply.github.com>
Co-authored-by: KimJeongSun <leo@atlaslabs.ai>
Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
Co-authored-by: cam <lrlrliwoo@gmail.com>
Co-authored-by: Mumble <kimjoanne@protonmail.com>
Co-authored-by: frutescens <info@laptop>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Enoch <enoch.jwsong@gmail.com>
Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
* Fix daily run generated movesets
* add unit-tests for `fix-daily-run` (#3)
* add `daily` and `classic` helper. split `runToSummon`
there is now a `classicMode.runToSummon` which represents the old one used.
There is now a `dailyMode.runToSummon` too
* add daily_mode.test.ts
covers the occured issue
---------
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
* Refactor protection moves
* Revert Protected move result change
* Fix typo in documentation
* Fix merge conflicts in integration tests
* Improve readability of apply function
* Fix effects applying through Protect
* Fix typos in `src/data/egg.ts` comments
* [Localization(it)] Added Honey Gather translation (#2301)
* Update ability.ts [Localization(it)]
* Update ability.ts [Localization(it)]
Fixed capitalization
* Hitting into protect now records a move as failed
* Add check for move success before applying additional effects (Stone Axe)
* `Overrides` should be capitalized
* Add fail conditions for `RechargeAttr` and Jaw Lock
* Update protect test
* Add check for protect in Glaive Rush
* Update tests to use new overrides helpers
* Account for Mat Block and add protect test for Glaive Rush
---------
Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
* Crafty Shield now blocks ALL protect-ignoring moves
* Crafty Shield test + Fix blocking ally-target moves
* ESLint
* Mat Block and Wide Guard integration tests
* Fix strict-null errors in integration tests
* Fix strict-null issue in arena-tag
* Fix strict-null in unrelated test :pikamad:
* Fix conflicting AbAttr
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
* Implemented Stall
* Fixed implementation
* AbAttr Name Change
* Wrote test for Stall
* Update src/test/abilities/stall.test.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/data/ability.ts
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* Updated ability variables and test
* Apply suggestions from code review
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
* eslint fixes
* Update src/test/abilities/stall.test.ts
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* added documentation and implemented mycelium might
* added note on quick claw
* Documentation + Quick Claw implementation
* This is where I would test quick claw-stall/m.m. if i could override modifierstacks
* Forgot to add edits oops
---------
Co-authored-by: Frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
* Fix typos in `src/data/egg.ts` comments
* Refactor Disguise using Ice Face as a base
i18n {
Co-authored-by: Arxxer <javiptn7@gmail.com>
Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com>
Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com>
}
Update tests
* Update jsdoc
* Make recoil damage a parameter
* Fix Ice Face i18n parameter name
* Add i18n placeholder strings for translation
* Update disguise test with override helper functions
* Move a form change from `battle-scene.ts` to `ability.ts`
* Remove a bit of obsolete code from the Disguise test
* Add some translations
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: returntoice <dieandbecome@gmail.com>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com>
* Add translation placeholder strings for Japanese and Catalan
* Update for strict-null
* Remove unused parameter from the `BattlerTag` class
* Remove species checks, fusion doesn't seem to be an issue (any more?)
* Move Ice Face weather-based code to a subclass
* Condense conditionals
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
---------
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: returntoice <dieandbecome@gmail.com>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
* fix: let flash fire hit after frozen, and baton pass not passing it. added: flash fire test file
* added more tests and made small adjustments
* Update src/test/abilities/flash_fire.test.ts
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
---------
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* Cherrypick due to beta roll back
* Adds corrected stat eliminated message to move trigger, removes from battle.ts
* Adds check for Clear Smog vs Haze/Freezy Frost for targetting purposes
* Adds translations for fr, de, and pt_br
* Update src/locales/ko/move-trigger.ts with translation
Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com>
* Update korean move-trigger.ts with proper translation
* Update src/locales/zh_CN/move-trigger.ts with translation
Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com>
* Update src/locales/zh_TW/move-trigger.ts with translation
Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com>
* Adds locales to ja and ca-ES
* Creates unit test for Haze
* Removes repeats option on Haze test left from testing
* Updates title of haze tests, creates freezy frost tests
* Update src/locales/es/move-trigger.ts with translation
Co-authored-by: Asdar <asdargmng@gmail.com>
* Fixes freezy_frost.test.ts copy errors from Haze test
---------
Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com>
Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com>
Co-authored-by: Asdar <asdargmng@gmail.com>
* First issue with soft attribute on challenges as well as incorrect sprites appearing on the starter select ui
* Updated logic to fix starter party icons, forms and shinies in starter selection area
* Fixed issue where some pokemon were being shown in challenges originally if the default form didn't meet the criteria
* Updated docs and tests to account for new behaviour
* Removed some debugging comments
* Fixed rotom form not counting as valid party
* Fixed a bug where the cursor's last known position would be used when pokemon forms were being changed when other forms were available when updated from your party directly
* Fixed issue with starter party icons' forms updating incorrectly when removing pokemon from party
* Fixed docs
* Updated code to allow for starter icons to remember their previous state after a reload
* fixing switchout ability doubles bug, refactor move redirect code
* added unit test for dragon tail
* updating test
* addressing errors from pages deployment
* pages deployment still failing
* typedoc
* please let this be the one
* formatting and test fixing
* await starting battle should go after overrides
* TS: enable strict-null
* fix battle-scene.ts
* fix voucher.ts
* adapt more files to strict-null
* adapt more files to strict-null ( 2)
* adapt ability.ts to strict-null
* adapt `arena.ts` to strict-null
* adapt TagAddedEvent constructor to strict-null
* adapt phases.ts.to strict-null
* adapt status-effect.ts to strict-null
* adapt `account.ts` to strict-null
* adapt `configHandler.ts` to strict-null
* adapt `ability.ts` to strict-null
* adapt `biomes.ts` to strict-null
* adapt `challenge.ts` to strict-null
* adapt `daily-run.ts` to strict-null
* adapt `nature.ts` to strict-null
* adapt `pokemon-forms.ts` to strict-null
* adapt `tainer-names.ts` to strict-null
* adapt `types.ts` to strict-null
* adapt `weather.ts` to strict-null
* adapt `egg-hatch-phase.ts` to strict-null
* adapt `evolution-phase.ts` to strict-null
* adapt `pokemon-sprite-sparkle-handler.ts` to strict-null
* adapt `evolution-phase.ts` to strict-null
* adapt `game-mode.ts` to strict-null
* adapt `utils.ts` to strict-null
* adapt `voucher-ui-handler.ts` to strict-null
* adapt `src/ui/unavailable-modal-ui-handler.ts` to strict-null
* adapt `src/ui/ui.ts` to strict-null
* adapt `src/ui/ui-theme.ts` to strict-null
* adapt `src/ui/title-ui-handler.ts` to strict-null
* adapt `src/ui/time-of-day-widget.ts` to strict-null
* adapt `src/ui/text.ts` to strict-null
* adapt `src/ui/target-select-ui-handler.ts` to strict-null
* adapt `src/ui/settings/settings-keyboard-ui-handler.ts` to strict-null
* adapt more files to strict-null (3)
* adapt more files to strict-null (4)
* adapt more files (mostly tests) to strict-null (5)
* adapt more files to strict-null (6)
* adapt more files to strict-null (7)
* Update `src/data/pokemon-evolutions.ts` for strict-null
Partial update `src/data/pokemon-species.ts` for strict-null
* adapt more files to strict-null (8)
* adapt more files to strict-null (9)
* Strict some more nulls (still a few errors remaining)
* adapt rest of the files to strict-null (9)
* fix tests (check for null instead of undefined)
* repalce a lot of `??` with bangs
And added TODO notice as usual
* fix more tests
* all tests pass now
* fix broken game-loop after trainer battle
add some console.warn for missing cases and falling back to default
* remove guessed fallback from utils.rgbHexToRgba
* add TODO for this.currentBattle = null
* adjust getPokemonById() return to include `null`
* fix compilation errors
* add test for pokemon.trySetStatus
* `chanceMultiplier` shouldn't be optional
* allow `null` for currentPhase
* adjust hasExpSprite logic for no keymatch found
* reduce bang usage in account.updateUserInfo()
* fix new strict-null issues after merge
* fix `strict-null` issues in dropdown.ts
and sand_spit.test.ts
* fix egg-gacha
* adapt gul_missile.test.ts to strict-null
* fix move.ts strict-null
* fix i18n.ts strict-null
* fix strict-null issues
* fix baton_pass test
after accidentially breaking it
* chore: fix compiler errors
* revert accidential changes in baton_pass.test.ts
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Add helper function to modify the turn order for tests
* Replace manual speed modification with new helper function
* Replace `vi.spyOn()` instances with helper function
* prevent double-application of status contact abilities and switch out abilities
* use SwitchPhase for ForceSwitchOutAbAttr instead of switchOut()
* add tests for baton pass/uturn
* PR comments
* Update src/test/moves/baton_pass.test.ts
* add test for forced switch after mutual KO + revive
* tweak condition to fix uturn/baton pass
* improve docs
* style/typo nits from CR
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* CR feedback
* use doSelectPartyPokemon + rename
* int -> number
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
* implement gulp missile
* add tests
* change fly to dive
* show ability when reverting to normal form
* update ai score, tests
* update score condition
* adjust conditions, damage
* add underwater test
* update damage in test
* partial commit