jbhaywood / 5e-statblock-importer

A module for FoundryVTT that creates a new actor from any 5e monster or NPC statblock.
MIT License
18 stars 12 forks source link

Import error when Actions, Bonus Actions or Reactions contain a size descriptor (tiny, small, meduim, etc.) #106

Open Kirsham opened 4 months ago

Kirsham commented 4 months ago

As the title says, the parser appears to get confused when it encounters terms from the list of 5e sizes, i.e., tiny, small, medium, large, huge or gargantuan in other parts of the stat block, typically in Actions, Bonus Actions and Reactions. The result is that the action in question isn't imported properly and the size, type and alignment is overwritten.

E.g., if an action contains the phrase "Large or smaller" to describe acceptable targets for the action, the size becomes "Large", the type becomes "Or" and the alignment becomes "Smaller".

It is relatively simple to work around by replacing any of these terms with some placeholder text and importing it, then manually adding the removed term(s) in the action/bonus action/reaction.

Here's an example from importing the Voiceless Talker from MCDM's Flee, Mortals!

The statblock as copy-pasted into the parser:

Voiceless Talker Medium Aberration, Typically Lawful Evil Armor Class 16 (natural armor) Hit Points 91 (14d8 + 28) Speed 30 ft., fly 30 ft. STR DEX CON INT WIS CHA 10 (+0) 16 (+3) 14 (+2) 19 (+4) 15 (+2) 14 (+2) Saving Throws Con +5, Int +7, Wis +5 Skills Arcana +7, Deception +5, Insight +5, Perception +5, Persuasion +5, Stealth +6 Damage Resistances bludgeoning Senses darkvision 120 ft., passive Perception 15 Languages Deep Speech, Undercommon, telepathy 120 ft. Proficiency Bonus +3 ACTIONS Multiattack. The voiceless talker manifests a power and makes one Tentacle or Psionic Pistol attack. Tentacle. Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) psychic damage, and if the target is Large or smaller, they are grappled (escape DC 15). Psionic Pistol. Ranged Weapon Attack: +7 to hit, range 80/320 ft., one target. Hit: 15 (2d10 + 4) force damage. *Memory Thief (4th-Order Power). The voiceless talker psionically plunders the mind of a creature they can see within 30 feet of them. The target must make a DC 15 Intelligence saving throw. On a failed save, the target takes 22 (4d10) psychic damage, and until they finish a long rest or die, their proficiency bonus is cumulatively lowered by 1 and the voiceless talker gains a cumulative +2 bonus to damage rolls. On a successful save, a target takes half as much damage and doesn’t have their proficiency bonus reduced. A creature whose proficiency bonus drops to 0 can’t form new thoughts or speak, and they have disadvantage on ability checks, attack rolls, and saving throws. Flay (3/Day; 5th-Order Power). The voiceless talker shoots forth a 15-foot cone of pure psionic energy. Each creature in the area must make a DC 15 Intelligence saving throw, taking 28 (8d6) psychic damage on a failed save, or half as much damage on a successful one. Guise (3rd-Order Power). The voiceless talker projects a psionic image over their body, transforming their appearance for 1 hour into that of a Medium creature they have seen. When they manifest this power, they can also change the appearance of any equipment they carry for the duration. The changes wrought by this power fail to hold up to physical inspection. A creature can use an action to inspect the voiceless talker’s appearance and make a DC 15 Intelligence (Investigation) check, noticing the image is a projection on a success. REACTIONS Brain Drain. When a creature grappled by the voiceless talker makes a saving throw against one of the voiceless talker’s powers, the voiceless talker momentarily weakens the creature and the creature has disadvantage on the saving throw. CR 7

Results in the following stat block in Foundry:

image

jbhaywood commented 4 months ago

I don't have much time these days to work on this, but I'm open to pull requests.