Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Math mutation category

Open GuardianDll opened this issue 1 year ago • 2 comments

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>" }
    ]
  },

image

GuardianDll avatar Sep 10 '24 22:09 GuardianDll

Saved from the JSON mines

Standing-Storm avatar Sep 11 '24 04:09 Standing-Storm

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

Maleclypse avatar Sep 12 '24 20:09 Maleclypse