mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Add Save
This commit is contained in:
parent
8423ab6776
commit
ddbb6c4fd8
34 changed files with 609 additions and 378 deletions
|
|
@ -26,26 +26,18 @@
|
|||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dice-total">
|
||||
<div class="dice-total-value">{{roll.total}}</div>
|
||||
</div>
|
||||
{{#if (gt targets.length 0)}}
|
||||
<div class="target-section">
|
||||
{{#each targets as |target|}}
|
||||
<div class="dice-total target-container {{#if target.hit}}hit{{else}}miss{{/if}}" data-token="{{target.id}}">
|
||||
<img src="{{target.img}}" />
|
||||
<div class="target-inner-container">
|
||||
{{#if target.hit}}{{localize "Hit"}}{{else}}{{localize "Miss"}}{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if hasDamage}}
|
||||
</div>
|
||||
</div>
|
||||
{{> 'systems/daggerheart/templates/chat/parts/target-chat.hbs'}}
|
||||
{{#if hasDamage}}
|
||||
<div class="dice-roll daggerheart chat roll">
|
||||
<div class="dice-result">
|
||||
<div class="flexrow">
|
||||
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>Roll Damage</span></button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||
<div class="dice-flavor">{{title}}</div>
|
||||
<div class="dice-result">
|
||||
<div class="dice-formula">{{formula}}</div>
|
||||
<div class="dice-formula">{{roll.formula}}</div>
|
||||
<div class="dice-tooltip">
|
||||
<div class="wrapper">
|
||||
<section class="tooltip-part">
|
||||
{{#each roll.dice}}
|
||||
<div class="dice">
|
||||
<header class="part-header flexrow">
|
||||
<span class="part-formula">{{formula}}</span>
|
||||
|
||||
<span class="part-formula">{{formula}}</span>
|
||||
<span class="part-total">{{total}}</span>
|
||||
</header>
|
||||
<ol class="dice-rolls">
|
||||
|
|
@ -22,7 +21,12 @@
|
|||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dice-total">{{roll.result}}</div>
|
||||
<div class="dice-total">{{roll.total}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> 'systems/daggerheart/templates/chat/parts/target-chat.hbs'}}
|
||||
<div class="dice-roll daggerheart chat roll">
|
||||
<div class="dice-result">
|
||||
<div class="dice-actions">
|
||||
<button class="damage-button" data-target-hit="true" {{#if (eq targets.length 0)}}disabled{{/if}}>{{localize "DAGGERHEART.Chat.DamageRoll.DealDamageToTargets"}}</button>
|
||||
<button class="damage-button">{{localize "DAGGERHEART.Chat.DamageRoll.DealDamage"}}</button>
|
||||
|
|
|
|||
|
|
@ -92,18 +92,11 @@
|
|||
{{roll.total}}
|
||||
</div>
|
||||
</div>
|
||||
{{#if (gt targets.length 0)}}
|
||||
<div class="target-section">
|
||||
{{#each targets as |target|}}
|
||||
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
|
||||
<img src="{{target.img}}" />
|
||||
<div class="target-inner-container">
|
||||
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{> 'systems/daggerheart/templates/chat/parts/target-chat.hbs'}}
|
||||
<div class="dice-roll daggerheart chat roll">
|
||||
<div class="dice-result">
|
||||
<div class="dice-actions{{#unless (or hasDamage hasHealing)}} duality-alone{{/unless}}">
|
||||
{{#if hasDamage}}
|
||||
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.RollDamage"}}</span></button>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||
<div class="dice-flavor">{{title}}</div>
|
||||
<div class="dice-result">
|
||||
<div class="dice-formula">{{formula}}</div>
|
||||
<div class="dice-formula">{{roll.formula}}</div>
|
||||
<div class="dice-tooltip">
|
||||
<div class="wrapper">
|
||||
<section class="tooltip-part">
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
<div class="dice">
|
||||
<header class="part-header flexrow">
|
||||
<span class="part-formula">{{formula}}</span>
|
||||
|
||||
<span class="part-total">{{total}}</span>
|
||||
</header>
|
||||
<ol class="dice-rolls">
|
||||
|
|
@ -22,7 +21,7 @@
|
|||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dice-total">{{roll.result}}</div>
|
||||
<div class="dice-total">{{roll.total}}</div>
|
||||
<div class="flexrow">
|
||||
<button class="healing-button"><span>{{localize "DAGGERHEART.Chat.HealingRoll.Heal"}}</span></button>
|
||||
</div>
|
||||
|
|
|
|||
32
templates/chat/parts/target-chat.hbs
Normal file
32
templates/chat/parts/target-chat.hbs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{{#if (gt targets.length 0)}}
|
||||
<fieldset class="dice-roll daggerheart chat roll expanded" data-action="expandRoll">
|
||||
<legend class="dice-flavor">Targets</legend>
|
||||
<div class="dice-result">
|
||||
<div class="dice-tooltip">
|
||||
<div class="wrapper">
|
||||
<div class="target-section">
|
||||
{{#each targets as |target|}}
|
||||
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
|
||||
<img src="{{target.img}}" />
|
||||
<div class="target-inner-container">
|
||||
{{#if ../directDamage}}
|
||||
<div data-perm-id="{{target.actorId}}"><span>{{target.name}}</span></div>
|
||||
{{else}}
|
||||
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if ../hasSave}}
|
||||
<button class="target-save-container{{#if target.saved.result includeZero=true}} is-rolled{{/if}}"{{#unless target.hit}} style="visibility: hidden;"{{/unless}} data-perm-id="{{target.actorId}}">
|
||||
{{!-- {{target.saved.result}} --}}
|
||||
<i class="fa-solid {{#if target.saved.result includeZero=true}}{{#if target.saved.success}}fa-check{{else}}fa-xmark{{/if}}{{else}}fa-shield{{/if}}">
|
||||
</i>
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
</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'}}
|
||||
{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=systemFields.attack.fields.effects.element.fields source=source.system.attack.effects}}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@
|
|||
<div class="hope-section">
|
||||
<h4>{{localize "DAGGERHEART.General.Hope"}}</h4>
|
||||
{{#times document.system.resources.hope.max}}
|
||||
<span class='hope-value' data-action='toggleHope' data-value="{{this}}">
|
||||
{{#if (gte ../document.system.resources.hope.value this)}}
|
||||
<span class='hope-value' data-action='toggleHope' data-value="{{add this 1}}">
|
||||
{{#if (gte ../document.system.resources.hope.value (add this 1))}}
|
||||
<i class='fa-solid fa-diamond'></i>
|
||||
{{else}}
|
||||
<i class='fa-regular fa-circle'></i>
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@
|
|||
<legend>{{localize "DAGGERHEART.Sheets.Global.Actions"}} <a><i class="fa-solid fa-plus icon-button" data-action="addAction"></i></a></legend>
|
||||
<div class="actions-list">
|
||||
{{#each document.system.actions as |action index|}}
|
||||
<div class="action-item">
|
||||
<div class="action-item"
|
||||
data-action="editAction"
|
||||
data-index="{{index}}"
|
||||
>
|
||||
<img class="image" src="{{action.img}}" />
|
||||
<span>{{action.name}}</span>
|
||||
<div class="controls">
|
||||
<a data-action="editAction" data-index="{{index}}"><i class="fa-solid fa-pen-to-square"></i></a>
|
||||
<a data-action="removeAction" data-index="{{index}}"><i class="fa-solid fa-trash"></i></a>
|
||||
<a data-action="removeAction"><i class="fa-solid fa-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="hope-container">
|
||||
{{#times 6}}
|
||||
<span class="hope-inner-container">
|
||||
<input class="hope-value" type="checkbox" data-action="toggleHope" data-value="{{this}}" {{ checked (gte ../document.system.resources.hope.value this) }} {{#if (gte this ../document.system.resources.hope.max)}}disabled{{/if}} />
|
||||
<input class="hope-value" type="checkbox" data-action="toggleHope" data-value="{{add this 1}}" {{ checked (gte ../document.system.resources.hope.value (add this 1)) }} {{#if (gte this ../document.system.resources.hope.max)}}disabled{{/if}} />
|
||||
{{#if (gte this ../document.system.resources.hope.max)}}<i class="fa-solid fa-droplet-slash hope-scar"></i>{{/if}}
|
||||
</span>
|
||||
{{/times}}
|
||||
|
|
|
|||
|
|
@ -41,11 +41,12 @@
|
|||
</div>
|
||||
<div class="tab {{this.tabs.effect.cssClass}}" data-group="primary" data-tab="effect">
|
||||
{{#if fields.roll}}{{> 'systems/daggerheart/templates/views/actionTypes/roll.hbs' fields=fields.roll.fields source=source.roll}}{{/if}}
|
||||
{{#if fields.save}}{{> 'systems/daggerheart/templates/views/actionTypes/save.hbs' fields=fields.save.fields source=source.save}}{{/if}}
|
||||
{{#if fields.damage}}{{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=fields.damage.fields.parts.element.fields source=source.damage}}{{/if}}
|
||||
{{#if fields.healing}}{{> 'systems/daggerheart/templates/views/actionTypes/healing.hbs' fields=fields.healing.fields source=source.healing}}{{/if}}
|
||||
{{#if fields.resource}}{{> 'systems/daggerheart/templates/views/actionTypes/resource.hbs' fields=fields.resource.fields source=source.resource}}{{/if}}
|
||||
{{#if fields.documentUUID}}{{> 'systems/daggerheart/templates/views/actionTypes/uuid.hbs' fields=fields.documentUUID source=source.documentUUID}}{{/if}}
|
||||
{{#if fields.effects}}{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs'}}{{/if}}
|
||||
{{#if fields.effects}}{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
@ -14,15 +14,15 @@
|
|||
{{/unless}}
|
||||
{{#each source.parts as |dmg index|}}
|
||||
{{#if @root.isNPC}}
|
||||
{{formField ../fields.custom.fields.enabled value=dmg.custom.enabled name=(concat ../path "damage.parts." index ".custom.enabled")}}
|
||||
<input type="hidden" name="{{../path}}damage.parts.{{index}}.multiplier" value="{{dmg.multiplier}}">
|
||||
{{#if dmg.custom.enabled}}
|
||||
{{formField ../fields.custom.fields.formula value=dmg.custom.formula name=(concat ../path "damage.parts." index ".custom.formula") localize=true}}
|
||||
{{formField ../fields.value.fields.custom.fields.enabled value=dmg.value.custom.enabled name=(concat ../path "damage.parts." index ".value.custom.enabled")}}
|
||||
<input type="hidden" name="{{../path}}damage.parts.{{index}}.value.multiplier" value="{{dmg.value.multiplier}}">
|
||||
{{#if dmg.value.custom.enabled}}
|
||||
{{formField ../fields.value.fields.custom.fields.formula value=dmg.value.custom.formula name=(concat ../path "damage.parts." index ".value.custom.formula") localize=true}}
|
||||
{{else}}
|
||||
<div class="multi-display">
|
||||
{{formField ../fields.flatMultiplier value=dmg.flatMultiplier name=(concat ../path "damage.parts." index ".flatMultiplier") label="Multiplier" }}
|
||||
{{formField ../fields.dice value=dmg.dice name=(concat ../path "damage.parts." index ".dice")}}
|
||||
{{formField ../fields.bonus value=dmg.bonus name=(concat ../path "damage.parts." index ".bonus") localize=true}}
|
||||
{{formField ../fields.value.fields.flatMultiplier value=dmg.value.flatMultiplier name=(concat ../path "damage.parts." index ".value.flatMultiplier") label="Multiplier" }}
|
||||
{{formField ../fields.value.fields.dice value=dmg.value.dice name=(concat ../path "damage.parts." index ".value.dice")}}
|
||||
{{formField ../fields.value.fields.bonus value=dmg.value.bonus name=(concat ../path "damage.parts." index ".value.bonus") localize=true}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{formField ../fields.type value=dmg.type name=(concat ../path "damage.parts." index ".type") localize=true}}
|
||||
|
|
|
|||
|
|
@ -4,15 +4,31 @@
|
|||
</legend>
|
||||
<div class="action-category-data open" data-key="effects">
|
||||
<div class="fas fa-plus icon-button" data-action="addEffect"></div>
|
||||
{{#each @root.effects as | effect index | }}
|
||||
{{!-- {{#each @root.effects as | effect index | }}
|
||||
<fieldset>
|
||||
{{!-- <div class="multi-display"> --}}
|
||||
<div class="multi-display">
|
||||
<div class="form-group">
|
||||
<img src="{{img}}">
|
||||
<label data-action="editEffect">{{name}}</label>
|
||||
<div class="fas fa-trash" data-action="removeEffect" data-index="{{index}}"></div>
|
||||
</div>
|
||||
{{!-- </div> --}}
|
||||
{{formfield }}
|
||||
</div>
|
||||
</fieldset>
|
||||
{{/each}} --}}
|
||||
{{#each source as | effect index |}}
|
||||
<fieldset data-effect-id="{{effect._id}}">
|
||||
<div class="multi-display">
|
||||
{{#with (@root.getEffectDetails effect._id) as | details |}}
|
||||
<div class="form-group" data-action="editEffect">
|
||||
<img src="{{img}}">
|
||||
<label>{{name}}</label>
|
||||
<div class="fas fa-trash" data-action="removeEffect" data-index="{{index}}"></div>
|
||||
</div>
|
||||
{{/with}}
|
||||
<input type="hidden" name="effects.{{index}}._id" value="{{effect._id}}">
|
||||
{{formField ../fields.onSave value=effect.onSave name=(concat "effects." index ".onSave")}}
|
||||
</div>
|
||||
</fieldset>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
{{formField fields.bonus label="Bonus" name="roll.bonus" value=source.bonus}}
|
||||
{{else}}
|
||||
{{formField fields.type label="Type" name="roll.type" value=source.type localize=true}}
|
||||
{{formField fields.trait label="Trait" name="roll.trait" value=source.trait localize=true}}
|
||||
{{formField fields.difficulty label="Difficulty" name="roll.difficulty" value=source.difficulty}}
|
||||
{{formField fields.trait label="Trait" name="roll.trait" value=source.trait localize=true disabled=(not source.type)}}
|
||||
{{formField fields.difficulty label="Difficulty" name="roll.difficulty" value=source.difficulty disabled=(not source.type)}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</fieldset>
|
||||
10
templates/views/actionTypes/save.hbs
Normal file
10
templates/views/actionTypes/save.hbs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<fieldset class="action-category">
|
||||
<legend class="action-category-label" data-action="toggleSection" data-section="roll">
|
||||
<div>Save</div>
|
||||
</legend>
|
||||
<div class="action-category-data open">
|
||||
{{formField fields.trait label="Trait" name="save.trait" value=source.trait localize=true}}
|
||||
{{formField fields.difficulty label="Difficulty" name="save.difficulty" value=source.difficulty disabled=(not source.trait)}}
|
||||
{{formField fields.damageMod label="Damage on Save" name="save.damageMod" value=source.damageMod localize=true disabled=(not source.trait)}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
<footer>
|
||||
{{!-- <footer>
|
||||
<button data-action="sendCost"{{#unless canUse}} disabled{{/unless}}>Accept</button>
|
||||
</footer>
|
||||
</footer> --}}
|
||||
</div>
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<div>
|
||||
{{#if @root.hasRoll}}
|
||||
<div class="roll-dialog-container">
|
||||
<div class="flexcol">
|
||||
<div class="roll-dialog-experience-container">
|
||||
|
|
@ -34,8 +35,9 @@
|
|||
</div> --}}
|
||||
{{!-- {{/if}} --}}
|
||||
</div>
|
||||
<footer>
|
||||
<button data-action="submitRoll"{{#unless canRoll}} disabled{{/unless}}>Roll</button>
|
||||
</footer>
|
||||
</div>
|
||||
{{/if}}
|
||||
<footer>
|
||||
<button data-action="submitRoll"{{#unless canRoll}} disabled{{/unless}}>Roll</button>
|
||||
</footer>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue