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

Math mutation category #76341

Merged
merged 7 commits into from
Sep 14, 2024

Conversation

GuardianDll
Copy link
Member

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

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions labels Sep 10, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Sep 10, 2024
@Standing-Storm
Copy link
Contributor

Saved from the JSON mines

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 11, 2024
@Maleclypse
Copy link
Member

Maleclypse commented Sep 12, 2024

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

@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Sep 12, 2024
@Maleclypse Maleclypse merged commit 2fba219 into CleverRaven:master Sep 14, 2024
25 of 26 checks passed
@GuardianDll GuardianDll deleted the math_mutation_category branch September 14, 2024 14:14
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 <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A method for math to check how many mutations in a given category a character has
3 participants