ttrpg-convert-cli
ttrpg-convert-cli copied to clipboard
:sparkles: exposed missing spell fields
Resolves issue #780, adds spell fields from the json that are currently omitted
First time writing java so bear with me.
Exposes the json fields from spells to Qute. All are a string
- ability checks
- affected creature types
- area tags (converted to words)
- condition immunities
- conditions inflicted
- damage immunities
- damage inflicted
- damage resistances
- damage vulnerabilities
- misc tags (converted to words)
- saving throws
- scaling damage dice
- spell attack melee or ranged
- higher levels text
Testing process:
- I haven't got testing up and running due to a few errors but it builds fine for me using and I get the expected result in obsidian afterwards.
Notes:
- most are lists so could send through a list of strings as well as a string if desired. I went with what I assume convention was and made them all just a string
- Could send through the raw values of area/misc tags but I figured just sticking with the converted versions was fine. Also, I'm not sure if the converted text is 100% accurate I got AI to do it
- some of the larger fields have a higher change of having a quote in them so will usually break when inserting into the properties field from qute. I've left that in and got around this by using
.replace('"', "'")in the qute templates because I'm not sure if there's a convention to do it in the java. - mostly got claude sonnet to do the work for me then tidied it up. Happy to take any feedback and make any style changes
spell2md-custom.txt
---
obsidianUIMode: preview
cssclasses:
- json5e-spell
{#if resource.tags }
tags:
{#for tag in resource.tags}
- {tag}
{/for}
{/if}
{#if resource.classes }
classes:
{#each resource.classList}
- {it}
{/each}{/if}
aliases:
- {resource.name}
CastingTime: "{resource.time}{#if resource.ritual} unless cast as a ritual{/if}"
Range: "{resource.range}"
Components: "{resource.components}"
Duration: "{resource.duration}"
{#if resource.higherLevels }
Upcast: True
HigherLevels: "{resource.higherLevels.replace('"', "'")}"
{/if}
{#if resource.ritual}
Ritual: True
{/if}
{#if resource.areaTags }
Area: "{resource.areaTags}"
{/if}
{#if resource.damageInflict }
Damage: "{resource.damageInflict}"
{/if}
{#if resource.savingThrows }
SavingThrow: "{resource.savingThrows}"
{/if}
{#if resource.conditionInflict }
Conditions: "{resource.conditionInflict}"
{/if}
{#if resource.abilityChecks }
AbilityChecks: "{resource.abilityChecks}"
{/if}
{#if resource.spellAttacks }
AttackRoll: "{resource.spellAttacks}"
{/if}
{#if resource.affectsCreatureTypes }
AffectsCreatures: "{resource.affectsCreatureTypes}"
{/if}
{#if resource.conditionImmune }
ConditionImmunities: "{resource.conditionImmune}"
{/if}
{#if resource.damageImmune }
DamageImmunities: "{resource.damageImmune}"
{/if}
{#if resource.damageResist }
DamageResistances: "{resource.damageResist}"
{/if}
{#if resource.damageVulnerable }
DamageVulnerabilities: "{resource.damageVulnerable}"
{/if}
{#if resource.miscTags }
MiscTags: "{resource.miscTags}"
{/if}
{#if resource.scalingLevelDice }
ScalingDice: "{resource.scalingLevelDice}"
{/if}
{#if resource.duration.contains('Concentration') }
Concentration: True
{/if}
Source: "{resource.source.replace('"', "'")}"
---
# {resource.name}
%%-- Embedded content starts on the next line. --%%
*{resource.level}, {resource.school}{#if resource.ritual} (ritual){/if}*
{#if resource.hasImages }{resource.showPortraitImage}{/if}
- **Casting time:** {resource.time}{#if resource.ritual} unless cast as a ritual{/if}
- **Range:** {resource.range}
- **Components:** {resource.components}
- **Duration:** {resource.duration}
{resource.text}
{#if resource.hasSections }
## Summary
{/if}{#if resource.hasMoreImages }
{resource.showMoreImages}
{/if}{#if resource.classes }
**Classes**: {resource.classes}
{/if}
*Source: {resource.source}*
Sorry for being slow.. I will get to this! Thank you!