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

Muscle strain: pass 1 #72733

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
972a47b
Step 1: Adds a very crude value for strain
I-am-Erk Mar 30, 2024
16196d2
apply strain in a few spots where it is easy
I-am-Erk Mar 30, 2024
5a6e77d
burn_energy_arms uses strain too
I-am-Erk Mar 31, 2024
d1643a7
Widget quick fix by Renech
I-am-Erk Apr 5, 2024
c63d889
Fix widget. Strain works now.
I-am-Erk Apr 5, 2024
9d2dd4f
some balance adjustments
I-am-Erk Apr 5, 2024
bef204e
this isn't working but should stop attacks at high strain
I-am-Erk Apr 6, 2024
dfb8990
Merge branch 'master' into strain-pass-1
I-am-Erk Apr 6, 2024
3758a56
Too much strain stops you from bashing and smashing
I-am-Erk Apr 6, 2024
385254d
Merge branch 'strain-pass-1' of https://github.com/i-am-erk/Cataclysm…
I-am-Erk Apr 6, 2024
83e468b
Nearly ready for primetime maybe
I-am-Erk Apr 7, 2024
f1dfaaa
Astyle
I-am-Erk Apr 7, 2024
e3a9e2e
I SHOULD NOT BE TRUSTED WITH UI (#32)
RenechCDDA Apr 8, 2024
a5a320c
modify burn to not build too fast
I-am-Erk Apr 9, 2024
5ac22d5
Update src/character.h
I-am-Erk Apr 11, 2024
d3e4437
Update effective_dps_test.cpp
I-am-Erk Apr 13, 2024
505953c
Update strain.json
I-am-Erk Apr 13, 2024
24b468c
Update strain.json
I-am-Erk Apr 13, 2024
ed29c78
Try to fix text analyzer
I-am-Erk Apr 13, 2024
f39a4d8
Merge remote-tracking branch 'upstream/master' into strain-pass-1
I-am-Erk Apr 13, 2024
eeda6a8
adjust and disable tests while strain is in flux
I-am-Erk Apr 14, 2024
e82b078
Update enchantments_test.cpp
I-am-Erk Apr 14, 2024
f71c39f
ensure strain doesn't run out in attack tests
I-am-Erk Apr 14, 2024
2115f3b
Merge remote-tracking branch 'upstream/master' into strain-pass-1
I-am-Erk Apr 14, 2024
1ae56f1
Update enchantments_test.cpp
I-am-Erk Apr 14, 2024
eee1889
Update tests/enchantments_test.cpp
I-am-Erk Apr 14, 2024
c9bf64e
Update monster_attack_test.cpp
I-am-Erk Apr 14, 2024
e6b89e1
Merge branch 'strain-pass-1' of https://github.com/i-am-erk/Cataclysm…
I-am-Erk Apr 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions data/core/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@
"stype": "int",
"value": 15
},
{
"type": "EXTERNAL_OPTION",
"name": "PLAYER_BASE_STRAIN",
"info": "Sets the base max strain value of the player, before cardio modifiers.",
"stype": "int",
"value": 3000
},
{
"type": "EXTERNAL_OPTION",
"name": "PLAYER_BASE_STRAIN_REGEN_RATE",
"info": "Sets base strain regeneration per turn of the player, before modifiers. May be used as an offset in strain draining effects.",
"stype": "float",
"value": 120
},
{
"type": "EXTERNAL_OPTION",
"name": "PLAYER_HUNGER_RATE",
Expand Down
2 changes: 1 addition & 1 deletion data/json/ui/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"style": "layout",
"label": "Stamina/Weariness",
"arrange": "rows",
"widgets": [ "stamina_graph", "activity_desc", "weariness_desc", "weary_malus_desc" ]
"widgets": [ "stamina_graph", "strain_and_burn_fake_graph", "activity_desc", "weariness_desc", "weary_malus_desc" ]
},
{
"id": "mood_focus_layout",
Expand Down
25 changes: 25 additions & 0 deletions data/json/ui/stamina.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,31 @@
"width": 10,
"symbols": ".\\|"
},
{
"id": "strain_widget",
"type": "widget",
"var": "strain",
"colors": [ "c_green", "c_light_green", "c_yellow", "c_light_red", "c_red" ]
},
{
"id": "strain_graph_classic",
"type": "widget",
"copy-from": "strain_widget",
"label": "Strain",
"style": "graph",
"width": 5,
"symbols": ".\\|"
},
{
"id": "strain_graph",
"type": "widget",
"copy-from": "strain_widget",
"//": "Like the classic 5-bar stamina graph, but twice as wide",
"label": "Strain",
"style": "graph",
"width": 10,
"symbols": ".\\|"
},
{
"id": "stamina_num_label",
"type": "widget",
Expand Down
251 changes: 251 additions & 0 deletions data/json/ui/strain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
[
{
"id": "strain_and_burn_fake_graph",
"type": "widget",
"style": "symbol",
"label": "Strain",
"label_align": "left",
"width": 10,
"clauses": [
{
"//0": "To those this may offend,",
"//1": "Sorry.",
"//2": "/* ----- BEGIN: STRAIN LISTING ----- */",
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 - 1" ] },
"id": "strain_1",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 2 - 1" ] },
"id": "strain_2",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 3 - 1" ] },
"id": "strain_3",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 4 - 1" ] },
"id": "strain_4",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 5 - 1" ] },
"id": "strain_5",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 6 - 1" ] },
"id": "strain_6",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 7 - 1" ] },
"id": "strain_7",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 8 - 1" ] },
"id": "strain_8",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 9 - 1" ] },
"id": "strain_9",
"color": "yellow",
"sym": "="
},
{
"condition": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') - 1" ] },
"id": "strain_10",
"color": "yellow",
"sym": "=",
"//0": "/* ----- END: STRAIN LISTING ----- */"
},
{
"//0": "/* ----- BEGIN: SEPERATOR LISTING ----- */",
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 - 1" ] } }
]
},
"id": "seperator_1",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 2 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 2 - 1" ] } }
]
},
"id": "seperator_2",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 3- 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 3 - 1" ] } }
]
},
"id": "seperator_3",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 4 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 5 - 1" ] } }
]
},
"id": "seperator_4",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 5 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 5 - 1" ] } }
]
},
"id": "seperator_5",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 6 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 6 - 1" ] } }
]
},
"id": "seperator_6",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 7 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 7 - 1" ] } }
]
},
"id": "seperator_7",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 8 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 8 - 1" ] } }
]
},
"id": "seperator_8",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') / 10 * 9 - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 9 - 1" ] } }
]
},
"id": "seperator_9",
"color": "white",
"sym": "-"
},
{
"condition": {
"and": [
{ "not": { "math": [ "u_val('strain') + u_val('strain_burn')", "<=", "u_val('strain_max') - 1" ] } },
{ "not": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') - 1" ] } }
]
},
"id": "seperator_10",
"color": "white",
"sym": "-",
"//0": "/* ----- END: SEPARATOR LISTING ----- */"
},
{
"//0": "/* ----- BEGIN: BURN LISTING ----- */",
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 - 1" ] },
"id": "burn_1",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 2 - 1" ] },
"id": "burn_2",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 3 - 1" ] },
"id": "burn_3",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 4 - 1" ] },
"id": "burn_4",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 5 - 1" ] },
"id": "burn_5",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 6 - 1" ] },
"id": "burn_6",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 7 - 1" ] },
"id": "burn_7",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 8 - 1" ] },
"id": "burn_8",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') / 10 * 9 - 1" ] },
"id": "burn_9",
"color": "red",
"sym": "#"
},
{
"condition": { "math": [ "u_val('strain_burn')", ">=", "u_val('strain_max') - 1" ] },
"id": "burn_10",
"color": "red",
"sym": "#",
"//0": "/* ----- END: BURN LISTING ----- */"
}
],
"default_clause": { "text": "----------", "color": "white" }
}
]
3 changes: 3 additions & 0 deletions doc/NPCs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,9 @@ These can be read or written to with `val()`.
| `stim` | ✅ | Current stim level. |
| `stored_kcal` | ✅ | Stored kcal in the character's body. 55'000 is considered healthy. |
| `stored_kcal_percentage` | ✅ | a value of 100 represents 55'000 kcal, which is considered healthy. |
| `strain` | ✅ | Current muscle strain. Note that this value decreases with activity, the values are the inverse of what you might expect. |
| `strain_burn` | ❌ | Current muscle burn. |
| `strain_max` | ❌ | Maximum muscle strain. Note that this value decreases with activity, scaling with acquired burn. |
| `strength`<br/>`dexterity`<br/>`intelligence`<br/>`pereception` | ✅ | Current attributes |
| `strength_base`<br/>`dexterity_base`<br/>`intelligence_base`<br/>`perception_base` | ✅ | Base attributes |
| `strength_bonus`<br/>`dexterity_bonus`<br/>`intelligence_bonus`<br/>`pereception_bonus` | ✅ | Bonus attributes |
Expand Down
Loading
Loading