Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Weight Handling #535

Merged
merged 7 commits into from Mar 5, 2024
Merged

Improve Weight Handling #535

merged 7 commits into from Mar 5, 2024

Conversation

Zrp200
Copy link
Contributor

@Zrp200 Zrp200 commented Mar 14, 2023

  • Moved all weight modification code to one place (utils)
  • Heavy/Light Metal and Float Stone can now stack.
  • Heavy Metal, Light Metal, and Float are now shown in the description when applicable
  • Weight modification is now done in Hectograms, though it still returns Kilograms after truncating fractional hectograms (Showdown implementation uses truncation, not rounding).
  • It is now impossible to get a weight lower than 0.1kg.

I also added tests for weight handling that mirror Showdown's.

This should address the weight-based inaccuracies expressed in #443

@Zrp200
Copy link
Contributor Author

Zrp200 commented Feb 13, 2024

Bump

* Float Stone now stacks with Light Metal and Heavy Metal
* getWeightFactor now populates the description item/ability as applicable
* renamed getWeightFactor to getWeight
Ability and Item weight modifiers are now handled completely independently of each other
@Zrp200
Copy link
Contributor Author

Zrp200 commented Mar 1, 2024

Rebased to fix the merge conflict. It was a trivial import conflict.

calc/src/mechanics/util.ts Outdated Show resolved Hide resolved
@thejetou thejetou merged commit 1b7b530 into smogon:master Mar 5, 2024
2 checks passed
@thejetou
Copy link
Collaborator

thejetou commented Mar 5, 2024

Great work. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants