CleverRaven / Cataclysm-DDA

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

Monsters use ranged attacks w/o line of fire #72853

Open worm-girl opened 8 months ago

worm-girl commented 8 months ago

Describe the bug

Monsters with ranged attacks will attempt to use them so long as they have line of sight to the player. They will not check if it's actually possible for their attack to hit. This has led to a common exploit where players will put a TRANSPARENT tile (commonly a street light) between themselves and a feral human. The feral will then expend all of its ammo uselessly throwing rocks at the player.

This also works with certain car parts.

Attach save file

N/A

Steps to reproduce

Stand next to a street light Spawn a feral human Position yourself so that the light is between you and the feral Watch them waste all their rocks

Expected behavior

Some tiles, like street lights, shouldn't block 100% of ranged attacks. Logically maybe they'd block like 10%? It might be nice if furniture's cover/concealment stat could actually intercept bullets, but maybe that's a separate issue.

Enemies should not take shots that have a 0% chance to hit unless the enemy is totally brainless (ie a turret) or the enemy knows that the tile is breakable. A feral throwing a rock at a window makes sense. A turret shooting at the player through ballistic glass makes sense. In any case, an enemy wasting all their ammo on a 4 inch wide post because an 18 inch wide survivor is standing behind it does not make sense.

Screenshots

No response

Versions and configuration

Additional context

No response

PatrikLundell commented 8 months ago

Well, a turret firing at a character behind ballistic glass makes sense. The fact that the bullets tunnel through the glass and hits the player without damaging the glass does not. That, however, is a tangent to the issue addressed.

ADekema commented 8 months ago

I think ferals are a bad example. They are mend to be borderline brainless throwing rocks at you eventhough they can´t hit you seems exactly suitable. I would rather imagine enemies like mi-go not doing that.

You do have a good point that stuff like streetlamps shouldn´t be blocking ALL projectals based being impassible. The suggestion to have cover block some projectals is interesting. Best way to implement that would probably to reduce the chance that a opponent hits you. What cover effectively does is make you a smaller target.