Fix: messages et insomnie

Amélioration des messages de sommeil (nombre d'heure, seulement les
récupérations de rêve effectives, ...)

Les insomnies ne durent bien que 12h draconique à partir du prochain
chateau dormant (elles pouvaient durer 3 jours par erreur).
This commit is contained in:
2023-02-10 02:01:43 +01:00
parent 0c1b70f3f0
commit 4cf428f630
6 changed files with 162 additions and 173 deletions

View File

@ -14,29 +14,29 @@
<span class="flex-grow-1">Moral</span>
<span class="flex-shrink">Ignorer</span>
</li>
{{#each actorsSettings as |actorSetting|}}
<li class="item flexrow list-item set-sommeil-actor" data-actor-id="{{actorSetting.actor.id}}">
{{#each actors as |actor|}}
<li class="item flexrow list-item set-sommeil-actor" data-actor-id="{{actor.id}}">
<span class="flex-grow-3">
<label>
<img class="chat-icon" src="{{actorSetting.actor.img}}" title="{{actorSetting.actor.name}}" />
<span>{{actorSetting.actor.name}}</span>
<img class="chat-icon" src="{{actor.img}}" title="{{actor.name}}" />
<span>{{actor.name}}</span>
</label>
</span>
<span class="flex-shrink">
<input type="checkbox" class="sommeil-insomnie" {{#if actorSetting.insomnie}}checked{{/if}}>
<input type="checkbox" class="sommeil-insomnie" {{#if actor.system.sommeil.insomnie}}checked{{/if}}>
</span>
<span class="flex-grow-1">
<input type="number" class="number-x sommeil-heures" data-dtype="Number"
value="{{#if actorSetting.insomnie}}0{{else}}4{{/if}}"
min="0" max="{{#if actorSetting.insomnie}}0{{else}}12{{/if}}"
{{#if actorSetting.insomnie}}disabled{{/if}}/>
value="{{#if actor.system.sommeil.insomnie}}0{{else}}4{{/if}}"
min="0" max="{{#if actor.system.sommeil.insomnie}}0{{else}}12{{/if}}"
{{#if actor.system.sommeil.insomnie}}disabled{{/if}}/>
h
</span>
<span class="flex-shrink">
<input type="number" class="number-x2 sommeil-stress" value="0" data-dtype="Number" min="0" max="200"/>
</span>
<span class="flex-grow-1 flexrow sommeil-actor-moral">
{{> "systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs" actorSetting}}
{{> "systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs" actor.system.sommeil}}
</span>
<span class="flex-shrink">
<input type="checkbox" class="sommeil-ignorer">

View File

@ -4,41 +4,39 @@
<div class="flexrow"><span>
<h2>{{name}} se repose</h2>
</span></div>
{{#if system.sommeil.insomnie}}
<div class="flexrow"><span>
Insomnie, impossible de dormir
</span></div>
<div class="flexrow"><span>
<input class type="radio" name="repos" id="sieste" value="sieste">
<label for="sieste">Sieste de
<input type="number" name="sieste.heures" value="1" data-dtype="Number" />
heures</label>
</span></div>
<div class="flexrow"><span><hr></span></div>
{{#if system.sommeil.nouveaujour}}
<div class="flexrow"><span>
<input type="radio" name="repos" id="chateau-dormant" value="chateau-dormant">
<label for="chateau-dormant">Juste château Dormant</label>
</span></div>
<div class="flexrow"><span>
<input type="radio" name="repos" id="nuit" value="nuit" checked>
{{#if system.sommeil.insomnie}}
<label>Insomnie cette nuit</label>
{{else}}
<label for="nuit">Dormir
<input type="number" name="sommeil.heures" value="{{system.sommeil.heures}}" data-dtype="Number" />
heures cette nuit
</label>
{{/if}}
</span></div>
<div class="flexrow">
<label for="moral">Moral</label>
<div class="sommeil-actor-moral">
{{> "systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs" system.sommeil}}
</div>
</div>
{{else}}
<div class="flexrow"><span>
<input class type="radio" name="repos" id="sieste" value="sieste">
<label for="sieste">Sieste de
<input type="number" name="sieste.heures" value="1" data-dtype="Number" />
heures</label>
Le gardien des rêves doit faire passer Chateau Dormant
</span></div>
<div class="flexrow"><span><hr></span></div>
{{#if system.sommeil.nouveaujour}}
<div class="flexrow"><span>
<input type="radio" name="repos" id="chateau-dormant" value="chateau-dormant">
<label for="chateau-dormant">Juste château Dormant</label>
</span></div>
<div class="flexrow"><span>
<input type="radio" name="repos" id="nuit" value="nuit" checked>
<label for="nuit">Dormir
<input type="number" name="sommeil.heures" value="{{system.sommeil.heures}}" data-dtype="Number" />
heures cette nuit
</label>
</span></div>
<div class="flexrow">
<label for="moral">Moral</label>
<div class="sommeil-actor-moral">
{{> "systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs" system.sommeil}}
</div>
</div>
{{else}}
<div class="flexrow"><span>
Le gardien des rêves doit faire passer Chateau Dormant
</span></div>
{{/if}}
{{/if}}
<div class="flexrow"><span><hr></span></div>
<div class="flexrow"><span>