Nouvelle fenêtre: attaque/defense

quelques améliorations
préparation pour gérer les messages de résultats en
fonction du type de jet (attaque/compétence/...)

quelques corrections (suppression du filtre de compétences
quand on change de type de jet, astrologie, ..)
This commit is contained in:
2025-09-24 01:23:10 +02:00
parent 1f330c734e
commit d26ab59c51
65 changed files with 381 additions and 350 deletions

View File

View File

@@ -0,0 +1,31 @@
<h4>
{{log this}}
<img class="chat-icon" src="{{competence.img}}" data-tooltip="{{competence.name}}" />
{{alias}} esquive une attaque à {{diffLibre}}</h4>
<p>{{selectedCarac.label}}{{#unless (eq selectedCarac.label competence.name)}} / {{competence.name}}{{/unless}}</p>
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.hbs"}}
<hr>
<p>
{{#if rolled.isSuccess}}
<span>Attaque esquivée!</span>
{{#if rolled.isPart}}
<!-- TODO: cas de parade à mains nues, texte à modifier -->
<span><strong>{{alias}} peut faire une deuxième esquive!</strong></span>
{{/if}}
{{else}}
<span>L'esquive de {{alias}} a échoué!</span>
{{/if}}
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.hbs"}}
</p>
{{#if attackerRoll.tactique}}
<p>
{{#if (eq attackerRoll.tactique 'charge')}}
<img class="chat-icon" src="icons/svg/thrust.svg" data-tooltip="charge" height="32" width="32" />
C'était une charge, les parades de l'adversaire de {{alias}} auront un -4 et il ne pourra pas esquiver!
{{ else if (eq attackerRoll.tactique 'feinte')}}
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg" data-tooltip="feinte" height="32" width="32" />
C'était une feinte!
{{/if}}
</p>
{{/if}}

View File

View File

View File

View File

View File

@@ -1,4 +1,4 @@
{{#if (or rollData.mode.passif (ne rollData.active.surprise.key 'totale'))}}
{{#if (or rollData.type.passif (ne rollData.active.surprise.key 'totale'))}}
<button name="roll-dialog-button">Lancer
{{rollData.current.carac.value}} à {{plusMoins rollData.current.totaldiff}}
{{#if rollData.current.significative.used}}

View File

@@ -1,10 +1,6 @@
<form class="roll-dialog">
<roll-header></roll-header>
<roll-mode>
{{#each modes as |mode|}}
{{> 'roll-mode' mode}}
{{/each}}
</roll-mode>
<roll-type>{{> 'roll-type' types=types}}</roll-type>
<roll-action>{{#each templates as |template|}}{{> 'roll-section' rollData=@root.rollData currentsection='action'}}{{/each}}</roll-action>
<roll-carac>{{#each templates as |template|}}{{> 'roll-section' rollData=@root.rollData currentsection='carac'}}{{/each}}</roll-carac>
<roll-comp>{{#each templates as |template|}}{{> 'roll-section' rollData=@root.rollData currentsection='comp'}}{{/each}}</roll-comp>

View File

@@ -1,3 +0,0 @@
<button name="roll-mode" data-tooltip="{{name}}" data-mode="{{code}}" data-checked="{{selected}}">
<img src="{{icon}}">
</button>

View File

@@ -1,2 +1,2 @@
<input name="{{code}}" type="checkbox" {{#if current.checked}}checked{{/if}}/>
<label for="{{code}}">{{current.label}}</label>
<label for="{{code}}">{{refs.label}}</label>

View File

@@ -1,5 +1,5 @@
<subline>
<select name="select-attaque" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-attaque" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.attaques selected=current.key valueAttr="key" labelAttr="label"}}
</select>
</subline>
@@ -11,7 +11,7 @@
<roll-part-detail>
<subline>
<label for="select-tactique">Tactique:</label>
<select name="select-tactique" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-tactique" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.tactiques selected=current.tactique.key valueAttr="key" labelAttr="label"}}
</select>
</subline>

View File

@@ -1,4 +1,4 @@
<select name="select-carac" {{#if (or rollData.mode.retry (eq refs.caracs.length 1))}}disabled{{/if}}>
<select name="select-carac" {{#if (or rollData.type.retry (eq refs.caracs.length 1))}}disabled{{/if}}>
{{selectOptions refs.caracs selected=current.key valueAttr="key" labelAttr="label"}}
</select>
<selected-numeric-value>{{current.value}}</selected-numeric-value>

View File

@@ -1,5 +1,5 @@
<label for="{{code}}">Coeur</label>
<select name="{{code}}" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="{{code}}" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.amoureux selected=current.key valueAttr="key" labelAttr="label"}}
</select>
{{#if current.amour}}

View File

@@ -1,4 +1,4 @@
<select name="select-comp" {{#if (or rollData.mode.retry (eq refs.comps.length 1))}}disabled{{/if}}>
<select name="select-comp" {{#if (or rollData.type.retry (eq refs.comps.length 1))}}disabled{{/if}}>
{{selectOptions refs.comps selected=current.key valueAttr="key" labelAttr="label"}}
</select>
<selected-numeric-value>{{plusMoins current.value}}</selected-numeric-value>

View File

@@ -4,5 +4,5 @@
step=1
min=current.min
max=current.max
disabled=rollData.mode.retry
disabled=rollData.type.retry
}}

View File

@@ -3,7 +3,7 @@
</roll-part-img>
<roll-part-detail>
<subline>
<select name="select-defense" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-defense" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.defenses selected=current.key valueAttr="key" labelAttr="label"}}
</select>
</subline>

View File

@@ -5,6 +5,6 @@
step=1
min=current.min
max=current.max
disabled=(or rollData.mode.retry current.disabled)
disabled=(or rollData.type.retry current.disabled)
}}
</subline>

View File

@@ -9,5 +9,5 @@
step=1
min=-30
max=0
disabled=rollData.mode.retry
disabled=rollData.type.retry
}}

View File

@@ -3,7 +3,7 @@
</roll-part-img>
<roll-part-detail>
<subline>
<select name="select-jeu" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-jeu" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.jeux selected=current.key valueAttr="key" labelAttr="label"}}
</select>
<selected-numeric-value>{{plusMoins current.value}}</selected-numeric-value>

View File

@@ -6,7 +6,7 @@
Rêve actuel: {{rollData.active.actor.system.reve.reve.value}}
</subline>
<subline>
<select name="select-meditation" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-meditation" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.meditations selected=current.key valueAttr="key" labelAttr="label"}}
</select>
{{#if current.meditation.system.malus}}
@@ -28,14 +28,14 @@
<subline>Durée:&nbsp;60 minutes</subline>
<hr>
<subline>
<input class="conditionMeditation" type="checkbox" name="isComportement" {{#if current.isComportement}}checked{{/if}} {{#if rollData.mode.retry}}disabled{{/if}}/>
<input class="conditionMeditation" type="checkbox" name="isComportement" {{#if current.isComportement}}checked{{/if}} {{#if rollData.type.retry}}disabled{{/if}}/>
<label for="isComportement">Comportement:&nbsp;
<span name="comportement">{{current.meditation.system.comportement}}</span>
</label>
</subline>
<subline>
<input class="conditionMeditation" type="checkbox" name="isHeure" {{#if current.isHeure}}checked{{/if}} {{#if rollData.mode.retry}}disabled{{/if}}/>
<input class="conditionMeditation" type="checkbox" name="isHeure" {{#if current.isHeure}}checked{{/if}} {{#if rollData.type.retry}}disabled{{/if}}/>
<label for="isHeure">Heure:&nbsp;
{{#with current.meditation.system.heure as |heure|}}
<span name="heure">{{timestamp-label heure}}</span>
@@ -45,13 +45,13 @@
</subline>
<subline>
<input class="conditionMeditation" type="checkbox" name="isPurification" {{#if current.isPurification}}checked{{/if}} {{#if rollData.mode.retry}}disabled{{/if}}/>
<input class="conditionMeditation" type="checkbox" name="isPurification" {{#if current.isPurification}}checked{{/if}} {{#if rollData.type.retry}}disabled{{/if}}/>
<label for="isPurification">Purification:&nbsp;
<span name="purification">{{current.meditation.system.purification}}</span></label>
</subline>
<subline>
<input class="conditionMeditation" type="checkbox" name="isVeture" {{#if current.isVeture}}checked{{/if}} {{#if rollData.mode.retry}}disabled{{/if}}/>
<input class="conditionMeditation" type="checkbox" name="isVeture" {{#if current.isVeture}}checked{{/if}} {{#if rollData.type.retry}}disabled{{/if}}/>
<label for="isVeture">Vêture:&nbsp;
<span name="veture">{{current.meditation.system.veture}}</span>
</label>

View File

@@ -3,7 +3,7 @@
</roll-part-img>
<roll-part-detail>
<subline>
<select name="select-oeuvre" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-oeuvre" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.oeuvres selected=current.key valueAttr="key" labelAttr="label"}}
</select>
{{#if current.oeuvre}}

View File

@@ -4,7 +4,7 @@
<roll-part-detail>
<subline>TMR actuelle: {{caseTmr-label rollData.active.actor.system.reve.tmrpos.coord}} {{rollData.active.actor.system.reve.tmrpos.coord}}</subline>
<subline>
<select name="select-sort" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-sort" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.sorts selected=current.key valueAttr="key" labelAttr="label"}}
</select>
{{#if current.isDiffVariable}}
@@ -13,7 +13,7 @@
step=1
min=-20
max=-1
disabled=rollData.mode.retry
disabled=rollData.type.retry
}}
{{else}}
<selected-numeric-value>{{plusMoins current.value}}</selected-numeric-value>
@@ -28,7 +28,7 @@
step=1
min=1
max=30
disabled=rollData.mode.retry
disabled=rollData.type.retry
}}
{{/if}}
<span>&nbsp;(actuel: {{rollData.active.actor.system.reve.reve.value}})</span>
@@ -37,7 +37,7 @@
{{#if current.sort.system.isrituel}}
<i class="fa-solid fa-book-sparkles"></i>&nbsp; Rituel
{{else}}
<input type="checkbox" name="reserve" {{#if current.isReserve}}checked{{/if}} {{#if rollData.mode.retry}}disabled{{/if}}/>
<input type="checkbox" name="reserve" {{#if current.isReserve}}checked{{/if}} {{#if rollData.type.retry}}disabled{{/if}}/>
<label for="reserve"><i class="fa-solid fa-sparkles"></i>&nbsp; Mettre en réserve</label>
{{/if}}
</subline>

View File

@@ -3,7 +3,7 @@
</roll-part-img>
<roll-part-detail>
<subline>
<select name="select-tache" {{#if rollData.mode.retry}}disabled{{/if}}>
<select name="select-tache" {{#if rollData.type.retry}}disabled{{/if}}>
{{selectOptions refs.taches selected=current.key valueAttr="key" labelAttr="label"}}
</select>
<selected-numeric-value>{{plusMoins current.value}}</selected-numeric-value>

View File

@@ -0,0 +1,5 @@
{{#each types as |type|}}
<button name="roll-type" data-tooltip="{{name}}" data-type="{{code}}" data-checked="{{selected}}">
<img src="{{icon}}">
</button>
{{/each}}