* Add neutralizing gas arena tag
* Add PostSummonAddArenaTagAbAttr
* Add PreLeaveField attr for neutralizing gas
* Remove old SuppressFieldAbilitiesAttr
* Fix ability suppression logic
* Add basic tests
* Reapply onGain abilities when neutralizing gas ends
* Untodo ability remval test
* Add more tests
* Modify gastro acid to call onLose attributes when suppressing
* Properly cancel abilities on switch in
* Add documentation
* Remove partial designation
* Update locale key usage
* Reactivate the last source's other abilities when it becomes the last remaining
* Fix loop vars
* Add access modifiers for SuppressAbilitiesTag
* Minor changes
* Move test to reflect new location
* Remove promises from abattr function signatures
* Make moveset gen consider multi hit moves fairly
* Make getTargetBenefitScore consider effective power
* Apply Kev's suggestions
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fix improper stat ratio.
* Fix expected hit count for pop-bomb like moves
Accuracy is now properly divided by 100
* Update src/data/move.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/data/move.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update src/data/move.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Remove Promises from moves and abilities
* Fix `PostSummonPhase`
* Apply suggestions from Kev's review
* More suggestions
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Cleaning up some updated functions
* Remove Promise from `addEnemyModifier`
+ fixes to some extraneous `await`s
* Test fixes
* Fix missing import in revival blessing test
Co-authored-by: innerthunder <brandonerickson98@gmail.com>
* Add back applyPreLeaveFieldAttrs
Attribute was removed due to absence in a cherry-pick
* Make applyPostApplyEffects work
* Fix move-effect-phase.ts applications
Some applyX methods were missed in the cherry pick commit and were still returning functions instead of running the function themselves
* Mock `BattleScene.addPokemonIcon` in tests
* Revival Blessing condition and tests
* Incorporate Despair-Games/poketernity/pull/48
* Break up imports
* Remove enemy modifier chance dead code
* Remove async from applyAbAttrsInternal
Stray async leftover from merge
* Remove docs and comments referencing promises
* Add `user.setTempAbility` to transform phase
---------
Co-authored-by: innerthunder <brandonerickson98@gmail.com>
Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
* Add setAbility method to pokemon.ts
* Edit SwitchAbilitiesAttr to use setAbility
* Change AbilityGiveAttr to use setAbility
* Rename setAbility to be more accurate
* Fix AbilityCopyAttr
* Fix AbilityChangeAttr
* Fix Transform
* Fix imposter
* Fix PostDefendAbilityGiveAbAttr
* Actually fix imposter
* Actually fix transform
* Fix CopyFaintedAllyAbilityAbAttr
* Fix Trace
* Fix PostDefendAbilitySwapAbAttr
* Add tests for skill swap
* Add tests for doodle
* Add tests for entrainment
* Add tests for role play
* Add test for simple beam
* Add test for transform
* Add test for imposter
* Add tests for mummy
* Add tests for trace
* Add tests for wandering spirit
* Consider legendary weather when changing ability
* Ensure that passives are not (re)applied when main abilities change
* Add general ability swap test cases
* Fix test name
* Add NoMidTurnActivationAttr
* Remove NoMidTurnActivationAttr from illusion
* Remove extraneous call to triggerWeatherBasedFormChanges
* Fix primal weather clearing
* Change "MidTurn" to "OnGain"
* Change NoOnGainActivationAttr to a field in PostSummonAbAttr
* Add passive support
* Remove redundant parentheses
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Commit old stashed changes
* Complete basic implementation of Tera
* Fix effectiveness test
* Make tera retain until forced recall or faint, regain on biome change
* Experimental sparkle fix
* Fix champion teras
* Attempted fix for double battles tera UI bug
* Fix the fix
* Fix linting and test issues
* Fix more tests
* Change int type
* Implement tera for ME trainers
* Cleanup species inclusivity check
* Make tera instant recharge if terapagos in party
* Make useless tera shards not generate
* Implement stellar tera damage boost
* Improve tera selection UI
* Tidy up animation and localisation
* Improve tera button sprite
* Fix Lance tera
* Make tera instant recharge during E4 in classic modes.
* Fix formatting in the tera common animation
The animation was also not playing due to `frameTimedEvents` being missing as well.
* Make tera effect start after animation
* Implement save migration
* Update version number for migration code
---------
Co-authored-by: Madmadness65 <blaze.the.fireman@gmail.com>
Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com>
* fully implemented spectral thief
* Update to structure of implementation
* line commented target.scene.queueMessage since message does not exist yet
* changed documentation
* added move-trigger.json key
* removed line comment since key was added to english locales
* removed console.log messages used for debugging
* refactored move-trigger key to race with @muscode13
* added more automated tests
* github tests failed
* removed line comment since key was added to english locales
* refactored move-trigger key to race with @muscode13
* added more automated tests
* github tests failed
* solved conflicts
* Update src/data/move.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* removed .partial()
* corrected spectral thief name
* changed target.scene to globalScene
* changed comments
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
* full implementation of supreme overlord + test
* removed unused import
* changed documentation since Battle.playerFaints is not used in supreme overlord
* Update faint-phase.ts
* changed supreme overlords power calculation function and adjusted tests
* added changes to Last Respects too
* added playerFaints to SessionSaveData to make the counter saveable
* Apply Kev's suggestions
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Reset enemy faint counter per battle
* Re-mark supreme overlord as partial
* added automated test case
* moved playerFaints reset to resetArenaEffects
* removed resetEnemyFaintCount() function since it is unused
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* added the ability to ignore held items at stat calculation
* integer -> number in src/field/pokemon.ts
* added tests from @SirzBenjie
* Update test
* Fix test filename
* added turnorder to tests
* added tera_blast changes and tests
---------
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Add Valentines event data
* Event ends Feb 21 not March 21
* Event starts Feb 11 12:00 UTC for testing on beta
* Oops I meant February 10
* Add Luvdisc +3 Luck Boost
* Added Applin to round out the total pokemon and because I know people are going to be confused why it isn't here if they've actually read in gen 8 (any readers in chat?)
---------
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>
* Fix super-niche edgecase with mega gengar and telekinesis
* Update TelekinesisTag doc comment
* Remove comment about mega gengar as this update fixes it
* Added new AbAttr that triggers whenever a pokemon leaves the field
* Use leaveField everywhere
* Changing order for PreSwitchOutAbAttr
* Don't clearEffects when catching in a mystery encounter
* Attempts to make new overrides for testing
* New options in overrides
* Implemented tests for Desolate Land
* Fixing instruct test to not read turnData of fainted mon
* Removed post faint clear weather
* Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Has_passive_ability override now turns off passives if set to "false", defaults to "null"
* Updating overrides type definitions
* Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Suggestions from review
* Fixed strings in suggestions
* Simplified function to throw balls in tests
* Added tsdocs to overrideHelper.ts
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* customPokemonData.types now accepts Type.UNKNOWN, ignores when determining type
* Changed test for clowning around encounter to look at getTypes() instead of directly accessing customData
* Simplifying logic for fusions when overrides are involved, introducing new tests in pokemon.test.ts
* Renamed overrideTypes to customTypes to avoid confusion with override
* pokemon.getType() properly recognizes Normal secondary type
* Added effectiveness test for ghost on normal
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* customPokemonData.types now accepts Type.UNKNOWN, ignores when determining type
* Changed test for clowning around encounter to look at getTypes() instead of directly accessing customData
* Simplifying logic for fusions when overrides are involved, introducing new tests in pokemon.test.ts
* Fixed typo
* Fixed another typo
* Renamed overrideTypes to customTypes to avoid confusion with override
* Fixing comments
* Add support for form and evolution specific passives
* Update src/data/pokemon-species.ts
---------
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: damocleas <damocleas25@gmail.com>
* Replace Title BGM with custom BGM by Firel
Also added descriptions for the battle scene and arena's getBgmLoopPoint methods.
---------
Co-authored-by: damocleas <damocleas25@gmail.com>
* Refactor timed event changes
* Use getWeather function
* Add mystery encounter tier change/disabling to timed events
* Event luck boost, event encounter helper function
* Events without shiny boost shouldn't give shiny charm
* globalScene -> this in battle scene class
* Change event pools
* Implement Flip Stat Challange
* Add Achivement
* Update challenge code to block other challenges.
* Add Achievment Image
* Add FLIP_STAT to enum ChallengeType
* Fix comment for FlipStatChallenge
* Add applyFlipStat override to Challenge Class, and add override inside of FlipStatsChallenge
* Add ChallengeType.FLIP_STAT case to export function applyChallenges (Master Switch Function)
* Properly block other challange achviements
* Change the way achivements are blocked by challenge modes to a more flexible method
* Adjust the image for Flip Stat, and add an additional achivement for completing both Flip and Inverse
* Fix FLIP_INVERSE achivement to check ALL challanges are met, not SOME
* Remove outdated image
* Fix FlipStat applyChallenges inside calculateBaseStats
* Update locales
---------
Co-authored-by: Scooom <na@na.na>
Co-authored-by: Scooom <jerry@hosterslice.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Combine moveset from allies and uses it to get a move
* Clearer implementation of combining user and teammates' moves
* Refactor assist and sleep talk to use metronome's attribute for calling a move
* Refactor move filtering in RandomMovesetMoveAttr, creates arrays with invalid moves for assist/sleep talk
* Refactor RandomMoveAttr to set moveId in condition, places reused code in callMove in RandomMoveAttr
* Correct invalid move lists, adds Max/Z moves to metronome's list
* Remove ignoresVirtual from beta merge
* Remove Max/Z moves per frutescens' comment
* Fix bug with metronome/copycat/assist/sleep talk targeting ally
* Experimental async/await to be tested
* Refactor other attributes to extend CallMoveAttr
* Replace QueuedMove with TurnMove, refactor to attempt two-turn move fix for metronome
* Fix Swallow test due to TurnMove refactor
* Further fixes for TurnMove refactor
* Fix metronome two turn moves for enemy pokemon
* Replace nested ternary with if-else block per DayKev's comment
* Minor fixes
* Adjust command phase args handling
* Create metronome test, refactor RandomMoveAttr for easier testing
* Add unit test for recharge moves
* Refactor Copycat and Mirror Move, adjust move targeting
* Add unit test for ally targeting with Aromatic Mist
* Add tests for secondary effects and recharge moves for metronome
* Add test for Roar, remove test for Acupressure
* Create test for Assist
* Add test for assist failing
* Add sleep talk unit test coverage
* Adjust move-phase to better track last move for copycat, write and update unit tests for assist/copycat
* Create moveHistory in Battle to track all moves used, adjust mirror move to use this, writes unit tests
* Correct mirror move implementation, rewrite unit test to adjust
* Add docs to attrs, update assist to only grab allies sets
* Update assist unit test to match expected functionality
* Update metronome unit test to use getMoveOverride
* Update copycat unit test to use metronome getMoveOverride mock
* Fix phase interception
* Add docs from missed conversations
* Update assist tests to use manual moveset overrides
Minor fixes to other tests
* Remove `export` from `CallMoveAttr`
* Add missing `.unimplemented()` to some Max- and Z-Moves
---------
Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Replace various `scene` pass-arounds with global scene variable
* Modify tests
* Add scene back to `fade[in|out]()` calls
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Fix Bug Superfan ME test
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Re-enable fixed test
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* Rename `gScene` to `globalScene`
* Move `globalScene` to its own file to fix import/async issues
* Fix `SelectModifierPhase` tests
* Fix ME tests by removing `scene` from `expect()`s
* Resolve merge issues
* Remove tsdocs referencing `scene` params
Remove missed instances of `.scene`
* Remove unnecessary `globalScene` usage in `loading-scene.ts`
* Fix merge conflicts
* Attempt to fix circular import issue
* Found the source of the import issue
* Fix merge issues
---------
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
* [ME] Fix GTS Wonder Trade shiny not giving luck
* [ME] Shiny Magikarp from Pokemon Salesman can have any variant
* [ME] Shiny lock MEs with custom or special sprites
* [ME] GTS shows shiny sparkle for received Pokemon
* [ME] Shiny lock 'Slumbering Snorlax' and 'The Strong Stuff'
* [ME] Dancing Lessson: show shiny sparkle for Oricorio in intro
* [ME] Show shiny sparkles for Pokemon in ME intro
* fix tests
* Ensure shiny sparkle animation is initialized before playing it (Fixes#3924)
* make loading variant assets cleaner
* cleanup EnemyPokemon shiny initialization
* test fixes and final cleanup
* Make 'getSpeciesFilterRandomPartyMemberFunc' more readable
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>