Skip to content

Commit

Permalink
✨ Add items for Pf2e creatures
Browse files Browse the repository at this point in the history
  • Loading branch information
miscoined authored and ebullient committed May 13, 2024
1 parent 19c39af commit 789822c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ protected QuteCreature buildQuteResource() {
Pf2eCreatureLanguages.create(Pf2eCreature.languages.getFrom(rootNode), this),
Pf2eCreature.skills(rootNode, this),
Pf2eCreature.senses.streamFrom(rootNode).map(n -> Pf2eCreatureSense.create(n, this)).toList(),
Pf2eCreature.abilityModifiers(rootNode));
Pf2eCreature.abilityModifiers(rootNode),
Pf2eCreature.items.replaceTextFromList(rootNode, this));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ public class QuteCreature extends Pf2eQuteBase {
public final List<CreatureSense> senses;
/** Ability modifiers as a map of (name, modifier) */
public final Map<String, Integer> abilityMods;
/** Items held by the creature as a list of strings */
public final List<String> items;

public QuteCreature(Pf2eSources sources, List<String> text, Tags tags,
Collection<String> traits, List<String> aliases,
String description, Integer level, Integer perception,
QuteDataDefenses defenses, CreatureLanguages languages, CreatureSkills skills,
List<CreatureSense> senses, Map<String, Integer> abilityMods) {
List<CreatureSense> senses, Map<String, Integer> abilityMods,
List<String> items) {
super(sources, text, tags);
this.traits = traits;
this.aliases = aliases;
Expand All @@ -67,6 +70,7 @@ public QuteCreature(Pf2eSources sources, List<String> text, Tags tags,
this.skills = skills;
this.senses = senses;
this.abilityMods = abilityMods;
this.items = items;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/templates/toolsPf2e/creature2md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ aliases:
- **Skills** {resource.skills}
{/if}
- {#each resource.abilityMods.keys}**{it.capitalized}** {resource.abilityMods.get(it).asBonus}{#if it_hasNext}, {/if}{/each}
{#if !resource.items.isEmpty }
- **Items** {#each resource.items}{it}{#if it_hasNext}, {/if}{/each}
{/if}

{#if resource.defenses}
{resource.defenses}
Expand Down

0 comments on commit 789822c

Please sign in to comment.