CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.65k stars 4.18k forks source link

Сaltrops. The wrong part of the body takes the damage. #76325

Open IdleSol opened 2 months ago

IdleSol commented 2 months ago

Describe the bug

It's about the following traps:

  1. loose caltrops https://cdda-guide.nornagon.net/item/caltrops
  2. loose glass caltrops https://cdda-guide.nornagon.net/item/caltrops_glass
  3. loose teeth caltrops https://cdda-guide.nornagon.net/item/caltrops_teeth

They are placed on the ground and triggered when stepped on. I don't know which version serves as the prototype for the game traps. But roughly speaking, it's a spike sticking out of the ground (5-10 cm). If you step on it, either the foot or the foot and lower leg will be hurt.

In the game, only the leg suffers (I have no idea which sub part). The foot stays fine.

This is the result of a naked character going through 8 traps. pict1

Attach save file

n/a

Steps to reproduce

  1. Standard world and character
  2. Place some traps
  3. Walk through them several times
  4. Open the medical window (N).
  5. Pay attention to the damaged parts

Expected behavior

These traps should do damage to the feet, not the legs.

Screenshots

No response

Versions and configuration

Additional context

No response

Venera3 commented 2 months ago

Minor bodyparts don't have heath and transfer damage to their main part(hands->arm, eyes/mouth->head, feet->leg) instead, that's how its's always worked. It could be done better, but HPing minor parts has a lot of annoying UI implications.

IdleSol commented 2 months ago

Oh, how many off-topic questions I have at once... Does this only work with the player? Because:

https://github.com/CleverRaven/Cataclysm-DDA/blob/9dea2100b8bc699b3f40fb7e23fc41a57bf8ed3f/src/trapfunc.cpp#L281-L291

I don't have enough knowledge to fully parse that. But it seems to specify feet specifically? Or is that just for monsters? But the game only shows the total HP of the monster...

IdleSol commented 2 months ago

Experiments have shown that there are additional problems. The game can ignore sub-part armor if the total coverage of all sub-parts is less than 100%.

I mean, I created boots:

    "armor": [
      {
        "covers": [ "foot_l", "foot_r" ],
        "material": [ { "type": "kevlar", "covered_by_mat": 100, "thickness": 2.0 } ],
        "coverage": 100,
      }
    ]

Total coverage is 100%. The character takes no damage. But if you add the line:

    "armor": [
      {
        "covers": [ "foot_l", "foot_r" ],
        "specifically_covers": [ "foot_sole_r", "foot_sole_l" ],
        "material": [ { "type": "kevlar", "covered_by_mat": 100, "thickness": 2.0 } ],
        "coverage": 100,
      }
    ]

We get a total coverage of 25%. https://github.com/CleverRaven/Cataclysm-DDA/blob/791baaf9921a8b443859964a592ac209d03289d7/data/json/body_parts.json#L1300-L1302 Which leads to the fact that 3 traps out of 4 start ignoring sole armor. Although it is the one and only one they should take into account.