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 u/npc_spawn_monster to pick randomly from a group for count > 1 #71019

Merged
merged 17 commits into from
Jan 19, 2024

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Jan 17, 2024

Summary

None

Purpose of change

Fixes #70812

Describe the solution

Adds a new field "single_type" that defaults to false but can be defined as true to replicate the old behaviour, I couldn't find any existing EoCs that want appear to want this to occur though (have a couple of ideas how it could be used tho)
Simplifies existing EoCs that were using the workaround of multiple 1 count EoCs
Updates documentation

Describe alternatives you've considered

Testing

Tested using the below EoCs with expected results

  {
    "type": "effect_on_condition",
    "id": "hallucination_swarm_testing",
    "effect": [
      { "u_spawn_monster": "", "hallucination_count": 20, "target_range": 50, "lifespan": [ "2 hours", "9 hours" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "hallucination_swarm_testing_2",
    "effect": [
      { "u_spawn_monster": "", "hallucination_count": 20, "target_range": 50, "lifespan": [ "2 hours", "9 hours" ], "single_target": true }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "hallucination_swarm_testing_3",
    "effect": [
      { "u_spawn_monster": "GROUP_PET_DOGS", "real_count": 20, "group": true }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "hallucination_swarm_testing_4",
    "effect": [
      { "u_spawn_monster": "GROUP_PET_DOGS", "real_count": 20, "group": true, "single_target": true }
    ]
  }

If anyone can think of anything else I should test comment below

Additional context

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 17, 2024
src/npctalk.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Mods: Defense Mode Anything to do with the Defense Mode mod EOC: Effects On Condition Anything concerning Effects On Condition Scenarios New Scenarios, balancing, bugs with scenarios labels Jan 17, 2024
@Procyonae Procyonae marked this pull request as ready for review January 17, 2024 16:08
src/npctalk.cpp Outdated Show resolved Hide resolved
src/npctalk.cpp Outdated Show resolved Hide resolved
@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 Jan 17, 2024
@Procyonae Procyonae marked this pull request as draft January 17, 2024 21:42
Copy link
Member

@GuardianDll GuardianDll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me
Didn't know default can be used with math

@Procyonae Procyonae marked this pull request as ready for review January 17, 2024 22:37
@Maleclypse Maleclypse merged commit d04b299 into CleverRaven:master Jan 19, 2024
26 checks passed
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. 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 Mods: Defense Mode Anything to do with the Defense Mode mod Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership Scenarios New Scenarios, balancing, bugs with scenarios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make u_spawn_monster works properly with mongroups
3 participants