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

Condition: count spells by spell class #67946

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Aug 30, 2023

Summary

None

Purpose of change

Very simple and quick addition.

Describe the solution

Adds a u_val variable called "spell_count" that returns the number of spells that a character knows. An optional "school" parameter will make it return only the number of spells known of that school/spell class.

Describe alternatives you've considered

Testing

Quick & dirty test in-game with these EOCs (with Magiclysm)
{
  "type": "effect_on_condition",
  "id": "TEST_SPELL_COUNT_RAW",
  "recurrence": 1,
  "condition": { "compare_num": [ { "u_val": "spell_count" }, "=", { "const": 3 } ] },
  "effect": [
    {
      "u_message": "TEST: you have 3 (TOTAL) spells.",
      "type": "good"
    }
  ]
},
{
  "type": "effect_on_condition",
  "id": "TEST_SPELL_COUNT_SCHOOL",
  "recurrence": 1,
  "condition": { "compare_num": [ { "u_val": "spell_count", "school": "MAGUS" }, "=", { "const": 3 } ] },
  "effect": [
    {
      "u_message": "TEST: you have 3 (MAGUS) spells.",
      "type": "good"
    }
  ]
}

Debugging 3 non-magus spells into the player and activating both EOCs, only the first (non-school-specific) one activates. Adding another 3 magus spells (6 total) and activating both EOCs, only the second (school-specific) one activates.

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs EOC: Effects On Condition Anything concerning Effects On Condition <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 30, 2023
@Maleclypse Maleclypse merged commit fd60fc1 into CleverRaven:master Aug 30, 2023
@dseguin dseguin deleted the spell_count_cond branch August 30, 2023 19:27
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-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Condition spell_count by school
2 participants