Correction typo "optionnelle"
This commit is contained in:
		| @@ -7,7 +7,7 @@ import { Misc } from "./misc.js"; | |||||||
| import { RdDCombatManager } from "./rdd-combat.js"; | import { RdDCombatManager } from "./rdd-combat.js"; | ||||||
| import { RdDCarac } from "./rdd-carac.js"; | import { RdDCarac } from "./rdd-carac.js"; | ||||||
| import { DialogSplitItem } from "./dialog-split-item.js"; | import { DialogSplitItem } from "./dialog-split-item.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { RdDSheetUtility } from "./rdd-sheet-utility.js"; | import { RdDSheetUtility } from "./rdd-sheet-utility.js"; | ||||||
| import { STATUSES } from "./settings/status-effects.js"; | import { STATUSES } from "./settings/status-effects.js"; | ||||||
| import { MAINS_DIRECTRICES } from "./actor.js"; | import { MAINS_DIRECTRICES } from "./actor.js"; | ||||||
| @@ -115,7 +115,7 @@ export class RdDActorSheet extends RdDBaseActorSheet { | |||||||
|   activateListeners(html) { |   activateListeners(html) { | ||||||
|     super.activateListeners(html); |     super.activateListeners(html); | ||||||
|  |  | ||||||
|     HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); |     HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionnelles.isUsing("appliquer-fatigue")); | ||||||
|  |  | ||||||
|     // Everything below here is only needed if the sheet is editable |     // Everything below here is only needed if the sheet is editable | ||||||
|     if (!this.options.editable) return; |     if (!this.options.editable) return; | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ import { RdDAlchimie } from "./rdd-alchimie.js"; | |||||||
| import { STATUSES, StatusEffects } from "./settings/status-effects.js"; | import { STATUSES, StatusEffects } from "./settings/status-effects.js"; | ||||||
| import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | ||||||
| import { RdDItemSigneDraconique } from "./item/signedraconique.js"; | import { RdDItemSigneDraconique } from "./item/signedraconique.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; | import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; | ||||||
| import { Draconique } from "./tmr/draconique.js"; | import { Draconique } from "./tmr/draconique.js"; | ||||||
| import { RdDCarac } from "./rdd-carac.js"; | import { RdDCarac } from "./rdd-carac.js"; | ||||||
| @@ -134,7 +134,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|   } |   } | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   getFatigueActuelle() { |   getFatigueActuelle() { | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue") && this.isPersonnage()) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue") && this.isPersonnage()) { | ||||||
|       return this.system.sante.fatigue?.value; |       return this.system.sante.fatigue?.value; | ||||||
|     } |     } | ||||||
|     return 0; |     return 0; | ||||||
| @@ -457,7 +457,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async dormirChateauDormant() { |   async dormirChateauDormant() { | ||||||
|     if (!ReglesOptionelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) { |     if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) { | ||||||
|       const message = { |       const message = { | ||||||
|         whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), |         whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), | ||||||
|         content: "" |         content: "" | ||||||
| @@ -712,7 +712,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async recupererFatigue(message) { |   async recupererFatigue(message) { | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue")) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|       let fatigue = this.system.sante.fatigue.value; |       let fatigue = this.system.sante.fatigue.value; | ||||||
|       const fatigueMin = this._computeFatigueMin(); |       const fatigueMin = this._computeFatigueMin(); | ||||||
|       if (fatigue <= fatigueMin) { |       if (fatigue <= fatigueMin) { | ||||||
| @@ -1178,7 +1178,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|     } |     } | ||||||
|     // Pour les autres |     // Pour les autres | ||||||
|     let state = Math.min(this.system.sante.vie.value - this.system.sante.vie.max, 0); |     let state = Math.min(this.system.sante.vie.value - this.system.sante.vie.max, 0); | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue") && this.system.sante.fatigue) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue") && this.system.sante.fatigue) { | ||||||
|       state += RdDUtility.currentFatigueMalus(this.system.sante.fatigue.value, this.system.sante.endurance.max); |       state += RdDUtility.currentFatigueMalus(this.system.sante.fatigue.value, this.system.sante.endurance.max); | ||||||
|     } |     } | ||||||
|     // Ajout de l'éthylisme |     // Ajout de l'éthylisme | ||||||
| @@ -1505,7 +1505,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async santeIncDec(name, inc, isCritique = false) { |   async santeIncDec(name, inc, isCritique = false) { | ||||||
|     if (name == 'fatigue' && !ReglesOptionelles.isUsing("appliquer-fatigue")) { |     if (name == 'fatigue' && !ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     const sante = duplicate(this.system.sante) |     const sante = duplicate(this.system.sante) | ||||||
| @@ -1547,7 +1547,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|     } |     } | ||||||
|     compteur.value = result.newValue; |     compteur.value = result.newValue; | ||||||
|     // If endurance lost, then the same amount of fatigue cannot be recovered |     // If endurance lost, then the same amount of fatigue cannot be recovered | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue") && sante.fatigue && fatigue > 0) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue") && sante.fatigue && fatigue > 0) { | ||||||
|       sante.fatigue.value = Math.max(sante.fatigue.value + fatigue, this._computeFatigueMin()); |       sante.fatigue.value = Math.max(sante.fatigue.value + fatigue, this._computeFatigueMin()); | ||||||
|     } |     } | ||||||
|     await this.update({ "system.sante": sante }) |     await this.update({ "system.sante": sante }) | ||||||
| @@ -2449,7 +2449,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async _tacheResult(rollData, options) { |   async _tacheResult(rollData, options) { | ||||||
|     // Mise à jour de la tache |     // Mise à jour de la tache | ||||||
|     rollData.appliquerFatigue = ReglesOptionelles.isUsing("appliquer-fatigue"); |     rollData.appliquerFatigue = ReglesOptionnelles.isUsing("appliquer-fatigue"); | ||||||
|     rollData.tache = duplicate(rollData.tache); |     rollData.tache = duplicate(rollData.tache); | ||||||
|     rollData.tache.system.points_de_tache_courant += rollData.rolled.ptTache; |     rollData.tache.system.points_de_tache_courant += rollData.rolled.ptTache; | ||||||
|     if (rollData.rolled.isETotal) { |     if (rollData.rolled.isETotal) { | ||||||
| @@ -3230,7 +3230,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     const attackerId = attacker?.id; |     const attackerId = attacker?.id; | ||||||
|     if (ReglesOptionelles.isUsing('validation-encaissement-gr') && !game.user.isGM) { |     if (ReglesOptionnelles.isUsing('validation-encaissement-gr') && !game.user.isGM) { | ||||||
|       RdDBaseActor.remoteActorCall({ |       RdDBaseActor.remoteActorCall({ | ||||||
|         actorId: this.id, |         actorId: this.id, | ||||||
|         method: 'appliquerEncaissement', |         method: 'appliquerEncaissement', | ||||||
| @@ -3243,7 +3243,7 @@ export class RdDActor extends RdDBaseActor { | |||||||
|  |  | ||||||
|   async appliquerEncaissement(rollData, show, attackerId) { |   async appliquerEncaissement(rollData, show, attackerId) { | ||||||
|     const armure = await this.computeArmure(rollData); |     const armure = await this.computeArmure(rollData); | ||||||
|     if (ReglesOptionelles.isUsing('validation-encaissement-gr')) { |     if (ReglesOptionnelles.isUsing('validation-encaissement-gr')) { | ||||||
|       DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, attackerId, (encaissement, show, attackerId) => this._appliquerEncaissement(encaissement, show, attackerId)); |       DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, attackerId, (encaissement, show, attackerId) => this._appliquerEncaissement(encaissement, show, attackerId)); | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import { RdDItemCompetence } from "./item-competence.js"; | |||||||
| import { RdDHerbes } from "./rdd-herbes.js"; | import { RdDHerbes } from "./rdd-herbes.js"; | ||||||
| import { RdDGemme } from "./rdd-gemme.js"; | import { RdDGemme } from "./rdd-gemme.js"; | ||||||
| import { HtmlUtility } from "./html-utility.js"; | import { HtmlUtility } from "./html-utility.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { SYSTEM_RDD } from "./constants.js"; | import { SYSTEM_RDD } from "./constants.js"; | ||||||
| import { RdDSheetUtility } from "./rdd-sheet-utility.js"; | import { RdDSheetUtility } from "./rdd-sheet-utility.js"; | ||||||
| import { SystemCompendiums } from "./settings/system-compendiums.js"; | import { SystemCompendiums } from "./settings/system-compendiums.js"; | ||||||
| @@ -157,7 +157,7 @@ export class RdDItemSheet extends ItemSheet { | |||||||
|     super.activateListeners(html); |     super.activateListeners(html); | ||||||
|     this.html = html; |     this.html = html; | ||||||
|  |  | ||||||
|     HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') |     HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionnelles.isUsing('afficher-prix-joueurs') | ||||||
|       || game.user.isGM |       || game.user.isGM | ||||||
|       || !this.item.isOwned); |       || !this.item.isOwned); | ||||||
|     HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique()); |     HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique()); | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import { RdDItem } from "../item.js"; | import { RdDItem } from "../item.js"; | ||||||
| import { Misc } from "../misc.js"; | import { Misc } from "../misc.js"; | ||||||
| import { ReglesOptionelles } from "../settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "../settings/regles-optionnelles.js"; | ||||||
|  |  | ||||||
| export class RdDItemArmure extends RdDItem { | export class RdDItemArmure extends RdDItem { | ||||||
|  |  | ||||||
| @@ -9,7 +9,7 @@ export class RdDItemArmure extends RdDItem { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   deteriorerArmure(dmg) { |   deteriorerArmure(dmg) { | ||||||
|     if (!ReglesOptionelles.isUsing('deteriorationArmure') || this.system.protection == '0') { |     if (!ReglesOptionnelles.isUsing('deteriorationArmure') || this.system.protection == '0') { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     let deterioration = (this.system.deterioration ?? 0) + dmg; |     let deterioration = (this.system.deterioration ?? 0) + dmg; | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ import { RdDBonus } from "./rdd-bonus.js"; | |||||||
| import { RdDResolutionTable } from "./rdd-resolution-table.js"; | import { RdDResolutionTable } from "./rdd-resolution-table.js"; | ||||||
| import { RdDRoll } from "./rdd-roll.js"; | import { RdDRoll } from "./rdd-roll.js"; | ||||||
| import { RdDRollTables } from "./rdd-rolltables.js"; | import { RdDRollTables } from "./rdd-rolltables.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { STATUSES } from "./settings/status-effects.js"; | import { STATUSES } from "./settings/status-effects.js"; | ||||||
| import { Targets } from "./targets.js"; | import { Targets } from "./targets.js"; | ||||||
| import { RdDEmpoignade } from "./rdd-empoignade.js"; | import { RdDEmpoignade } from "./rdd-empoignade.js"; | ||||||
| @@ -1048,7 +1048,7 @@ export class RdDCombat { | |||||||
|       competence: this.defender.getCompetence(competenceParade).clone(), |       competence: this.defender.getCompetence(competenceParade).clone(), | ||||||
|       arme: armeParade, |       arme: armeParade, | ||||||
|       surprise: this.defender.getSurprise(true), |       surprise: this.defender.getSurprise(true), | ||||||
|       needParadeSignificative: ReglesOptionelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(attackerRoll.arme, armeParade), |       needParadeSignificative: ReglesOptionnelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(attackerRoll.arme, armeParade), | ||||||
|       needResist: RdDItemArme.needArmeResist(attackerRoll.arme, armeParade), |       needResist: RdDItemArme.needArmeResist(attackerRoll.arme, armeParade), | ||||||
|       carac: this.defender.system.carac, |       carac: this.defender.system.carac, | ||||||
|       show: {} |       show: {} | ||||||
| @@ -1166,7 +1166,7 @@ export class RdDCombat { | |||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async computeDeteriorationArme(defenderRoll) { |   async computeDeteriorationArme(defenderRoll) { | ||||||
|     if (!ReglesOptionelles.isUsing('resistanceArmeParade')) { |     if (!ReglesOptionnelles.isUsing('resistanceArmeParade')) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     const attackerRoll = defenderRoll.attackerRoll; |     const attackerRoll = defenderRoll.attackerRoll; | ||||||
| @@ -1215,7 +1215,7 @@ export class RdDCombat { | |||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         // Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132) |         // Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132) | ||||||
|         if (ReglesOptionelles.isUsing('defenseurDesarme') && resistance > 0 && RdDItemArme.getCategorieParade(defenderRoll.arme) != 'boucliers') { |         if (ReglesOptionnelles.isUsing('defenseurDesarme') && resistance > 0 && RdDItemArme.getCategorieParade(defenderRoll.arme) != 'boucliers') { | ||||||
|           let desarme = await RdDResolutionTable.rollData({ |           let desarme = await RdDResolutionTable.rollData({ | ||||||
|             caracValue: this.defender.getForce(), |             caracValue: this.defender.getForce(), | ||||||
|             finalLevel: Misc.toInt(defenderRoll.competence.system.niveau) - dmg, |             finalLevel: Misc.toInt(defenderRoll.competence.system.niveau) - dmg, | ||||||
| @@ -1230,7 +1230,7 @@ export class RdDCombat { | |||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async computeRecul(defenderRoll) { // Calcul du recul (p. 132) |   async computeRecul(defenderRoll) { // Calcul du recul (p. 132) | ||||||
|     const attackerRoll = defenderRoll.attackerRoll; |     const attackerRoll = defenderRoll.attackerRoll; | ||||||
|     if (ReglesOptionelles.isUsing('recul') && this._isForceOuCharge(attackerRoll)) { |     if (ReglesOptionnelles.isUsing('recul') && this._isForceOuCharge(attackerRoll)) { | ||||||
|       const impact = this._computeImpactRecul(attackerRoll); |       const impact = this._computeImpactRecul(attackerRoll); | ||||||
|       const rollRecul = await RdDResolutionTable.rollData({ caracValue: 10, finalLevel: impact }); |       const rollRecul = await RdDResolutionTable.rollData({ caracValue: 10, finalLevel: impact }); | ||||||
|       if (rollRecul.rolled.isSuccess) { |       if (rollRecul.rolled.isSuccess) { | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| import { Grammar } from "./grammar.js"; | import { Grammar } from "./grammar.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
|  |  | ||||||
| export class RdDConfirm { | export class RdDConfirm { | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   static confirmer(options, autresActions) { |   static confirmer(options, autresActions) { | ||||||
|     options.bypass = options.bypass || !(options.settingConfirmer == undefined || ReglesOptionelles.isUsing(options.settingConfirmer)); |     options.bypass = options.bypass || !(options.settingConfirmer == undefined || ReglesOptionnelles.isUsing(options.settingConfirmer)); | ||||||
|     if (options.bypass) { |     if (options.bypass) { | ||||||
|       options.onAction(); |       options.onAction(); | ||||||
|     } |     } | ||||||
| @@ -47,7 +47,7 @@ export class RdDConfirm { | |||||||
|         icon: '<i class="fas fa-user-check"></i>', |         icon: '<i class="fas fa-user-check"></i>', | ||||||
|         label: options.buttonLabel + "<br>et ne plus demander", |         label: options.buttonLabel + "<br>et ne plus demander", | ||||||
|         callback: () => { |         callback: () => { | ||||||
|           ReglesOptionelles.set(options.settingConfirmer, false); |           ReglesOptionnelles.set(options.settingConfirmer, false); | ||||||
|           options.onAction(); |           options.onAction(); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import { RdDRoll } from "./rdd-roll.js"; | |||||||
| import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | ||||||
| import { ChatUtility } from "./chat-utility.js"; | import { ChatUtility } from "./chat-utility.js"; | ||||||
| import { STATUSES } from "./settings/status-effects.js"; | import { STATUSES } from "./settings/status-effects.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { TYPES } from "./item.js"; | import { TYPES } from "./item.js"; | ||||||
|  |  | ||||||
| /* -------------------------------------------- */ | /* -------------------------------------------- */ | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ import { RdDCombatManager, RdDCombat } from "./rdd-combat.js"; | |||||||
| import { ChatUtility } from "./chat-utility.js"; | import { ChatUtility } from "./chat-utility.js"; | ||||||
| import { StatusEffects } from "./settings/status-effects.js"; | import { StatusEffects } from "./settings/status-effects.js"; | ||||||
| import { RdDCompendiumOrganiser } from "./rdd-compendium-organiser.js"; | import { RdDCompendiumOrganiser } from "./rdd-compendium-organiser.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { RdDHotbar } from "./rdd-hotbar-drop.js" | import { RdDHotbar } from "./rdd-hotbar-drop.js" | ||||||
| import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; | import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; | ||||||
| import { RdDHerbes } from "./rdd-herbes.js"; | import { RdDHerbes } from "./rdd-herbes.js"; | ||||||
| @@ -186,7 +186,7 @@ export class SystemReveDeDragon { | |||||||
|     RdDCalendrier.init(); |     RdDCalendrier.init(); | ||||||
|     SystemCompendiums.init(); |     SystemCompendiums.init(); | ||||||
|     DialogChronologie.init(); |     DialogChronologie.init(); | ||||||
|     ReglesOptionelles.init(); |     ReglesOptionnelles.init(); | ||||||
|     RdDUtility.init(); |     RdDUtility.init(); | ||||||
|     RdDDice.init(); |     RdDDice.init(); | ||||||
|     RdDCommands.init(); |     RdDCommands.init(); | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import { ChatUtility } from "./chat-utility.js"; | import { ChatUtility } from "./chat-utility.js"; | ||||||
| import { Misc } from "./misc.js"; | import { Misc } from "./misc.js"; | ||||||
| import { RdDDice } from "./rdd-dice.js"; | import { RdDDice } from "./rdd-dice.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * difficultés au delà de -10 |  * difficultés au delà de -10 | ||||||
| @@ -126,7 +126,7 @@ export class RdDResolutionTable { | |||||||
|     rolled.bonus = rollData.bonus; |     rolled.bonus = rollData.bonus; | ||||||
|     rolled.factorHtml = Misc.getFractionHtml(rollData.diviseurSignificative); |     rolled.factorHtml = Misc.getFractionHtml(rollData.diviseurSignificative); | ||||||
|  |  | ||||||
|     if (ReglesOptionelles.isUsing("afficher-colonnes-reussite")) { |     if (ReglesOptionnelles.isUsing("afficher-colonnes-reussite")) { | ||||||
|       rolled.niveauNecessaire = this.findNiveauNecessaire(caracValue, rolled.roll); |       rolled.niveauNecessaire = this.findNiveauNecessaire(caracValue, rolled.roll); | ||||||
|       rolled.ajustementNecessaire = rolled.niveauNecessaire - finalLevel; |       rolled.ajustementNecessaire = rolled.niveauNecessaire - finalLevel; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ import { Misc } from "./misc.js"; | |||||||
| import { RdDBonus } from "./rdd-bonus.js"; | import { RdDBonus } from "./rdd-bonus.js"; | ||||||
| import { RdDCarac } from "./rdd-carac.js"; | import { RdDCarac } from "./rdd-carac.js"; | ||||||
| import { RdDResolutionTable } from "./rdd-resolution-table.js"; | import { RdDResolutionTable } from "./rdd-resolution-table.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Extend the base Dialog entity to select roll parameters |  * Extend the base Dialog entity to select roll parameters | ||||||
| @@ -85,7 +85,7 @@ export class RdDRoll extends Dialog { | |||||||
|     if (RdDBonus.isDefenseAttaqueFinesse(rollData)) { |     if (RdDBonus.isDefenseAttaqueFinesse(rollData)) { | ||||||
|       facteurSign *= 2; |       facteurSign *= 2; | ||||||
|     } |     } | ||||||
|     if (!ReglesOptionelles.isUsing('tripleSignificative')) { |     if (!ReglesOptionnelles.isUsing('tripleSignificative')) { | ||||||
|       facteurSign = Math.min(facteurSign, 4); |       facteurSign = Math.min(facteurSign, 4); | ||||||
|     } |     } | ||||||
|     return facteurSign; |     return facteurSign; | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; | |||||||
| import { PixiTMR } from "./tmr/pixi-tmr.js"; | import { PixiTMR } from "./tmr/pixi-tmr.js"; | ||||||
| import { Draconique } from "./tmr/draconique.js"; | import { Draconique } from "./tmr/draconique.js"; | ||||||
| import { HtmlUtility } from "./html-utility.js"; | import { HtmlUtility } from "./html-utility.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { RdDDice } from "./rdd-dice.js"; | import { RdDDice } from "./rdd-dice.js"; | ||||||
| import { STATUSES } from "./settings/status-effects.js"; | import { STATUSES } from "./settings/status-effects.js"; | ||||||
| import { RdDRencontre } from "./item/rencontre.js"; | import { RdDRencontre } from "./item/rencontre.js"; | ||||||
| @@ -55,7 +55,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|     this.actor = actor; |     this.actor = actor; | ||||||
|     this.actor.tmrApp = this; // reference this app in the actor structure |     this.actor.tmrApp = this; // reference this app in the actor structure | ||||||
|     this.viewOnly = tmrData.mode == "visu" |     this.viewOnly = tmrData.mode == "visu" | ||||||
|     this.fatigueParCase = this.viewOnly || !ReglesOptionelles.isUsing("appliquer-fatigue") ? 0 : this.actor.getTMRFatigue(); |     this.fatigueParCase = this.viewOnly || !ReglesOptionnelles.isUsing("appliquer-fatigue") ? 0 : this.actor.getTMRFatigue(); | ||||||
|     this.cumulFatigue = 0; |     this.cumulFatigue = 0; | ||||||
|     this.loadRencontres(); |     this.loadRencontres(); | ||||||
|     this.loadCasesSpeciales(); |     this.loadCasesSpeciales(); | ||||||
| @@ -207,7 +207,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); |     HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionnelles.isUsing("appliquer-fatigue")); | ||||||
|     HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord())); |     HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord())); | ||||||
|  |  | ||||||
|     // Roll Sort |     // Roll Sort | ||||||
| @@ -227,7 +227,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|  |  | ||||||
|     // Gestion du cout de montée en points de rêve |     // Gestion du cout de montée en points de rêve | ||||||
|     let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse(); |     let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse(); | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue")) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|       this.cumulFatigue += this.fatigueParCase; |       this.cumulFatigue += this.fatigueParCase; | ||||||
|     } |     } | ||||||
|     await this.actor.reveActuelIncDec(reveCout); |     await this.actor.reveActuelIncDec(reveCout); | ||||||
| @@ -263,7 +263,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|     let refoulement = document.getElementById("tmr-refoulement-value"); |     let refoulement = document.getElementById("tmr-refoulement-value"); | ||||||
|     refoulement.innerHTML = this.actor.system.reve.refoulement.value; |     refoulement.innerHTML = this.actor.system.reve.refoulement.value; | ||||||
|  |  | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue")) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|       let fatigueItem = document.getElementById("tmr-fatigue-table"); |       let fatigueItem = document.getElementById("tmr-fatigue-table"); | ||||||
|       fatigueItem.innerHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(this.actor.system.sante.fatigue.value, this.actor.system.sante.endurance.max).html() + "</table>"; |       fatigueItem.innerHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(this.actor.system.sante.fatigue.value, this.actor.system.sante.endurance.max).html() + "</table>"; | ||||||
|     } |     } | ||||||
| @@ -367,7 +367,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     const resteAvantInconscience = this.actor.getFatigueMax() - this.actor.getFatigueActuelle() - this.cumulFatigue; |     const resteAvantInconscience = this.actor.getFatigueMax() - this.actor.getFatigueActuelle() - this.cumulFatigue; | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue") && resteAvantInconscience <= 0) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue") && resteAvantInconscience <= 0) { | ||||||
|       this._tellToGM("Vous vous écroulez de fatigue : vous quittez les Terres médianes !"); |       this._tellToGM("Vous vous écroulez de fatigue : vous quittez les Terres médianes !"); | ||||||
|       this.quitterLesTMRInconscient(); |       this.quitterLesTMRInconscient(); | ||||||
|       return true; |       return true; | ||||||
| @@ -451,7 +451,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|     setTimeout(() => { |     setTimeout(() => { | ||||||
|       // TODO: remplacer par une boucle while(this.currentRencontre) ? |       // TODO: remplacer par une boucle while(this.currentRencontre) ? | ||||||
|       rencData.nbRounds++; |       rencData.nbRounds++; | ||||||
|       if (ReglesOptionelles.isUsing("appliquer-fatigue")) { |       if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|         this.cumulFatigue += this.fatigueParCase; |         this.cumulFatigue += this.fatigueParCase; | ||||||
|       } |       } | ||||||
|       this._tentativeMaitrise(rencData); |       this._tentativeMaitrise(rencData); | ||||||
| @@ -1004,7 +1004,7 @@ export class RdDTMRDialog extends Dialog { | |||||||
|     await this.actor.updateCoordTMR(tmr.coord); |     await this.actor.updateCoordTMR(tmr.coord); | ||||||
|  |  | ||||||
|     this.forceDemiRevePositionView(); |     this.forceDemiRevePositionView(); | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue")) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|       this.cumulFatigue += this.fatigueParCase; |       this.cumulFatigue += this.fatigueParCase; | ||||||
|     } |     } | ||||||
|     this.updateValuesDisplay(); |     this.updateValuesDisplay(); | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import { Misc } from "./misc.js"; | |||||||
| import { Grammar } from "./grammar.js"; | import { Grammar } from "./grammar.js"; | ||||||
| import { TMRUtility } from "./tmr-utility.js"; | import { TMRUtility } from "./tmr-utility.js"; | ||||||
| import { DialogItemAchat } from "./dialog-item-achat.js"; | import { DialogItemAchat } from "./dialog-item-achat.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
| import { RdDDice } from "./rdd-dice.js"; | import { RdDDice } from "./rdd-dice.js"; | ||||||
| import { RdDItem } from "./item.js"; | import { RdDItem } from "./item.js"; | ||||||
| import { RdDPossession } from "./rdd-possession.js"; | import { RdDPossession } from "./rdd-possession.js"; | ||||||
| @@ -279,7 +279,7 @@ export class RdDUtility { | |||||||
|     Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode()); |     Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode()); | ||||||
|  |  | ||||||
|     Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1))); |     Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1))); | ||||||
|     Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionelles.isUsing(option)); |     Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionnelles.isUsing(option)); | ||||||
|     Handlebars.registerHelper('trier', list => list.sort((a, b) => a.name.localeCompare(b.name))); |     Handlebars.registerHelper('trier', list => list.sort((a, b) => a.name.localeCompare(b.name))); | ||||||
|     Handlebars.registerHelper('filtreTriCompetences', competences => RdDItemCompetence.triVisible(competences)); |     Handlebars.registerHelper('filtreTriCompetences', competences => RdDItemCompetence.triVisible(competences)); | ||||||
|     Handlebars.registerHelper('linkCompendium', (pack, id, name) => RdDUtility.linkCompendium(pack, id, name)); |     Handlebars.registerHelper('linkCompendium', (pack, id, name) => RdDUtility.linkCompendium(pack, id, name)); | ||||||
| @@ -479,7 +479,7 @@ export class RdDUtility { | |||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   static calculFatigueHtml(fatigue, endurance) { |   static calculFatigueHtml(fatigue, endurance) { | ||||||
|     return ReglesOptionelles.isUsing("appliquer-fatigue") ? { |     return ReglesOptionnelles.isUsing("appliquer-fatigue") ? { | ||||||
|       malus: RdDUtility.calculMalusFatigue(fatigue, endurance), |       malus: RdDUtility.calculMalusFatigue(fatigue, endurance), | ||||||
|       html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(fatigue, endurance).html() + "</table>" |       html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(fatigue, endurance).html() + "</table>" | ||||||
|     } : { malus: 0, html: '' }; |     } : { malus: 0, html: '' }; | ||||||
| @@ -555,14 +555,14 @@ export class RdDUtility { | |||||||
|     let formula = "2d10"; |     let formula = "2d10"; | ||||||
|  |  | ||||||
|     // Chaque dé fait au minmum la difficulté libre |     // Chaque dé fait au minmum la difficulté libre | ||||||
|     if (ReglesOptionelles.isUsing('degat-minimum-malus-libre')) { |     if (ReglesOptionnelles.isUsing('degat-minimum-malus-libre')) { | ||||||
|       if (rollData.diffLibre < 0) { |       if (rollData.diffLibre < 0) { | ||||||
|         let valeurMin = Math.abs(rollData.diffLibre); |         let valeurMin = Math.abs(rollData.diffLibre); | ||||||
|         formula += "min" + valeurMin; |         formula += "min" + valeurMin; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     // Chaque dé fait au minmum la difficulté libre |     // Chaque dé fait au minmum la difficulté libre | ||||||
|     if (ReglesOptionelles.isUsing('degat-ajout-malus-libre')) { |     if (ReglesOptionnelles.isUsing('degat-ajout-malus-libre')) { | ||||||
|       if (rollData.diffLibre < 0) { |       if (rollData.diffLibre < 0) { | ||||||
|         let valeurMin = Math.abs(rollData.diffLibre); |         let valeurMin = Math.abs(rollData.diffLibre); | ||||||
|         formula += "+" + valeurMin; |         formula += "+" + valeurMin; | ||||||
| @@ -572,7 +572,7 @@ export class RdDUtility { | |||||||
|     let roll = await RdDDice.roll(formula, options); |     let roll = await RdDDice.roll(formula, options); | ||||||
|  |  | ||||||
|     // 1 dé fait au minmum la difficulté libre |     // 1 dé fait au minmum la difficulté libre | ||||||
|     if (ReglesOptionelles.isUsing('degat-minimum-malus-libre-simple')) { |     if (ReglesOptionnelles.isUsing('degat-minimum-malus-libre-simple')) { | ||||||
|       if (rollData.diffLibre < 0) { |       if (rollData.diffLibre < 0) { | ||||||
|         let valeurMin = Math.abs(rollData.diffLibre); |         let valeurMin = Math.abs(rollData.diffLibre); | ||||||
|         if (roll.terms[0].results[0].result < valeurMin) { |         if (roll.terms[0].results[0].result < valeurMin) { | ||||||
| @@ -625,7 +625,7 @@ export class RdDUtility { | |||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   static currentFatigueMalus(value, max) { |   static currentFatigueMalus(value, max) { | ||||||
|     if (ReglesOptionelles.isUsing("appliquer-fatigue")) { |     if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||||
|       max = Math.max(1, Math.min(max, 60)); |       max = Math.max(1, Math.min(max, 60)); | ||||||
|       value = Math.min(max * 2, Math.max(0, value)); |       value = Math.min(max * 2, Math.max(0, value)); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ import { RdDBonus } from "./rdd-bonus.js"; | |||||||
| import { RdDCarac } from "./rdd-carac.js"; | import { RdDCarac } from "./rdd-carac.js"; | ||||||
| import { RdDPossession } from "./rdd-possession.js"; | import { RdDPossession } from "./rdd-possession.js"; | ||||||
| import { RdDUtility } from "./rdd-utility.js"; | import { RdDUtility } from "./rdd-utility.js"; | ||||||
| import { ReglesOptionelles } from "./settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * tous les ajustements pouvant s'appliquer. |  * tous les ajustements pouvant s'appliquer. | ||||||
| @@ -86,7 +86,7 @@ export const referenceAjustements = { | |||||||
|     getValue: (rollData, actor) => actor.getMoralTotal() |     getValue: (rollData, actor) => actor.getMoralTotal() | ||||||
|   }, |   }, | ||||||
|   astrologique: { |   astrologique: { | ||||||
|     isUsed: (rollData, actor) => ReglesOptionelles.isUsing("astrologie") && RdDBonus.isAjustementAstrologique(rollData), |     isUsed: (rollData, actor) => ReglesOptionnelles.isUsing("astrologie") && RdDBonus.isAjustementAstrologique(rollData), | ||||||
|     getLabel: (rollData, actor) => 'Astrologique', |     getLabel: (rollData, actor) => 'Astrologique', | ||||||
|     getValue: (rollData, actor) => actor.ajustementAstrologique() |     getValue: (rollData, actor) => actor.ajustementAstrologique() | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import { SYSTEM_RDD } from "../constants.js"; | import { SYSTEM_RDD } from "../constants.js"; | ||||||
| import { Misc } from "../misc.js"; | import { Misc } from "../misc.js"; | ||||||
| 
 | 
 | ||||||
| const listeReglesOptionelles = [ | const listeReglesOptionnelles = [ | ||||||
|   { group: 'Règles générales', name: 'appliquer-fatigue',           descr: "Appliquer les règles de fatigue"}, |   { group: 'Règles générales', name: 'appliquer-fatigue',           descr: "Appliquer les règles de fatigue"}, | ||||||
|   { group: 'Règles générales', name: 'astrologie',                  descr: "Appliquer les ajustements astrologiques aux jets de chance et aux rituels"}, |   { group: 'Règles générales', name: 'astrologie',                  descr: "Appliquer les ajustements astrologiques aux jets de chance et aux rituels"}, | ||||||
| 
 | 
 | ||||||
| @@ -36,22 +36,22 @@ const listeReglesOptionelles = [ | |||||||
|   { group: 'Options alternatives', name: 'degat-ajout-malus-libre',           descr: "Le malus libre d'attaque s'ajoute au jet d'encaissement et aux autres bonus. Exemple : la difficulté libre de l'attaquant est de -4. Le jet d'encaissement est effectué à 2d10+4, plus les bonus de situation et d'armes.", default: false }, |   { group: 'Options alternatives', name: 'degat-ajout-malus-libre',           descr: "Le malus libre d'attaque s'ajoute au jet d'encaissement et aux autres bonus. Exemple : la difficulté libre de l'attaquant est de -4. Le jet d'encaissement est effectué à 2d10+4, plus les bonus de situation et d'armes.", default: false }, | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| const uniquementJoueur = listeReglesOptionelles.filter(it => it.uniquementJoueur).map(it=>it.name); | const uniquementJoueur = listeReglesOptionnelles.filter(it => it.uniquementJoueur).map(it=>it.name); | ||||||
| 
 | 
 | ||||||
| export class ReglesOptionelles extends FormApplication { | export class ReglesOptionnelles extends FormApplication { | ||||||
|   static init() { |   static init() { | ||||||
|     for (const regle of listeReglesOptionelles) { |     for (const regle of listeReglesOptionnelles) { | ||||||
|       const name = regle.name; |       const name = regle.name; | ||||||
|       const id = ReglesOptionelles._getIdRegle(name); |       const id = ReglesOptionnelles._getIdRegle(name); | ||||||
|       game.settings.register(SYSTEM_RDD, id, { name: id, scope: regle.scope ?? "world", config: false, default: regle.default == undefined ? true : regle.default, type: Boolean }); |       game.settings.register(SYSTEM_RDD, id, { name: id, scope: regle.scope ?? "world", config: false, default: regle.default == undefined ? true : regle.default, type: Boolean }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     game.settings.registerMenu(SYSTEM_RDD, "rdd-options-regles", { |     game.settings.registerMenu(SYSTEM_RDD, "rdd-options-regles", { | ||||||
|       name: "Choisir les règles optionelles", |       name: "Choisir les règles optionnelles", | ||||||
|       label: "Règles optionelles", |       label: "Règles optionnelles", | ||||||
|       hint: "Ouvre la fenêtre de sélection des règles optionelles", |       hint: "Ouvre la fenêtre de sélection des règles optionnelles", | ||||||
|       icon: "fas fa-bars", |       icon: "fas fa-bars", | ||||||
|       type: ReglesOptionelles |       type: ReglesOptionnelles | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @@ -66,8 +66,8 @@ export class ReglesOptionelles extends FormApplication { | |||||||
|   static get defaultOptions() { |   static get defaultOptions() { | ||||||
|     const options = super.defaultOptions; |     const options = super.defaultOptions; | ||||||
|     mergeObject(options, { |     mergeObject(options, { | ||||||
|       id: "regles-optionelles", |       id: "regles-optionnelles", | ||||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/settings/regles-optionelles.html", |       template: "systems/foundryvtt-reve-de-dragon/templates/settings/regles-optionnelles.html", | ||||||
|       height: 600, |       height: 600, | ||||||
|       width: 450, |       width: 450, | ||||||
|       minimizable: false, |       minimizable: false, | ||||||
| @@ -79,10 +79,10 @@ export class ReglesOptionelles extends FormApplication { | |||||||
| 
 | 
 | ||||||
|   getData() { |   getData() { | ||||||
|     let formData = super.getData(); |     let formData = super.getData(); | ||||||
|     const regles = listeReglesOptionelles.filter(it => game.user.isGM || it.scope == "client").map(it => { |     const regles = listeReglesOptionnelles.filter(it => game.user.isGM || it.scope == "client").map(it => { | ||||||
|       it = duplicate(it); |       it = duplicate(it); | ||||||
|       it.id = ReglesOptionelles._getIdRegle(it.name); |       it.id = ReglesOptionnelles._getIdRegle(it.name); | ||||||
|       it.active = ReglesOptionelles.isSet(it.name); |       it.active = ReglesOptionnelles.isSet(it.name); | ||||||
|       return it; |       return it; | ||||||
|     }); |     }); | ||||||
|     formData.regles = regles; |     formData.regles = regles; | ||||||
| @@ -94,15 +94,15 @@ export class ReglesOptionelles extends FormApplication { | |||||||
|     if (game.user.isGM && uniquementJoueur.includes(name)) { |     if (game.user.isGM && uniquementJoueur.includes(name)) { | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|     return ReglesOptionelles.isSet(name); |     return ReglesOptionnelles.isSet(name); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static isSet(name) { |   static isSet(name) { | ||||||
|     return game.settings.get(SYSTEM_RDD, ReglesOptionelles._getIdRegle(name)); |     return game.settings.get(SYSTEM_RDD, ReglesOptionnelles._getIdRegle(name)); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   static set(name, value) { |   static set(name, value) { | ||||||
|     return game.settings.set(SYSTEM_RDD, ReglesOptionelles._getIdRegle(name), value ? true: false); |     return game.settings.set(SYSTEM_RDD, ReglesOptionnelles._getIdRegle(name), value ? true: false); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   activateListeners(html) { |   activateListeners(html) { | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| import { ReglesOptionelles } from "../settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "../settings/regles-optionnelles.js"; | ||||||
| import { EffetsDraconiques } from "../tmr/effets-draconiques.js"; | import { EffetsDraconiques } from "../tmr/effets-draconiques.js"; | ||||||
|  |  | ||||||
| export class DialogRepos extends Dialog { | export class DialogRepos extends Dialog { | ||||||
| @@ -7,7 +7,7 @@ export class DialogRepos extends Dialog { | |||||||
|     if (!actor.isPersonnage()) { |     if (!actor.isPersonnage()) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|     if (!ReglesOptionelles.isUsing("chateau-dormant-gardien") || !actor.hasPlayerOwner) { |     if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !actor.hasPlayerOwner) { | ||||||
|       actor.system.sommeil = { |       actor.system.sommeil = { | ||||||
|         "nouveaujour": true, |         "nouveaujour": true, | ||||||
|         "insomnie": EffetsDraconiques.isSujetInsomnie(actor), |         "insomnie": EffetsDraconiques.isSujetInsomnie(actor), | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ import { RdDDice } from "../rdd-dice.js"; | |||||||
| import { Misc } from "../misc.js"; | import { Misc } from "../misc.js"; | ||||||
| import { DialogChronologie } from "../dialog-chronologie.js"; | import { DialogChronologie } from "../dialog-chronologie.js"; | ||||||
| import { HIDE_DICE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "../constants.js"; | import { HIDE_DICE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "../constants.js"; | ||||||
| import { ReglesOptionelles } from "../settings/regles-optionelles.js"; | import { ReglesOptionnelles } from "../settings/regles-optionnelles.js"; | ||||||
| import { DialogChateauDormant } from "../sommeil/dialog-chateau-dormant.js"; | import { DialogChateauDormant } from "../sommeil/dialog-chateau-dormant.js"; | ||||||
| import { APP_ASTROLOGIE_REFRESH, AppAstrologie } from "../sommeil/app-astrologie.js"; | import { APP_ASTROLOGIE_REFRESH, AppAstrologie } from "../sommeil/app-astrologie.js"; | ||||||
|  |  | ||||||
| @@ -305,7 +305,7 @@ export class RdDCalendrier extends Application { | |||||||
|     const oldTimestamp = this.timestamp; |     const oldTimestamp = this.timestamp; | ||||||
|     await Promise.all(game.actors.map(async actor => await actor.onTimeChanging(oldTimestamp, newTimestamp))); |     await Promise.all(game.actors.map(async actor => await actor.onTimeChanging(oldTimestamp, newTimestamp))); | ||||||
|     RdDTimestamp.setWorldTime(newTimestamp); |     RdDTimestamp.setWorldTime(newTimestamp); | ||||||
|     if (oldTimestamp.indexDate + 1 == newTimestamp.indexDate && ReglesOptionelles.isUsing("chateau-dormant-gardien")) { |     if (oldTimestamp.indexDate + 1 == newTimestamp.indexDate && ReglesOptionnelles.isUsing("chateau-dormant-gardien")) { | ||||||
|       await DialogChateauDormant.create(); |       await DialogChateauDormant.create(); | ||||||
|     } |     } | ||||||
|     this.timestamp = newTimestamp; |     this.timestamp = newTimestamp; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user