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

Combine crit hit and wp hit and tweak damage calculation for ranged attack #78877

Merged
merged 9 commits into from
Jan 5, 2025

Conversation

osuphobia
Copy link
Contributor

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's bp_hit and its coverage as it was #52060 #56104 ). Also changed the way Critical msg pops, zero dmg crit will no longer shows Critical! 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 random grenade_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, and mon_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.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Monsters Monsters both friendly and unfriendly. [Markdown] Markdown issues and PRs Mods: Dark Days of the Dead Anything related to the DDotD mod (classic style zombies) Items: Archery Bows, crossbows, arrows, bolts Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Items: Armor / Clothing Armor and clothing Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Xedra Evolved Anything to do with Xedra Evolved Mods: Bombastic Perks labels Dec 31, 2024
@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) Game: Balance Balancing of (existing) in-game features. labels Dec 31, 2024
Copy link
Contributor

@github-actions github-actions bot left a 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

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Dec 31, 2024
src/creature.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Dec 31, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 1, 2025
@GuardianDll
Copy link
Member

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

@GuardianDll GuardianDll merged commit 5f6d1e6 into CleverRaven:master Jan 5, 2025
22 of 26 checks passed
@osuphobia
Copy link
Contributor Author

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?

@osuphobia osuphobia deleted the combine-crit-and-wp branch January 5, 2025 16:28
@GuardianDll
Copy link
Member

Correct, because both crit and weakpoint represent the same thing, except weakpoints are much more detailed, flexible, and controllable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <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. <Documentation> Design documents, internal info, guides and help. Game: Balance Balancing of (existing) in-game features. Items: Archery Bows, crossbows, arrows, bolts Items: Armor / Clothing Armor and clothing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mods: Bombastic Perks Mods: Dark Days of the Dead Anything related to the DDotD mod (classic style zombies) Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Xedra Evolved Anything to do with Xedra Evolved Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants