-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Ability] Ignore Held Items for Stat Calculation #5254
[Ability] Ignore Held Items for Stat Calculation #5254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as intended based off of stat changes and x items etc, need a dev to review
Code looks good, needs automated tests then it's good to go. |
I added a unit test for this, but I can't suggest it here and I seem to be lacking the ability to do a PR for geeilhan's repo |
Mew's base stats were being changed by nature. I did an override to set the nature and I no longer observed an inconsistency across a dozen runs. |
IVs shouldn't be random, last I checked they were consistent between test runs. |
Huh. It looks like the test failed after the nature change (unless actions messed up). Is it still non deterministic? |
Ran the test a bunch and when it failed the Magikarp moved before Mew on the first turn. |
Oh I didn't do a turn order override? I should probably fix that. |
Added turnorder to tests |
Oh it looks like you made the same change in #4984, could you merge the changes to Tera Blast from there to this PR? |
Added Tera Blast Changes |
Fixes issue mentioned in #289
What are the changes the user will see?
Quark Drive and Protosynthesis now increase correct stat.
Why am I making these changes?
What are the changes from a developer perspective?
Both Abilities used the
getEffectiveStat
function which could not ignore held items. (Wiki-Link)I added another non-mandatory input to
getEffectiveStat
andgetStatStageMultiplier
which makes it possible to ignore stat changes from items (e.g. X Speed).Screenshots/Videos
Deactive and Active Quark Drive test with Mew with X Speed (should increase ATK since X Speed is ignored and all stats are the same value):
quark-drive-test-after.webm
Same tests with harsh sunlight and Protosynthesis:
protosynthesis-test-after.webm
How to test the changes?
npm run test
passes.Also tested the implementations manually with Mew (all same stats), Ramparados and Shuckle and the stats increased correctly after the conditions for the abilities to activate are met.
In addition, I tested the Abilities effects with held items such as X ATK, and X SPEED and the stat increases worked correctly.
Currently struggling writing automated tests.
I tried using
vi.spyon(player, "getEffectiveStat")
but this does not work. Just usingexpect(player.getEffectiveStat(Stat.ATK)).toBe([Value])
also did not work.-> Still working on the tests. Maybe just reading the damage numbers directly might work.
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?