CleverRaven / Cataclysm-DDA

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

BUG/Suggestion: Either make trader NPCs NOT investigate sounds or lock them behind reinforced glass. #56990

Closed Jan-Blasiak closed 1 year ago

Jan-Blasiak commented 2 years ago

Is your feature request related to a problem? Please describe.

Last time I did the "Traitor" quest for the Merchants, shooting the traitor caused the Merchant behind the locked counter to smash his own window, and run into the corridor, where he now sits, away from his designated location AND his pile of goods for sale.

Solution you would like.

Either make trader NPCs, preferably all of them for safety sake, NOT investigate sounds or lock them behind reinforced glass/steel bars or other applicable "cages". It's EXTREMELY irritating having to go to the corridor to trade with Merchant.

Inglonias commented 2 years ago

I think the simplest solution here is to lock Smokes behind reinforced glass, yeah.

Ilysen commented 2 years ago

Smokes actually *is* behind reinforced glass, it's just that his weapon (a Halligan bar) has very high bash and can break it. #56195 has been up to fix that, but has yet to be merged.

I-am-Erk commented 2 years ago

So, the solution here is probably not to make Smokes pound ineffectually on the indestructible glass. I suggest we set up an effect series for merchants like Smokes, and the doctor on the other side of the room, and probably a few more: drop their movement speed to 0 so that they cannot leave their spot, and add an Effect on Condition that turns that effect off if they're in danger. This will hold them in place and stop them from doing weird things in other situations

For the EoC I'd turn it off if:

The EoC that makes the merchant mobile could also unlock the merchant's door temporarily, but then we also need a mechanism that will get them to go back into their position and re-lock the door when the threat has passed.

Maleclypse commented 2 years ago

@Jan-Blasiak I can’t seem to tag you on https://github.com/CleverRaven/Cataclysm-DDA/pull/57072

but it’s been merged and I’m concerned maybe I added your name incorrectly.

I-am-Erk commented 1 year ago

I am making some recommendations to push forward for stable release. For this issue, I suggest that we resolve it in stable only by:

  1. Create a mutation that makes a character unable to move.
  2. Apply that mutation to smokes, the refugee doctor, the broker, Rubik, and any other merchant or similar NPCs that really shouldn't leave their spots.
  3. Although the mutation can be kept in the code (it can be handy for mods), it should only be applied to these NPCs in the G-stable release. It should be removed for H-experimental. This should be a very simple fix. It will not close this issue but it will remove it from release blockers.
I-am-Erk commented 1 year ago

Posting this possibly for my own reference:

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/character.cpp#L3789-L3796

I think easiest is to add a conditional here for "if has trait (no move), skip all this and instead return a speed of 0."

Night-Pryanik commented 1 year ago

Fixed by #62439.

I-am-Erk commented 1 year ago

Technically, as noted above, that solution is meant to be a stopgap. I plan to remove some of those flags after stable, although the solution is robust enough that I may not be as prompt about it. We can perhaps leave this closed, but we'll need a follow up issue about the actual solutions we need.