-
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): uncanny dodge can now actually roll to dodge bullets #4125
feat(balance): uncanny dodge can now actually roll to dodge bullets #4125
Conversation
src/character_functions.cpp
Outdated
@@ -602,7 +602,7 @@ bool try_uncanny_dodge( Character &who ) | |||
bool is_u = who.is_avatar(); | |||
bool seen = is_u || get_player_character().sees( who ); | |||
std::optional<tripoint> adjacent = pick_safe_adjacent_tile( who ); | |||
if( adjacent ) { | |||
if( adjacent && x_in_y( who.get_dodge(), 10 ) ) { |
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 way you don't get to just dodge infinite bullets for free
I think it's a bit unfair, as
- dodging consumes huge amount of electric charges
- you may waste huge amount of electric charges and still fail
- it introduces rng to uncanny dodge, which taints
Creature::ranged_target_size
. this might make debugging it harder.
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.
As already written it was already set up so if you had no space to dodge it would automatically fail and waste charges, so only real break with consistency is it becoming based on your dodge skill.
@@ -532,6 +532,9 @@ static double occupied_tile_fraction( m_size target_size ) | |||
|
|||
double Creature::ranged_target_size() const | |||
{ | |||
if( const_cast<Creature &>( *this ).uncanny_dodge() ) { |
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 we should avoid using const_cast
because this breaks the promise that Creature::ranged_target_size() const
will never modify itself (hence const
).
we should probably separate uncanny_dodge
into "check if it's possible to uncanny dodge" and "actually do uncanny dodge".
After some discussion about it on the discord last night and thinking on it, closing in favor of #4139 |
Co-Authored-By: scarf <greenscarf005@gmail.com>
Aight, after some tinkering with it, I eventually decided it's maybe reasonable to reopen this and see which is a better method. The new method no longer just lets you get hit purely based off RNG, instead:
Idea is that the bionic lets you casually wade through individual shots so long as that's all you're dealing with, but taking on a whole firing squad or mixing it up with enemies in melee while being shot at requires higher skill to pull off, and more dakka can potentially overwhelm you. But as a benefit, it pairs well with any martial arts, enchantments, etc that grant bonus dodges by giving you increased breathing room if those rolls fail. |
Autofix has formatted code style violation in this PR. I edit commits locally (e.g: git, github desktop) and want to keep autofix
I do not want the automated commit
If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT. |
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'd like to revisit on physically dodging with cool vfx but that's for another day...
Purpose of change
closes #4139
This finally makes the description for Uncanny Dodge CBM no longer misleading. This now allows you to actually dodge bullets when shot at while using it. In exchange however it no longer works flawlessly 100% of the time, instead it will either dodge based on your skill, falling back on a limited number of dodges per turn based on dodges per turn.
Describe the solution
C++ changes:
try_uncanny_dodge
so that it no longer moves you around, and instead performs a two-part check. First, checks the user's effective dodge level (including effects of encumbrance, mutations, etc) so that dodge skill actually matters for this, and if so the attack is dodged completely for free. If not, you only get a dodge if you have dodges left that turn, if not then you take a hit as you would if out of power. Moving around was found to be less than ideal during further testing, as it jitters you around erratically and negates an entire burst of enemy fire when it triggers, preventing the "can overwhelm the user with more dakka" concept from working right.Creature::ranged_target_size
so that a character triggering a successful application of Uncanny Dodge returns as being impossible to hit. The main consequence of this is that, based on your dodging ability, you can now indeed dodge bullets and not just specific hardcoded monster attacks.JSON changes:
BONUS_DODGE
actually grants bonus dodge attempts like martial art buffs, enchantment values can't directly mess with effective dodge currently.Describe alternatives you've considered
BONUS_DODGE
so it applies to effective dodge and not dodge attempts, so we don't have to use the hacky solution of a hidden mutation.Testing
@
screen, activating the CBM has dodge go from 3.0/0 to 5.0/0.Additional context
DDA's workaround for this problem was to just remove the mention of dodging bullets from the CBM description, PR done by @sonphantrung: CleverRaven/Cataclysm-DDA#59733
Checklist