More tests againts rolls

This commit is contained in:
2026-03-06 08:06:57 +01:00
parent 95b19c8f02
commit 16cf35aed6
15 changed files with 677 additions and 185 deletions
+50 -10
View File
@@ -1,26 +1,65 @@
<form class="awemmy-roll-dialog">
{{! Attribute name + base modifier (read-only) }}
<div class="dialog-row check-label">
<span class="attr-name">{{attrLabel}}</span>
<span class="base-modifier">
{{#if (gt modifier 0)}}+{{modifier}}{{else}}{{modifier}}{{/if}}
{{!-- Attribute name + modifier breakdown --}}
<div class="roll-header">
<span class="roll-attr-name">{{attrLabel}}</span>
<span class="roll-formula-summary">
1d20
{{#if (gt modifier 0)}} + {{modifier}}{{else if (lt modifier 0)}} {{abs modifier}}{{/if}}
{{#if (gt attributeBonus 0)}} + <em>{{attributeBonus}}</em>{{else if (lt attributeBonus 0)}} <em>{{abs attributeBonus}}</em>{{/if}}
</span>
</div>
{{! Situational bonus / penalty }}
{{!-- Attribute persistent bonus/penalty (read-only if non-zero) --}}
{{#if attributeBonus}}
<div class="dialog-row hint-row">
<span class="hint-label">{{localize "AWEMMY.Roll.AttributeBonus"}}</span>
<span class="hint-value {{#if (gt attributeBonus 0)}}positive{{else}}negative{{/if}}">
{{#if (gt attributeBonus 0)}}+{{/if}}{{attributeBonus}}
</span>
</div>
{{/if}}
{{!-- Situational bonus / penalty --}}
<div class="dialog-row">
<label for="awe-bonus">{{localize "AWEMMY.Roll.SituationalBonus"}}</label>
<input type="number" id="awe-bonus" name="bonus" value="0" />
<select id="awe-bonus" name="bonus">
{{#each bonusChoices}}
<option value="{{this.value}}"{{#if this.selected}} selected{{/if}}>{{this.label}}</option>
{{/each}}
</select>
</div>
{{! DC (optional) }}
{{!-- Knowledge bonus (field items) --}}
{{#if knowledgeBonuses.length}}
<div class="dialog-row">
<label for="awe-knowledge">{{localize "AWEMMY.Roll.KnowledgeBonus"}}</label>
<select id="awe-knowledge" name="knowledgeBonus">
<option value="0">—</option>
{{#each knowledgeBonuses}}
<option value="{{this.bonus}}">{{this.label}} (+{{this.bonus}})</option>
{{/each}}
</select>
</div>
{{/if}}
{{!-- DC --}}
<div class="dialog-row">
<label for="awe-dc">{{localize "AWEMMY.Roll.DC"}}</label>
<input type="number" id="awe-dc" name="dc" value="{{dc}}" placeholder="—" />
<select id="awe-dc" name="dc">
{{#each dcChoices}}
<option value="{{this.value}}"{{#if this.selected}} selected{{/if}}>{{this.label}}</option>
{{/each}}
</select>
</div>
{{! Roll visibility }}
{{!-- Formula preview --}}
<div class="dialog-row formula-preview">
<span class="formula-label">{{localize "AWEMMY.Roll.Formula"}}</span>
<span class="formula-text" id="awe-formula-preview">1d20 + {{totalMod}}</span>
</div>
{{!-- Roll visibility --}}
<div class="dialog-row">
<label for="awe-visibility">{{localize "AWEMMY.Roll.Visibility"}}</label>
<select id="awe-visibility" name="visibility">
@@ -29,3 +68,4 @@
</div>
</form>