Cataclysm-DDA
Cataclysm-DDA copied to clipboard
Math mutation category
Summary
None
Purpose of change
Save ourselves from atrocities of the devil Close #73008
Describe the solution
Implement what 73008 describes
Testing
{
"type": "effect_on_condition",
"id": "AAAAAAAAAAAAAAA",
"effect": [
{ "math": [ "_x", "=", "u_sum_traits_of_category('RAT', 'type': 'POSITIVE')" ] },
{ "math": [ "_y", "=", "u_sum_traits_of_category_char_has('RAT', 'type': 'POSITIVE')" ] },
{ "u_message": "POSITIVE MUT OF RAT = <context_val:x>" },
{ "u_message": "POSITIVE MUT OF RAT U HAVE = <context_val:y>" }
]
},
{
"type": "effect_on_condition",
"id": "BBBBBBBBBBBBBBBBBB",
"effect": [
{ "math": [ "_x", "=", "u_sum_traits_of_category('RAT')" ] },
{ "math": [ "_y", "=", "u_sum_traits_of_category_char_has('RAT')" ] },
{ "u_message": "MUT OF RAT = <context_val:x>" },
{ "u_message": "MUT OF RAT U HAVE = <context_val:y>" }
]
},
Saved from the JSON mines
Error: /home/runner/work/Cataclysm-DDA/Cataclysm-DDA/src/mutation.cpp:243:9: error: Value stored to 'is_type' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
243 | is_type = false;
| ^ ~~~~~
/home/runner/work/Cataclysm-DDA/Cataclysm-DDA/src/mutation.cpp:243:9: note: Value stored to 'is_type' is never read
243 | is_type = false;
| ^ ~~~~~
Clang error