-
Notifications
You must be signed in to change notification settings - Fork 793
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
Bugfix/Refactor: Min-Max Damage Range Calculations #7022
Bugfix/Refactor: Min-Max Damage Range Calculations #7022
Conversation
Looks like this made the demo run off the rails |
This likely addresses all the uses qndel identified in #6402 except the item.cpp changes, good to keep it focused for damage rolls. |
Should be good now? |
e3488d5
to
b14455b
Compare
I think it would be nice to unify randomizing damage in the future - at the moment sometimes numbers are randomized before getting shifted, sometimes after, it's a mess - which means in some cases it's possible to get 1.5 dmg while in other places you'd get integers only - doesn't make much sense imo ;) |
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.
Happy to leave it to a future PR to sort out the inconsistent fixed point/integer rolls
b14455b
to
e943df3
Compare
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.
Still good to go imo, the only behaviour change introduced is called out in missiles.cpp:1066
Refactors damage calculations from the format:
damage = min + rnd(max - min + 1)
to:
damage = randombetween(min, max)
Also fixes a bug in some damage calculations, where max damage in the range is 63/64th lower than it should be.