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

Allow more dialog use of arithmetic, small portal storm rebalance. #57983

Merged
merged 14 commits into from
May 31, 2022

Conversation

Ramza13
Copy link
Contributor

@Ramza13 Ramza13 commented May 28, 2022

Summary

None

Purpose of change

Part of #52475
Allow using arithmateic in more places to reduce needed json.
Adjust portal storm values, portal storms are less freqent and shorter.

Describe the solution

Had to move arithmatec from npctalk.cpp to conditions.cpp and switch some uses of talker for dialog which involved a ton of converting over code to use templates. Yeesh I wish there was an easier way.

Describe alternatives you've considered

So many, didn't want to have to refactor this many things but its a gnarly part of code. Maybe should have just ripped out the template stuff.

Testing

Used this json

{
    "type": "effect_on_condition",
    "id": "test",
    "effect": [
      {
        "u_spawn_monster": "mon_absence",
        "real_count": { "arithmetic": [ { "const": 1 }, "+", { "const": 1 } ] },
        "outdoor_only": true,
        "min_radius": 3,
        "max_radius": 20,
        "lifespan": [ "45 seconds", "5 minutes" ],
        "spawn_message": "The very notion of empty space is made a cruel joke.  Nearby nothing becomes even less."
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "test2",
    "effect": [
      {
        "u_spawn_monster": "mon_absence",
        "real_count": { "arithmetic": [ { "arithmetic": [ { "const": 1 }, "+", { "const": 1 } ] }, "+", { "const": 1 } ] },
        "outdoor_only": true,
        "min_radius": 3,
        "max_radius": 20,
        "lifespan": [ "45 seconds", "5 minutes" ],
        "spawn_message": "The very notion of empty space is made a cruel joke.  Nearby nothing becomes even less."
      }
    ]
  }

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON [Markdown] Markdown issues and PRs Code: Tests Measurement, self-control, statistics, balancing. EOC: Effects On Condition Anything concerning Effects On Condition Mechanics: Enchantments / Spells Enchantments and spells Missions Quests and missions NPC / Factions NPCs, AI, Speech, Factions, Ownership json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 28, 2022
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label May 29, 2022
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label May 29, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 30, 2022
@dseguin dseguin merged commit 0f30e55 into CleverRaven:master May 31, 2022
@Ramza13 Ramza13 deleted the arith_int_or_var branch May 31, 2022 19:30
bombasticSlacks pushed a commit to bombasticSlacks/Cataclysm-DDA that referenced this pull request Jun 10, 2022
…leverRaven#57983)

* nested rithmetic

* Move over existing json

* Update portal_storm_effect_on_condition.json

* fix

* linker?

* Fix

* Update condition.cpp

* Update condition.cpp

* stupid linker making this code worse

* Update condition.cpp

* Update condition.cpp

* Update condition.cpp

* Update condition.cpp

* Update condition.h
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` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mechanics: Enchantments / Spells Enchantments and spells Missions Quests and missions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants