Commit Graph

401 Commits

Author SHA1 Message Date
Greenlamp2
d03c75c2f9
[QoL] Improve Input Accuracy by Refactoring Button Handling (#1936)
* refactored inputs-controller for better hold button management

* refactored the touch controls file to use a class and add holding button system

* added a method to deactivate pressed key for touch on focus lost

* better lost focus management
2024-06-09 19:15:37 -04:00
Tempoanon
f6ad30b58f
[Feature] Add evil teams assets (#1577)
* Fix tinted caught icon false positive

* Remove unused import

* Rename and optimize

* Block comment

* Draft of evil team grunt pokemon pools

* Add graphics and music

* Add grunt spawn logic

* Add Giovanni

* Add team leader graphics

Giovanni and Ghetsis already have sprites, so they do not need added.

* Add teams for other evil team bosses

* Fix some typos and change hp bars to 2/2/2

* Fix sprites and add random team boss

* Add forced grunt encounter and update dialogue

* Update locales

* also lint en trainers

* More merge conflicts

* Deleted some duplicate images

* Correctly renamed the grunt files

* Forgot about team rocket

* New Magma Sprites

* Adjusted the trimming. Now they dont have as huge of a shadow bbelow them

* Fix grunt sprites

* Add real dialogue

* German Localization of the Dialogue

* Changes

* Tweak waves grunts spawn on

* Fix some typos in dialogue

* Y is canon

* Disable evil team spawns

* Fix another merge conflict

---------

Co-authored-by: Madmadness65 <blaze.the.fireman@gmail.com>
Co-authored-by: Jannik Tappert <tappertjannik@googlemail.com>
2024-06-09 19:02:29 -04:00
Madmadness65
67a0ae49b3
Add new Gym Leader, Elite Four, and Champion music (#1971) 2024-06-08 20:51:37 -05:00
SquillWall
a1171eceb9
[QoL] Show currently bound controls on starter menu for last active device (#1859)
* show currently bound controls on starter menu for last active device

* add special handling for touch controls

* remove hardcoded controls for all locales
2024-06-09 03:35:11 +02:00
Yentis
3f9eaf4a5d
Add setting for showing type effectiveness hints (#1061)
* type hints

* fix overwritten change

* don't set color to white, just leave it unchanged

* remove unrelated code

* don't show hints if no opponents, use type effectiveness instead of move effectiveness

* fix color not going back to white when new opponent is sent

* move effectiveness to move info container

* add effectiveness overlay, partial hints only show move effectiveness, improve colors

* lint

* docs

* remove full hints, move container to right of enemy info box

* hide effectiveness while flyout is visible

* move setting to display, use default style color instead of white
2024-06-08 15:33:13 -04:00
hayuna
b4cf80a984
[Bug] Override battles into single only if not fighting with trainers (#1949) 2024-06-08 09:41:56 -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
Madmadness65
bf5b6e3f6b
[Enhancement] Add more legendary battle music; add music preference setting (#1753)
* Add more legendary battle music; add music preference setting

* Replace BDSP tracks

"Souless", they say. Naysayers, I say.

* Update for settings menu refactor

* Remove unnecessary Reshiram/Zekrom music calls

The default legendary battle music is the Reshiram & Zekrom battle theme anyways, so removing these lines make it functionally identical.

* Update for settings menu refactor AGAIN
2024-06-07 21:52:14 -05:00
Matthew
3022aabc32
Cleanup format, show correct value for money rewards (#1926) 2024-06-08 02:09:12 +01: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
hayuna
bb1dde5b0c
[Refactor] Move enum ExpNotification into separated file (#1909)
* Move enum ExpNotification into separated file

* Update phases.ts

* Change type of this.scene.expParty into enum
2024-06-07 13:14:52 -04:00
Matthew Olker
20a3a4f60f added a few more gameobject names for debug 2024-06-07 10:27:36 -04:00
Matthew Olker
1276006de3 Money shouldn't cover full screen even if its funny 2024-06-06 13:30:43 -04:00
Noor Q
14b5d141c1
[QoL] Added an indicator when money changes. (#1772)
* added an animation and color shift when adding/removing money

* eslint fix

* The animation is now vertically centered, larger and faster.
2024-06-06 11:50:02 -05:00
Adrian T
8d6a0bb0a1
[Ability] Implement Ice Face (#1755)
* implement ice face ability

* remove showing ability bar

* fixes

* add documentations

* move code out of phases.ts

* add hardcoded eiscue check, localization

* add KO locale

* remove unnecessary constructor

* use && instead of || to specify ice form on eiscue
2024-06-06 11:49:50 -04:00
SeafoamQueen
3fea384dc1
[Feature] Added Battle Style setting (#1872)
* Added Battle Style setting with Shift and Set options

* Changed 'Shift' option to 'Switch' to match the Gen 8 setting.
2024-06-06 11:26:04 -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
flx-sta
283714bd0f
[Refactor] Move enums from game-data into their respective files in src/data/enums (#1837)
* move PlayerGender enum into src/data/enums/player-gender.ts

this is necessary to avoid circular dependencies which did crash tests in the past (in PRs)

* Update settings.ts

* Update game-data.ts

* Update summary-ui-handler.ts

* Update ui.ts

* move Passive & GameDataType enums into own files
2024-06-05 19:11:07 -05:00
Matthew Olker
6d71db0f13 luck based encounter 2024-06-05 11:02:58 -04:00
Frede
fe732bbbe6
[QoL] Pokemon Info Container hides Enemy Modifier Bar (#1820)
* Added "Skip Dialogues" option (if at least 1 classic win)

* Removed error sound and hide option instead when classic wins = 0

* Add skip dialogues option to Unlockables and show unlocked message on first classic win

* Only skips seen dialogues, removed dialogue option from unlockables, seen dialogues get saved to local storage

* oops

* dont show charSprite when skipping a dialogue, small fixes

* pokemonInfoContainer always on top of battle UI when shown

* removed setDepth and rather hide enemyModifierBar

---------

Co-authored-by: Frederik Hobein <frederik.hobein@nterra.com>
2024-06-05 10:09:06 -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
Madmadness65
a01cb96de6 Allow Pumpkaboo & Gourgeist forms to be caught
They do not have sprite differences currently, so they won't be able to be identified at a glance, but they do have the canon stat differences between "sizes".
2024-06-04 00:33:57 -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
Frede
12bd22f2ca
Added "Skip Seen Dialogues" option (#1431)
* Added "Skip Dialogues" option (if at least 1 classic win)

* Removed error sound and hide option instead when classic wins = 0

* Add skip dialogues option to Unlockables and show unlocked message on first classic win

* Only skips seen dialogues, removed dialogue option from unlockables, seen dialogues get saved to local storage

* oops

* dont show charSprite when skipping a dialogue, small fixes

---------

Co-authored-by: Frederik Hobein <frederik.hobein@nterra.com>
2024-06-03 11:49:13 +01: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
dielle000
bda3013c19
Allow selection of item quantity when transferring items (fixes #723) (#1394)
* Transferring item does not kick out of transfer menu

* Select simultaneously the item to transfer and the quantity

* eslint fix

* eslint fix

* Reset quantity on scroll

* Documentation

* eslint fix
2024-05-30 16:58:10 -05:00
Matthew Olker
ed7a4045d8 show luck after reroll 2024-05-30 13:45:30 -04:00
Matthew Olker
c822a89878 Fix money text hidden in select modifiers 2024-05-30 11:27:17 -04:00
Benjamin Odom
9b5c1cdadb
Adds a Small Flyout Panel to the Battle Info Object (#1377)
* Initial Commit

* Update pbinfo_enemy_boss_stats.png

* Move to Separate Key

* Add Separate Mobile Control for Flyout

* Add Setting to Enable/Disable

* Add to the Tutorial

* Change to BUTTON.V
2024-05-29 20:29:59 -04:00
Benjamin Odom
700ccf3afc
Various Error Fixes (#1580)
* Add @types/node to the package lock to resolve node_module errors

Devs will need to run npm install --save-dev @types/node on their end as well

* Final Various Fixes
2024-05-29 18:14:32 -05:00
hayuna
ee2c61c4b8
[Feature] Add possibility to override foe level (#1561)
* Add possibility to override foe level

* Override foe level

* Update code styling

* Replace null with 0 as init value

* Replace null with 0 as init value

* Update order of constants
2024-05-29 15:17:36 -04:00
José Ricardo Fleury Oliveira
7e003d68a9
Indicator when a candy upgrade is available (#1083)
* initial implementation

* updated logic

* reverse retTint

* added candy overlays and colors

* added settings and minor fixes

* german changes

* logic fix

* german changes pt2

* german changes pt3

* setting name changed

* Update battle-scene.ts

* initial animation implementation

* minor fixes

* main compatibility

* minor fix

* logic for animations

* eslint fixes

* final generation logic

* Pause Animation when Selected or Purchased

* Disable Indicator if not Root Species

* Add to Reload and Add Anchor

* Fix Animation on Change

* Fix Icon on Change

* Code Cleanup

* fix

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-28 13:49:15 -04:00
Frederico Santos
89f58961cb
Implement Zero to hero (#1131)
* Implemented Zero-To-Hero

* Zero to Hero documentation and form reset on summon

* Zero to Hero: form reset on biome/trainer

* Updated documentation on PreSwitchOutFormChangeAbAttr apply

* Faint bypass on canApplyAbility

* revert zygarde

* zero to hero post-merge
2024-05-28 06:11:04 -05:00
Franck TROUILLEZ
99835c27c8
Add setting to change money format (#1261)
* Add setting to change money format

This setting can currently be set either on "normal" or "abbreviated". "normal" will show all the numbers, while "abbreviated" will abbreviate to the most significant numbers and use a suffix to show the power-10.

A new enum has been added for MoneyFormat as well.

* Update src/battle-scene.ts

Co-authored-by: Franck TROUILLEZ <57403591+francktrouillez@users.noreply.github.com>

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-27 22:58:33 -04:00
Daeloth
f957994fe4
Tweaked SSS luck value color (#1457)
Changed the gradient colors in the SSS luck value to something with a little more life
2024-05-27 20:14:16 -04: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
Madmadness65
6f4c087f7a Add Pikachu and Eevee technical forms
This adds Partner Eevee and Partner Pikachu, as well as all Cosplay Pikachu variants. Also included are some minor trainer-related formatting clean ups.

• Partner Pikachu and Eevee have their boosted base stats from the Let's Go games, but are otherwise identical in function and appearance to their regular variants.
• Cosplay Pikachus have their special moves as "evolution" moves and can be relearned if desired.
• Unlike the canon games, Partner Pikachu and Eevee are able to evolve like normal.
2024-05-26 16:15:37 -05:00
Greenlamp2
3120917368
Overrides - Gender, Xp multiplier and arena tint (day & night) overrides (#1201)
* added override gender and arena tint (day & night)

* cleaner diff

* reset override

* fix gender override default value

* removed useless return variable

* also null for opponent

* add override tint, gender, xp multiplier

* remove condition duplicated + set overrides initial value to null

* added comments

* eslint

* Update overrides.ts

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-26 11:17:41 -05:00
Benjamin Odom
5c28e1fb11
Adds New BattleSceneEventTypes (#1372)
* Add BattleSceneEvents

* Update battle-scene-events.ts
2024-05-25 17:23:53 +01:00
zaccie
564add66d2
Changing Biome Text Colour (#1346)
On light coloured biomes this change should be similar readability
In darker biomes it's has much easier readability
+ now becomes more consistent colour with the rest of the game text which just looks better imo
2024-05-24 20:31:33 -04:00
Benjamin Odom
416d666b30
Update Biome Text Labels and Variable Name (#1340)
* Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object.

* Revert "Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object."

This reverts commit 0f87000aa4.

* Reverted changes, added biome text to line one and renamed wavecounttext to a more standard name.

* Update battle-scene.ts

* Update Formatting

* Update Enums

* Revert

* Update overrides.ts

* Update battle-scene.ts

---------

Co-authored-by: Jon Studders <jonstudders1@gmail.com>
2024-05-24 18:43:38 -05:00
Jon Studders
c8b77cffc1
Added current biome text (#915)
* Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object.

* Revert "Added ability to get hex colour from type, added biome text, added functionality for querying biomeType with object."

This reverts commit 0f87000aa4.

* Reverted changes, added biome text to line one and renamed wavecounttext to a more standard name.

* Update battle-scene.ts

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-24 18:36:02 -04:00
Benjamin Odom
3985c63dad Update battle-scene.ts 2024-05-24 17:03:49 -05:00
Benjamin Odom
74bf42b4b7 Let's try this again 2024-05-24 17:01:47 -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
Matthew
f7a7b23dd1
Update README and package, re-add money formatter (#1286) 2024-05-23 12:29:18 -04: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