diff --git a/src/main/java/dev/ebullient/convert/tools/dnd5e/qute/QuteMonster.java b/src/main/java/dev/ebullient/convert/tools/dnd5e/qute/QuteMonster.java index fb53899e1..e3494e0ad 100644 --- a/src/main/java/dev/ebullient/convert/tools/dnd5e/qute/QuteMonster.java +++ b/src/main/java/dev/ebullient/convert/tools/dnd5e/qute/QuteMonster.java @@ -11,6 +11,7 @@ import dev.ebullient.convert.qute.ImageRef; import dev.ebullient.convert.qute.NamedText; import dev.ebullient.convert.tools.Tags; +import dev.ebullient.convert.tools.dnd5e.Tools5eIndexType; import dev.ebullient.convert.tools.dnd5e.Tools5eSources; import io.quarkus.qute.TemplateData; import io.quarkus.runtime.annotations.RegisterForReflection; @@ -239,7 +240,7 @@ public Map getSkillMap() { */ public String get5eInitiativeYaml() { Map map = new LinkedHashMap<>(); - addUnlessEmpty(map, "name", name); + addUnlessEmpty(map, "name", name + yamlMonsterName()); addIntegerUnlessEmpty(map, "ac", acHp.ac); addIntegerUnlessEmpty(map, "hp", acHp.hp); addUnlessEmpty(map, "hit_dice", acHp.hitDice); @@ -256,7 +257,7 @@ public String get5eInitiativeYaml() { */ public String get5eStatblockYaml() { Map map = new LinkedHashMap<>(); - addUnlessEmpty(map, "name", name); + addUnlessEmpty(map, "name", name + yamlMonsterName()); addUnlessEmpty(map, "size", size); addUnlessEmpty(map, "type", type); addUnlessEmpty(map, "subtype", subtype); @@ -306,6 +307,15 @@ public String get5eStatblockYaml() { .replaceAll("\\*([^*]+)\\*", "$1"); // bold em } + public String yamlMonsterName() { + String source = getBooks().get(0); + if (Tools5eIndexType.monster.defaultSourceString().equalsIgnoreCase(source)) { + return ""; + } else { + return " (" + source + ")"; + } + } + Collection spellcastingToTraits() { if (spellcasting == null) { return List.of(); diff --git a/src/test/resources/other/monster-all.txt b/src/test/resources/other/monster-all.txt index 9eefff6a8..3fe54e890 100644 --- a/src/test/resources/other/monster-all.txt +++ b/src/test/resources/other/monster-all.txt @@ -1,6 +1,7 @@ --- obsidianUIMode: preview cssclass: json5e-monster +statblock: inline {#if resource.tags } tags: {#for tag in resource.tags}