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

[Done] Pain descriptions w/o SELFAWARE trait #24894

Merged
merged 11 commits into from Sep 6, 2018

Conversation

vircung
Copy link
Contributor

@vircung vircung commented Aug 17, 2018

Players without SELFAWARE trait won't see exact pain level number. Current considerations:

  • pain thresholds are / 10.f floating point operation
  • pain 0 is correctly detected as No pain
  • get_perceived_pain is not yet offset by 1, so 0-9 pain will be considered as No Pain
  • pain description had to be moved a a bit to not to be overwritten
  • pain description are taken from issue comment
  • there is no "max pain" level so far, or at least I didn't found it

closes #24700

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");
Copy link
Contributor

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
@woutershep
Copy link
Contributor

I'm pretty sure you don't want the modulo operator but want the division operator.

@vircung
Copy link
Contributor Author

vircung commented Aug 17, 2018

Modulo operator will split get_perceived_pain into event 10 point range groups. Reminder is useless at this point and provides no value.

@jniscior
Copy link

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
8 Pain % 10 = 8 = Unmanageable
56 Pain % 10 = 6 = Distracting

Also Severe level is impossible to reach because there is no such X that (X % 10) > 9 is true.
Also when it comes to naming the scales Severe seems like it should have a lesser value than Unmanageable.

@vircung
Copy link
Contributor Author

vircung commented Aug 17, 2018

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.
Number of thresholds, value span and it's naming is open for discussion, ideally by more experienced players.

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() );
Copy link
Contributor

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());
Copy link
Contributor

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.

@ZhilkinSerg ZhilkinSerg added Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels Aug 18, 2018
@vircung
Copy link
Contributor Author

vircung commented Sep 3, 2018

Examples of longest description of pain/hunger/thirst/mood area with double digit stats.

zrzut ekranu 2018-09-03 o 16 46 01

zrzut ekranu 2018-09-03 o 16 46 34

@vircung vircung changed the title [CR] Pain descriptions w/o SELFAWARE trait [Done] Pain descriptions w/o SELFAWARE trait Sep 3, 2018
@ZhilkinSerg ZhilkinSerg self-assigned this Sep 6, 2018
@ZhilkinSerg ZhilkinSerg merged commit b5df7f8 into CleverRaven:master Sep 6, 2018
@ZhilkinSerg ZhilkinSerg removed their assignment Sep 6, 2018
@vircung vircung deleted the pain-descriptions branch September 6, 2018 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exact pain number should only be visible by character with "Self aware" trait
6 participants