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
[Done] Pain descriptions w/o SELFAWARE trait #24894
Conversation
Pain threshold description will be used to hide exact pain number for players without `SELFAWARE` trait. references CleverRaven#24700
Player without `SELFAWARE` won't see exact pain level number. Instead player will see pain threshold description. Currently longest pain description is `Uncomfortable` and it'll be rendered under player morale. Given that pain threshold needs to be moved a bit. references CleverRaven#24700
src/creature.cpp
Outdated
} else if(scale > 7) { | ||
return _("Unmanageable"); | ||
} else if(scale > 6) { | ||
return _("Intense"); |
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.
Intense is used for both >6 and >8
Simple duplicate-copy-paste error
I'm pretty sure you don't want the modulo operator but want the division operator. |
Modulo operator will split |
Perhaps I'm dumb, but... @woutershep is definitely right here. Are you sure you know how modulo operation works? Because what modulo returns is the remainder. 90 Pain % 10 = 0 = No pain Also Severe level is impossible to reach because there is no such X that (X % 10) > 9 is true. |
Sorry for trying to defend own brain fart. Of course You are right about type of operation. Mea culpa. For naming scales implementation initially adopted naming convention from related Issue comment pain scale. |
src/sidebar.cpp
Outdated
@@ -440,8 +440,11 @@ void player::disp_status( const catacurses::window &w, const catacurses::window | |||
} else if( get_perceived_pain() >= 40 ) { | |||
col_pain = c_light_red; | |||
} | |||
if( get_perceived_pain() > 0 ) { | |||
|
|||
if( has_trait( trait_SELFAWARE ) ) { | |||
mvwprintz( w, sideStyle ? 0 : 3, 0, col_pain, _( "Pain %d" ), get_perceived_pain() ); |
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.
If player has the Self-Aware trait, it will always show the Pain %d
line, even if there is no pain at all?
src/sidebar.cpp
Outdated
mvwprintz( w, sideStyle ? 0 : 3, 0, col_pain, _( "Pain %d" ), get_perceived_pain() ); | ||
} else if( get_perceived_pain() > 0 ) { | ||
mvwprintz( w, sideStyle ? 1 : 2, 0, col_pain, get_pain_scale()); |
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.
What is the get_pain_scale
function? Maybe you meant get_pain_description
that you added?
Also it will show just text like Severe
in the sidebar. I suggest change it so it'll look like Pain: Severe
, or probably Severe Pain
.
Changing calculation to floating point number allow detecting if we're in scale range. Lowering scale by one provides correct way to detect `No Pain` for value of 0, `Minimal` for 1-10, `Mild` for 11-20 and so on
Players without
SELFAWARE
trait won't see exact pain level number. Current considerations:/ 10.f
floating point operationpain 0
is correctly detected asNo pain
get_perceived_pain
is not yet offset by 1, so 0-9 pain will be considered asNo Pain
closes #24700