- Enemy entity: full 5e stat block (size/type/subtype/alignment, AC, HP,
speed, six ability scores, CR/XP/prof, saves/skills/senses/languages,
damage & condition modifiers, traits/actions/bonus/reactions/legendary,
description, source) plus a DM game-notes field and updated_at.
- CreatureSize / CreatureType enums.
- /enemies: server-side DataTable (name, size, type, CR, AC, HP, notes),
"Add enemy" button.
- /enemies/{id}: stat block rendered read-only + editable game notes.
- /enemies/new and /enemies/{id}/edit: the full stat-block form (no notes).
- "Enemies" nav item between NPC's and Storyline.
- Table left empty on purpose.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
99 lines
4.7 KiB
Twig
99 lines
4.7 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block title %}{{ enemy.name }} · Enemies · dmtools{% endblock %}
|
|
|
|
{% macro mod(n) %}{{ n >= 0 ? '+' ~ n : n }}{% endmacro %}
|
|
|
|
{% macro stat(label, score, m) %}
|
|
<div class="col text-center">
|
|
<div class="text-uppercase small text-body-secondary">{{ label }}</div>
|
|
<div class="fw-semibold">{{ score }} ({{ m }})</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro line(label, value) %}
|
|
{% if value %}
|
|
<div><span class="fw-semibold">{{ label }}.</span> {{ value }}</div>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro section(title, body) %}
|
|
{% if body %}
|
|
<h2 class="h6 border-bottom pb-1 mt-3">{{ title }}</h2>
|
|
<div>{{ body|nl2br }}</div>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% import _self as sb %}
|
|
|
|
{% block body %}
|
|
<div class="d-flex justify-content-between align-items-start mb-3 gap-3">
|
|
<div>
|
|
<a href="{{ path('app_enemies') }}" class="text-decoration-none small">← All enemies</a>
|
|
<h1 class="h3 mb-0">{{ enemy.name }}</h1>
|
|
<span class="text-body-secondary fst-italic">{{ enemy.metaLine }}</span>
|
|
</div>
|
|
<a href="{{ path('app_enemies_edit', {id: enemy.id}) }}" class="btn btn-outline-secondary btn-sm">Edit stats</a>
|
|
</div>
|
|
|
|
<div class="row g-4">
|
|
<div class="col-lg-7">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
{{ sb.line('Armor Class', enemy.armorClass ~ (enemy.armorClassNote ? ' (' ~ enemy.armorClassNote ~ ')' : '')) }}
|
|
{{ sb.line('Hit Points', enemy.hitPoints ~ (enemy.hitDice ? ' (' ~ enemy.hitDice ~ ')' : '')) }}
|
|
{{ sb.line('Speed', enemy.speed) }}
|
|
|
|
<div class="row row-cols-6 my-3 g-1">
|
|
{{ sb.stat('Str', enemy.strength, sb.mod(enemy.abilityModifier(enemy.strength))) }}
|
|
{{ sb.stat('Dex', enemy.dexterity, sb.mod(enemy.abilityModifier(enemy.dexterity))) }}
|
|
{{ sb.stat('Con', enemy.constitution, sb.mod(enemy.abilityModifier(enemy.constitution))) }}
|
|
{{ sb.stat('Int', enemy.intelligence, sb.mod(enemy.abilityModifier(enemy.intelligence))) }}
|
|
{{ sb.stat('Wis', enemy.wisdom, sb.mod(enemy.abilityModifier(enemy.wisdom))) }}
|
|
{{ sb.stat('Cha', enemy.charisma, sb.mod(enemy.abilityModifier(enemy.charisma))) }}
|
|
</div>
|
|
|
|
{{ sb.line('Saving Throws', enemy.savingThrows) }}
|
|
{{ sb.line('Skills', enemy.skills) }}
|
|
{{ sb.line('Damage Vulnerabilities', enemy.damageVulnerabilities) }}
|
|
{{ sb.line('Damage Resistances', enemy.damageResistances) }}
|
|
{{ sb.line('Damage Immunities', enemy.damageImmunities) }}
|
|
{{ sb.line('Condition Immunities', enemy.conditionImmunities) }}
|
|
{{ sb.line('Senses', enemy.senses) }}
|
|
{{ sb.line('Languages', enemy.languages ?? '—') }}
|
|
{{ sb.line('Challenge', enemy.challengeRating ? enemy.challengeRating ~ (enemy.experiencePoints ? ' (' ~ enemy.experiencePoints ~ ' XP)' : '') : null) }}
|
|
{{ sb.line('Proficiency Bonus', enemy.proficiencyBonus ? sb.mod(enemy.proficiencyBonus) : null) }}
|
|
|
|
{{ sb.section('Traits', enemy.traits) }}
|
|
{{ sb.section('Actions', enemy.actions) }}
|
|
{{ sb.section('Bonus Actions', enemy.bonusActions) }}
|
|
{{ sb.section('Reactions', enemy.reactions) }}
|
|
{{ sb.section('Legendary Actions', enemy.legendaryActions) }}
|
|
{{ sb.section('Description', enemy.description) }}
|
|
|
|
{% if enemy.source %}
|
|
<p class="text-body-secondary small mt-3 mb-0">Source: {{ enemy.source }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-5">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<span>Game notes</span>
|
|
{% if enemy.updatedAt %}
|
|
<span class="text-body-secondary small fw-normal">saved {{ enemy.updatedAt|date('Y-m-d H:i') }}</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="card-body">
|
|
{{ form_start(form) }}
|
|
{{ form_row(form.gameNotes) }}
|
|
<button class="btn btn-primary mt-2">Save notes</button>
|
|
{{ form_end(form) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|