Updated the check in place when attempting to play a trainer sprite. Separated it into a separate function to reduce reusing code and to make it easier to exit early when failures occur.
Took a look at some of the entries for trainers and adjusted accordingly. it looks like all of these trainer types were grabbed from an online source as a sort of future-proofing which is good, but resulted in some errors. Some of which have already been fixed, and some which are included here.
Also prevents an issue if there is a missing image and displays a warning in the console instead of a crash.
* Issue #745 - Added the option to localize titles, trainer names (for important trainers like elite 4, champs etc) and trainer classes.
- Also i already did the whole localization for german (sorry thats the only language is speak other then english...)
- Also renamed the trainer Type "student" to school_kid (because there apparently really is a trainer class called student since the gen 9 dlc)
- And i changed it so it makes sure that i18 only gets initalized once (it may be needed to initalize it before the loading phase so the elite 4 titles etc can be localized)
* Issue #745 - Removed stuff that wasnt meant for this branch
* Translation of French trainers.ts
* Translation of French trainers.ts
* Translation of French trainers.ts
* Fixed spelling on german translation
* Fixed name of Hex Maniac
* ADded missing "," that were lost in the merge
* For Trainer Classes that have a female and male variant the correct name is now choosen. (If a language has both).
Also added a safety net that if the female version does not exist it uses the one without the suffix
* Reverting override.ts
* Added ptBR trainers.ts (thanks to zé ricardo on discord)
* Updates Pokefan to reflect the correct english spelling (in all languages that still have the english defaults)
* Updated Rich_kid trainer typ to named correctly as "Rich Boy" in english and all non yet localized languages
* Added that the title will get made lower case so the rival is correctly set
* Reverted a formatting change that i didnt make intentionally
---------
Co-authored-by: Lugiad <adrien.grivel@hotmail.fr>
* Implemented Power Split and Guard Split
* Update changeStat method to use summonData for Pokemon stats
This commit modifies the `changeStat` method in the `Pokemon` class to use the `summonData` object for updating Pokemon stats instead of directly modifying the `stats` object. This change ensures that the updated stats are correctly reflected in the `summonData` object, which is used for battle calculations and other related operations.
Refactor the `getStat` method to check if `summonData` exists and return the corresponding stat value from `summonData.stats` if it does. Otherwise, return the stat value from the `stats` object.
This change improves the accuracy of stat calculations during battles and ensures consistency between the `stats` and `summonData` objects.
* Added documentation for Power Split and Guard Split + linting
* removed incorrect files
* Removed incorrect folder
* removed unnecessary import
* Added documentation for getStat and changeSummonStat methods
* New description for getStat()
* Adjusting function descriptions
* adjusted descriptions according to guideline
---------
Co-authored-by: Frederico Santos <frederico.santos@fivedegrees.nl>
* added auto hit and 2x damage from certain moves when targetting a pokemon who used minimize
* review fixes and bad merge
* review fixes and bad merge v2
* changed to be double damage instead of power for the minimize condition
* added TSdocs for function]
* remove ability to add minimize tag to dynamax-mons
* status cannot be applied to max-mons, and falls off if they dynamax
* updated doccumentation
* Update move.ts
---------
Co-authored-by: Cae Rulius <cae@polywhack.com>
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
* Made Sheer Cold not affect Ice Types, as well as implementing the Gen VII change of 20% for non ice types.
* Pushed accurancy change
* Updated and separated the accuracy attribute and the Ice no effect attribute
* Fixed the OHKO attribute (accidentally removed) and fixed multiplier
* Updated attribute names, as well as making the move cancelled instead of 0x multiplier
* Added TSDoc comments
* Updated accuracy logic
* Changed the text response for Sheer Cold immunity
* Added immune to the HitResult enum
* Ability Corrosion
Implemented Corrosion Partially.
Tested against:
- Poison Powder
- Toxic
- Dire Claw
- Sludge Bomb
- Psycho Shift
They all work as expected
Missing ability Magic Bounce to test against.
* Added TSDoc Documentation
Added documentation to the new IgnoreTypeStatusEffectImunnityAbAttr and added comments to the checks for this ability attribute.
* Added More Documentation
Add comment into Phases for what sourcePokemon is for.
Renamed source to sourcePokemon onto trySetStatus and canSetStatus.
Added TSDoc head for what sourcePokemon is and anything else I am aware of what they are used for.
* Removed unfinished TSDoc
Removed TSDoc headers due to not having enough understanding to fill out all of the parameters
* Fix Formatting and Reorder Parameters
* Update arena-tag.ts
* Update phases.ts
* Update ability.ts
Added access modifiers to my class and the class I compared to.
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
* Fixes some variable damage moves not working with abilities
* Rework as new ability attribute
* Update variable base power check to original location
* formatting
* Add tsdoc comments
* add floor for potential non int multipliers
* Update pokemon.ts
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
The Vivillon forms can all be encountered properly now, and Calyrex's forms have since been removed from the wild encounter pool, requiring a form change item to obtain.
If the pokemon species and form is the same as the second fusion component, then skip the logic to make a fused cry and just use the cry of the primary component.
* Redo moveset generation
* Decrease the weight of lower power moves and egg moves
* More weight tweaking
Trainers never get OHKO moves, are less likely to get self KO and multiturn moves, and more likely to get stat buffing moves. All pokemon are less likely to get offstat moves.
* Hydro Steam, Spirit Shackle, U-turn fix
Match formatting to project style
Co-authored-by: Samuel H <flashfireex@gmail.com>
* Fix Hydro Steam power up in Sun, even harsh sun if type changes
* Fix issue with Hydro Steam outside sun
* Add comments to IgnoreWeatherTypeDebuffAttr for documentation
* Move U-turn fix to another PR
---------
Co-authored-by: Samuel H <flashfireex@gmail.com>
* Save battler tags
Also saves the rest of the summonData except for transform specific things.
* Add missing values for type boost tag.
* Add intellisense comments
* Implements healer
* adds an ally check to the condition
* done testing, changes chance back to 30%
* adds comment header for PostTurnResetStatusAbAttr
* adds override to resetStatus to not allow revive
* dont revive
* override revert
* fix scrappy and mindseye working as passive ability
* update apply for ignoretypeimmunityabattr
* simplify logic for ignoretypeimmunityabattr
---------
Co-authored-by: contra1337 <jpbastyr@gmail.com>
* adds the ribbon asset, hooking it up
* works if override. need to add field on server side I imagine
* moves count to starterData, increments on win
* formatting
* increment works properly
* recursively check for prevolution
* cleaned up to use getRootSpeciesId()
* changes ribbon to gold medal version
* adds Akuma's ribbon achievements
* ribbons increment correctly
* missed ui handler update
* reorder achievements
* ribbon correct, vouchers not. currently investigating
* increments properly, but voucher reward phase not appearing
* some cleanup
* works great, need to better reflect who is getting ribbon in message and cry
* plays level fanfare, tabling cry for now
* reran items.bat
* Minor fixes
---------
Co-authored-by: Flashfyre <flashfireex@gmail.com>
* Fixes Struggle Softlock
Fixed an issue where moves marked as (N) would prevent you from being able to Struggle.
Also fixes messaging so that a message shows when you are out of PP, Disabled, or trying to use an unimplemented move consistently.
* Update phases.ts
The AI couldn't decide who to target with CounterDamageAttr moves which don't need a target. This change makes an exception. Now functions the same as when the player selects one of these moves.
Fixed having Shedinja share PP usage with the Ninjask it evolved from and vice versa.
The solution was to make a deep copy of each move in the moveset array rather than copying the array itself.
Shedinja wasn't taking the luck value from Ninjask so when it calculated its luck it just took the entire fused Pokemon's luck somehow. This has been fixed so it takes both the first and second part of the fusion's luck values instead.
Also fixes an issue where Shedinja crashed the game if it was the second part of a fusion combo. Now the correct pokemon species gets checked against and the correct pokemon evolution occurs to create Shedinja.
* Some Fixes
- HP ratio related checks (`getHpRatio`): Added rounding to 2 decimals for non-precise option.
- Hustle (`BattleStatMultiplierAbAttr`): added optional condition; Hustle now works only for physical attacks.
- Imposter (`PostSummonTransformAbAttr`): Switch in a double battle after both foes have been defeated no longer crashes the game.
- Sleep Talk (`RandomMovesetMoveAttr`): Single target moves no longer target allies.
* Formatting changes for consistency
---------
Co-authored-by: Flashfyre <flashfireex@gmail.com>
* Implement Rivalry
* Implement Quick Feet, Liquid Voice, and Normalize
* Forgot paralysis is half speed instead of a quarter
* Remove log statements
* Fix minor edge case in rivalry for gendered vs genderless
* Add wind abilities and charge
* Implement Charge and more abilities
* Add i18n support and Beedrill fury cutter
* Fix merge conflict in taunt
* More English strings removed
* Implements present, adds an override in the dmg calc to make 0 power moves do 0 dmg
* present doesn't make contact
* removes console log
* only === 0
Shields Down is only partially implemented; the form changing aspect is implemented, but the immunity to statuses is not yet.
Minior's alternate colored forms can now be encountered in the wild.
Rotom's appliance forms should *finally* appear in the wild correctly now.
And a minor fix for Zen Mode activating incorrectly.
* Implement Rivalry
* Implement Quick Feet, Liquid Voice, and Normalize
* Forgot paralysis is half speed instead of a quarter
* Remove log statements
* Fix minor edge case in rivalry for gendered vs genderless
* Added a new BattlerTagType and support for Laser Focus
BattlerTagType.ALWAYS_CRIT
* Updated battler-tags to support ALWAYS_CRIT
* Added ALWAYS_CRIT = "ALWAYS_CRIT", for the updated battler-tag-type
* Updated the crit formula to include the new critAlways
* Updated crit logic to include critAlways, fixed indents