Commit Graph

22 Commits

Author SHA1 Message Date
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
AJ Fontaine
8a2900ad29
[Refactor] Move some relevant files, tables etc to new balance folder (#4510)
* Move biomes.ts

* Move starter costs, passives, friendship, starter-candy to starters.ts

* Change relative imports to absolute imports

* Add docstrings, passives.ts

* Constants in rates.ts for egg pity, egg tier rates, hatch waves, variant chances

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-10-02 06:20:19 -07:00
NightKev
15205c5e00
Prevent daily runs from breaking due to very (un)lucky RNG (#3841) 2024-08-30 20:10:38 -07:00
NightKev
d234466d61
[Balance] Make sure trainers are using fully evolved Pokémon by gym 3 (#3499)
* Make sure trainers are using fully evolved Pokemon by gym 3

* Expand comment info

Co-authored-by: Mumble <kimjoanne@protonmail.com>

* Implement suggestions

* Update `getPokemonSpecies()` to throw an error if passed `undefined`

---------

Co-authored-by: Mumble <kimjoanne@protonmail.com>
2024-08-26 23:05:16 +02:00
flx-sta
5000a91348
resolve some open strict-null bangs TODOs (#3530) 2024-08-13 22:12:42 +01:00
flx-sta
a07d2c57a4
[Refactor] use typescript strict-null (#3259)
* 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>
2024-08-07 17:23:12 +01:00
Matthew
dc30dd33b2
[QoL] Reorganize Enum Locations (#2185)
* moving enums

* import updates

* fix tsconfig paths importing (#2184)

* reverse index.ts addition

---------

Co-authored-by: Devin Korb <meepdarknessmeep@gmail.com>
2024-06-13 18:44:23 -04:00
Matthew Olker
e6c24dceab Revert "[QoL] Reorganize Enum Locations (#2142)"
This reverts commit cf06ff3b8d.
2024-06-13 11:30:47 -04:00
Matthew
cf06ff3b8d
[QoL] Reorganize Enum Locations (#2142)
* moving enums
2024-06-13 11:11:12 -04:00
Xavion3
696ff6eae3
Add Challenges (#1459)
* Initial challenge framework

* Add type localisation

* Change how challenges are tracked

Also fixes the difficulty total text

* MVP

Renames challenge types, temporarily hides difficulty, and implements challenge saving.

* Attempt to fix one legal pokemon in a double battle

* Make monotype ignore type changing effects

* Make isOfType correctly detect normal types

* Try to fix double battles again

* Make challenge function more like classic

* Add helper function for fainted or not allowed

* Add framework for fresh start challenge and improve comments

* Try to fix evolution issues

* Make form changing items only usable from rewards screen

* Update localisation

* Additional localisation change

* Add achievements for completing challenges

* Fix initialisation bug with challenge achievements

* Add support for gamemode specific fixed battles

Also make monogen challenges face the e4 of their generation

* Add better support for mobile in challenges

* Localise illegal evolution/form change message

* Update achievement names

* Make alternate forms count for monogen

* Update monotype achievement icons

* Add more comments

* Improve comments

* Fix mid battle form changes

* Reorder mode list

* Remove currently unused localisation entry

* Add type overrides for monotype challenges

Meloetta always counts for psychic and castform always counts for normal

* Change how form changes are handled

Now attempts a switch at the start of each turn instead of immediately

* Add start button to challenge select screen

* Make starter select back out to challenge screen if using challenges

* Fix daily runs

* Update tests to new game mode logic
2024-06-08 01:07:23 -04:00
Tempoanon
1c73b3b084
Revert "[Feature] Add possibility to override whole user party (#1643)" (#1796)
This reverts commit ef8b6aa4f9.
2024-06-04 16:39:02 +01:00
hayuna
ef8b6aa4f9
[Feature] Add possibility to override whole user party (#1643)
* Add possibility to override whole user party

* Update species overriding

* Replace SPARTER_SPECIES_OVERRIDE with array

* Replace SPARTER_SPECIES_OVERRIDE with array

* Add possibility to override species forms

* Add possibility to override species forms

* Fix eslint styling

* Add possibility to override Abilities for party

* Override status, gender, moveset

* Add possibility to override shinies

* Fix CI
2024-06-04 11:29:38 -04:00
Greenlamp2
e2be6ba002
added rule no-trailing-spaces (#1307) 2024-05-23 18:45:04 -05:00
Greenlamp2
bac6c22973
ESLint - The Essential Linter and Formatter for JavaScript and TypeScript (#1224)
* eslint config + packages

* updated eslint config

* fix the issue eslint adding ;;;; at interfaces

* first round with eslint --fix .

* removed config for unused export

* Revert "first round with eslint --fix ."

This reverts commit 77a88e0895.

* removed config for camelCase

* for real this time, first round of eslint --fix .

* halfway to manual eslint fix

* eslint done

* added "how to setup" the hook to eslint --fix each new file before commit (if wanted)

* removed eslintrc config file duplicat

* fix human error + ignore build folder + merge overrides

* added curly brace style + eslint

* applied double quote linter rule

* added lefthook

* test precommit

* test precommit

* test precommit

* test precommit

* test precommit

* test precommit

* test precommit

* github action to run eslint

* added node_modules to ignore eslint

* different action for typescript

* no need for different glob (default src)

* node 20

* node 20

* removed no longer needed install file

* remove hooks part from README

* eslint fixes

---------

Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
2024-05-23 11:03:10 -04:00
Nexllon
df499e2f71
offline mode - adds daily run and fixes clear freezes (#834)
* offline mode - adds daily run and fixes clear freezes

* removed unused import
2024-05-14 15:42:30 -04:00
Flashfyre
c76f8c5e7e Add tiered shiny variants 2024-04-18 22:52:26 -04:00
Flashfyre
824a73ef71 Add candy system for passives and value reductions 2024-04-13 18:59:58 -04:00
Flashfyre
84f6456972 Use nature override property instead of overwriting base nature 2024-04-02 23:00:56 -04:00
Flashfyre
5b0a790d86 Allow overriding daily run starters 2024-03-30 17:10:34 -04:00
Flashfyre
0afec8fd35 Rebalance trainer evolution logic 2024-03-28 14:05:15 -04:00
Flashfyre
56f4a71ca6 Add daily runs (WiP) 2024-03-16 22:06:56 -04:00
Flashfyre
81f9e2da36 Add WiP logic for daily run and fix some performance issues 2024-03-15 21:59:34 -04:00