Commit Graph

4175 Commits

Author SHA1 Message Date
NightKev 4c8a18690e
[Misc] Rename `DamagePhase` to `DamageAnimPhase` (#4880)
* Rename `DamagePhase` to `DamageAnimPhase`

* Fix unreliable Speed Boost test
2024-11-25 14:15:39 -08:00
PigeonBar 2d6dfc45a0
[Documentation] Remove obsolete `.edgeCase()` from Gulp Missile (#4909) 2024-11-18 21:44:49 -05:00
Blitzy b293797c99
[Balance] Make Intrepid Sword / Dauntless Shield their Generation 8 Implementation (#4902) 2024-11-18 17:47:11 -08:00
NightKev c584dfafb7
[Balance] Remove reduced weight for regional species from egg pulls (#4882) 2024-11-18 17:46:52 -08:00
Moka 0c920ba195
[Hotfix] Prevent more Future Sight crash with new catches (#4910) 2024-11-18 19:41:24 +01:00
NightKev dd904fe782
[Hotfix] Prevent crash if enemy Future Sight user is caught (#4905) 2024-11-17 18:08:00 -08:00
Moka 33d8db73ef
[P1] Fix crash caused by removing arena tags on a new catch (#4888) 2024-11-17 16:35:14 -05:00
Mumble e825e308f9
[Test] Update wimp out test and comment (#4900)
* Changed conditional to actually consider the wave index.

* Added PigeonBar's test

* Added check for MEs + Documentation

* Apply suggestions from code review

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
2024-11-17 16:22:11 -05:00
Mumble 6b58d51ea2
Changed conditional to actually consider the wave index. (#4899)
Co-authored-by: frutescens <info@laptop>
2024-11-17 20:19:23 +00:00
Amani H. 1867ac4a9e
[Dev] Minor Version Migration Tweaks (#4727)
* [P3] Prevent Unintended ME Migration Application

* Change Patch Value from 4 to 5

* Bump Game Version

* Fix Imports, Use `isNullOrUndefined`
2024-11-17 17:34:41 +00:00
PigeonBar 07f08877c1
[Balance] Multi Lens damage reduction on fixed-damage moves (#4896) 2024-11-17 17:16:54 +00:00
Moka ae8efeedf8
[UI] Make ME text legible when using the legacy UI theme (#4847) 2024-11-16 23:34:14 +00:00
Daniel Pochert 7dc4210f71
[Bug] fix training session encounter not applying nature correctly (#4801)
* fix training session encounter not applying nature correctly

* implement pokemon.setCustomNature + nature unlock utility method(s)

* update doc

---------

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2024-11-16 23:33:14 +00:00
Mumble c2afac8b02
[Bug] Moved code preventing MBH's transfer to post modifier generation (#4858)
* Moved code preventing MBH's transfer to after enemy modifiers were generated.

* Removed unnecessary !

* Removed unnecessary ?

* Created a new enum and functions for retrieving final bosses.

* Moved isBattleClassicFinalBoss to game-mode.ts and reverted battle.ts

* Preventing item transfer with tryTransferModifier instead

* Added filtering to modifier-retrieve methods.

* Revised logic in tryTransferHeldItemModifier

* Adding what works to the game even though it's not the best.

* Added comments

* Removing past changes to files.

* Added check for Classic Final Boss.

---------

Co-authored-by: frutescens <info@laptop>
2024-11-16 23:32:05 +00:00
Amani H. c22b48f903
[P1] Fix System Data Conversion Failure 3 (#4866)
* [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>
2024-11-16 23:31:28 +00:00
Mumble 4aff2ffa1d
[Dev] Sessions will now sync with the server at the start of every 5 waves (#4808)
* Replaced conditional with `true` so that sync-to-server occurs at the start of every wave.

* Update src/phases/encounter-phase.ts

Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>

* Fixed errors from previous commit.

* Revised condition to include the first wave of a run.

* Apply suggestions from code review

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2024-11-16 23:30:47 +00:00
innerthunder 360a897ed2
[Balance] Endure Tokens only endure one hit (#4875)
* Endure Tokens only endure one hit

* Add tests for Endure

* Update docs

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-15 21:11:46 +01:00
AJ Fontaine 413f2b80c8
[Balance] Increase Gimmighoul's evo counter more with Big Nugget/Relic Gold (#4856)
* Increase Gimmighoul's evo counter more with Big Nugget/Relic Gold

* Update src/modifier/modifier.ts

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

---------

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2024-11-15 20:26:58 +01:00
AJ Fontaine 5e7d44abfd
[Balance] Fix Liquidation, Double-Edge, Body Press compatibility (#4879) 2024-11-15 14:07:02 -05:00
Mumble c535e928d8
[Beta][QoL] Improved cursor memory for target selection in Doubles (#4849)
* Added more intelligent cursor memory for target selection in Doubles

* Added documentation

* Fixed variable name.

* Apply suggestions from code review

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2024-11-15 12:45:21 -05:00
Mumble eb3c0d731a
[P2] Lunar Blessing / Jungle Healing now heal Freeze (#4877)
* Added Freeze to statuses healed by Jungle Healing / Lunar Blessing

* Fixed up documentation.

---------

Co-authored-by: frutescens <info@laptop>
2024-11-15 12:17:46 -05:00
pom-eranian 5ca1fd5cfd
[Sprite] Set default fps to 10 instead of 12 on pokemon animations (#4842)
* Set default fps to 10 instead of 12 for pokemon sprites

* [Sprite] Set pokemon animation framerate to 10 where assigned
2024-11-15 11:58:50 -05:00
AJ Fontaine ef7d860166
[Balance] Remove from trainers: Pika/Eevee forms before 30, BB Greninja, Rival starter HA (#4863)
* Remove Pika/Eevee forms from Trainers before wave 30, and BB Gren

* Fix `egg` test

* Ban hidden ability from Rival starter

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-15 11:57:02 -05:00
innerthunder 9273b4930d
[Beta][P1] Fix crash when resetting Commanded Dondozo before Trainer battles (#4873)
* Add failsafe to Commander remove anim

* Commanded tag saves Tatsu form on reload
2024-11-15 11:56:05 -05:00
NightKev 8326e3556b
Remove `.edgeCase()` from fully implemented moves (#4876)
This includes Sunsteel Strike, Moongeist Beam and Photon Geyser
2024-11-15 08:29:52 -08:00
Mumble 6dec84e39c
[Balance] No more double 50x bosses in Endless + cleaning up RNG (#4862)
* Added double battle exclusion to Endless bosses.

* Brought Endure token RNG in line with game RNG formatting.

* Corrected incorrect modulo condition in isEndlessBoss

* Moved new doubles conditional to be above overrides.

* Fixed bad RNG calls for Covet and Thief too.

* Updated unburden test.

* Revert "Updated unburden test."

This reverts commit 01788d40c2.

* Revert "Fixed bad RNG calls for Covet and Thief too."

This reverts commit c7fcfd195d.

---------

Co-authored-by: frutescens <info@laptop>
2024-11-14 21:13:23 -08:00
PigeonBar b1138c1d70
[P2][Beta] Freeze-dry Re-implementation (#4874) 2024-11-14 21:07:19 -08:00
Moka f778bd5877
Prevent crash from null dexData attributes (#4871) 2024-11-14 23:01:04 +00:00
Mumble 58912db8f1
[P2] Telekinesis now sets FloatingTag to 3 turns instead of 5 turns (#4869)
Co-authored-by: frutescens <info@laptop>
2024-11-14 16:16:05 -05:00
PigeonBar 640ac23741
[Dev] Add overrides for alternating between single and double battles (#4833)
* [Dev] Add overrides for alternating between single and double battles

* PR feedback

* Add type `DoubleType`

* Fixed Gastro Acid test using `game.override.battleType(null)`

* Changed new type name to `SingleOrDoubleType`

* `SingleOrDoubleType` is now `BattleStyle`

* Update src/test/utils/helpers/overridesHelper.ts

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2024-11-14 20:40:01 +01:00
Mumble d0d9eb78da
Set the IVs of default starters to 15. (#4861)
Co-authored-by: frutescens <info@laptop>
2024-11-14 11:35:13 -08:00
geeilhan 0c521bbe08
[Move] Implement Freeze Dry type-changed interactions (#4840)
* Full implementation of freeze-dry including edge cases such as Normalize and Electrify plus tests

* Update comments

* renamed WaterSuperEffectTypeMultiplierAttr to FreezeDryAttr

* Added test case for freeze dry during inverse battles

* cleaned up code making it more general

* Added some more documentation

* implementing reviewed changes

* used getMoveType() instead of move.type

* added additional test cases to freeze dry

* Revert "used getMoveType() instead of move.type"

This reverts commit 03445dfab4.

* added reviewed changes without changing public/locales

---------

Co-authored-by: ga27lok <geeil.han@tum.de>
2024-11-13 10:41:39 -05:00
muscode 162eea500d
Fixed wild form changes messages, and form-changed Cramorant crashing the game when both sides faint at the same time (#4859) 2024-11-13 14:28:22 +08:00
innerthunder e45cb42f7e
[Balance] Disable King's Rock for moves that can already flinch (#4860) 2024-11-12 18:42:47 -08:00
NightKev b6b756a162
[P2] Fix issue with Pokemon not evolving until the next floor and clean up `LevelUpPhase` (#4854) 2024-11-12 06:44:28 -05:00
PigeonBar 6f3fd0f138
[Beta][P3] Fix failed charge moves not displaying failed text (#4853) 2024-11-12 06:29:37 -05:00
innerthunder 8e26db944d
[Balance][Beta] Revert Spread Move Restriction on Multi-Lens (#4851)
* Multi-Lens now applies to spread moves

* Fix Multi-Lens applying to both damage and power
2024-11-11 21:13:37 -08:00
PigeonBar 4802f512ff
[P1][Beta] Fix softlock when losing a run on local build (#4846) 2024-11-11 15:22:27 -08:00
innerthunder cebedd220b
[Balance] Rework Multi-Lens (#4831)
* Rework Multi-Lens

* Multi-Lens integration tests

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Fix obsolete tests related to Multi-Lens

* Fix flaky unburden tests

* maybe fix flaky ceaseless edge test?

* Fixed Multi-Lens apply comment

* Fix ceaseless edge test for real this time

* Update locales

* Another locale update

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-11 14:56:16 -08:00
Mumble e5e3926176
[beta] Fix MovePhase not ending properly. (#4848)
Co-authored-by: frutescens <info@laptop>
2024-11-11 21:13:15 +01:00
Mumble 6feb63484c
[P3] Added `failIfSingleBattle` condtion to Doubles-only moves and display failure message when used in singles (#4839)
* Added failIfSingleBattle condtion to Helping Hand

* Added failIfSingleBattle conditions to Doubles-Only moves

* Adjusted canMove failure condition.

* Updated moves that failIfSingleBattle

* Fixed condtional.

---------

Co-authored-by: frutescens <info@laptop>
2024-11-11 12:29:20 -05:00
NightKev 6799594bbb
[Test] Update Zen Mode test (#4845) 2024-11-11 02:21:06 -05:00
PigeonBar efa9f119a0
[Beta][P3] Fix shiny Pokemon being displayed before shiny colours are loaded (#4843) 2024-11-11 02:18:57 -05:00
chaosgrimmon f2a2281ff1
[Sprite] Implement female icon assets for Meganium and Doduo + Torchic lines (#4841)
* [Sprite] Implement more female icons

* [Sprite] Add female Doduo/Dodrio icons

* [Sprite] Add female Meganium icons

* [Sprite] Add female Torchic line icons

* [Sprite] Add female Meganium icons

* [Sprite] Add female Torchic line icons

Identical to male counterpart icons
2024-11-10 14:37:21 -05:00
PigeonBar 63ffab027d
[Beta][P2] Several Unburden bug fixes (#4820)
* [P2][Beta] Several Unburden bug fixes

* Unburden test adjustments

* Some further test cleanup

* Add suggested `.bypassFaint()` to Unburden

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-10 14:21:29 -05:00
NightKev 2968059814
[P1] Transform and Imposter will now fail when either Pokemon is fused (#4824)
* Transform and Imposter will now fail when either Pokemon is fused

* Prevent Ditto from being randomly generated as part of a fusion
2024-11-10 00:39:05 -05:00
Mumble b3a94e6a6b
[Telemetry][Misc] Client-Side changes to log run results at the end of runs (#4834)
* Added new telemetry-related parameters

* Update test with new parameters.

* Removing extra parameters.

* Cat in front of keyboar d sorry

* Changed variable name to isVictory.

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Thank you Torranx

* Condensed if-else pair to else if statement

* Update src/phases/game-over-phase.ts

Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>

* inhale... exhale... corrected variable name to pass linter

---------

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>
2024-11-10 00:37:09 -05:00
Moka 44a68a91ba
[P1] Fix crash when newly aquired Pokemon are sent in battle (#4835) 2024-11-10 00:35:49 -05:00
Payton Rogers 265b3cb938
[P3] Fix visual bug with level text remaining the same when pokemon levels are reduced in weird dream ME (#4837) 2024-11-10 00:35:16 -05:00
damocleas 198ac2431d
Undo Event modifier-type.ts item table changes (#4836) 2024-11-09 14:26:55 -08:00
PigeonBar 2bf8acea06
[Beta][P2] Fix Sketch failing to sketch moves that call other moves virtually (#4823)
* [P2][Beta] Fix Sketch failing to sketch Metronome et al

* Suggested changes to `getLastXMoves()`

* Renamed turnCount to moveCount
2024-11-09 13:15:24 -05:00
innerthunder a763cd173d
[Beta][P1-3] Fix Commander implementation bugs (#4826) 2024-11-09 13:14:11 -05:00
innerthunder 329e43ad48
[P2] Removed incorrect calls to `resetBattleData` on switchout (#4828) 2024-11-09 13:13:12 -05:00
NightKev c54d21c313
[Test] Fix flaky Wimp Out test (#4830) 2024-11-09 13:12:22 -05:00
AJ Fontaine c6cc187c96
[Balance] Modify potion and ether weight funcs (#4829)
* Adjust for low HP mons
2024-11-09 01:10:49 -08:00
AJ Fontaine de4ec5e1cb
[Feature] [Item] Add Catching Charm item (#4811)
* Add catching charm item

* Add Catching Charm item

* Disable catching charm in item pool when dex isn't full enough

* Replace catching charm icon

---------

Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
2024-11-09 14:38:45 +08:00
NightKev 00f7fd47df
[Refactor] Remove unnecessary re-exports (#4818)
* Remove unnecessary re-exports

* Move `Type` enum to `src/enums/type.ts`

* Remove import style change from `modifier-type.ts`
2024-11-08 17:44:34 -05:00
Mumble 58d40b905a
[Bug] Fixing Encore's interactions with other Move Restriction moves (#4805)
* Converted EncoreTag into a MoveRestrictionBattlerTag

* Wrote test and added documentation

* Added documentation describing EncoreTag as a whole

* Added PRE_MOVE lapse code to handle early tag expiration from PP-less encored move

* Replaced PRE_MOVE with CUSTOM for lapsing Encore in situations where the encored move has 0 PP

* Add encore tests

* fix overrides

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update command-phase.ts

* Addressed failing eslint test

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: innerthunder <brandonerickson98@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-08 09:35:33 -08:00
innerthunder 625b98a6fe
[Move][Refactor] Create `Move.getPriority` + Fully Implement Upper Hand (#4789)
* Fully Implement Upper Hand

* doc for UpperHandCondition

* New Upper Hand tests + some nit fixes

* Use Fake Out over mocked Tackle in test
2024-11-08 10:50:23 -05:00
Mumble 4821df68f2
[P1] Prevents crash from using Sketch against a lost turn (#4806)
* Added check to make sure that Sketch does not copy a failed move.

* Added check for Struggle.

* Added a revised check.

* Added test + change to valid move finding conditional.

* Made revision to .find target

* Reverting previous commit, whoops.

* Add moveset checks to Sketch tests

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-07 23:10:46 -05:00
Daniel Pochert aa2c794910
[Balance/Bug] Boss segments properly heal (#4819) 2024-11-07 23:09:25 -05:00
Moka 2b91d9d259
[Dev] Remove logging for api requests outside of dev (#4804) 2024-11-07 15:30:49 -08:00
AJ Fontaine b2fdb9fcd1
[P2] Fix Cosmoem requirng an evolution level (#4812) 2024-11-07 16:33:25 -05:00
Mumble 4c5b83612b
[P2] END biome transition now properly uses seeded RNG (#4809)
Co-authored-by: frutescens <info@laptop>
2024-11-07 10:36:25 -05:00
AJ Fontaine 1f6dab069d
[Feature][Balance] Add critical captures, update shake probability to match gen 6 (#4791)
* Change shake probability to match Gen 6

* Add critical captures, update shake probability to gen 6

* Change IntegerHolder to NumberHolder

* Adjust dex count thresholds for multiplier

* Disable critical captures in fresh start runs

* Skip first shake check for critical captures

* Move shake check for crit captures to after first shake

* Use less insane catch formula

* Integer to number in bounceanim signature

* Use max crit catch dex multiplier in daily runs

* Adjust crit capture animation

---------

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-06 18:25:27 -08:00
ThePsychedelicSeal 9dae28f264
[Misc] Adding Type, Current HP, Max HP, & Status to updateGameInfo() (#4756)
* Adding to window.gameInfo

Added
type -> not working
currentHP -> not working
maxHP
status

* Adding to updateGameInfo()

* Update pokemon.ts

* Modifying battle-scene.ts

Added code to get Form and Tera Type
Typo fixed in pokemon.ts

* Output type names/etc instead of numbers

---------

Co-authored-by: ThePsychedelicSeal <trevorlrichfield@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-11-06 11:42:39 -05:00
Mumble 6b7efb444b
[Ability] Fully implement Synchronize (#4785)
Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-06 11:29:24 -05:00
Mumble 4f733796c5
[Move] Implement Grudge (#4794)
* some work

* slay dnr

* Fixed up move mechanics

* bahhh

* yawn

* updated lapse type to correctness

* Test + documentation

* yattt

* Remove some redundant code

* Apply suggestions from code review

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* Update battler-tags.ts

* Fix `PokemonAnimPhase`

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-11-05 21:32:07 -05:00
innerthunder eb32545772
[Balance][Beta] Commander now increases double battle chance (#4803) 2024-11-05 11:23:22 -08:00
Moka b79b643b31
[P2][ME] Fix GTS not getting proper item tier when trading items (#4802) 2024-11-05 12:42:04 -05:00
geeilhan 198d3ce2a6
[P2] Fixing Incorrect Freeze Dry Interaction With Soaked Wonder Guard Target (#4798)
* [Bug] fixed interaction between freeze dry and soaked wonder guard target

* added automated test for freeze dry interaction with soaked wonder guard target

* using parameter instead of function to get typeMultiplier
2024-11-05 12:37:47 -05:00
innerthunder 6fd3ba284c
[Move][Ability] Implement Commander and Order Up (#4670)
* Implement Order Up (mostly untested)

* Commander unit tests + bug fixes

* Implement Order Up (misnamed the other commit...)

* Order Up unit tests

* applying Temp's suggestions + other bugfixes

* add TODO comment

* Reviver Seed reapplies Commander

* ESLint woes

* Some animation fixes

* Update locales

* Order Up now uses attr option

* Prevent semi-invulnerability lapsing out while Commanding

* semi-invulnerability test

* Add `edgeCase`
2024-11-05 12:35:43 -05:00
Adrian T. 88789c685e
[Documentation] Flag Gulp Missile with edge case (#4800) 2024-11-05 11:08:55 -05:00
PigeonBar 543a97076b
[P1][Beta] Fix FormChangePhase being broken by EvolutionPhase refactor (#4795)
* [P1][Beta] Fix FormChangePhase being broken by EvolutionPhase refactor

* Apply suggested changes to added test
2024-11-05 15:19:20 +01:00
AJ Fontaine 13841765f1
[Dev] Update test save with everything unlocked (#4137)
* Add test save with all egg moves unlocked

* Move to everything.prsv

---------

Co-authored-by: Lugiad <adrien.grivel@hotmail.fr>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
2024-11-04 21:33:15 -05:00
NightKev ab6d15ee8a
[Move] Improve Future Sight & Doom Desire (still partial) (#4545)
* Fix behavior of Future Sight and Doom Desire

Add test for Future Sight

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Prevent crash if Future Sight target is missing

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

* Add `partial()` comments, update `DelayedAttackAttr` return

---------

Co-authored-by: Gianluca Fuoco <gianluca_1227@hotmail.com>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
2024-11-04 21:31:40 -05:00
Moka 433d4b4fc9
[P3][UI][QoL] Fix tooltips going out of screen on mobile & other improvements (#4792)
* [ui] Fix tooltip placement when using touchscreen

* [ui] make candy friendship tooltip hitbox bigger
2024-11-04 20:24:17 -05:00
flx-sta 7a0c88e661
[Refactor] Pokerogue API client (#4583)
* 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 a97dafe8b2.

* 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>
2024-11-04 15:57:21 -05:00
NightKev a70f0860e1
[Beta Bug] Enemy pokemon shouldn't get unimplemented moves (#4787) 2024-11-03 23:34:26 -05:00
Adrian T. 618dfbd324
[Refactor] Reduce nesting in doEvolution() (#4786)
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
2024-11-03 22:40:24 -05:00
Mumble 3a767ed38a
[Refactor] Another Audio clean up (#4077)
* Cleaned up how cry keys were retrieved

* Legendary Pokemon Changes + Cry Cleanup

* Spelling mistake

* Fixed settings.

* correcting typedocs

* eslint

* eslint cleanup

* music pref

* gdfafa

* Music

* Apply suggestions from code review

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

* Update src/battle.ts

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

* Update src/battle.ts

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

* fixed default

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Added changes

* Update src/battle-scene.ts

Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>

* Fix variable usage

* Fix `getFormSpriteKey()` and `.concat()` usage

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

* asdsafafaf

* i need to do the dishes ughhh

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: PigeonBar <56974298+PigeonBar@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>
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
2024-11-03 22:31:07 -05:00
NightKev 770f388c45
[Refactor] Miscellaneous code cleanup (#4596)
* 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>
2024-11-03 22:23:51 -05:00
Moka 62f9f6dd32
[UI] Starter Select UI no longer reloads sprite when changing nature, ability, etc (#4782)
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
2024-11-03 22:04:53 -05:00
innerthunder c3d832aaca
[Move] Fully Implement Round (#4783) 2024-11-03 21:59:55 -05:00
muscode 3f97c9e39f
[Ability] Implement Unburden (#4534)
* 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>
2024-11-03 21:58:12 -05:00
muscode 1619d512cf
[Move] Implement Fairy Lock (#4736)
* inital wip

* wip set isTrapped to true and removed timedtrap

* implement fairy lock

* whitespace fix

* added documentation for tag

* added more suggested tests

* give tests breathing room

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* give tests breathing room

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* give tests breathing room

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* updated nested ternary, changed test name

---------

Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-11-03 21:56:54 -05:00
NightKev 836b37f383
[Refactor] Clean up some code related to starter select UI (#4752)
* 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>
2024-11-03 21:55:12 -05:00
NightKev af473ba4ff
[Refactor] Clean up various methods in `battle-scene.ts` and `pokemon.ts` (#4412)
* 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>
2024-11-03 21:53:52 -05:00
Tempoanon 87b7122b60
[P2] Illuminate ignores evasion (#4781) 2024-11-03 21:47:07 -05:00
NightKev 5e2dfa975a
Rename `PokemonTurnData`'s `damageDealt` and `currDamageDealt` (#4784) 2024-11-03 14:09:28 -08:00
muscode f0ae36de6c
[Ability] Implement Wimp Out and Emergency Exit (#4701)
* implement Wimp Out/Emergency Exit

* fixed test

* fixed weather bug

* Added nightmare interaction to Wimp Out following bug fix

* refactored and added postdamageattr

* bug fixes

* added confusion test back (skipped)

* updated applyPostDamageAbAttrs to applyPostDamage

* fix external func name

* fixed syntax inconsistency

* updated PostDamageForceSwitchAttr -> PostDamageForceSwitchAbAttr

* Modify `wimp_out.test.ts`

* remove extra comment

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* remove extra comment

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update tsdocs

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* remove comment

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* remove comment

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* fix tsdocs

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* fix tsdocs

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* fix tsdocs

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* fix tsdocs

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* fix whitespace

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* make getFailedText public

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* make switchOutLogic public

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* make getSwitchOutCondition public

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* make getFailedText public

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* make applyPostDamage public

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* simplify if statement

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* add public override to applyPostDamage

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* fixed nested if issue, remove trapped tag removal

* add fix for multi hit move

* added multi-lens logic

* moved applyPostDamageAbAttrs to pokemon.damage, added check for multi lens in pokemon.apply

* added source to damageAndUpdate and applyPostDamageAbAttrs, added Parental Bond logic + test, put applyPostDamageAbAttrs back in damageAndUpdate

* simplify multi hit check

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* Minor formatting changes

* Update src/data/ability.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* moved and renamed shouldPreventSwitchOut, rewrote tests to account for U-turn changes, fix syntax error

* Move comment slightly

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-11-03 01:04:20 -05:00
podar b17b1d6e7e
[P1] Fixing crash that can occur when failing to loading variant sprites. (#4315) 2024-11-03 01:33:48 -04:00
Mumble f16309fd06
[P2] Plus, Minus, Beads/Sword of Ruin not ignorable. Shield Dust and Armoa Veil ignorable (#4778)
Co-authored-by: frutescens <info@laptop>
2024-11-03 01:22:40 -04:00
Mumble 70ddc29e86
[Refactor] Refactor data/pokemon-species.ts (#4054)
* 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>
2024-11-02 23:11:24 -04:00
Mason S c31657d952
[Refactor] Reduced nesting in MoveEffectPhase (#3541)
* Re-structured MoveEffectPhase.run() to reduce nesting and improve readability.

* Re-structured MoveEffectPhase.run() to reduce nesting and improve readability.

* Added Substitute Implementation

* Fix indentation, tsdocs, add `public`/etc

* Prevent ENEMY_SIDE targeted moves from occurring twice in double battles

* Add `override` to `start()` and `end()`

* Minor indentation fix

---------

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-02 22:55:15 -04:00
innerthunder 1474f8cf14
[Refactor] Add `options` param interface for `MoveEffectAttr` (#4710)
* Optional parameter interfaces for `MoveEffectAttr` and `StatStageChangeAttr`

* Update docs + Diamond Storm typo

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Make move effect trigger specification optional

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-02 13:05:33 -04:00
Mumble 1659f57262
[P2] Camouflage now considers Terrains first (#4761)
* 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>
2024-11-02 12:48:10 -04:00
innerthunder 80a8c659ee
[P2] Add "no switch-in" fail condition for Shed Tail and Baton Pass (#4777) 2024-11-02 12:47:08 -04:00
Moka c2d24d6e93
[Bug] Take weight into account when getting the tier of a modifier (#4775)
* disable timed events in tests

* Take weight into account when getting the tier of modifiers

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
2024-11-02 11:55:22 -04:00
AJ Fontaine 8169760e1e
[Bug] Prevent wild mons fleeing with U-turn, Flip Turn, Volt Switch (#4643)
* Wild mons can't flee with U-turn

* Update src/data/move.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-11-01 21:21:45 -07:00