-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix projectile interaction with obstacles; remove ACID_DROP from documentation #17759
Conversation
Now that the projectile's speed is a determining factor in deciding whether it's a bullet or not, throwing axes can't go through dressers anymore.
im not sure coorosives spit enough acid to make a puddle. in fact, im sure it was removed because its annoying unavoidable damage and encourages minmaxing. corrosive acid doesnt puddle when it hits a player, unless thats been readded very recently |
You're right, it was removed in #14775. |
proj_arg.impact.damage_units.end(), | ||
[]( const damage_unit &dam ) | ||
{ | ||
return dam.type == DT_CUT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make thrown rocks stop at windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRL, a rock that's badly aimed, weakly thrown, or thrown from far away might not go through a window. With 2 throwing, 5 strength, 5 dexterity, and from 1 tile away, 4 out of 14 throws broke a window. With 2 throwing, 8 strength, and 8 dexterity, you can reliably break it from 3 tiles away. With 0 throwing, 8 strength, and 8 dexterity, you can reliably break a window from 2 tiles away. With 1 throwing, 5 strength, and 5 dexterity, it's very difficult (but possible) to break a window from 1 tile away.
EDIT: All the tests had 7-8 perception.
This check gates whether or not a projectile could go through furniture or terrain. It's gating by speed, obviously, but also by damage type. But, why? This commit fixes a problem where you could not shoot through fences. This problem has also appeared in the past, and in both instances, it was because of this damage type check. So, clearly this damage type check does something, but does it do what it's supposed to? Going back to the commit that introduced it, a037977, it shows that it was introduced because the author or that commit though it was the only way to tell if a projectile was a bullet or not. In the commit after next, the author also adds the projectile speed check. Going to the PR that commit is included in, CleverRaven#17759, it reveals that this was likely introduced to prevent corrosive zombies from using their acid spit over things like dressers and through things like chain link fences. And indeed, removing this allows them to spit through these furnitures, but more importantly, through reinforced vehicle glass. So, let's use an ammo effect instead to determine if it should penetrate obstacles or not.
This check gates whether or not a projectile could go through furniture or terrain. It's gating by speed, obviously, but also by damage type. But, why? This commit fixes a problem where you could not shoot through fences. This problem has also appeared in the past, and in both instances, it was because of this damage type check. So, clearly this damage type check does something, but does it do what it's supposed to? Going back to the commit that introduced it, a037977, it shows that it was introduced because the author or that commit though it was the only way to tell if a projectile was a bullet or not. In the commit after next, the author also adds the projectile speed check. Going to the PR that commit is included in, CleverRaven#17759, it reveals that this was likely introduced to prevent corrosive zombies from using their acid spit over things like dressers and through things like chain link fences. And indeed, removing this allows them to spit through these furnitures, but more importantly, through reinforced vehicle glass. So, let's use an ammo effect instead to determine if it should penetrate obstacles or not.
This check gates whether or not a projectile could go through furniture or terrain. It's gating by speed, obviously, but also by damage type. But, why? This commit fixes a problem where you could not shoot through fences. This problem has also appeared in the past, and in both instances, it was because of this damage type check. So, clearly this damage type check does something, but does it do what it's supposed to? Going back to the commit that introduced it, a037977, it shows that it was introduced because the author or that commit though it was the only way to tell if a projectile was a bullet or not. In the commit after next, the author also adds the projectile speed check. Going to the PR that commit is included in, CleverRaven#17759, it reveals that this was likely introduced to prevent corrosive zombies from using their acid spit over things like dressers and through things like chain link fences. And indeed, removing this allows them to spit through these furnitures, but more importantly, through reinforced vehicle glass. So, let's use an ammo effect instead to determine if it should penetrate obstacles or not.
This check gates whether or not a projectile could go through furniture or terrain. It's gating by speed, obviously, but also by damage type. But, why? This commit fixes a problem where you could not shoot through fences. This problem has also appeared in the past, and in both instances, it was because of this damage type check. So, clearly this damage type check does something, but does it do what it's supposed to? Going back to the commit that introduced it, a037977, it shows that it was introduced because the author or that commit though it was the only way to tell if a projectile was a bullet or not. In the commit after next, the author also adds the projectile speed check. Going to the PR that commit is included in, CleverRaven#17759, it reveals that this was likely introduced to prevent corrosive zombies from using their acid spit over things like dressers and through things like chain link fences. And indeed, removing this allows them to spit through these furnitures, but more importantly, through reinforced vehicle glass. So, let's use an ammo effect instead to determine if it should penetrate obstacles or not.
Fixes #17709.
Non-bullet projectiles will only penetrate an impassable obstacle if it destroys the obstacle and still has momentum afterwards (e.g. throwing axe vs. window). Bullet projectiles (those that deal DT_CUT and have a high speed) will penetrate an impassable obstacle whether it destroys the obstacle or not, as long as it has momentum after hitting it.
Also, it's a little odd that the acid that corrosives spit disappears if it hits the ground (and not a creature). I noticed that there is a documented ammo effect in
doc/JSON_FLAGS.md
calledACID_DROP
that "creates a tiny field of weak acid." Strangely, it wasn't implemented, so I implemented it and added it to the projectile created bymattack::acid_accurate
.This has the effect of buffing corrosives a bit. In testing, it appears that if you leave the field as soon as it appears under your feet, the field will cause about 10 damage if you have no clothes on your legs or feet, or 5 damage when wearing socks/boots and briefs/cargo pants.