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
Critical hit coverage #52060
Critical hit coverage #52060
Conversation
03db642
to
9db938a
Compare
Unless I missed something major critical hits are a strictly player-only (or character-only at most) system, monsters can't crit at all. Including a vitals coverage is at least futureproofing for when we do wounds/vital hits, but until then it will be of limited relevance. Also, what's the melee/ranged split supposed to represent? |
Thanks for confirming, I though I was going crazy! For now, crit mitigation will only be applied to hits from
@I-am-Erk would have more details about this, but I figure that different armour pieces would effectively cover you differently based on the kind of hit you're taking. Right now it affects armour damage absorption and infection risk from hits to filthy clothing, but also different effects could be added based on different coverage types. |
4aba82c
to
adb68a6
Compare
Gunplay and the newer throwing attacks monsters can make detour through the player code, and can indeed trigger critical hits. Melee attacks are handled directly in the monster code and do not trigger crits for now, but lacking a way to mitigate them is precisely the reason they aren't there... |
I see that
I think it would make sense to do something similar for melee attacks: migrate |
adb68a6
to
87e3b02
Compare
I want to make sure before diving into review... You list a lot of things that could be affected, but I would think that as long as "coverage" the base stat is unchanged, adding more stats that are independent of it shouldn't have any impact on stuff like wind protection |
That's right, those are just areas that make use of coverage in general. I made that list before I started on this to figure out the scope of coverage. I'll update the list to avoid confusion. |
There is a lot of space in Armor Sort window. Please expand all these M, R, and V, they could be confusing for players. |
Summary
None
Purpose of change
This is part of a more comprehensive coverage balance. This adds coverage values for additional categories: melee, ranged and vitals. Certain armour pieces would be more effective at protecting vitals (a.k.a. protection from critical hits).
Describe the solution
Currently, monster attacks do not generate critical hits. Characters can crit using either melee attacks or projectile attacks. The implementation of critical hits is a bit scattered around the codebase, so some minor adjustments were made:
projectile_attack_results::damage_mult
for projectile attacks (seeCreature::select_body_part_projectile_attack()
)Character::roll_all_damage()
and sub-functions)The optional fields
"cover_melee"
,"cover_ranged"
and"cover_vitals"
are used to affect the damage received from different sources.TODO:
armor_portion_data
Update coverage values in jsonThis should be left to the expertsThe following areas of code may be affected:
armor_layers.cpp
character.cpp
character_armor.cpp
creature.cpp
get_crit_factor()
to multiply crit effects, crit modifiers inselect_body_part_projectile_attack()
dump.cpp
item.cpp
get_coverage()
andget_avg_coverage()
item.h
item::cover_type
enum for identifying coverage typeitem_factory.cpp
itype.h
armor_portion_data
melee.cpp
roll_<type>_damage()
functionsiteminfo_test.cpp
Describe alternatives you've considered
Critical hit protection could also be derived from the clothing's materials.
Testing
Additional context