-
Notifications
You must be signed in to change notification settings - Fork 276
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
feat(balance): extend and improve ranged_bash_info
to allow taking cover behind furniture
#4129
Conversation
This reverts commit b4c8c72.
I forgot I'd started messing with an earlier failed attempt to implement this idea on my laptop under a branch of the same name, augh |
ranged_bash_info
to allow taking cover behind furniture
The one that explodes doesn't need more fire, instead have the initial stage ignite if shot up like gas pump terrain does.
@@ -98,7 +101,7 @@ | |||
"name": "sandbag barricade", | |||
"symbol": "#", | |||
"bgcolor": "brown", | |||
"description": "A sandbag barricade, typically used for blocking bullets.", | |||
"description": "A sandbag barricade, typically used for blocking bullets. Stand next to it to fire past it unimpeded.", |
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.
i think this line should be programmatically generated for all terrain that has bash.ranged
, unless it'd be too much code duplication.
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.
That'd be a bit of effort yeah. We'd also have to restrict it to only ones that use block_unaimed_chance
.
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.
Any that are also TRANSPARENT gain a block_unaimed_chance roughly modeled after their coverage value.
maybe block_unaimed_chance
should be computed from TRANSPARENT
and coverage?
overall, i think it may be better in the long term to avoid manually computed values as much as possible and prefer computed properties.
That's gonna be a pain in the ass, yeah. Biggest issue with it though is just the fact that |
maybe we could still keep |
I just realized another issue with making this use coverage: a closed window logically should stop shots 100% of the time, but it needs coverage defined in order for the "crouch behind it to hide" behavior to work. Working around that would require it to treat coverage as 0% by default if unspecified instead of 100%, and then to work around THAT we'd have to specify a whole fuckload of terrains with explicit 100% coverage... EDIT: The window problem is also the definitive example of why auto-generating it from "transparent and has coverage" at all is probably more pain than it's worth. |
EDIT: after offline discussion, yes i now understand window shouldn't have 100% coverage because it'd be half wall and half glass, and |
Gonna hope this goes well then, had done some more testing and faffing about so... |
Purpose of change
This improves how ballistic resistance data for terrain/furniture bashing is used. Not only does it extend it to be accessible by furniture, it sets it up to be used for some basic cover mechanics to finally increase one's options a bit beyond the level of "block line of sight so enemy can't shoot me but I can't shoot them" along with a few assorted improvements to the underlying code.
Describe the solution
C++ changes:
map::shoot
considerably. The big one of course is now furniture can supportranged_bash_info
in addition to terrain. In addition, the function now grabs the position of the shooter, and ifblock_unaimed_chance
is used by the terrain/furniture in question, the shooter can shoot over adjacent obstacles unimpeded. This allows you to, for example, take cover by standing behind a sandbag barricade and have it potentially negate enemy shots without blocking yours. Set up the way it is so you can't exploit this to shoot clean through stuff like full-on sandbag walls or ballistic glass just by standing next to it. Shots that have damaged reduced but not negated also now print a message so it's more clear that successful intercepts are actually happening, but now the intercept messages only print if there's actual RNG involved in whether it blocks the shot (i.e. ifblock_unaimed_chance
is set, that way it doesn't spam intercept messages for stuff that will always block shots like ballistic glass). Lastly, the effect of potentially destroying the terrain being hit was moved to print AFTER theadd_msg
section, preventing cases where the message says your bullet punched through "nothing" because it detroyed a sandbag barricade that intercepted the shot.map::shoot
in ballistics.cpp and ranged_aoe.cpp to pass the new origin value to the function. In the latter case, origin and target points are identical to allow for AoE cones to bypass cover randomized cover entirely.JSON changes:
coverage
value.reduction
tends to be close tostr_min
for thin stuff not typically expected to soak up bullets, while stuff clearly expected to protect you like sandbags use values closer to or sometimes above theirstr_max
.destroy_threshold
generally tends to either matchstr_max
or be a bit higher or lower depending on which made more sense. Any that are alsoTRANSPARENT
gain ablock_unaimed_chance
roughly modeled after theircoverage
value.TRANSPARENT
like washing machines, driers, smaller grid batteries etc, and thus giving their ballistic datablock_unaimed_chance
.Describe alternatives you've considered
execute_shaped_attack
's use ofmap::shoot
to useorigin
instead ofp
for its first argument, but I'd be leery of that since we probably want some AoE attacks to ignore cover entirely. But we might also want some to not ignore cover...augh.block_unaimed_chance
high if the target is crouching.Testing
Additional context
I plan to follow up on this with two additional updates:
Checklist