Commit Graph

415 Commits

Author SHA1 Message Date
Jannik Tappert cf5fa887e9
[QoL] Improve shop readibility (#2267)
* Change Rouge Text Color to green, add black shadow behind name text

* Also added shader to cost text

* Update src/ui/modifier-select-ui-handler.ts

* Changed colors that didnt fit the contrast scaling thanks to @dakurai on discord.

* Removed a useless line and added a comment

* Apply suggestions from code review

Co-authored-by: Dakurei <maxime.palanchini@gmail.com>

* Revert changes

* Change colors for better contrast score (makes reading easier)

  + Corrects colors that were totally white when they should have been f8f8f8 like the others

* Created a new overlay especially for the shop

  + This one is an almost black color with a higher opacity. This makes the shop elements easier to read, as they blend much less into the UI underneath

* Add a filter on modifiers displayed in the shop

  + Add a getModifierBar() getter to retrieve the battle-scene bar directly
  + Modified the updateModifiers() method to filter the items displayed (modifiers held by Pokémon can be hidden)
  + Shop overlay hidding transition lengthened to the same duration as its showing

* Apply suggestion from @bennybroseph

* Apply suggestion from @brain-frog

* Fix - Removal of a warning in the generation of the typedoc for which my modification is responsible

---------

Co-authored-by: Dakurei <maxime.palanchini@gmail.com>
2024-06-22 00:04:25 +01:00
Dmitriy K 74aa5a8005
Create Class constructor utility type. (#2162) 2024-06-19 12:00:26 -04:00
Matthew d70dd16f8c
[Refactor] I18n Cleaning (#2348)
* I18n Cleaning

* pr comments

* appease typedoc

* moved types into src
2024-06-17 17:05:33 -04:00
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
hayuna c929bbd23a
[Refactor] Move enum BattleStyle into separated file (#1906)
* Move enum BattleStyle into separated file

* Move enum BattleStyle into separated file

* Move enum BattleStyle into separated file

* Update battle-style.ts

* Replace shift into switch
2024-06-13 10:10:31 -04:00
Greenlamp2 c908153761
[Bug] Fix PostSummonPhase Logic to Support Single Pokémon Teams (#2153)
* added test for spikes + forceOpponentToSwitch

* fix conditional for intimidate in a double if there is only 1 pokemon available on our side

* fix variable naming and ternary condition

* added a fallback to clear the conditionalQueue if it's a new turn

* speed up tests by skipping LoginPhase
2024-06-13 08:42:25 -04:00
Dmitriy K 0970c2cd4e
[Refactor] Replace forceBypass with bypassFaint flag (#1839)
* replace forceBypass with bypassFaint flag

* add another path alias for src/test

* make form override work for the whole party instead of the first pokemon

* add tests for all abilities that are touched by this change

* remove unnecessary overrides from tests

* move SpeciesFormChangeTimeOfDayTrigger outside arena reset logic

* remove alll resetMock calls, rename it to test
2024-06-13 11:36:12 +02:00
DustinLin e5d9cfd10f
[Bug] Fixing Baton Pass passing (#2058)
* skip yawn and infatuation for baton pass, and some docs along the way

* update yawn condition readability
2024-06-12 10:19:50 -04:00
prime 0c85823645
[Enhancement] Golden IVs Chart when all IVs are perfect (#2019)
* golden chart for perfect IVs

The IVs chart is now golden in case all IVs are perfect.

A few overrides have also been added to make testing easier:
- the opponents IVs can be overridden
- the color can be modded via the window.perfectIVsChartColor variable.

* added perfectIVsChartColor to window

* added changes as requested

- removed global variable
- removed chart versatility
- changed color
2024-06-12 09:56:23 -04:00
Greenlamp2 f57798fd1d
[Bug Fix] Correct PostSummonPhase Timing for Abilities and Entry Hazards (#2108)
* added test for spikes + forceOpponentToSwitch

* added conditionalQueue && pushConditionalPhase to fix entry hasard and abilities at post summon

* reduce timeout time to default
2024-06-12 00:55:16 +02:00
Adrian T 65ddd49d64
[Enhancement] Move event files to a central directory (#1918)
* Move events to a central directory

* Update modifier import

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* remove old battle-scene-events

* Move to field events

* Update battle-scene.ts

---------

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-06-10 20:19:07 -05:00
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