-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Combine crit hit and wp hit and tweak damage calculation for ranged attack #78877
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.
Auto-requesting reviews from non-collaborators: @LyleSY @bombasticSlacks
Also, just so it is written anywhere, but in the end it is desired to get rid of crits altogether in favor of you hitting weakpoints |
I'm not sure what does this mean, in the future we will no longer do crits to monsters but instead calculate all the bonuses/penalties depending on weakpoint system? |
Correct, because both crit and weakpoint represent the same thing, except weakpoints are much more detailed, flexible, and controllable |
Summary
Balance "Combine crit hit and wp hit and tweak damage calculation for ranged attack"
Purpose of change
The codes about ranged attack crit are kinda old, some of them older than the wp system #37241 #39203. Moved wp selection to crit calculation, and refactored crit formula a bit.
Describe the solution
782725f
Select wp for proj before crit check.
14a01b2
f0021ec
Make wp considered when determining crit hit for critters, tweaked the damage calculation, and fixed headshot counting process.
is_head
is added to wps as a maker for headshot. You will have a chance to make crit hit, even if it's not going to deal as much damage as the target's hp is, as long as you aimed really well and hit some weak spot. (For critters, it's weakpoint, for NPCs, it'sbp_hit
and its coverage as it was #52060 #56104 ). Also changed the way Critical msg pops, zero dmg crit will no longer showsCritical!
etc.e8efaa0
This one is to specifically fix explosive shrapnel using
wp_skill
of the thrower, which seems to be introduced by #77056 , and was causing randomgrenade_lethality
failure while me testing this PR.e94fcc1
After the changes, the average damage of aimed shot will be slightly increased, and a careless aim will be more likely to deal less damage. Tweaked test cases that were influenced. For the
archery_damage_thresholds
test, made it more reasonable, andmon_moose
test now somewhat works.f933c52
Encountered a weird failure I can't understand. Anyone knows what's wrong with it? This seems to please it.
Describe alternatives you've considered
As crit multiplier is counted after resistence, maybe we can further change the way it works. But that can be a hard task.
Testing
Complied and passed test cases locally. Shot some moose and some hulk, works as expected.
Weapons like bows birdshot and .22 now can make some reasonable crit, but still don't have the ability to hurt armored target.
Additional context
I considered to add an accuracy factor to wp selection, but that would make this PR too complicated so I gave it up. Might do it in another PR.
Another thing is about how shotgun shell works when hitting point-blank target, but that's out of scope and will also be treated in another new PR.