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

Fix projectile interaction with obstacles; remove ACID_DROP from documentation #17759

Merged
merged 7 commits into from
Jul 25, 2016

Conversation

sethsimon
Copy link
Contributor

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 called ACID_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 by mattack::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.

sethsimon added 5 commits July 19, 2016 21:55
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.
@pisskop
Copy link
Contributor

pisskop commented Jul 21, 2016

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
corrosive acid burns the players via damage over time if it hits, targetted. the puddle is redundant

@sethsimon
Copy link
Contributor Author

You're right, it was removed in #14775.

proj_arg.impact.damage_units.end(),
[]( const damage_unit &dam )
{
return dam.type == DT_CUT;
Copy link
Contributor

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.

Copy link
Contributor Author

@sethsimon sethsimon Jul 21, 2016

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.

@sethsimon sethsimon changed the title Fix projectile interaction with obstacles; give corrosives ACID_DROP Fix projectile interaction with obstacles; remove ACID_DROP from documentation Jul 21, 2016
@Coolthulhu Coolthulhu self-assigned this Jul 25, 2016
@Coolthulhu Coolthulhu merged commit 24d829b into CleverRaven:master Jul 25, 2016
@sethsimon sethsimon deleted the corrosive branch August 4, 2016 19:53
anothersimulacrum added a commit to anothersimulacrum/Cataclysm-DDA that referenced this pull request Apr 14, 2020
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.
anothersimulacrum added a commit to anothersimulacrum/Cataclysm-DDA that referenced this pull request Apr 18, 2020
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.
anothersimulacrum added a commit to anothersimulacrum/Cataclysm-DDA that referenced this pull request Apr 18, 2020
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.
tung pushed a commit to tung/Cataclysm-DDA that referenced this pull request Aug 9, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants