Commit Graph

354 Commits

Author SHA1 Message Date
podar
34bf0069ca
[P1] Fixing continue menu option when game finishes (#4287)
* [Bug] Fixing continue error when game finishes

* migrate: `GameData.tryClearSession` to async/await

* install dev: msw module

* add: game-data test => tryClearSession tests

---------

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-09-26 13:55:08 -07:00
RedstonewolfX
06331ccdf6
[Daily] Daily standardization (#3776)
* Disable Luck in Daily Runs

If the Game Mode is Daily Run, the player's Luck is set to 0, and the Luck value is hidden.

* Give free map in daily

Adds a Map to the player's pool of starting items for Daily Runs.

* Disable Eviolite in Daily Runs

Disables Eviolite spawning in Daily Run mode.

* Write shop test and add new overrides

Adds new overrides that allow you to force content to be locked or unlocked
These overrides were also added to the OverridesHelper to make them available to tests

Adds a new check function for content unlocks, which returns `true` if it is overrode to be unlocked, `false` if it is overrode to be locked, and the unlock data mapped to a Boolean otherwise

All existing checks (other than the ones that involve actually unlocking things) for unlockables have been changed to use this

Added a pair of new exporting booleans, specifically for my test, that check if Eviolite or Mini Black Hole are in the loot table

* Prevent shinies from altering runs

Places variant rolls inside of an ExecuteWithSeedOffset block, using the current floor's RNG seed as the seed and the Pokémon's ID as the offset.

---------

Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
2024-09-26 01:39:59 -07:00
innerthunder
029d26b4c9
[Beta][P2 Bug] Fix Sappy Seed applying its secondary effect against targets with Substitute (#4430)
* Fix Sappy Seed applying Leech Seed through Substitutes

* Add docs
2024-09-25 22:32:20 -04:00
innerthunder
a6a61b2984
[Move] Implement Shed Tail (#4382)
* Implement Shed Tail

* Fix leftover batonPass reference in docs

* Fix ChillyReceptionAttr

* oops

* Remove unneeded default arg in ReturnPhase

* Fix imports per Kev's suggestions

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Docs and Shed Tail on-add message

* Remove mixin attribute

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Update battler-tags.json

* Fix indents

* More nit fixes

* Make Switch[Summon]Phase params readonly

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Lugiad <adrien.grivel@hotmail.fr>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-09-25 17:17:46 -07:00
Mumble
57f39efdae
[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378)
* Torment

* Taunt and Imprison

* ability immunities

* Aroma Veil

* Imprison

* Test Files

* Added exceptions for Rollout and check for active ability

* adding tests so that git doesn't auto-fail

* Blah

* please

* some documentation

* Removed random newlines

* Added check for ability's presence mid battle

* Changed BattlerTagImmunityAbAttr to look at lists instead

* Work?

* Imprison and Taunt Tests

* Tests

* Final tests before documentation

* documentation blah

* Imports

* Flx Change

* flx - adding overrides

* Update src/data/arena-tag.ts

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

* flx fixes

* quick docs

* privated retrieveField

* Handling undefined

* Update src/data/arena-tag.ts

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

* forget to remove partials for heal block

* Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Marked Torment as partial

* Update src/test/moves/torment.test.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* tsdocs

* Prevents test pokemon from being immune to torment

* Update src/data/arena-tag.ts

Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>

* Torranx Fixes

* Check for this.source

* why

* lighting things with my mind on fire

* aRHGHSHDKSHD

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
flx-sta
9af89414b9
[Refactor][Localization] Better handling for StatusEffect.NONE with i18n (#4405)
* remove: `StatusEffect.NONE` from displaying any messages

even thougn this case will never occur, by code definition it should be covered

* remove: obsolete `statusEffect:none.` translation keys

* fix: status-effect test

* chore: undo overrides commit (whops)
2024-09-24 14:15:18 -07:00
ImperialSympathizer
a1d1de2c0d more ME dialogue cleanup 2024-09-24 13:41:00 -04:00
ImperialSympathizer
24bbb0931c change return type of isNullOrUndefined 2024-09-24 13:15:18 -04:00
ImperialSympathizer
1513f2a57d more ME balance changes and bug fixes 2024-09-24 11:32:22 -04:00
ImperialSympathizer
b2b88c37cf fix Absolute Avarice test 2024-09-23 19:36:09 -04:00
ImperialSympathizer
4d8d605c02 merge from beta 2024-09-23 19:25:13 -04:00
ImperialSympathizer
05b9e74729 balance adjustments to certain ME battles 2024-09-23 19:23:46 -04:00
flx-sta
b2b314cd68
[Refactor][Tests] Remove manual test timeouts (#4385)
* remove: manual timeout setting

some more sneaked in after changing the default-timeout to 20s. Possibly older PRs.

* remove: manual test timeouts from chilly reception tests
2024-09-23 17:35:53 -04:00
PrabbyDD
3d4eadbc3e
[Bug] Flash Fire/etc now trigger even if the attack would miss (#4337)
* adding immunity check

* making tests

* modifying and adding tests

* making tests more rigorous

* changing hitcheck return to be what it was originally, no significant effect

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-23 15:37:21 -04:00
flx-sta
c4f81c55b0
[Tests][Mystery-Encounter] Fix The Strong Stuff flakyness (#4394)
* extend: log in encounter phase for better debugging

* fix: `the storng stuff` test flakiness

The enemy pokemon could get contrary or other abilities that cause the expected values to be ... not as expected

* remove accidental it.each

tests were being executed 30-100 times. This is a debugging tool but was never supposed to make it to merge.
2024-09-23 15:32:07 -04:00
NightKev
554d4f0a95
[P2 Bug] Dragon Tail now properly respects abilities like Suction Cups (#4252)
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-09-23 11:50:42 -04:00
Tempoanon
b9b69ad834
[Move] Implement autotomization weight effects (#4228)
* Implement Autotomize

* Another linting

* Fix unit tests

* Add nonnull after checking for null

* Update autotomize test

---------

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-09-23 11:42:17 -04:00
NightKev
1d559f2194
[Test] Fix flaky Shell Side Arm test (#4383)
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-09-23 10:55:47 -04:00
flx-sta
8b6e55d5e9
[Test] flakyness in teleporting hijinks encounter test (#4386) 2024-09-23 10:55:01 -04:00
DustinLin
c387f498c8
[Bug] Fix move Chilly Reception (#3198)
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com>
Co-authored-by: returntoice <dieandbecome@gmail.com>
Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: protimita <protimitajp@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Chapybara-jp <charlie.beer@hotmail.com>
2024-09-22 20:09:51 -07:00
Yiling Kang
b9b2491f95
[Ability] (Partially) Implement synchronize ability with old psycho shift interaction (#2746)
* Initial changes for Synchronize ability

* Fix psycho shift interaction causing buggy behaviour

* Update to show ability even if opponent pokemon does not get statused

* Fix some spacing

* Update tests

* Formatting change

* Remove impossible `if` statement

* Add `simulated` support

* Apply suggestions from code review

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* Don't need those comments

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-09-22 19:38:09 -07:00
ImperialSympathizer
1c87532e64
[Bugs/Balance] Fix various ME bugs and small balance adjustments (#4369)
* various bug fixes for MEs

* various bug fixes for MEs

* fix final isTransferable rename that was missed

* change Trainer's test vouchers for second option

* change unit test skips

* cut down excess ME track length and loop properly

* ME bug fix cleanup

* updating AI for Slumbering Snorlax ME, and small ME balance changes

* fix ts error

* fix bug type superfan dialogue discrepancy

* ME bug fixes PR feedback

* ME PR nits and fixes

* update naming convention of sprites

* ME balance changes and bug fixes

* fix tests

* fix An Offer You Can't Refuse ME requirements

* clean up post-battle logic for Breeder ME

* party size requirement cleanup

* clean up challenge requirements for disabling certain MEs

---------

Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-09-22 05:47:32 +02:00
Amani H.
612dcc5f27
[Balance] Adjust Relevant Abilities to Match Lures (#4231)
* [Balance] Adjust Relevant Abilities to Match Lures

* Add Relevant Unit Tests
2024-09-21 21:40:47 -04:00
ImperialSympathizer
0518cfd9d6
Merge pull request #4363 from PigeonBar/gts-infinite-loop
[Bug] [Beta] Fix game freeze from GTS infinite loop
2024-09-21 17:24:20 -04:00
Mumble
4fb76fd117
[Move] Implement Heal Block (#4120)
* Heal Block on new branch

* Add/update code from previous PR

* Re-add i18n from previous PR

Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: Asdar <asdargmng@gmail.com>

* Disabling Moves

* Still need to update tests and write docs

* removing partial tags from abilities to feel better

* Pollen Puff works now

* Implemented Psychic Noise

* typedocs

* Documentation

* Update src/data/battler-tags.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update src/data/battler-tags.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update src/data/battler-tags.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Turns out the old condition wasn't buggy. Probably mixed up another change I made.

* changed array clear

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: Asdar <asdargmng@gmail.com>
2024-09-21 13:15:32 -07:00
Michael Li
7190277f79 PR Feedback 2024-09-21 14:36:02 -04:00
Michael Li
5a24435047 [Bug] Fix game freeze from GTS infinite loop 2024-09-21 11:52:54 -04:00
flx-sta
0aac6c6647
[Dev][Test] Add "Mystery Encounter" type for create-test script + minor timeout fixes (#4350)
* add: mystery encounter to create-test

* remove: leftover `TIMEOUT`

in boss-pokemon.test

* add regex to replace ` ` with `_`

This was never done before. for any

* remove: manual test timeout overwrites
2024-09-20 17:54:37 -04:00
MokaStitcher
5f5b439e42
[P2 Bug] Fix sturdy and endure causing an extra stat boost to boss Pokemon (#4347)
* [bug] fix sturdy and endure causing an extra stat boost to boss Pokemon

* [doc] add doc for handleBossSegmentCleared
2024-09-20 17:19:33 -04:00
flx-sta
4cc3b0daae
[Test] Make berries abound test more robust (#4339)
* make `berries-abound` test more robust

the "should reward the player with X berries based on wave" test was failing due to berry max stacks and the party only having 1 pokemone.
Increased it to 3 to reduce that probability

* berries abound test: change `defaultParty`

increase size of default-party to 3

* add: some missing types in berries-abound encounter

for ease of reading

* fix: berries abound tests

the "Should skip battle when fastest pokemon is faster than boss" test was failing due to the party being more than 1 pokemon.
2024-09-20 17:18:48 -04:00
flx-sta
4c9c66f898
[Test] Fix Teleporting Hijinks tests (#4349)
set enemy passive ability by default to `Ball Fetch` to prevent random passive abilities that raise stats too
2024-09-20 17:18:18 -04:00
flx-sta
0a5e9ff9e6
[Test] Fix The Pokemon Salesman tests (#4345)
The expects didn't account for the possible shiny, which appends a `_shiny` to some dialogue tokens.
I've added regexes to account for that possibility
2024-09-20 17:14:55 -04:00
flx-sta
1a5cbf8ecb
[Refactor][Tests] Set default test timeout to 20s (#4338)
* set default test timeout to 20s

* remove "TIMEOUT" reference from create-test-boilerplate

* remove TIMEOUT from tests

* test: remove leftover `20 sec timeout` references

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-20 23:05:45 +02:00
DustinLin
0eea2031fb
[Bug] Fixing seed sower uturn switchout bug for trainer battles (#4113)
* refactor wildFlee for seed sower animation bug

* better naming functions

* review suggestions

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-20 10:27:43 -04:00
flx-sta
48430c8feb
[Feature] Seasonal splash messages logic + scaffolding (#4318)
* add: seasonsl splash messages logic + scaffolding

* refactor: settin up and displaying splash messages.

They are now stored with their i18next keys and only get translated as soon as they are displayed. This also allows for better display of the `battlesWon` parameter which now supports better number formatting and the count is an interpolation

* fix: updateTitleStats not checking the namespace of battlesWon

* add tests for splash_messages

* test: always use UTC time

* fix: time-pattern to MM-DD

* fix splash_messages test

* add: const to control usage of seasonal splash messages

* fix tests (splashj)

* Update src/locales/ja/splash-messages.json

Co-authored-by: Chapybara-jp <charlie.beer@hotmail.com>

* Update src/locales/es/splash-messages.json

Add missing `number` format for battlesWon message

---------

Co-authored-by: Chapybara-jp <charlie.beer@hotmail.com>
2024-09-19 15:59:37 -07:00
ImperialSympathizer
7490699bef
[Feature] Adds Expert Pokemon Breeder Mystery Encounter to the game (#4328)
* Adds Expert Breeder Mystery Encounter to the game

* add achievement for Breeders in Space and remove redundant tests

* rename to Expert Pokemon Breeder

* remove unintentional test code

* remove unintentional test code

* test fix with breeder rename

---------

Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
2024-09-19 22:46:27 +02:00
ImperialSympathizer
5888a7758c
Mystery Encounter bug fixes and minor adjustments (#4299)
* various bug fixes for MEs

* various bug fixes for MEs

* fix final isTransferable rename that was missed

* change Trainer's test vouchers for second option

* change unit test skips

* cut down excess ME track length and loop properly

* ME bug fix cleanup

* updating AI for Slumbering Snorlax ME, and small ME balance changes

* fix ts error

* fix bug type superfan dialogue discrepancy

* ME bug fixes PR feedback

* ME PR nits and fixes

---------

Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
2024-09-19 14:44:10 +01:00
innerthunder
605ae9e1c3
[Move] Improved damage forecasting for Shell Side Arm (#4310) 2024-09-18 19:03:01 -04:00
peng06
0567d4b5e2
[Dev] Remove variant-tiers.ts Enum (#3746)
* remove varianttiers

* Thanks GitHub

* Update import in `overrides.ts`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
2024-09-18 15:20:33 -04:00
flx-sta
6030b780f2
[Move][Mirror] Update HitTagAttr attributes v2 (#4297)
* [Move] Updated HitAttr tags

Affects Whirlwind/Fly, Steamroller/Minimize, and Malicious Moonsault/Minimize

* [Move] Update for MinimizeAccuracyAttr

Affects Steamroller and Malicious Moonsault

* add: whirlwind test

* add: steamroller test

* rename: `AlwaysHitMinimizeAttr` (from `MinimizeAccuracyAttr`)

* rename: `DealsDoubleDamageToTagAttr` (from `HitsTagAttr`)

---------

Co-authored-by: chaosgrimmon <31082757+chaosgrimmon@users.noreply.github.com>
2024-09-17 22:41:46 -04:00
flx-sta
4389bff5d0
[Bug] Fix stat-protection-attribute not taking inverts (e.g. Contrary) into account (#4031)
* add generic types to`Pokemon.getAbilityAttrs()`

* add invert check to `ProtectStatAbAttr.apply...`

This makes sure that a stat is only protected if no other ability inverts the change. E.g. `Contrary` inverts any decrease to an increase

* migrate contrary.test.ts to game.classicMode

* move `StatStageChangeMultiplierAbAttr` resolve above `ProtectStatAbAttr`

The effect of StatStageChangeMultiplierAbAttr is now applied before resolving any ProtectStatAbAttr. Thus the stage (level) of the BattleStat change was properly altered at the time of resolving the protection

* revert ability.ts changes

* add automated tests for `Clear Body` + `Contrary`

* StateStageChangePhase replace ~~`IntegerHolder`~~ with `NumberHolder`

Update Utils import and replace all occurcences of `Utils.`

* contrary.test.ts: remove `js` import
2024-09-17 19:14:41 -07:00
PigeonBar
009fd3fc5c
[Bug] Fix reloads erasing weather on first wave of biome (#4078)
* [Bug] Fix reloads erasing weather on first wave of biome

* Minor revisions

* Minor revisions 2

* Update test

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-16 15:30:42 -04:00
Tempoanon
72439ffff7
[Move][Beta] Add back grounded condition to ground shaky moves and grassy terrain (#4276) 2024-09-16 10:58:28 -04:00
Tempoanon
8046b99b75
[Refactor] Refactor code for Grassy Terrain halving the power of Earthquake, Magnitude, and Bulldoze (#4263)
* EQ, magnitude, and bulldoze do half damage in grassy terrain

* Fix more styling issues in grassy glide

* lol unit tests

* Add test :pikastare:

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-15 13:06:22 -04:00
PrabbyDD
3a683c0663
[Bug] Fix for "Moves Can Miss Against Protect, Baneful Bunker, King's Shield" (#4262)
* added various tests for protect based moves, reset protect test file bc no easy way to test specifically with protect, and changes in move-effect to fix the issue

* adding another non contact move test for baneful bunker

* Update src/test/moves/obstruct.test.ts

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* Update src/test/moves/baneful_bunker.test.ts

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* Update src/test/moves/baneful_bunker.test.ts

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* Update src/test/moves/baneful_bunker.test.ts

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>

* better descriptions for baneful bunker test

---------

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-09-14 20:11:54 -04:00
Jannik Tappert
aecdcd34f5
[BUG] Fix a couple of bugs regarding MEs and their localization (#4261)
* Fixed SURF and FLY not beeing localized in "lost at sea"
Fixed Mysterious Challenger Title not beeing correct
Fixed Winstrate Names not beeing localized

* Revert the winstrate fix. It breaks other trainer battles for some reason...

* A new way of giving the winstrates localized names (and for the future all named trainers that dont use a "initFor" method)

* Updated test (with ok from ImperialSympathizer)

* Made the expected value simpler

* FLY and SURF can be localized much simpler
2024-09-14 19:12:55 -04:00
flx-sta
763c1922fb
[Bug] Fix exp gains speed not applying properly (#4243)
* update battle-info.ts

* add: ExpGainsSpeed enum

* address PR comments

* add test coverage (exp gains speed)

---------

Co-authored-by: Mr.WaterT <water.t.works@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-14 12:35:46 -04:00
innerthunder
bdc7c95c1c
[Misc][AI] Fix KO filter not accounting for move conditions (#4245)
* Only filter KO moves that won't fail

* Add Last Resort enemy command test
2024-09-14 12:35:36 -04:00
innerthunder
77f0fe6e4b
[Enhancement][EnemyAI] Add support for simulated damage calculations and "Search for KO" move filtering (#3975)
* Create getAttackDamage function

* Add ignoreAbility params to getBattleStat

* Rewrite Pokemon.apply

* renamed damage variables

* Add `ignoreSourceAbility` arg to `getAttackDamage`

* Enemy AI now searches for KO moves

* Add probabilistic test for KO search

* Add tests to `damage_calculation`

* "killMoves" --> "koMoves"

* Clean up `randomMultiplier`

* Clean up damage calculation test

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Fix stabMultiplier using base type for Tera bonus

* Restore simulation capabilities for Unaware

* move sourceTeraType closer to where it's used

* Add base damage test

* Exclude counter moves from KO search

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2024-09-13 22:54:22 -07:00
NightKev
e6cffc6a93
Disable broken tests for now (#4242) 2024-09-13 20:48:25 -07:00