[Feature] 155 - New Adversary Sheet (#228)

* rework adversary templates, add setting dialog to adversary and fix erratas

* fix errata in adversary data model

* developing experience setting page

* Experience settings update

* finish actions setting tab

* Fixed Notes enriched path and adversary-settings form id

* Fixed UseItem and ToChat

* Fixed Firefox progress bar (HP/Stress) (#230)

* insert prose-mirror style and inicial implement to damage settings

* fix character import relative paths and remove effects from standard adversary attack

---------

Co-authored-by: WBHarry <williambjrklund@gmail.com>
Co-authored-by: GyroFalc <43814421+GyroFalc@users.noreply.github.com>
This commit is contained in:
Murilo Brito 2025-07-01 17:07:12 -03:00 committed by GitHub
parent 8b834036fa
commit 5ffb22fcc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 2123 additions and 254 deletions

View file

@ -0,0 +1,11 @@
<section
class='tab {{tabs.actions.cssClass}} {{tabs.actions.id}}'
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
>
<div class="action-section">
{{#if document.system.actions}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.actions.label) type='action'}}
{{/if}}
</div>
</section>

View file

@ -0,0 +1,8 @@
<section
class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}'
data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'
>
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.activeEffects') type='effect'}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inativeEffects') type='effect'}}
</section>

View file

@ -1,9 +1,43 @@
<header class='item-card-header'>
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
<div class='item-info'>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize 'TYPES.Actor.adversary'}}</h3>
<header class='adversary-header-sheet'>
<line-div></line-div>
<div class="name-row">
<h1 class='actor-name'>
<input type='text' name='name' value='{{source.name}}' placeholder='Actor Name'
/>
</h1>
</div>
<div class="tags">
<div class="tag">
<span>
{{localize (concat 'DAGGERHEART.Tiers.' source.system.tier)}}
</span>
</div>
<div class="tag">
<span>
{{localize (concat 'DAGGERHEART.Adversary.Type.' source.system.type '.label')}}
</span>
</div>
{{#if (eq source.system.type 'horde')}}
<div class="tag">
<span>{{source.system.hordeHp}}</span>
<span>/HP</span>
</div>
{{/if}}
</div>
<line-div></line-div>
<div class="adversary-info">
<div class="description">
<i>{{source.system.description}}</i>
</div>
<div class="motives-and-tatics">
<b>{{localize 'DAGGERHEART.Sheets.Adversary.FIELDS.motivesAndTactics.label'}}: </b>{{{source.system.motivesAndTactics}}}
</div>
</div>
<div class="adversary-navigation">
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
<button data-action="openSettings">
<i class="fa-solid fa-wrench"></i>
</button>
</div>
</header>

View file

@ -4,33 +4,26 @@
data-group='{{tabs.main.group}}'
>
<div class="adversary-container">
<button data-action="reactionRoll">Reaction Test</button>
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Adversary.General"}}</legend>
{{formGroup systemFields.tier value=source.system.tier localize=true}}
{{formGroup systemFields.type value=source.system.type localize=true}}
<div class="full-width">{{formGroup systemFields.difficulty value=source.system.difficulty}}</div>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}}</legend>
{{formGroup systemFields.damageThresholds.fields.major value=source.system.damageThresholds.major}}
{{formGroup systemFields.damageThresholds.fields.severe value=source.system.damageThresholds.severe}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}}</legend>
<!--
{{formGroup systemFields.resources.fields.hitPoints.fields.value value=source.system.resources.hitPoints.value}}
{{formGroup systemFields.resources.fields.hitPoints.fields.max value=source.system.resources.hitPoints.max}}
-->
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Stress"}}</legend>
<!--
{{formGroup systemFields.resources.fields.stress.fields.value value=source.system.resources.stress.value}}
{{formGroup systemFields.resources.fields.stress.fields.max value=source.system.resources.stress.max}}
-->
</fieldset>
<fieldset>
@ -46,35 +39,5 @@
{{/each}}
</fieldset>
</fieldset>
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Attack"}}</legend>
<button data-action="attackConfigure">Configure</button>
<button data-action="attackRoll">Attack</button>
<fieldset class="action-category" style="grid-column: 1 / -1;">
<legend class="action-category-label" data-action="toggleSection" data-section="range">
<div>Name</div>
</legend>
<div class="action-category-data open">
{{formGroup systemFields.attack.fields.name value=source.system.attack.name name="system.attack.name"}}
{{formGroup systemFields.attack.fields.img value=source.img label="Icon" name="system.attack.img"}}
</div>
</fieldset>
<div>
<fieldset class="action-category">
<legend class="action-category-label" data-action="toggleSection" data-section="range">
<div>Bonus to Hit</div>
</legend>
<div class="action-category-data open">
{{formField systemFields.attack.fields.roll.fields.bonus value=source.system.attack.roll.bonus name="system.attack.roll.bonus"}}
</div>
</fieldset>
{{> 'systems/daggerheart/templates/views/actionTypes/range-target.hbs' fields=(object range=systemFields.attack.fields.range target=systemFields.attack.fields.target.fields) source=(object target=source.system.attack.target range=source.system.attack.range) path="system.attack."}}
</div>
{{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=source.system.attack.damage path="system.attack."}}
<div style="grid-column: 1 / -1;">
{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=systemFields.attack.fields.effects.element.fields source=source.system.attack.effects}}
</div>
</fieldset>
</div>
</section>

