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

Add bodygraph with wetness data #63158

Merged
merged 1 commit into from
Jan 22, 2023
Merged

Add bodygraph with wetness data #63158

merged 1 commit into from
Jan 22, 2023

Conversation

Kromgart
Copy link
Contributor

Summary

Features "Add bodygraph displaying wetness status"

Purpose of change

I was making a custom sidebar and noticed that there are bodygraphs for hitpoints, encumbrance, body temperature and bodypart status, but wetness was missing. So I decided to add it to expand modding options.

Describe the solution

This PR adds another bodygraph, which displays wetness of the corresponding body part. The bodygraph can be used same as the other 4 to build custom sidebar widgets (see the attached screenshot).

bodygraph_wet

Sample widget json:

  {
    "id": "body_graph_wet",
    "type": "widget",
    "copy-from": "compact_body_graph_template",
    "var": "body_graph_wet"
  }

Wetness is color-coded as follows:

0%               - light gray (Dry)
0%  <  ... < 30% - light cyan (Damp)
30% <= ... < 60% - light blue (Wet)
60% <= ...       - blue (Soaked)

I took these breakpoints from the code that applies the wetness effect (src/character_body.cpp), and moved them to 2 new constants in weather.h

Describe alternatives you've considered

Testing

Created a widget in a custom sidebar (sample code above), walked around, got wet, got dry (slowly), observed that the bodygraph colors match wetness effects in player info screen '@' and body part wetness percentage in Body Status screen '{'.

Additional context

@Kromgart Kromgart requested a review from dseguin as a code owner January 17, 2023 23:41
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. Mechanics: Weather Rain, snow, portal storms and non-temperature environment <Enhancement / Feature> New features, or enhancements on existing astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 17, 2023
@dseguin dseguin merged commit c2a599a into CleverRaven:master Jan 22, 2023
Willenbrink pushed a commit to Willenbrink/Cataclysm-DDA that referenced this pull request Jan 25, 2023
@Kromgart Kromgart deleted the body_graph_wet branch February 19, 2023 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Mechanics: Weather Rain, snow, portal storms and non-temperature environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants