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

Weakpoints (Part 2.1): Ignore weakpoints for item DPS calculations #51404

Merged
merged 5 commits into from
Sep 6, 2021

Conversation

Joshua-Chin
Copy link
Contributor

@Joshua-Chin Joshua-Chin commented Sep 5, 2021

Summary

Bugfixes "Ignore weakpoints for item DPS calculations"

Purpose of change

The existing item DPS calculation assumes that a creatures armor has 100% coverage. The recent weak point changes will break that assumption.

Describe the solution

Inline the previous monster::absorb_hit definition into item::effective_dps. Temporarily increase the allowable difference between actual and calculated DPS.

This involves a static_cast, but all targets passed to effective_dps are currently monsters.

Describe alternatives you've considered

Eventually, the DPS calculation should consider weakpoints.

Testing

Additional context

See #51305

@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. labels Sep 5, 2021
@Joshua-Chin Joshua-Chin marked this pull request as draft September 5, 2021 21:23
@Joshua-Chin Joshua-Chin marked this pull request as ready for review September 5, 2021 21:39
@Joshua-Chin
Copy link
Contributor Author

@I-am-Erk This should temporarily resolve the issues with the DPS test for #51373. Once things stabilize, we should update the expected values to consider weakpoints.

@I-am-Erk
Copy link
Member

I-am-Erk commented Sep 6, 2021

Whew, thanks. That was bothering me and I've had no time to work on it at all.

@I-am-Erk
Copy link
Member

I-am-Erk commented Sep 6, 2021

Hmm, I think this is not the ideal solution even as a stopgap as it's essentially just turning off the test entirely. What I think I'll do for the moment is generate a duplicate monster that has no weakpoints, and use that for the test. I'll add that to this PR myself if you've given me the ability, hold on.

This solution isn't great either but it keeps the current utility of the test unchanged. If smoker or regular zombies get weak points we'll need to get smarter.

@I-am-Erk I-am-Erk merged commit 142b56a into CleverRaven:master Sep 6, 2021
Venera3 pushed a commit to Venera3/Cataclysm-DDA that referenced this pull request Sep 21, 2021
…leverRaven#51404)

* Ignore weakpoints for item DPS calculations

* Increase epsilon between actual and expected DPS

* Fix bug with rapid strike calculation

* set effective_dps_test to use a test soldier

* Update zed_soldiers.json

Co-authored-by: I-am-Erk <45136638+I-am-Erk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants