Merge pull request 'v10.6.15' (#626) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#626
This commit is contained in:
commit
f229537206
193
module/actor.js
193
module/actor.js
@ -360,31 +360,19 @@ export class RdDActor extends RdDBaseActor {
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
async prepareChateauDormant(finChateauDormant, consignes) {
|
||||
if (consignes.ignorer) {
|
||||
async prepareChateauDormant(consigne) {
|
||||
if (consigne.ignorer) {
|
||||
return;
|
||||
}
|
||||
if (consignes.stress.valeur > 0) {
|
||||
await this.distribuerStress('stress', consignes.stress.valeur, consignes.stress.motif);
|
||||
}
|
||||
if (!consignes.sommeil?.insomnie) {
|
||||
await this.update({
|
||||
"system.sommeil": {
|
||||
nouveaujour: true,
|
||||
date: finChateauDormant,
|
||||
moral: consignes.sommeil?.moral ?? 'neutre',
|
||||
heures: consignes.sommeil?.heures ?? 4
|
||||
}
|
||||
})
|
||||
if (consigne.stress.valeur > 0) {
|
||||
await this.distribuerStress('stress', consigne.stress.valeur, consigne.stress.motif);
|
||||
}
|
||||
await this.update({ 'system.sommeil': consigne.sommeil })
|
||||
}
|
||||
|
||||
async onTimeChanging(oldTimestamp, newTimestamp) {
|
||||
await super.onTimeChanging(oldTimestamp, newTimestamp);
|
||||
const insomnie = EffetsDraconiques.isSujetInsomnie(this);
|
||||
if (!this.system.sommeil || this.system.sommeil.insomnie || insomnie) {
|
||||
await this.update({ 'system.sommeil.insomnie': insomnie });
|
||||
}
|
||||
await this.setInfoSommeilInsomnie();
|
||||
}
|
||||
|
||||
async repos() {
|
||||
@ -409,22 +397,15 @@ export class RdDActor extends RdDBaseActor {
|
||||
await this.transformerStress();
|
||||
this.bonusRecuperationPotion = 0; // Reset potion
|
||||
}
|
||||
await this.update({
|
||||
"system.sommeil": {
|
||||
nouveaujour: false,
|
||||
moral: "neutre",
|
||||
heures: 0
|
||||
}
|
||||
})
|
||||
|
||||
await this.resetInfoSommeil()
|
||||
ChatMessage.create(message);
|
||||
this.sheet.render(true);
|
||||
}
|
||||
|
||||
async _recuperationSante(message) {
|
||||
const maladiesPoisons = this._maladiePoisons(message);
|
||||
this._messageRecuperationMaladiePoisons(maladiesPoisons, message);
|
||||
const isMaladeEmpoisonne = maladiesPoisons.length > 0;
|
||||
this._messageRecuperationMaladiePoisons(maladiesPoisons, message);
|
||||
const blessures = duplicate(this.system.blessures);
|
||||
await this._recupererBlessures(message, "legere", blessures.legeres.liste.filter(b => b.active), [], isMaladeEmpoisonne);
|
||||
await this._recupererBlessures(message, "grave", blessures.graves.liste.filter(b => b.active), blessures.legeres.liste, isMaladeEmpoisonne);
|
||||
@ -438,10 +419,10 @@ export class RdDActor extends RdDBaseActor {
|
||||
return actifs;
|
||||
}
|
||||
|
||||
_messageRecuperationMaladiePoisons(actifs, message) {
|
||||
if (actifs.length > 0) {
|
||||
const identifies = actifs.filter(it => it.system.identifie);
|
||||
const nonIdentifies = actifs.filter(it => !it.system.identifie);
|
||||
_messageRecuperationMaladiePoisons(maladiesPoisons, message) {
|
||||
if (maladiesPoisons.length > 0) {
|
||||
const identifies = maladiesPoisons.filter(it => it.system.identifie);
|
||||
const nonIdentifies = maladiesPoisons.filter(it => !it.system.identifie);
|
||||
message.content += 'Vous souffrez';
|
||||
switch (nonIdentifies.length) {
|
||||
case 0: break;
|
||||
@ -460,7 +441,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async dormirChateauDormant() {
|
||||
if (!ReglesOptionelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil?.nouveaujour) {
|
||||
if (!ReglesOptionelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
||||
const message = {
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: ""
|
||||
@ -469,9 +450,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
await this._recuperationSante(message)
|
||||
await this._jetDeMoralChateauDormant(message);
|
||||
await this._recupereChance();
|
||||
if (!this.system.sommeil?.insomnie) {
|
||||
await this.transformerStress();
|
||||
}
|
||||
await this.transformerStress();
|
||||
await this.retourSeuilDeReve(message);
|
||||
this.bonusRecuperationPotion = 0; // Reset potion
|
||||
await this.retourSust(message);
|
||||
@ -480,17 +459,31 @@ export class RdDActor extends RdDBaseActor {
|
||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
await this.update({
|
||||
"system.sommeil": {
|
||||
nouveaujour: false,
|
||||
moral: "neutre",
|
||||
heures: 0
|
||||
}
|
||||
});
|
||||
await this.resetInfoSommeil();
|
||||
this.sheet.render(true);
|
||||
}
|
||||
}
|
||||
|
||||
async resetInfoSommeil() {
|
||||
await this.update({
|
||||
'system.sommeil': {
|
||||
nouveaujour: false,
|
||||
date: game.system.rdd.calendrier.getTimestamp(),
|
||||
moral: "neutre",
|
||||
heures: 0,
|
||||
insomnie: EffetsDraconiques.isSujetInsomnie(this)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async setInfoSommeilInsomnie() {
|
||||
await this.update({ 'system.sommeil.insomnie': EffetsDraconiques.isSujetInsomnie(this) });
|
||||
}
|
||||
|
||||
async setInfoSommeilMoral(situationMoral) {
|
||||
await this.update({ 'system.sommeil.moral': situationMoral });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _recupereChance() {
|
||||
// On ne récupère un point de chance que si aucun appel à la chance dans la journée
|
||||
@ -639,50 +632,32 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async dormir(sommeilHeures, options = { grisReve: false, chateauDormant: false }) {
|
||||
const sommeil = !this.system.sommeil?.insomnie || options.grisReve;
|
||||
async dormir(heures, options = { grisReve: false, chateauDormant: false }) {
|
||||
const message = {
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: ""
|
||||
content: this.name + ': '
|
||||
};
|
||||
await this.recupereEndurance(message);
|
||||
let sep = ""
|
||||
let recuperationReve = "";
|
||||
let heuresDormies = 0;
|
||||
for (; heuresDormies < sommeilHeures; heuresDormies++) {
|
||||
await this._recupererEthylisme(message);
|
||||
if (sommeil) {
|
||||
await this.recupererFatigue(message);
|
||||
if (!options.grisReve) {
|
||||
if (sommeil) {
|
||||
let r = await this.recuperationReve(message);
|
||||
if (r >= 0) {
|
||||
recuperationReve += sep + r;
|
||||
sep = "+";
|
||||
}
|
||||
|
||||
if (r >= 0 && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||
r = await this.recuperationReve(message);
|
||||
if (r >= 0) {
|
||||
recuperationReve += sep + r;
|
||||
}
|
||||
}
|
||||
if (r < 0) {
|
||||
heuresDormies++;// rêve de dragon pendant l'heure en cours
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.system.sommeil?.insomnie || heures == 0) {
|
||||
message.content += 'Vous ne trouvez pas le sommeil';
|
||||
}
|
||||
else {
|
||||
let jetsReve = [];
|
||||
let dormi = await this.dormirDesHeures(jetsReve, message, heures, options);
|
||||
message.content += `Vous dormez ${dormi.heures <= 1 ? 'une heure' : (dormi.heures + ' heures')}. `;
|
||||
if (jetsReve.length > 0) {
|
||||
message.content += `Vous récupérez ${jetsReve.filter(it => it >= 0).reduce(Misc.joining("+"))} Points de rêve. `;
|
||||
}
|
||||
if (dormi.etat == 'eveil') {
|
||||
message.content += 'Vous êtes réveillé par un Rêve de Dragon.'
|
||||
}
|
||||
options.chateauDormant = options.chateauDormant && dormi.heures == heures;
|
||||
}
|
||||
|
||||
if (!options.grisReve) {
|
||||
const repos = this.system.sommeil?.insomnie ? "vous reposez" : "dormez"
|
||||
message.content = `${this.name}: Vous ${repos} ${heuresDormies <= 1 ? 'une heure' : (heuresDormies + ' heures')}. `
|
||||
+ (recuperationReve == "" ? "" : `Vous récupérez ${recuperationReve} Points de rêve. `)
|
||||
+ message.content;
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
if (options.chateauDormant && heuresDormies == sommeilHeures) {
|
||||
if (options.chateauDormant) {
|
||||
await this.dormirChateauDormant();
|
||||
}
|
||||
else {
|
||||
@ -690,6 +665,43 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
}
|
||||
|
||||
async dormirDesHeures(jetsReve, message, heures, options) {
|
||||
const dormi = { heures: 1, etat: 'dort' };
|
||||
for (; dormi.heures <= heures && dormi.etat == 'dort'; dormi.heures++) {
|
||||
await this._recupererEthylisme(message);
|
||||
if (options.grisReve) {
|
||||
await this.recupererFatigue(message);
|
||||
}
|
||||
else if (!this.system.sommeil?.insomnie) {
|
||||
await this.recupererFatigue(message);
|
||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
||||
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dormi;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async jetRecuperationReve(jetsReve, message) {
|
||||
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
||||
let reve = await RdDDice.rollTotal("1dr");
|
||||
if (reve >= 7) {
|
||||
// Rêve de Dragon !
|
||||
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
|
||||
await this.combattreReveDeDragon(reve);
|
||||
jetsReve.push(-1);
|
||||
return 'eveil';
|
||||
}
|
||||
else {
|
||||
await this.reveActuelIncDec(reve);
|
||||
jetsReve.push(reve);
|
||||
}
|
||||
}
|
||||
return 'dort';
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _recupererEthylisme(message) {
|
||||
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
||||
@ -750,27 +762,6 @@ export class RdDActor extends RdDBaseActor {
|
||||
return cumul;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async recuperationReve(message) {
|
||||
const seuil = this.system.reve.seuil.value;
|
||||
const reveActuel = this.getReveActuel();
|
||||
if (reveActuel < seuil) {
|
||||
let deRecuperation = await RdDDice.rollTotal("1dr");
|
||||
console.log("recuperationReve", deRecuperation);
|
||||
if (deRecuperation >= 7) {
|
||||
// Rêve de Dragon !
|
||||
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${deRecuperation} Points de rêve qui vous réveille! `;
|
||||
await this.combattreReveDeDragon(deRecuperation);
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
await this.reveActuelIncDec(deRecuperation);
|
||||
return deRecuperation;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async retourSeuilDeReve(message) {
|
||||
const seuil = this.system.reve.seuil.value;
|
||||
@ -1922,7 +1913,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
/* -------------------------------------------- */
|
||||
async transformerStress() {
|
||||
const stress = Number(this.system.compteurs.stress.value);
|
||||
if (stress <= 0) {
|
||||
if (this.system.sommeil?.insomnie || stress <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3841,7 +3832,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
await draconique.onActorCreateOwned(this, item)
|
||||
this.notifyGestionTeteSouffleQueue(item, draconique.manualMessage());
|
||||
}
|
||||
await this.update({ 'system.sommeil.insomnie': EffetsDraconiques.isSujetInsomnie(this) });
|
||||
await this.setInfoSommeilInsomnie();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||
this._appliquerRechercheObjets(formData.objets, formData.conteneurs);
|
||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||
return formData;
|
||||
}
|
||||
|
||||
|
@ -170,6 +170,9 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
getCurrentMinute() { return this.timestamp.indexMinute; }
|
||||
|
||||
getTimestamp() {
|
||||
return this.timestamp;
|
||||
}
|
||||
getTimestampFinChateauDormant(nbJours = 0) {
|
||||
return this.timestamp.nouveauJour().addJours(nbJours);
|
||||
}
|
||||
@ -260,7 +263,7 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
async setNewTimestamp(newTimestamp) {
|
||||
const oldTimestamp = this.timestamp;
|
||||
game.actors.forEach(actor => actor.onTimeChanging(oldTimestamp, newTimestamp));
|
||||
await Promise.all(game.actors.map(async actor => await actor.onTimeChanging(oldTimestamp, newTimestamp)));
|
||||
RdDTimestamp.setWorldTime(newTimestamp);
|
||||
if (oldTimestamp.indexDate + 1 == newTimestamp.indexDate && ReglesOptionelles.isUsing("chateau-dormant-gardien")) {
|
||||
await DialogChateauDormant.create();
|
||||
|
@ -1,16 +1,13 @@
|
||||
import { EffetsDraconiques } from "../tmr/effets-draconiques.js";
|
||||
|
||||
export class DialogChateauDormant extends Dialog {
|
||||
|
||||
static async create() {
|
||||
const date = game.system.rdd.calendrier.dateCourante();
|
||||
const actorsSettings = game.actors.filter(actor => actor.hasPlayerOwner && actor.isPersonnage())
|
||||
.map(actor => ({
|
||||
actor: actor,
|
||||
insomnie: actor.system.sommeil?.insomnie,
|
||||
moral: 'neutre'
|
||||
}));
|
||||
const actors = game.actors.filter(actor => actor.hasPlayerOwner && actor.isPersonnage());
|
||||
|
||||
const dialogData = {
|
||||
actorsSettings,
|
||||
actors: actors,
|
||||
date: date,
|
||||
motifStress: `Nuit du ${date}`,
|
||||
finChateauDormant: game.system.rdd.calendrier.getTimestampFinChateauDormant()
|
||||
@ -65,44 +62,42 @@ export class DialogChateauDormant extends Dialog {
|
||||
const selected = this.html.find(event.currentTarget);
|
||||
const actorRow = selected.parents('.set-sommeil-actor');
|
||||
const actorId = actorRow.data('actor-id');
|
||||
const actorSetting = this.getActorSetting(actorId);
|
||||
if (actorSetting) {
|
||||
actorSetting.moral = selected.data('moral');
|
||||
const htmlMoral = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs', actorSetting)
|
||||
actorRow.find('.sommeil-actor-moral').html(htmlMoral);
|
||||
// re-attach listeners for actor row
|
||||
this._activateListenerOnActorMoral(actorRow);
|
||||
}
|
||||
const actor = this.getActor(actorId);
|
||||
actor.system.sommeil.moral = selected.data('moral');
|
||||
const htmlMoral = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs', actor.system.sommeil)
|
||||
actorRow.find('.sommeil-actor-moral').html(htmlMoral);
|
||||
// re-attach listeners for actor row
|
||||
this._activateListenerOnActorMoral(actorRow);
|
||||
}
|
||||
|
||||
getActorSetting(actorId) {
|
||||
return this.dialogData.actorsSettings.find(it => it.actor.id == actorId);
|
||||
getActor(actorId) {
|
||||
return this.dialogData.actors.find(it => it.id == actorId);
|
||||
}
|
||||
|
||||
async onChateauDormant() {
|
||||
const motifStress = this.html.find("form input[name='motifStress']").val();
|
||||
const sommeilActors = jQuery.map(this.html.find('li.set-sommeil-actor'), it => {
|
||||
const consignesChateauDormant = jQuery.map(this.html.find('li.set-sommeil-actor'), it => {
|
||||
const actorRow = this.html.find(it);
|
||||
const actorId = actorRow.data('actor-id');
|
||||
const actorSetting = this.getActorSetting(actorId);
|
||||
const actor = this.getActor(actorId);
|
||||
const insomnie = actorRow.find('input.sommeil-insomnie').is(':checked');
|
||||
return {
|
||||
actorId,
|
||||
actor,
|
||||
ignorer: actorRow.find('input.sommeil-ignorer').is(':checked'),
|
||||
stress: {
|
||||
motif: motifStress,
|
||||
valeur: Number.parseInt(actorRow.find('input.sommeil-stress').val()),
|
||||
},
|
||||
sommeil: {
|
||||
insomnie: actorRow.find('input.sommeil-insomnie').is(':checked'),
|
||||
heures: Number.parseInt(actorRow.find('input.sommeil-heures').val()),
|
||||
moral: actorSetting.moral,
|
||||
nouveaujour: true,
|
||||
date: this.dialogData.finChateauDormant,
|
||||
insomnie: insomnie,
|
||||
heures: insomnie ? 0 : Number.parseInt(actorRow.find('input.sommeil-heures').val()),
|
||||
moral: actor.moral,
|
||||
}
|
||||
}
|
||||
});
|
||||
await Promise.all(
|
||||
sommeilActors.filter(it => !it.ignorer)
|
||||
.map(async it => await game.actors.get(it.actorId)?.prepareChateauDormant(this.dialogData.finChateauDormant, it))
|
||||
)
|
||||
consignesChateauDormant.forEach(async consigne => await consigne.actor.prepareChateauDormant(consigne))
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import { ReglesOptionelles } from "../settings/regles-optionelles.js";
|
||||
import { EffetsDraconiques } from "../tmr/effets-draconiques.js";
|
||||
|
||||
export class DialogRepos extends Dialog {
|
||||
|
||||
@ -6,7 +7,7 @@ export class DialogRepos extends Dialog {
|
||||
if (!ReglesOptionelles.isUsing("chateau-dormant-gardien")) {
|
||||
actor.system.sommeil = {
|
||||
"nouveaujour": true,
|
||||
"insomnie": false,
|
||||
"insomnie": EffetsDraconiques.isSujetInsomnie(actor),
|
||||
"moral": "neutre",
|
||||
"heures": 4
|
||||
}
|
||||
@ -58,7 +59,8 @@ export class DialogRepos extends Dialog {
|
||||
|
||||
async nuit() {
|
||||
await this.html.find("[name='sommeil.heures']").change();
|
||||
const sommeilHeures = Number.parseInt(await this.html.find("[name='sommeil.heures']").val());
|
||||
const val = await this.html.find("[name='sommeil.heures']").val();
|
||||
const sommeilHeures = Number.parseInt(val ?? '0');
|
||||
await this.actor.dormir(sommeilHeures, { chateauDormant: true });
|
||||
}
|
||||
|
||||
@ -72,7 +74,7 @@ export class DialogRepos extends Dialog {
|
||||
const selected = this.html.find(event.currentTarget);
|
||||
const parentDiv = selected.parents().find('.sommeil-actor-moral');
|
||||
const situationMoral = selected.data('moral');
|
||||
await this.actor.update({"system.sommeil.moral": situationMoral});
|
||||
await this.actor.setInfoSommeilMoral(situationMoral);
|
||||
const htmlMoral = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs', {
|
||||
moral: situationMoral
|
||||
});
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "10.6.14",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.6.14.zip",
|
||||
"version": "10.6.15",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.6.15.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
|
@ -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">
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user