feat(import): add smart parsing for Nimble Nexus action descriptions#323
Merged
feat(import): add smart parsing for Nimble Nexus action descriptions#323
Conversation
Parse damage types, saving throws, conditions, and range/reach from action descriptions to build proper effect trees. This replaces hardcoded damage types with intelligent extraction from multiple text patterns. - Add descriptionParser.ts with parsing utilities for damage types, saves, conditions, and range/reach extraction - Add comprehensive test suite with 132 tests using real Nimble Nexus data - Extend constants.ts with DAMAGE_TYPE_MAP, SAVE_TYPE_ABBREVIATION_MAP, and CONDITION_MAP for canonical type lookups - Extend types.ts with ParsedSavingThrow, ParsedCondition, ParsedDamage, and ParsedRangeReach interfaces - Integrate buildEffectTree into NimbleNexusParser.createActionItem
369de19 to
6a50bc0
Compare
The damage roll includes the type ("2d8+2 fire"), not just the formula.
Actor.create doesn't always apply nested prototypeToken.texture settings. Now explicitly update the full texture object after creation to ensure the token image matches the actor portrait.
- Monster list preview uses 100.png (100x100 thumbnail) - Imported actor uses 400.png (400x400 higher quality) - Simplified import logic, removed failed CORS download attempts Note: Token images on canvas still blocked by CORS on storage bucket. Portrait images display correctly via HTML img tags.
Fronix
reviewed
Feb 23, 2026
Collaborator
There was a problem hiding this comment.
- Import various monsters from Nimble Nexus in FoundryVTT and verify effect trees
- Works for the most part, we are in the hands of people not writing novels in the damage sections so there are still some that fail. We could probably work a bit with nimble.nexus and ask for a
foundry-mode that puts stricter rules on the creation of the monster, then we could promote those in the importer to be more "safe to work as intended".
Another way would be if nimble nexus used foundry-type patterns.
- Works for the most part, we are in the hands of people not writing novels in the damage sections so there are still some that fail. We could probably work a bit with nimble.nexus and ask for a
- Test damage rolls show correct damage types
- The ones that are imported as actions work, even more advanced ones. Though, many get created as simple actions but it will probably be hard to catch all here, not a deal breaker for merge.
- Tutor, Teaching Golem
- Caerys, the Hollow Star
- Thor, God of Thunder
- Test saving throw buttons appear for save-based actions
- Tested with Thor, God of Thunder's Call Lightning
- Test conditions apply on appropriate triggers (hit, crit, failed save)
- Crits works fine
- On hit works fine
- Not sure about the save part, I tested Tutor, Teaching Golem's
Fiiiire Ball! (1/use).
5d6.
Aoe, Range 8, 5x5. DEX Save DC 11. On Failure: Full damage and target gains Smoldering. On Success: Half Damage.
They get imported as shared rolls instead of on fail/pass save
Add support for parsing "On Failure:" and "On Success:" patterns in action descriptions, which are used by creatures like Tutor, Teaching Golem. Previously these were imported as shared rolls without proper failedSave/passedSave context. Changes: - Detect "On Success: Half Damage" pattern for halfOnSave - Detect "On Failure:" context for bracket notation conditions - Add "target gains <condition>" pattern matching - Add comprehensive tests for the new patterns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
'bludgeoning'damage type with smart extraction from multiple text patternsSavingThrowNodeandConditionNodeeffects based on action description contentChanges
New Files:
descriptionParser.ts- Parsing utilities for damage types, saving throws, conditions, and range/reachdescriptionParser.test.ts- Comprehensive test suite with 132 tests using real Nimble Nexus API dataModified Files:
constants.ts- AddedDAMAGE_TYPE_MAP,SAVE_TYPE_ABBREVIATION_MAP, andCONDITION_MAPtypes.ts- AddedParsedSavingThrow,ParsedCondition,ParsedDamage, andParsedRangeReachinterfacesNimbleNexusParser.ts- IntegratedbuildEffectTree()intocreateActionItem()Supported Patterns
"5d8+13 Radiant""fire damage""DC 15 DEX save or 4d6 fire""DC 21 DEX save for half""On hit: [[Slowed]]""On crit: Poisoned""(Range: 8)""Cone 6","Line 10x2"Test plan