-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat(balance): throwing weapons sanity-checking #5474
base: main
Are you sure you want to change the base?
Conversation
Autofix has formatted code style violation in this PR. I edit commits locally (e.g: git, github desktop) and want to keep autofix
I do not want the automated commit
If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT. |
So, throwing rocks at 12 in stats and 10 throwing skill deals about 12 damage prior to this change, and about 19 with the change. I'm trying to figure out where I bungled the math in the process of writing this. |
Okay, tests pass after giving it a second look, and new testing done:
So it seems Scarf did succeed in fixing the damage values, it's just the UI is displaying them very wrongly for some reason. |
EDIT: Disregard, I forgot the ammo itself comes with +10 range, duh. |
Okay, it now uses either the ammo's specified damage/range OR the value you'd get out of throwing the ammo, whichever is higher, instead of getting both. :> |
maybe we should change to show both thrown and used-as-ammo damage? (e.g rocks can be both thrown/used in sling) |
Hmm, maybe? That might need to be applied to a lot of stuff actually, since non-ammo items like throwing knives would also benefit from it... |
…aclysm-BN into sling-damage-stuff
UGH. Fucking teeesssts. |
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Optional
Purpose of change
followup of #5088.
After some work, finally got this working right. This follows up on #5088 by making it so guns that use the throwing skill will use either the damage/range you'd get from throwing the ammo, or the ammo's own bonuses, whichever is higher.
Describe the solution
C++ Changes:
select_ammo
uses either damage bonus from throwing weapons (see below) or the ammo's own damage when choosing what ammo to load into a sling, whichever is higher.item::gun_info
to check how much you'd get out of throwing the ammo by hand displaying the damage of a weapon with the throwing skill, anditem::gun_range
likewise gets the throwing range of the ammo being tested when printing total range, using either in place of the ammo's specified damage/range bonus depending on which is higher. Also includes a UI note stating that the listed damage and range will vary for relevant weapons.throw_damage_projectile
used to calculate how much damage throwing an item would deal. This is done so the same calcs can be used inranged::fire_gun
to use that damage for slings if needed, and inthrow_item
, without redundant functions.JSON changes:
Describe alternatives you've considered
Screaming, main alternative that was here got implemented.
Testing
Additional context