https://github.com/pagefaultgames/pokerogue/pull/6178
* Replaced all instances of `game.scene.getXXXPokemon()!`
inside tests with `game.field.getXXXPokemon()`
* Fixed tests
* Fixed oblivious test
* Fix Grudge test
* Changing remaining Modifiers to Consumables, and renaming ModifierType to Reward
* Renamed modifier files and moved them into items folder
* Using rewards in most places
* Removed consumables in favor of using rewards directly
* Renamed RewardTier to RarityTier
* Reward ids, function to match rewards
* Getting reward tiers from player pool still
* Messing around with parameters of Reward.apply()
* Always requiring player pokemon in rewards
* Fixing some functions in select-reward-phase and battle-scene
* Fixed various post-merge issues
* Fixed most localization strings (accidentally broken by replacing modifierType with reward)
* Fixed tests for select reward phase
* Using Pokemon.hasSpecies()
* Zero weight for trainer items rewards which are already max stack
* Cleaning up SelectRewardPhase, held item rewards behave the same as any PokemonReward
* Cleaned up some functions
* Introduced RewardCategoryId, distributed RewardIds
* Utility `is` functions for rewards
* Minor fixes
* Moved `HeldItemEffect` to its own file
* rmade some todo comments
* Adding a big comment
* Added tsdocs and removed `RewardClass`
* undid breaking changes
* added TODO
* Moved matchingRewards function to reward-utils.ts
* Added RewardGenerator classes for mints and tera shards
* Introducing default rarity tiers for trainer items and rewards
* RewardFunc now can return RewardGenerator
* Moved pool reward functions to their own file, plus other utility files
* Fixed WeightedModifier to work with the new RewardFunc
* Fixed wrong type import
* Shifting trainer item and reward ids to avoid overlaps
* Added some types
* Updated comment in reward.ts
* Added strong typing ot item maps
* added type safety to held item name map
---------
Co-authored-by: Bertie690 <taylormw163@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
* Standardize filenames to kebab-case
Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>
* Move script outside of public folder
* Move update_exp_sprites to scripts
* Add ls-lint to lint file and directory names
* Update lefthook.yml to skip merge / rebase on all pre-commit commands
---------
Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>
* Introducing held items
* Pokemon class can add held items
* Example of applyHeldItemAttrs
* Introducing a PokemonItemManager class
* Moving away from HeldItemAttr
* Attempt at incorporating the new framework in modifier-type
* Changes
* More changes
* Splitting up methods in select-modifier-phase.ts
* Newrefactors of reward-pool-manager.ts
* New refactors of select-modifier-phase.ts
* Extracted logic from modifierSelectCallback
* Moved some files around, added many held item ids
* Introduced HeldItemReward class
* Introduced AttackBoosterReward
* Introduced AttackBoosterRewardGenerator
* Removed unused file
* Select modifier phase tentatively working with new held items
* Working leftovers in new style
* Moved modifier-bar to its own file
* Held items now show up in summary
* Added some suggestions
* Implemented more suggestions
* Splitting up held-item file
* Fixing various imports
* Created items folder
* Shell bell
* Converted White Herb
* HeldItem .apply() methods do not really need the stack as input, just the pokemon
* Made heldItems public in heldItemManager
* Update modifier bar is now called in the apply of consumable held items
* Refactored parameters passed to .apply() methods; introduced generic .applyHeldItems() function; all HeldItems classes specify an ITEM_EFFECT
* Lucky egg and Golden egg
* Converted wild pokemon pool to held item rewards
* Temporary stopgap on maxUpgradeCount to avoid game crashing on modifier select ui handler
* Changed held-items.ts to held-item-id.ts and renamed id object accoridngly
* Added reviver seed
* Simplified HeldItemReward
* Added effect of reviver seed (leveraging consumable logic)
* Remove InstantReviveModifier
* Added Stat Boost items; generic name and description in HeldItem class
* Added Crit Boost held items, King's Rock, Focus Band and Quick Claw
* Added Mystical Rock
* Added Shell Bell, Soul Dew
* Added multi lens and wide lens
* Added Baton and Golden Punch
* Baton switch logic in party ui handler now using held item
* Partial implementation of item steal items
* Using held items in some places
* Using phaseManager
* Tracking forms in held item manager
* Shuckle Juice and Old Gateau
* Using phaseManager
* Removed a bunch of modifiers
* Fixed shell bell in ability.ts (why is it here?)
* Changed BattleScene.removeModifier and pokemon.loseHeldItem
* Making some held items unstealable and unsuppressable
* Refactored most of battle-scene.ts with held items
* Added soundName to HeldItem (possibly useless)
* Reworked various effects that steal items
* Refactored Baton logic
* Reworked most entries in Modifier Types
* pokemon.getHeldItems now uses heldItemManager
* Added Evolution Tracker as held item
* MBE is always untransferable
* Improved item transfer
* Fixed types in held item manager
* Various fixes
* Fixed types in shuckle juice and old gateau
* MBE achievement now tracks held items
* Removed AttackTypeBoosterModifierRequirement for MEs
* Fixed Pickup
* Fixing (most) berry usage
* Using Berry held items in move.ts
* Split up vitamins from the rest of stat boosting items
* Fixed form change trigger after merge conflicts
* Added some utility functions to check if an item fits a list of items/categories, or to filter out which held items fit
* Fixed delibirdy encounter
* Various fixes
* Reworked EnemyPokemonConfig to include a HeldItemProperty object (to feed to the heldItemManager). Updated Dark Deal ME
* More various fixes; introduced isMaxStack(item) method to heldItemManager
* Updated modifier-bar.ts
* Converted Berries Abound encounter
* Converted The Strong Stuff encounter
* Fixed Slumbering Snorlax encounter, overrideItems of heldItemConfiguration can deal with items with 0 stack
* Preliminary changes to some MEs
* Changes to the summary ui handler
* Converting to held item pools
* Fixed evo tracker
* Moved many data types for held items to a dedicated file; introduced held item pools for item generation
* Fixed some MEs
* Added function to assign items from a given configuration
* Fixed held item evolution condition
* Fixed some ui handlers
* Fixed select-modifier-phase
* Some changes to modifier files
* Daily run items are generated within the new system
* Held item generation for enemies follows the new scheme
* Fixed init-modifier-pools.ts
* Held item overrides now use the new system
* Removed unused getOrInferTier function (was only used by thief and covet)
* Fixed shady vitamin ME and some HeldItem files
* Updated various MEs. HeldItemManager can now generate a configuration from its items.
* Converted most MEs, introduced some more utility functions and methods
* Replaced ModifierTier with RewardTier
* Fixed some rogue inputs
* Held item pools take a single pokemon as input, set weights to 0 for max stack items
* Restored various changes to held item pool generation; distinguishing target of the generation from the party
* Pools can now take a HaldItemConfigurationId without weights; set up table of item tiers; used custom pools in Clowning Around ME
* Fixing some phases
* Fixed several bugs related to accessing and visualizing held items
* Fixed position of enemy modifier bar
* Fixed berries, removed some debug messages
* Vitamins max stack temporarily set to 30
* Luck upgrades work correctly again (maybe)
* First steps to port tests to the new system
* Form change items work correctly when selected in battle
* Introducing helper functions for a modifier migrator; PokemonItemMap now uses pokemonId
* Renamed file with item migrator functions
* Restored missing strings
* Shuckle juic and Old gateau are not instance dependent
* Simplified HeldItemData
* Migrator utils include shuckle juice
* Introducing trainer items
* Enemy tokens are now also trainer items
* Converted most of modifierTypes
* Fixed various MEs; removed findModifier from battle-scene
* Removed most uses of globalScene.applyModifiers
* Removed more functions from globalScene; changed lure weight function
* Updated a variety of files
* Split out X_accuracy, fixed trainer-item-manager
* Fixed expert breeder ME
* Replaced updateModifiers with updateItems
* Removed modifiers from saveData
* Trainer item rewards are generating during runs, added properly to the scene
* Items (including held items) are saved and loaded correctly.
* Fixed several trainer item names and descriptions, plus various issues with item generation
* Restored override file
* Added icons to tokens
* Fixed Dire Hit starting stack
* Using Pokemon.getMoveType() in generation of attack type boosters
* Test for dire hit; ensuring that lapsing trainer items are added from config at full stack
* Eviolite does not apply to G-Max forms
* Changes to various item tests
* Some still broken tests
* More changes to tests but still failing
* Fixed evo tracker item
* Moved allHeldItems and allTrainerItems definitions to data-lists
* Renamed modifier-bar and moved to ui files
* Fixed held item when pokemon not passed
* Remove `package-lock.json` added by merge issue
* Add review comments as `TODO`s for now
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Made `game.phaseInterceptor` fail if move not in moveset
also added a few assorted doc fixes
* Fixed fail comment
* added `map` statement
* Fixed tests
* Fixed test
* Fixed test and comment
* Fixed tests
* Fixed test v2
* Fixed various tests
* Update error msg to not use fullcaps
* Fixed remaining tests
* Fixed test 0.5
* Fixed up tetss
* Fixed test
* Fixed imposter tests
* Fixed imposter tests
* Fiexd remainig tests
* Marked test as TODO
wasn't as if it was doing anything beforehand but w/e
* Update moveHelper.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Update moveHelper.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Apply Biome
* Update comment in `spikes.test.ts`
* Add faint checks to Spikes test
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
https://github.com/pagefaultgames/pokerogue/pull/5926
* Condensed all overrides into 1 line where possible
I hope I got them all...
* Fixed tests 0.5
* Cleaned up safeguard test to not use outdated code; fixed rest of errors
* Fixed illusion test
* Revert safeguart etst
* Fixed battle tets
* Fixed stuff
* Fixed things2.0
* Fixed import issues
* Revert changes outside of the tests directory
* Revert changes outside of the tests directory
---------
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Add abilityAttr.is methods
* [WIP] move modifier stuff around
* Untangle circular deps from modifiers
* Move unlockables to own file
* Untangle all circular deps outside of MEs
* Move constants in MEs to their own files
* Re-add missing import to battle.ts
* Add necessary overload for getTag
* Add missing type import in weather.ts
* Init modifier types and pools in loading-scene
* Remove stray commented code
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Move game-mode to its own file
Reduces circular imports to 325
* Move battler-index to own file
Reduces circular deps to 314
* Move trainer-variant to own file
Reduces circ deps to 313
* Move enums in pokemon to their own file
* Move arena-tag-type to its own file
* Move pokemon-moves to its own file
* Move command to own file
* Move learnMoveType to own file
* Move form change item to own file
* Move battlerTagLapseType to own file
* Move anim enums to own shared file
* Move enums out of challenges
* Move species form change triggers to own file
Reduces circ imports to 291
* Update test importing pokemon move
* Replace move attribute imports with string names
* Untangle circular deps from game data
* Fix missing string call in switch summon phase
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Ensure ChargeMove's is method calls super
* Use InstanceType for proper narrowing
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Rename `Abilities` to `AbilityId`
* Rename `abilities.ts` to `ability-id.ts`
* Rename `Moves` to `MoveId`
* Rename `moves.ts` to `move-id.ts`
* Rename `Species` to `SpeciesId`
* Rename `species.ts` to `species-id.ts`
* Rename `Biome` to `BiomeId`
* Rename `biome.ts` to `biome-id.ts`
* Replace `Abilities` with `AbilityId` in comments
* Replace `Biome` with `BiomeId` in comments
* Replace `Moves` with `MoveId` in comments
* Replace `Species` with `SpeciesId` in comments
* Add Deep Sea Scale & Tooth items
Also changes Clamperl's evolution method from gender-specific to requiring one of the Deep Sea items to be held.
* Move Deep Sea items to Great tier
Also gives every species stat booster item a `rare` boolean to split these items from the rest of the species stat booster items. Updated the existing tests accordingly to account for the split.
* Reduce Great tier species booster item weight
* Fix global scene on evolution conditions
* Merge branch 'beta' into deep-sea-items
* Change how the held item is found in evolution condition
It should no longer look through the entire party's modifiers when seeing if Clamperl is eligible to use a Linking Cord.
* Fix wrong type being boosted
---------
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
* Fixed IVs of trainers using the Battle Seed.
* Renamed the randSeedInt functions that use the Battle Seed to randBattleSeedInt functions
* Incorrectly used this in common
* Fixed tests that were still calling the old function name
---------
Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
Co-authored-by: AJ Fontaine <36677462+Fontbane@users.noreply.github.com>
Co-authored-by: Dean <69436131+emdeann@users.noreply.github.com>
Co-authored-by: lxy-lxy-lxy <55084073+lxy-lxy-lxy@users.noreply.github.com>
Co-authored-by: Xavion3 <xavion333@gmail.com>
Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Lylian BALL <131535108+PyGaVS@users.noreply.github.com>
Co-authored-by: Jimmybald1 <147992650+IBBCalc@users.noreply.github.com>
* Extract Mode enum out of UI and into its own file
Reduces circular imports from 909 to 773
* Move around utility files
Reduces cyclical dependencies from 773 to 765
* Remove starterColors and bypassLogin from battle-scene
Reduces cyclical dependencies from 765 to 623
* Fix test runner error
* Update import for bypassLogin in test
* Update mocks for utils in tests
* Fix broken tests
* Update selectWithTera override
* Update path for utils in ab-attr.ts
* Update path for utils in ability-class.ts
* Fix utils import path in healer.test.ts
* Add isPartner method to trainer class
* Ensure force switches cannot pull pokemon from the wrong trainer
* Add override for battle type
* Fixup tests and broken assumptions
* Make move fail override semi-invuln check
Bandaid fix because move effect phase does not allow for the move to fail if all of its conditions fail
* Restore overrides
* Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Fix illusion test battle type invocation
* Update struggle and healer tests to use battleStyle
---------
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
* Move LearnMoveSituation to its own file
* Remove unused selfStatLowerMoves array
* Move all-moves to its own file
* Move TurnMove interface to its own file
* move AiType to its own file
* Move PokemonMove to its own file
* Move DamageCalculationResult interface to its own file
* Move fieldPosition to its own file
* Move hit-result to its own file
* Move DamageResult to its own file
* Move SpeciesWildEvolutionDelay to its own file
* move EvolutionItem to its own file
* Checks for hit result status on Grip Claw application
* Adds a boolean check for the Pollen Puff edge case in canBeMultiStrikeEnhanced
* Adds parental bond test
* Adds grip claw and multi lens tests
* Create new turnData field for tracking damageResults, check for HitResult in Reviver Seed modifier
* Optional chaining for cases like stealth rock
* Adds HitResult.SELF for confusion to distinguish from indirect damage
* Adds HitResult.SELF to damage sound effect switch
* Cover edge case of salt cure, insert HitResult for ALL damage regardless of optional variable
* Change Liquid Ooze HitResult to OTHER from HEAL
* Adjust OHKO moves to not bypass endure or RSeed
* Add tests for reviver seed
* Fixes endure to no longer block indirect damage, updates weather damage to be HitResult.OTHER, adds/fixes unit test
* Change destiny bond to HitResult.OTHER so it doesn't trigger rseed
* Adds destiny bond unit test
* Creates additional unit tests for endure
* Rename SELF hitresult to CONFUSION
* Update CONFUSION enum
* Refactors implementation per Wlowscha's suggestions: removes damageSources array and preventEndure variable
* Rename HitResult.OTHER to INDIRECT, create INDIRECT_KO for PSong/DBond, add functionality for INDIRECT_KO to damageanim/number handler
* Fixes hit result for stealth rock
* Removes unnecessary check, makes DamageResult default to EFFECTIVE, updates remaining damageAndUpdate calls to use INDIRECT
* Refactors damageAndUpdate to replace optional parameters with object parameter
* Fixes based on Kev's suggestions
* Updates tsdocs for damageAndUpdate
* Fix merge conflict
---------
Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>