Commit Graph

52 Commits

Author SHA1 Message Date
Matthew Olker 02d5654be4 Pride Update 2024-06-14 12:42:37 -04: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
José Ricardo Fleury Oliveira 40727bdc16
[Localization] Localize "Loading asset:" text (#1961)
* localized "Loading..." texts

* fixes

* localized loading asset

* fix
2024-06-08 14:34:05 -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
Matthew 9c97e37c27
initVouchers correctly (#1940) 2024-06-07 23:50:07 -04:00
Greenlamp2 1a149bfa04
[Testing] Flexible Testing Wrapper for Phaser-Based Battle-Scenes (#1908)
* refactor executed code while importing and initializing all of these in loading-scene

* reset to main

* fix server url

* added rule no-trailing-spaces

* made progress

* test somme data from a session save is working

* trying to launch a battle

* added fetch wrapper to load data locally

* trying to mockAllSettled

* pushPhase & shiftPhase

* check integrity of exported session

* set toke + loggedInUser in tests

* progress on starting new battle

* tring to test phase but it's async

* mocking fetch

* working mock fetch

* need to handle pile of data

* attempt to use real phaser classes

* reorder overrides

* refactored to use some real classes from phaser

* removed useless things

* started to work on some container mock

* finished the mockContainer time to add some logic

* some more mock containers

* removed addMethods since there is the mock classes now

* commented issues

* attempt to create mockTextureManager

* fix tests

* mockSprite & mockText

* yes but not really

* yes but not really

* fix tutorial callback

* reached mode title

* added achievement tests

* fix test achievements with current state of mock

* correct sequence loading for BattleScene with mockLoader !

* deep dive into next step

* working wait until starter selection screen

* added newGame method into wrapper

* expect to save_slot

* trying to manage pokemon sprite for getAll without success yet

* added test for egg output

* fixed egg test for June

* fix tests + locate next issue to fix

* we are in battle baby

* added new game in one-line

* export is working but export only what's in the fetch

* fix start game as guest

* refactored how we start a battle + cleanup

* overrided mewtwo but issue with currentBattle

* refactor: rename InitAchievements to initAchievements

* added missing mock method

* override level and pokemon forms working as intended

* bringToTop Obj

* remove launch battle in achivement test

* fix getIndex when same pokemon

* can run all tests

* first attack, faint, and shop modifiers, MockClock

* on method for container

* added doAttack one-liner

* one-line export data

* removed throw error

* feat: Make `scenes` property of `GameWrapper` class public

The `scenes` property of the `GameWrapper` class was changed from private to public. This change allows external access to the `scenes` map, which is used to store Phaser scenes. This modification was made to enable easier manipulation and interaction with the scenes in the game.

* correction

* removed CanvasRenderer

* added a param to remove console.log and added a param to preven scene create call

* fix encounter wave 30 when it's a trainer

* test double-battle

* test fight without KO

* test double fight no ko

* fix crashing texture + added Text wrapper to log fight

* fix tests on boss - trainer - rival

* chore: Refactor BattleScene initialization and add new phases

Refactor the BattleScene initialization code to remove unnecessary delay and improve performance. Also, add new phases for the title and unavailable states to enhance the game experience.

* rework of Game tests

* skipFn is working

* added onNextPrompt and restore Og Start

* better newGame

* added skipFN in remove

* not yet working test but updated interceptors

* do attack work but not on PostSummonPhase phase when there is mention of silcoon and wurmple

* error located, it's just a double fight, i was not there yet

* single OHKO & double no OHKO

* added expirationFn into next prompt

* all tests are passing

* working test on non damaging move from opponent

* cleaned a bit

* removed phaser initialisation on every tests

* renamed test file

* added load system data

* added some ability support

* added onKill & onSummon abilities test

* removed useless test + cleanup

* removed useless test + cleanup

* fixed tests after merge main

* added itemHeld endTurn trigger test (toxic orb)

* added runFrom..To

* added mustRun to assert currentPhase

* added no-miss move to test things

* cleaner restore mock

* fix test

* fix moxie test + game speed

* improve test speed

* added onOurself and onOpponent mvoe test

* added onDamage test for tackle

* removed timeout in intervals to run tests faster

* cleanup

* added never crit override + separate file per test + remove randomness in randBattleSeedInt

* move folders

* better org

* renamed itemHeld folder to items

* fix deploy.yml

* cleanup

* simplified the gameManager start battle and allow single pokemon in party

* remove the need of mode development

* added input handler to test inputs + remove time from phaser into inputController

* added keyboard support

* added fakeMobile support

* added details

* removed a console.log + added logUp

* move test to folder

* fixed canvas issue

* added starter select tests

* added some more test on starter-select

* added battle-order tests

* added battle-order tests

* fixing Phaser RNG

* ordering stats for better reading

* fix tests for main

* adapt battle-order test to be more readable

* fix merge

* fix some errors and silent all errors from gameWrapper since it's not possible to avoid them

* fix mocks to manage childs & stuffs

* added some docs

* fix achievement test

* removed an unused file

* separate misc tests to clean battle.test file

* added a basic french lokalization test

* added i18n where it needs to be used only

* revers extracted method

* removed unused method

* removed handler fetch since we do not test anything server related

* fix test with handlers removed

* added intrepid sword test

* fix enum exp party

---------

Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
2024-06-07 18:33:45 -04:00
prime f5f98ec537
[Bug] fixed wrong stacking of move info overlay issues (#1888)
* fixed wrongly stacking overlay issues

- starter selection
 - IVs are now behind the overlay
 - the overlay should clear when exiting it via controller (requires tests as i don't have a controller)
- TM
 - will prevent C/Shift from showing the overlay until the next item selection, when selecting a TM as item reward.
 - will prevent C/Shift from showing the overlay when canceling item selection

* removed reference to previously deleted resource

* fixed override
2024-06-07 16:45:49 -04:00
Benjamin Odom 5e52be676f
[QoL] Add Time of Day Widget to Arena Flyout (#1846)
* Time of Day Sample

* Add Proper Time of Day Tracking

* Add Settings
2024-06-05 22:57:55 -05:00
prime 1c98106642
[QoL] Move Info Overlay (#1585)
* move info implemented for starter selection

a move info box is displayed when editing the starter moveset.

also menus have now onHover triggers.

todo:
- show ui when selecting TMs
- show ui when selecting moves to remember (memory mushroom)

* More Move Info Overlays

Added overlays during Memory Mushroom use and when viewing TMs.
Furthermore a settings option can enable/disable those overlays.

* Added missing ko language entry

... though translation still remains necessary

* updated ui

also added overrides for item rewards

* minor ui update

moved values to the right in the tm move info box

* fixed typedoc issues

* removed settings in to prepare for merge

* updated settings option

added settings option to new settings implementation

* minor changes

removed unused graphic
moved settings option to accessibility
2024-06-05 20:28:12 -05:00
Matthew c5689dfc96
dont make api calls when no server is connected in local (#1847)
* dont make api calls in local without a server connected and fix fusionLuck not set by default
2024-06-05 21:24:47 -04:00
Matthew Olker 7c9e5e9f52 loading screen disclaimer 2024-06-04 21:41:36 -04:00
Jannik Tappert a8205ae819
[Bug] Handle if the browser gives a long form of a language (like "de-DE") … (#1795)
* Handle if the browser gives a long form of a language (like "de-DE") for cases where we only have the short form "de".

* Changed it so that now resolved Language is now used anywhere. This is basically what i orignally did manually but provided from i18next directly
2024-06-04 15:11:02 -05:00
Benjamin Odom 98cff12fd1
[QoL] Add Arena Info Flyout for Weather, Terrain, etc. (#1734)
* Initial Commit

* Add Time of Day Icons and Remove Fight UI Dependancy

* Rename to Match

* Update battle-scene.ts

* Add Settings

* Add Comments
2024-06-03 21:18:09 -05:00
Greenlamp2 060b1b2ccc
Menu - Controls Rebind - Gamepad & Keyboard (Cleaner git log) (#1666)
* squased merge rebind_menu

* azerty to qwerty

* add a check to preven a crash in firefox

* reset navigation menu on quit

* removed dual lock mekanism

* navigation display update icons on new bind

* added submit binding

* removed attribute no longer used

* change protected to abstract

* remove last bind protection since action and cancel are protected + renamed default controller to controller

* removed default alt qwerty keys in config

* fix some errors for doc

* fix tests

* fix some more errors for docs

* fix some more errors for docs final ?

* added alt bind for menu navigation + update icons on delete/home
2024-06-01 13:56:32 +01:00
Matthew Olker 5be2a6a4e7 Variant Update 2024-05-27 13:47:15 -04:00
Jannik Tappert 8a6f87cfea
When the language is changed the game will complety reload (same as F5). (#1438)
Also now only the current language type image is loaded. If it doesnt exist for a language it will load the english one as a fallback

Tested with all lanugages
2024-05-27 10:12:29 -05:00
Jannik Tappert 88f725e15a
zhTW Type Images are now correctly loaded. (#1436) 2024-05-27 09:23:05 -05:00
Dakurei 6d2b8ef2d1
Cleanup game-stats-ui-handler (from PR #1095) (#1106)
* Update i18n.ts

* Update config.ts

* Update game-stats-ui-handler.ts

* Add files via upload

* Cleanup code

  + Modification of the interface to manage labels dynamically (without this, the language change was not reflected until the page was completely refreshed)

* Apply ESLint after rebase on upstream/main

* Remove useless initStatsKeys

* Adds german localization

  + Changes font size in german only (because otherwise it overflows :D)

* Adds an additional method of formatting large numbers to make it a little more pleasant to read

  + The other was a little too barbaric in what it truncated, but is still useful in certain cases
  + Use abbreviations from 10^0 to 10^33

* Use of the new 'formatFancyLargeNumber' method to display money owned in combat and the highest sum of money obtained in statistics

---------

Co-authored-by: Lugiad <adrien.grivel@hotmail.fr>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
2024-05-27 12:58:20 +01:00
Jannik Tappert 35cb04fae1
Added the type icon localization (#1407)
* Added the type icon localization

* Updated french types image

* Revert the change to the "Type" Label. This wasnt meant to be in this pr
2024-05-27 03:39:18 -05:00
Greenlamp2 136fcbfda8
init dialog call in the loading-scene (#1331) 2024-05-24 15:08:18 -05:00
Greenlamp2 c1a7df913a
refactor executed code while importing and initializing all of these in loading-scene (#1125) 2024-05-24 13:46:30 -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
Flashfyre 7561521020 Add endings for classic mode 2024-05-16 21:41:38 -04:00
Benjamin Odom 9ee5fec41d
Added Passives to the Summary Screen (#703)
* Added passives to the Summary Screen

Adds the ability to view passives on the Summary screen. Just like in the starter select, you can only see the passive once it is unlocked.

There is a small pixel button prompt which helps indicate you are able to press the button to view the passive. This buttons shows an A when gamepad support is enabled and a Z otherwise.

* Update summary-ui-handler.ts

* Updated for Legacy Support
2024-05-12 23:38:28 -04:00
alpaca 36cde21ce3
Adds ribbon in starter screen if mon has beat classic mode (#370)
* adds the ribbon asset, hooking it up

* works if override. need to add field on server side I imagine

* moves count to starterData, increments on win

* formatting

* increment works properly

* recursively check for prevolution

* cleaned up to use getRootSpeciesId()

* changes ribbon to gold medal version

* adds Akuma's ribbon achievements

* ribbons increment correctly

* missed ui handler update

* reorder achievements

* ribbon correct, vouchers not. currently investigating

* increments properly, but voucher reward phase not appearing

* some cleanup

* works great, need to better reflect who is getting ribbon in message and cry

* plays level fanfare, tabling cry for now

* reran items.bat

* Minor fixes

---------

Co-authored-by: Flashfyre <flashfireex@gmail.com>
2024-05-07 00:44:41 -04:00
Akuma-Reiki 92fb8b715e
Added Candy Progress UI (#463)
* Added Candy Progress UI

* GetRootSpecies rather than colors of current Species
2024-05-04 18:29:48 -04:00
Flashfyre 71705dd6d4 Add candy popup sound 2024-05-03 15:03:11 -04:00
Flashfyre ba5bef123c Load missed master achievement bar 2024-05-01 19:42:06 -04:00
Flashfyre 6fd5709b13 Reapply stat change feature with fixes 2024-04-30 23:02:16 -04:00
Flashfyre 8a54e862fc Revert "Add togglable stat change display"
This reverts commit 718585062b.
2024-04-30 22:14:24 -04:00
Flashfyre 718585062b Add togglable stat change display 2024-04-30 22:06:54 -04:00
Flashfyre 5e7356636e Update shiny luck mechanics and count both fusion components 2024-04-26 11:31:39 -04:00
Flashfyre ba71d2750b Load files from manifest for caching 2024-04-23 22:00:23 -04:00
Flashfyre 0eff8cd81a Add Wide Lens item 2024-04-20 01:59:07 -04:00
Miguel S 95d2ad2fb4
Added language setting (#185)
* Added language setting

* Allow properly changing language

---------

Co-authored-by: Flashfyre <flashfireex@gmail.com>
2024-04-19 14:55:01 -04:00
Flashfyre 46ce515fe4 Revert to not showing intro on mobile 2024-04-19 08:45:21 -04:00
Flashfyre c76f8c5e7e Add tiered shiny variants 2024-04-18 22:52:26 -04:00
Flashfyre 4b77ba8c39 Fix certain elements not showing on loading screen on mobile 2024-04-16 11:26:23 -04:00
Flashfyre 986e907894 Don't show intro video on mobile 2024-04-16 10:59:15 -04:00
Flashfyre abc729ed5c Revert "Replace intro with smaller file"
This reverts commit 8cce544536.
2024-04-15 15:04:42 -04:00
Flashfyre 8cce544536 Replace intro with smaller file 2024-04-15 14:45:00 -04:00
Flashfyre c1d641251b Add Pagefault Games intro 2024-04-15 13:10:09 -04:00
Flashfyre 8ccdf6d554 Fix cachebusting 2024-04-14 15:47:00 -04:00
shayebeadling f068b53d44
Show icon in dex for HA mons, like shiny (#117)
* Show icon in dex for HA mons, like shiny

* Swaps the star with the HA capsule

* Removes the unwanted icon
2024-04-13 23:20:54 -04:00
Flashfyre eff64db70e Use bitmap text for modifier text for optimization 2024-04-09 13:59:46 -04:00
Flashfyre fcecad8707 Add monotype icons 2024-04-04 12:27:41 -04:00
Flashfyre 075db8ae0c Show icon when saving data 2024-04-04 10:16:29 -04:00