Skip to content

AGE Official Update: Improve spell labels and attack spell metadata - #98

Open
nighthunter226-but-real wants to merge 9 commits into
Roll20:mainfrom
nighthunter226-but-real:label-issues
Open

AGE Official Update: Improve spell labels and attack spell metadata#98
nighthunter226-but-real wants to merge 9 commits into
Roll20:mainfrom
nighthunter226-but-real:label-issues

Conversation

@nighthunter226-but-real

@nighthunter226-but-real nighthunter226-but-real commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Submission Checklist

  • The Pull Request title contains the short name of the sheet being submitted.
  • The Pull Request title states the type of change being submitted (New/Update/Bugfix/etc.).
  • I have authorization from the game's publisher to make this an official sheet on Roll20 with their name attached.
  • This game is not a traditionally published game, but a copy of the game rules can be purchased/downloaded/found at: < >
  • This sheet is for an unofficial fan game, modification to an existing game, or a homebrew system.

New Sheet Checklist

Not applicable. This is an update to the existing AGE official sheet.

Changes / Description (optional)

Updates AGE spell/power handling and related attack metadata:

  • Updates Fantasy AGE and Modern AGE spell labels to better match Compendium terminology.
  • Keeps Blue Rose spell labels unchanged.
  • Fixes stale magic terminology when switching systems.
  • Expands spell casting time options.
  • Adds spell conditions and resistance test outcome fields.
  • Prints spell conditions, resistance tests, success/failure results, and damage qualities in chat where relevant.
  • Hardens spell damage rolling so missing or malformed damage does not crash the sheet.
  • Uses Force for Modern AGE resistance targets and Spellpower for Fantasy AGE/Blue Rose.
  • Addresses review feedback around attack/inventory qualities and spell damage roll rendering.

Validation:

  • npm run build passes.

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded Casting Time choices with more action and timed duration options.
    • Added spell test fields to capture Successful and Failure results.
    • Added optional spell Conditions and Attack “Damage Qualities” inputs.
  • Bug Fixes

    • Improved spell damage parsing to better handle wrapped/annotated dice inputs.
    • Prevented incorrect component totals by ensuring numeric summation.
    • Removed an unnecessary debug log from component calculations.

@nighthunter226-but-real
nighthunter226-but-real requested a review from a team as a code owner June 14, 2026 07:13
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de3965ae-ef0c-4e06-853f-7a19f2970f43

📥 Commits

Reviewing files that changed from the base of the PR and between a667a6b and b8c636e.

📒 Files selected for processing (4)
  • ageofficial/src/components/magic/CharacterSpell.vue
  • ageofficial/src/components/magic/SpellModal.vue
  • ageofficial/src/rolltemplates/expressions/sumComponents.ts
  • ageofficial/src/sheet/stores/magic/magicStore.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • ageofficial/src/components/magic/SpellModal.vue
  • ageofficial/src/sheet/stores/magic/magicStore.ts
  • ageofficial/src/components/magic/CharacterSpell.vue

📝 Walkthrough

Walkthrough

The Spell interface in magicStore.ts gains optional fields (testSuccess, testFailure, conditions, damageQualities, abilityFocus). Store actions addSpell, printSpell, and printSpellDamage are updated to populate and transmit these fields via rollToChat. SpellModal.vue adds corresponding input controls and expands casting time options. CharacterSpell.vue removes Bootstrap modal wiring, unifies fatigue-gating logic, displays the new conditions field, and uses a dynamic resistance label. sumComponents adds numeric coercion for type safety.

Changes

Spell Data Shape & UI Expansion

Layer / File(s) Summary
Spell interface and optional field definitions
ageofficial/src/sheet/stores/magic/magicStore.ts
Spell interface adds abilityFocus?, testSuccess?, testFailure?, conditions?, damageQualities? optional fields and adjusts formatting/optionality of existing fields.
Store action implementations
ageofficial/src/sheet/stores/magic/magicStore.ts
addSpell populates new spell fields and conditionally assigns fatigue only when not undefined. printSpell adds conditional Conditions keyValue and rebuilds spell-resistance/test text by gameSystem. printSpellDamage uses a more permissive regex with early-return guard and expands rollToChat keyValues with damage type/note, qualities, results, and conditions. printSpellDetails filters falsy traits and adds conditional Conditions. Supporting functions unchanged.
SpellModal form inputs
ageofficial/src/components/magic/SpellModal.vue
Casting Time select expanded to include Free Action, Reaction, Minor/Major Action, and time-based options. New Successful Result and Failure Result text inputs bound to spell.testSuccess and spell.testFailure. New Conditions input bound to spell.conditions. New Damage Qualities input for attack spell types. Minor style whitespace adjustment.
CharacterSpell display and button logic
ageofficial/src/components/magic/CharacterSpell.vue
Bootstrap modal data-bs-* attributes removed from Cast button; both Cast and Attack/Damage buttons gate disabled/class on settings.userPowerFatigue. New resistanceTargetLabel computed derives label from settings.gameSystem ("Force" vs "Spellpower"). Casting time renders spell.castingTime directly. Conditional Conditions row displays when spell.conditions is present. Spell test comparison uses resistanceTargetLabel.