View file

@ -0,0 +1,10 @@
<section
class='tab {{tabs.notes.cssClass}} {{tabs.notes.id}}'
data-tab='{{tabs.notes.id}}'
data-group='{{tabs.notes.group}}'
>
<fieldset class="fit-height">
<legend>{{localize tabs.notes.label}}</legend>
{{formInput systemFields.notes value=document.system.notes enriched=document.system.notes localize=true toggled=true}}
</fieldset>
</section>

View file

@ -0,0 +1,111 @@
<aside class="adversary-sidebar-sheet">
<div class="portrait {{#if (gte source.system.resources.hitPoints.value source.system.resources.hitPoints.maxTotal)}}death-roll{{/if}}">
<img src="{{source.img}}" alt="{{source.name}}" data-action='editImage' data-edit="img">
<a class="death-roll-btn" data-tooltip="{{localize "DAGGERHEART.Sheets.PC.Health.DeathMoveTooltip"}}" data-action="makeDeathMove"><i class="fas fa-skull death-save" ></i></a>
</div>
<div class="info-section">
<div class="resources-section">
<div class="status-bar">
<div class='status-value'>
<p><input class="bar-input" name="system.resources.hitPoints.value" value="{{source.system.resources.hitPoints.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{source.system.resources.hitPoints.max}}</p>
</div>
<progress
class='progress-bar'
value='{{source.system.resources.hitPoints.value}}'
max='{{source.system.resources.hitPoints.max}}'
></progress>
<div class="status-label">
<h4>HP</h4>
</div>
</div>
<div class="status-bar">
<div class='status-value'>
<p><input class="bar-input" name="system.resources.stress.value" value="{{source.system.resources.stress.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{source.system.resources.stress.max}}</p>
</div>
<progress
class='progress-bar stress-color'
value='{{source.system.resources.stress.value}}'
max='{{source.system.resources.stress.max}}'
></progress>
<div class="status-label">
<h4>Stress</h4>
</div>
</div>
</div>
<div class="status-section">
<div class="threshold-section">
<h4 class="threshold-label">{{localize "DAGGERHEART.Sheets.PC.Health.Minor"}}</h4>
<h4 class="threshold-value">{{document.system.damageThresholds.major}}</h4>
<h4 class="threshold-label">{{localize "DAGGERHEART.Sheets.PC.Health.Major"}}</h4>
<h4 class="threshold-value">{{document.system.damageThresholds.severe}}</h4>
<h4 class="threshold-label">{{localize "DAGGERHEART.Sheets.PC.Health.Severe"}}</h4>
</div>
</div>
<div class="status-section">
<div class="status-number">
<div class='status-value armor-slots'>
{{#if source.system.difficulty}}
<p>{{source.system.difficulty}}</p>
{{else}}
<p>-</p>
{{/if}}
</div>
<div class="status-label">
<h4>Difficulty</h4>
</div>
</div>
<div class="status-number">
<div class='status-value armor-slots'>
{{#if source.system.attack.target.amount}}
<p>{{source.system.attack.target.amount}}</p>
{{else}}
<p>-</p>
{{/if}}
</div>
<div class="status-label">
<h4>Attack</h4>
</div>
</div>
</div>
</div>
<div class="attack-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<h3>Attack</h3>
<side-line-div></side-line-div>
</div>
<ul class="items-sidebar-list">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=source.system.attack type=source.system.attack.systemPath isSidebar=true}}
</ul>
</div>
<div class="experience-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<h3>Experience</h3>
<side-line-div></side-line-div>
</div>
<div class="experience-list">
{{#each source.system.experiences as |experience id|}}
<div class="experience-row">
<div class="experience-value">
+{{experience.modifier}}
</div>
<span class="experience-name">{{experience.name}}</span>
<div class="controls">
<a data-action="toChat" data-type="experience" data-uuid="{{id}}"><i class="fa-regular fa-message"></i></a>
</div>
</div>
{{/each}}
</div>
</div>
<line-div></line-div>
<div class="reaction-section">
<button data-action="reactionRoll">Reaction Test</button>
</div>
</aside>

View file

@ -18,7 +18,7 @@
max='{{document.system.resources.hitPoints.maxTotal}}'
></progress>
<div class="status-label">
<h4>Health</h4>
<h4>HP</h4>
</div>
</div>