{# # Shared 5e stat-block rendering. Used on the enemy detail page and, folded # up, inside each tracker combatant. # {% import 'enemy/_statblock.html.twig' as sb %} # {{ sb.block(enemy) }} #} {% macro mod(n) %}{{ n >= 0 ? '+' ~ n : n }}{% endmacro %} {% macro _stat(label, score, m) %}
{{ label }}
{{ score }} ({{ m }})
{% endmacro %} {% macro _line(label, value) %} {% if value %}
{{ label }}. {{ value }}
{% endif %} {% endmacro %} {% macro _section(title, body) %} {% if body %}

{{ title }}

{{ body|nl2br }}
{% endif %} {% endmacro %} {% macro block(e) %} {% import _self as sb %} {{ sb._line('Armor Class', e.armorClass ~ (e.armorClassNote ? ' (' ~ e.armorClassNote ~ ')' : '')) }} {{ sb._line('Hit Points', e.hitPoints ~ (e.hitDice ? ' (' ~ e.hitDice ~ ')' : '')) }} {{ sb._line('Speed', e.speed) }}
{{ sb._stat('Str', e.strength, sb.mod(e.abilityModifier(e.strength))) }} {{ sb._stat('Dex', e.dexterity, sb.mod(e.abilityModifier(e.dexterity))) }} {{ sb._stat('Con', e.constitution, sb.mod(e.abilityModifier(e.constitution))) }} {{ sb._stat('Int', e.intelligence, sb.mod(e.abilityModifier(e.intelligence))) }} {{ sb._stat('Wis', e.wisdom, sb.mod(e.abilityModifier(e.wisdom))) }} {{ sb._stat('Cha', e.charisma, sb.mod(e.abilityModifier(e.charisma))) }}
{{ sb._line('Saving Throws', e.savingThrows) }} {{ sb._line('Skills', e.skills) }} {{ sb._line('Damage Vulnerabilities', e.damageVulnerabilities) }} {{ sb._line('Damage Resistances', e.damageResistances) }} {{ sb._line('Damage Immunities', e.damageImmunities) }} {{ sb._line('Condition Immunities', e.conditionImmunities) }} {{ sb._line('Senses', e.senses) }} {{ sb._line('Languages', e.languages ?? '—') }} {{ sb._line('Challenge', e.challengeRating ? e.challengeRating ~ (e.experiencePoints ? ' (' ~ e.experiencePoints ~ ' XP)' : '') : null) }} {{ sb._line('Proficiency Bonus', e.proficiencyBonus ? sb.mod(e.proficiencyBonus) : null) }} {{ sb._section('Traits', e.traits) }} {{ sb._section('Actions', e.actions) }} {{ sb._section('Bonus Actions', e.bonusActions) }} {{ sb._section('Reactions', e.reactions) }} {{ sb._section('Legendary Actions', e.legendaryActions) }} {{ sb._section('Description', e.description) }} {% if e.source %}

Source: {{ e.source }}

{% endif %} {% endmacro %}