Utility Updates

Layer / File(s) Summary
sumComponents numeric coercion
ageofficial/src/rolltemplates/expressions/sumComponents.ts
Reduction logic coerces each component value to number using Number(component.value ?? 0) for type safety. Removes console.log from trained === false branch while preserving subsequent Math.ceil(sum / 2) halving behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • NBrooks-Roll20

Poem

🐇✨ Spells now track their conditions true,
Test results and damage qualities too!
Cast buttons unified, no Bootstrap in view,
Modal inputs expanded—your spell form's brand new! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes across all files: improving spell label terminology (resistance labels), adding spell casting metadata (casting time options, conditions, test results), and enhancing attack spell metadata (damage qualities). These are the core objectives of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ageofficial/src/components/magic/CharacterSpell.vue`:
- Around line 64-67: The span displaying spell.spellTest information on line 67
hardcodes the resistance label as "Spellpower", but this should be
system-specific. For Modern AGE games (where gameSystem equals 'mage'), the
label should show "Force" instead. Create a computed property or method in the
CharacterSpell component that returns the appropriate resistance label based on
the gameSystem value, then use that in place of the hardcoded "Spellpower"
string in the spellTest display span to maintain consistency with the damage
chat generation logic.
- Around line 16-20: The disable logic for the spell casting button in
CharacterSpell.vue allows casting when settings.userPowerFatigue is true
(bypassing the MP cost check), but the handlePrint method or the underlying
magicStore.ts spendMP function still deducts MP from char.magic even in
power-fatigue mode for non-blue-rose systems. To fix this inconsistency, ensure
that when settings.userPowerFatigue is enabled and a spell is cast, the spendMP
call in magicStore.ts (around line 109) is skipped for non-blue-rose systems, or
add a power-fatigue mode check in handlePrint to prevent the MP deduction from
occurring when power-fatigue is active, so the resource handling matches the UI
behavior.

In `@ageofficial/src/components/magic/SpellModal.vue`:
- Around line 200-209: The Conditions label and input elements (the span with id
"basic-addon1" and the text input with v-model="spell.conditions") are not
properly wrapped in a column container, causing structural misalignment. Wrap
both the Conditions label span and input field inside a new div element with the
classes "mb-3 col" to match the expected Bootstrap grid structure and ensure
proper nesting with the closing div tag on line 209. This will align the
Conditions field structure with other form fields in the component and prevent
layout breakage for subsequent fields.

In `@ageofficial/src/sheet/stores/magic/magicStore.ts`:
- Around line 77-79: The condition `if (spell?.fatigue)` at the fatigue
assignment in magicStore.ts uses a truthy check, which skips assignment when
fatigue is 0 (a valid falsy value). Replace this truthy check with an explicit
check for existence, such as `if (spell?.fatigue !== undefined)` or `if
('fatigue' in spell && spell.fatigue !== undefined)`, to ensure that explicit
zero-fatigue values are preserved during spell add/edit flows.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 10a2a66a-8ee6-48b0-8474-9decdaa40038

📥 Commits

Reviewing files that changed from the base of the PR and between 0b98c7e and a667a6b.

📒 Files selected for processing (3)
  • ageofficial/src/components/magic/CharacterSpell.vue
  • ageofficial/src/components/magic/SpellModal.vue
  • ageofficial/src/sheet/stores/magic/magicStore.ts

Comment thread ageofficial/src/components/magic/CharacterSpell.vue
Comment thread ageofficial/src/components/magic/CharacterSpell.vue Outdated
Comment thread ageofficial/src/components/magic/SpellModal.vue Outdated
Comment thread ageofficial/src/sheet/stores/magic/magicStore.ts Outdated
@BronsonHall BronsonHall added the blocked Something needs to be addressed with this before it continues label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Something needs to be addressed with this before it continues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants