First flip management

This commit is contained in:
2021-01-24 23:18:50 +01:00
parent 8cd9d638b9
commit 05a2b02482
8 changed files with 252 additions and 38 deletions

27
templates/chat-flip.html Normal file
View File

@ -0,0 +1,27 @@
<h4>{{alias}} flips a card from {{cardOrigin}}{{#if isTrump}} with a Trump ! {{/if}}</h4>
<h4>This a {{mode}} {{#if skill}} {{skill.name}} {{/if}} Flip, with {{localize stat.label}} ({{stat.value}} - {{stat.cardsuit}})</h4>
<table>
<tr class="flexrow">
{{#each cardSlot as |slot|}}
<td class="flexcol">
<span><img class="chat-icon card-icon" src="{{slot.card1Path}}" /></span>
{{#if slot.isFace1}}
<span></span><img class="chat-icon card-icon" src="{{slot.card2Path}}" /></span>
{{/if}}
</td>
{{/each}}
</tr>
</table>
{{#if isJoker}}
<label>This is a Critical Failure ! You deck has been resetted !</label>
{{else}}
<div class="flexcol">
<label>Card(s) total value : {{cardTotal}}</label>
<label>Stat/Skill base value : {{baseScore}} </label>
<label>Modifier : {{numberFormat modifier decimals=0 sign=false}}</label>
<label>Final result : {{finalScore}} compared to TN {{tn}}</label>
<label><strong>This is a {{result}} with a magnitude of {{magnitude}}</strong></label>
</div>
{{/if}}

View File

@ -2,37 +2,59 @@
<h2 class="compdialog" id="statSkillFlip">Flip Dialog !</h2>
<h3 class="compdialog" id="flipSubTitle">
{{#if (eq mode 'stat')}}
Stat Only Flip : {{localize stat.label}}
<h3 class="compdialog" id="flipSubTitle">
Stat Only Flip : {{localize stat.label}} ({{stat.value}}, {{stat.cardsuit}})
</h3>
{{else}}
Skill Flip : {{skill.name}}
<h3 class="compdialog" id="flipSubTitle">
Select Stat
<select name="stat" id="statSelect" data-dtype="String">
{{#select statList}}
{{#each statList as |stat key|}}
<option value={{key}}>{{localize stat.label}}</option>
{{/each}}
{{/select}}
</select>
</h3>
<h3 class="compdialog" id="flipSubTitle">
Skill Flip : {{skill.name}} ({{skill.data.value}})
</h3>
{{/if}}
</h3>
<section class="sheet-body">
<div class="tab" data-group="primary">
<div class="flexrow">
<label for="categorie generic-label">Modifier</label>
<label for="categorie generic-label">Target Number (TN) : </label>
<select name="tn" id="tn" data-dtype="number">
{{#select tn}}
{{#each tnList as |key|}}
<option value={{key}} {{#if (eq key 10)}}selected{{/if}}>{{numberFormat key decimals=0 sign=false}}</option>
{{/each}}
{{/select}}
</select>
</div>
<div class="flexrow">
<label for="categorie generic-label">Flip Modifier</label>
<select name="modifier" id="modifier" data-dtype="number">
{{#select modifier}}
{{#each modifierList as |key|}}
<option value={{key}} {{#if (eq key 0)}}selected{{/if}}>{{numberFormat key decimals=0 sign=true}}</option>
{{/each}}
{{/select}}
</select>
{{#select modifier}}
{{#each modifierList as |key|}}
<option value={{key}} {{#if (eq key 0)}}selected{{/if}}>{{numberFormat key decimals=0 sign=true}}</option>
{{/each}}
{{/select}}
</select>
</div>
<div id="flexrow">
<label class="generic-label">Click on deck to flip from deck, or click on the relevant Edge card to flip from it!</label>
</div>
<div id="flowrow">
<span id="view-deck"></span>
<span class="generic-label" id="do-flip-deck"><a>Flip from deck !</a></span>
<div id="flexrow">
<span class="class-view-deck" id="view-deck"></span>
<span class="class-view-edge" id="view-edge"></span>
</div>
<div id="view-discard">
</div>
<div id="view-edge">
</div>
<div id="view-draw">
<div id="flexrow">
<label class="generic-label"></label>
</div>
</div>
</section>
</form>
</form>