-
Notifications
You must be signed in to change notification settings - Fork 273
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(UI): make empty-handed unarmed damage bonus more visible #4241
Conversation
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.
we should make this member function (aka methods), Character::display_empty_handed_base_damage()
into a free function display_empty_handed_base_damage()
in character_display.cpp
.
Rationale
We should avoid using/adding member functions at all, in particular for large classes like Character
.
Character
class is gigantic, and is depended by everything. Changing a single line ofcharacter.h
usually results in 300 files having to be rebuilt again, which means ~5 minutes of extra time on average PC.display_empty_handed_base_damage()
only has single usage inbool character_martial_arts::pick_style()
and nowhere else.- it look like does not require any
private
information ofCharacter
, which means its functionality can be replicated as regular functions.
therefore, it looks like there's no pros of it being a member function but only cons, thus i suggest we move this function into character_display.cpp
.
Ah, seems reasonable then. What of the use in player.cpp? I assume that won't work the same if it's not a character function? EDIT: I think I have an idea for that. |
Okay so this errors:
I don't even remotely know what the fuck that means. |
The Autofix app has found code style violation and automatically formatted this Pull Request. I locally edit my commits (e.g: git, github desktop)Please choose following options: I'd like to accept the automated commit
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. This PR is complete and I don't want to edit it anymoreIt's safe to ignore this message. I edit this PR through web UIYou can ignore this message and continue working. I have no idea what this message is talking aboutYou can ignore this message and continue working. If you find any problem, please ask for help and ping @scarf005. |
Co-authored-by: scarf <greenscarf005@gmail.com>
And augh I hate this already ffs
|
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.
also the input parameter should be made const
as it's not modifying Character
in any way; this helps us ensure it's not chainging character state and make debugging easier
Co-authored-by: scarf <greenscarf005@gmail.com>
Co-authored-by: scarf <greenscarf005@gmail.com>
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.
yeet
Purpose of change
It was brought up in #4160 that it might be good to actually tell the player about the bonus somewhere.
Describe the solution
C++ changes:
character_display::display_empty_handed_base_damage
. This prints a number that not only sums up the skill bonus you get, but for bonus points tallies up bonuses from the Fingertip Razors CBM and from mutations (i.e.cut_dmg_bonus
,rand_cut_bonus
, and the like). In the case ofrand_bash_bonus
andrand_cut_bonus
however it only takes into accountmin
, since this only generates a single number as the output.draw_skills_tab
now shows the output of the above number next to your unarmed skill, just like how dodge skill shows your character's effective dodge rating.character_martial_arts::pick_style
so the "pick a style" menu also shows this number below your stats summary, and as a bonus it also shows your effective dodge since both this numbers are relevant.JSON changes:
Describe alternatives you've considered
Making the function properly track the result of random damage bonuses by, if present, printing min and max as two separate numbers.
Testing
@
screen goes up by the expected amount.bash_dmg_bonus
of 2 if both hands are free, and +2 if only one hand is.Additional context
Checklist