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

Add bullet damage type #38912

Merged
merged 11 commits into from
May 3, 2020
Merged

Conversation

anothersimulacrum
Copy link
Member

@anothersimulacrum anothersimulacrum commented Mar 20, 2020

Summary

SUMMARY: Features "Separate bullet damage type from cut/stab"

Purpose of change

Currently, bullet damage is modeled the same as cut/pierce damage. This is incorrect - bullets mechanically deal damage differently than a knife or lower velocity projectile, like an arrow, would. Because bullets deal damage in a different way than a knife or arrow, they are also protected against in a different. This is evident in materials like kevlar, which is excellent at blocking bullets, but performs less well against cutting/stabbing implements.

Describe the solution

Depends on #37329 and #38882.
The first three commits are from those two PRs.
Commit by commit:

Damage loading code
  • Add bullet_protec member to bionics, holding the bullet protection armor that a CBM gives.
  • Add bullet type clothing mods.
  • Add armor_bullet_bonus member to Creature
  • Add code to load bullet type damage from damage objects
  • Add DT_BULLET to the damage type enum
  • Allow spells to do bullet damage and bullet damage related enchantments
  • Add bullet_resist to materials
  • Add armor_bullet to monsters
  • Adds a warning (using debugmsg) when an item is loaded using the old damage format, because this means it is likely a gun that should be using this damage type, not stab.
Update logic for bullet resistance
  • Add bullet damage/armor getters
  • Use bullet damage in shotgun traps
  • Update tests for bullet damage
Bullet damage UI bits
  • Update UI to show bullet armor/damage
Update materials for bullet damage
  • Set bullet resistance for materials to 80% of their cut resistance, arithmetically rounded
Update guns to use bullet damage
  • Change the damage type from stab to bullet for guns
Update ammo to bullet damage
  • Change the damage type from stab to bullet for ammunition.
Update monster bullet damage
  • Bullet damage is set equal to stab damage (generally 80% of cut), arithmetically rounded
Add documentation
  • Update the docs

There should be few changes to how guns damage and interact with monsters, the player, etc. in this PR, and the changes that there are should just be slight changes to armor due to rounding.

Describe alternatives you've considered

I considered setting the values for armor to be something other than largely what they were before (duplicates of piercing damage), but I decided that that probably deserved a more thorough and careful examination than I could do in this PR.

Testing

Bullet damage works correctly: Shooting a kevlar hulk with a .308 rifle does ~30 damage when their bullet damage field is populated, and ~70 when it is not.
Looking at clothing items shows bullet resistance.
Looking in the + menu shows bullet resistance.
This is a pretty big PR, so I probably need to come up with some more tests.

Additional context

I considered JSON-izing damage types first, as requested by @ZhilkinSerg, but I figured this was more important to do now (I'll JSONize later).

@ghost
Copy link

ghost commented Mar 21, 2020

No more bulletproof chainmail?
image

@Aphegis
Copy link

Aphegis commented Mar 23, 2020

This is a big improvement.

@mkikt4743
Copy link

cool now we can balance ESPAI vests

@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/cut-piercing-dmg-should-not-be-used-against-bullet-dmg/23217/5

@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/way-of-solving-excessive-damage-of-new-turrets-just-replace-ammo-type/23051/22

@anothersimulacrum anothersimulacrum force-pushed the dt_bullet branch 2 times, most recently from c06a0f0 to 5f7e0e2 Compare April 14, 2020 16:33
@mlangsdorf mlangsdorf added [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics labels Apr 14, 2020
@lgtm-com
Copy link

lgtm-com bot commented Apr 14, 2020

This pull request introduces 1 alert when merging 5f7e0e2 into 32e6aab - view on LGTM.com

new alerts:

  • 1 for Use of c-style math functions

@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/esapi-armor-is-still-hilariously-broken/23258/3

@anothersimulacrum anothersimulacrum changed the title [CR] Add bullet damage type Add bullet damage type Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants