Commit Graph

31 Commits

Author SHA1 Message Date
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
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
Flashfyre bd80281859 Fix various shiny checks for palettes 2024-04-19 11:11:19 -04:00
Flashfyre ee18c05f02 Compare variant colors using integers for compatibility 2024-04-19 10:23:18 -04:00
Flashfyre eebe39e1fe Fix base forms showing as shiny 2024-04-18 23:10:18 -04:00
Flashfyre c76f8c5e7e Add tiered shiny variants 2024-04-18 22:52:26 -04:00
Flashfyre 203ba1646d Make trainer switch AI aware of arena traps 2024-03-31 12:00:54 -04:00
Flashfyre e9b94f47f0 Fix battle animation Pokemon sprites losing shadow 2024-03-26 17:45:43 -04:00
Flashfyre cf959c6e1b Add proper title screen and logo 2024-03-21 13:12:05 -04:00
Flashfyre a76f795cd5 Trainer updates including names and double battle pairs
Add dynamic trainer pairs; add trainer names with Bulbapedia scraping logic; add Hex Maniac trainer; make namebox stretch to fit name
2024-03-21 00:57:28 -04:00
Flashfyre 81f9e2da36 Add WiP logic for daily run and fix some performance issues 2024-03-15 21:59:34 -04:00
Flashfyre 47cf14da9b Implement terrains and rework status logic 2024-03-09 21:57:33 -05:00
Flashfyre 50b9bf10a7 Add toggle for fusion palette swaps 2024-03-05 21:54:26 -05:00
Flashfyre f48464d48d Minor refactoring 2024-02-29 20:08:58 -05:00
Flashfyre 74e9b95e13 Fix damage reduction abilities not working 2024-02-26 12:34:45 -05:00
Flashfyre 5f9636e2d7 Fix crash with form changes 2024-02-20 13:59:44 -05:00
Flashfyre dadc08d16e Add Terestallization mechanics
Add Terestallization mechanics; implement Stellar type; fix bug with held item weights
2024-02-17 00:40:03 -05:00
Flashfyre f49a3e5127 Add field zoom functionality and make final boss larger 2024-01-14 20:47:08 -05:00
Flashfyre 40d2c200a4 Add form change animation and additional final boss changes 2024-01-13 20:15:55 -05:00
Flashfyre 60260faaa4 Ignore time of day tint on Pokemon sprites in UI 2023-12-30 15:44:20 -05:00
Flashfyre 5ef6f2da88 Add day/night cycle 2023-12-29 21:04:40 -05:00
Flashfyre 1e2bd0dbb9 Minor change to sprite shader 2023-11-26 09:53:16 -05:00
Flashfyre e5fe0c6e3a Add transform support to fusion palette swaps 2023-11-24 15:12:26 -05:00
Flashfyre 4d02432606 Add palette swaps for fusions 2023-11-23 23:52:13 -05:00
Flashfyre c62cb27cdb Reimplement one-hit KO effect 2023-11-07 22:23:42 -05:00
Flashfyre 48797cb20f Add WiP trainer logic 2023-10-07 16:08:33 -04:00
Flashfyre 6b1f96e0c1 Fix issues with shader code 2023-06-05 23:01:00 -04:00
Flashfyre da8629164e Fix some bugs 2023-06-05 11:39:49 -04:00
Flashfyre 0cc87b4ba0 Add sprite shadows and update engine 2023-06-04 21:47:43 -04:00
Flashfyre bf2eca2851 Add shader for sprite tone 2023-06-02 18:33:51 -04:00