Roll classes

This commit is contained in:
Dapoolp 2025-06-17 03:04:20 +02:00
parent 4a044db77f
commit 7cc92d153b
25 changed files with 793 additions and 337 deletions

View file

@ -0,0 +1,9 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div>{{{description}}}</div>
<div class="dice-result">
<div class="dice-actions">
<button class="duality-action-effect">{{localize "DAGGERHEART.Chat.AttackRoll.ApplyEffect"}}</button>
</div>
</div>
</div>

View file

@ -6,12 +6,12 @@
{{label}}
</div>
{{/each}}
{{#if advantageState}}
{{#if (eq advantage 1)}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Advantage.Full"}}
</div>
{{/if}}
{{#if (eq advantageState false)}}
{{#if (eq advantage -1)}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Disadvantage.Full"}}
</div>
@ -25,40 +25,40 @@
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{hope.dice}}</span>
<span>1{{roll.hope.dice}}</span>
|
<span>1{{fear.dice}}</span>
<span>1{{roll.fear.dice}}</span>
</span>
<span class="part-total">{{diceTotal}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls duality">
<li class="roll die {{hope.dice}}" title="{{localize "DAGGERHEART.General.Hope"}}">
<li class="roll die {{roll.hope.dice}}" title="{{localize "DAGGERHEART.General.Hope"}}">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Hope"}}</div>
<div class="dice-inner-container hope" title="{{localize "DAGGERHEART.General.Hope"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{hope.value}}</div>
<div class="dice-value">{{roll.hope.value}}</div>
</div>
</div>
</li>
<li class="roll die {{fear.dice}}" title="{{localize "DAGGERHEART.General.Fear"}}">
<li class="roll die {{roll.fear.dice}}" title="{{localize "DAGGERHEART.General.Fear"}}">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Fear"}}</div>
<div class="dice-inner-container fear" title="{{localize "DAGGERHEART.General.Fear"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{fear.value}}</div>
<div class="dice-value">{{roll.fear.value}}</div>
</div>
</div>
</li>
</ol>
</div>
</div>
{{#if advantageState}}
{{#if (eq advantage 1)}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
@ -82,7 +82,7 @@
</div>
</div>
{{/if}}
{{#if (eq advantageState false)}}
{{#if (eq advantage -1)}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
@ -110,7 +110,7 @@
</section>
</div>
</div>
<div class="dice-total duality {{#if fear.discarded}}hope{{else}}{{#if hope.discarded}}fear{{else}}critical{{/if}}{{/if}}">
<div class="dice-total duality {{#if roll.fear.discarded}}hope{{else}}{{#if roll.hope.discarded}}fear{{else}}critical{{/if}}{{/if}}">
<div class="dice-total-label">{{totalLabel}}</div>
<div class="dice-total-value">
{{roll.total}}
@ -128,12 +128,15 @@
{{/each}}
</div>
{{/if}}
<div class="dice-actions{{#unless hasDamage}} duality-alone{{/unless}}">
<div class="dice-actions{{#unless (or hasDamage hasEffect)}} duality-alone{{/unless}}">
{{#if hasDamage}}
<button class="duality-action" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.RollDamage"}}</span></button>
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.RollDamage"}}</span></button>
{{/if}}
{{#if hasEffect}}
<button class="duality-action{{#if hasDamage}} duality-action-effect{{/if}}" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.ApplyEffect"}}</span></button>
{{/if}}
<div class="duality-result">
<div>{{roll.total}} {{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
<div>{{roll.total}} {{#if (eq roll.dualityResult 1)}}With Hope{{else}}{{#if (eq roll.dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
</div>
</div>
</div>

View file

@ -13,7 +13,7 @@
<li class="item inventory-item">
<div class="inventory-row" data-item-id="{{item.uuid}}">
<div class="inventory-item-title-container">
<div data-action="viewObject" data-value="{{item.uuid}}" class="inventory-item-title">
<div data-action="useItem" data-value="{{item.uuid}}" class="inventory-item-title">
<img src="{{item.img}}" />
{{item.name}}
</div>

View file

@ -7,7 +7,7 @@
{{#each source as |cost index|}}
<fieldset>
<div class="multi-display">
{{formField ../fields.type label="Resource" value=cost.type name=(concat "cost." index ".type") localize=true}}
{{formField ../fields.type choices=(@root.disableOption index ../fields.type.choices ../source) label="Resource" value=cost.type name=(concat "cost." index ".type") localize=true}}
{{formField ../fields.value label="Value" value=cost.value name=(concat "cost." index ".value")}}
</div>
<div class="multi-display">

View file

@ -1,16 +1,16 @@
<div>
{{#each cost as | c index |}}
{{#each costs as | cost index |}}
<div class="form-group">
<div class="form-fields">
<label for="{{type}}">{{type}}: {{total}}</label>
<input name="{{index}}.enabled" type="checkbox"{{#if enabled}} checked{{/if}}>
<input name="costs.{{index}}.enabled" type="checkbox"{{#if enabled}} checked{{/if}}>
{{#if scalable}}
<input type="range" value="{{scale}}" min="1" max="10" step="{{step}}" name="{{index}}.scale">
<input type="range" value="{{scale}}" min="1" max="10" step="{{step}}" name="costs.{{index}}.scale">
{{/if}}
</div>
</div>
{{/each}}
<footer>
<button data-action="sendHope">Accept</button>
<button data-action="sendCost"{{#unless canUse}} disabled{{/unless}}>Accept</button>
</footer>
</div>

View file

@ -2,25 +2,25 @@
<div class="roll-dialog-container">
<div class="flexcol">
<div class="roll-dialog-experience-container">
{{#each this.experiences}}
{{#if this.description}}
<div class="roll-dialog-chip {{#if this.selected}}selected{{/if}}" data-action="selectExperience" data-key="{{this.id}}">
<span>{{this.description}}</span>
<span>+{{this.value}}</span>
{{#each experiences}}
{{#if description}}
<div class="roll-dialog-chip {{#if (includes ../selectedExperiences id)}}selected{{/if}}" data-action="selectExperience" data-key="{{id}}">
<span>{{description}}</span>
<span>+{{value}}</span>
</div>
{{/if}}
{{/each}}
</div>
<div class="flexrow">
<button class="disadvantage flex1 {{#if this.advantage}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="true">{{localize "DAGGERHEART.General.Advantage.Full"}}</button>
<button class="disadvantage flex1 {{#if (eq this.advantage false)}}selected{{/if}}" data-action="updateIsAdvantage">{{localize "DAGGERHEART.General.Disadvantage.Full"}}</button>
<button class="disadvantage flex1 {{#if (eq advantage 1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="1">{{localize "DAGGERHEART.General.Advantage.Full"}}</button>
<button class="disadvantage flex1 {{#if (eq advantage -1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="-1">{{localize "DAGGERHEART.General.Disadvantage.Full"}}</button>
</div>
{{#if (not this.isNpc)}}
{{!-- {{#if (not isNpc)}} --}}
<div class="form-group">
<label>Hope</label>
<div class="form-fields">
<select name="hope">
{{selectOptions this.diceOptions selected=this.hope valueAttr="value" labelAttr="name" localize=true}}
{{selectOptions diceOptions selected=hope valueAttr="value" labelAttr="name" localize=true}}
</select>
</div>
</div>
@ -28,14 +28,14 @@
<label>Fear</label>
<div class="form-fields">
<select name="fear">
{{selectOptions this.diceOptions selected=this.fear valueAttr="value" labelAttr="name" localize=true}}
{{selectOptions diceOptions selected=fear valueAttr="value" labelAttr="name" localize=true}}
</select>
</div>
</div>
{{/if}}
{{!-- {{/if}} --}}
</div>
<footer>
<button data-action="finish">Roll</button>
<button data-action="close"{{#unless canRoll}} disabled{{/unless}}>Roll</button>
</footer>
</div>
</div>