Merge branch 'rendu-messages' into 'v1.2'

Rendu messages

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!98
This commit is contained in:
Leratier Bretonnien 2021-01-02 21:52:22 +00:00
commit c97ad8ec32
18 changed files with 146 additions and 255 deletions

View File

@ -468,19 +468,19 @@ export class RdDActor extends Actor {
const seuil = this.data.data.reve.seuil.value; const seuil = this.data.data.reve.seuil.value;
const reveActuel = this.getReveActuel(); const reveActuel = this.getReveActuel();
if (reveActuel >= seuil) { if (reveActuel >= seuil) {
message.content += "<br>Vous avez suffisament rêvé (seuil " + seuil + ", rêve actuel "+reveActuel+")"; message.content += `<br>Vous avez suffisament rêvé (seuil ${seuil}, rêve actuel ${reveActuel})`;
} }
else { else {
let deRecuperation = await DeDraconique.ddr("selfroll").total; let deRecuperation = (await DeDraconique.ddr("selfroll")).total;
console.log("recuperationReve", deRecuperation); console.log("recuperationReve", deRecuperation);
if (deRecuperation>=7) if (deRecuperation>=7)
{ {
// Rêve de Dragon ! // Rêve de Dragon !
message.content += "<br>Vous faites un <strong>Rêve de Dragon</strong> de " + deRecuperation + " Points de rêve"; message.content += `<br>Vous faites un <strong>Rêve de Dragon</strong> de ${deRecuperation} Points de rêve`;
message.content += await this.combattreReveDeDragon(deRecuperation); message.content += await this.combattreReveDeDragon(deRecuperation);
} }
else{ else{
message.content += "<br>Vous récupérez " + deRecuperation + " Points de rêve"; message.content += `<br>Vous récupérez ${deRecuperation} Points de rêve`;
await this.reveActuelIncDec(deRecuperation); await this.reveActuelIncDec(deRecuperation);
} }
} }
@ -491,7 +491,7 @@ export class RdDActor extends Actor {
const seuil = this.data.data.reve.seuil.value; const seuil = this.data.data.reve.seuil.value;
const reveActuel = this.getReveActuel(); const reveActuel = this.getReveActuel();
if (reveActuel > seuil) { if (reveActuel > seuil) {
message.content += "<br>Votre rêve redescend vers son seuil naturel (seuil " + seuil + ", nouveau rêve actuel "+(reveActuel-1)+")"; message.content += `<br>Votre rêve redescend vers son seuil naturel (${seuil}, nouveau rêve actuel ${(reveActuel-1)})`;
await this.reveActuelIncDec(-1); await this.reveActuelIncDec(-1);
} }
} }
@ -818,7 +818,7 @@ export class RdDActor extends Actor {
content: this.name + " subit une Queue de Dragon : " + queue.name content: this.name + " subit une Queue de Dragon : " + queue.name
}); });
} }
return queue; return queue.name;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1331,6 +1331,7 @@ export class RdDActor extends Actor {
ui.notifications.info("Aucun sort disponible!"); ui.notifications.info("Aucun sort disponible!");
return; return;
} }
if ( this.currentTMR) this.currentTMR.minimize(); // Hide
let rollData = { let rollData = {
selectedCarac: this.data.data.carac.reve, selectedCarac: this.data.data.carac.reve,
@ -1344,7 +1345,6 @@ export class RdDActor extends Actor {
coutreve: Array(20).fill().map((item, index) => 1 + index) coutreve: Array(20).fill().map((item, index) => 1 + index)
} }
if ( this.currentTMR) this.currentTMR.minimize(); // Hide
const dialog = await RdDRoll.create(this, rollData, const dialog = await RdDRoll.create(this, rollData,
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html',
close: html => { this.currentTMR.maximize() } // Re-display TMR close: html => { this.currentTMR.maximize() } // Re-display TMR
@ -1528,10 +1528,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollCarac( caracName ) { async rollCarac( caracName ) {
let rollData = { let rollData = { selectedCarac: this.getCaracByName(caracName) };
selectedCarac: this.getCaracByName(caracName),
diviseur : this.getDiviseurSignificative()
};
const dialog = await RdDRoll.create(this, rollData, const dialog = await RdDRoll.create(this, rollData,
{html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html'}, {html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html'},
@ -1550,15 +1547,12 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async _onRollCaracResult(rollData) { async _onRollCaracResult(rollData) {
// Final chat message // Final chat message
await RdDResolutionTable.displayRollData(rollData, this.name); await RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-general.html');
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollCompetence( name ) { async rollCompetence( name ) {
let rollData = { let rollData = { competence: this.getCompetence(name) }
competence: this.getCompetence(name),
diviseur : this.getDiviseurSignificative()
}
if (rollData.competence.type == 'competencecreature') { if (rollData.competence.type == 'competencecreature') {
// Fake competence pour créature // Fake competence pour créature
@ -1610,17 +1604,15 @@ export class RdDActor extends Actor {
competence.data.defaut_carac = tache.data.carac; // Patch ! competence.data.defaut_carac = tache.data.carac; // Patch !
let rollData = { let rollData = {
competence: competence, competence: competence,
diviseur : this.getDiviseurSignificative(),
tache: tache, tache: tache,
diffConditions: tache.data.difficulte, diffConditions: tache.data.difficulte,
editLibre: false, editLibre: false,
editConditions: false, editConditions: false,
actor: this carac : { }
} };
rollData.carac = {};
rollData.carac[tache.data.carac] = duplicate(this.data.data.carac[tache.data.carac]); // Single carac rollData.carac[tache.data.carac] = duplicate(this.data.data.carac[tache.data.carac]); // Single carac
console.log("rollTache !!!", duplicate(rollData));
console.log("rollTache !!!", rollData);
const dialog = await RdDRoll.create(this, rollData, {html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html'}, { const dialog = await RdDRoll.create(this, rollData, {html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html'}, {
name: 'jet-competence', name: 'jet-competence',
@ -1658,7 +1650,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollAppelChance( ) async rollAppelChance( )
{ {
let rollData = { selectedCarac: this.getCaracByName('chance-actuelle') }; let rollData = { selectedCarac: this.getCaracByName('chance-actuelle'), surprise: '' };
const dialog = await RdDRoll.create(this, rollData, const dialog = await RdDRoll.create(this, rollData,
{ html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html'}, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html'},
@ -1676,18 +1668,9 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async _appelChanceResult(rollData) { async _appelChanceResult(rollData) {
// TODO:
const message = {
user: game.user._id,
alias: this.name,
content: this.name + " fait appel à la chance" + RdDResolutionTable.explain(rollData.rolled)
};
if (rollData.rolled.isSuccess) { if (rollData.rolled.isSuccess) {
message.content += "<br>Un point de chance est dépensée, l'action peut être retentée"
await this.chanceActuelleIncDec(-1) await this.chanceActuelleIncDec(-1)
} }
ChatMessage.create(message);
RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-appelchance.html') RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-appelchance.html')
} }
@ -2047,21 +2030,21 @@ export class RdDActor extends Actor {
} }
let rolled = await RdDResolutionTable.roll( this.getReveActuel(), - Number(entite.data.data.carac.niveau.value)); let rolled = await RdDResolutionTable.roll( this.getReveActuel(), - Number(entite.data.data.carac.niveau.value));
const rollData = {
let message = { alias: this.name,
content: "Jet de points actuels de rêve à " + rolled.finalLevel + RdDResolutionTable.explain(rolled) + "<br>", rolled: rolled,
whisper: ChatMessage.getWhisperRecipients(this.name) entite: entite.name,
selectedCarac : this.data.data.carac.reve
}; };
if (rolled.isSuccess) { if (rolled.isSuccess) {
await entite.setEntiteReveAccordee(this); await entite.setEntiteReveAccordee(this);
message.content += this.name + " s'est accordé avec " + entite.name;
} }
else {
message.content+= this.name + " n'est pas accordé avec " + entite.name; await RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-accorder-cauchemar.html');
if (rolled.isPart) {
await this._appliquerAjoutExperience(rollData, true);
} }
ChatMessage.create( message );
return rolled.isSuccess; return rolled.isSuccess;
} }

View File

@ -27,6 +27,7 @@ export class ChatUtility {
chatOptions.whisper = ChatUtility.getWhisperRecipients(rollMode, name); chatOptions.whisper = ChatUtility.getWhisperRecipients(rollMode, name);
break; break;
} }
chatOptions.alias = chatOptions.alias||name;
ChatMessage.create(chatOptions); ChatMessage.create(chatOptions);
} }

View File

@ -5,7 +5,7 @@ import { DeDraconique } from "./de-draconique.js";
import { Misc } from "./misc.js"; import { Misc } from "./misc.js";
import { RdDDice } from "./rdd-dice.js"; import { RdDDice } from "./rdd-dice.js";
import { RdDResolutionTable } from "./rdd-resolution-table.js"; import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { RdDRollResolution } from "./rdd-roll-resolution.js"; import { RdDRollResolutionTable } from "./rdd-roll-resolution-table.js";
import { RdDRollTables } from "./rdd-rolltables.js"; import { RdDRollTables } from "./rdd-rolltables.js";
import { RdDUtility } from "./rdd-utility.js"; import { RdDUtility } from "./rdd-utility.js";
import { TMRUtility } from "./tmr-utility.js"; import { TMRUtility } from "./tmr-utility.js";
@ -167,7 +167,7 @@ export class RdDCommands {
async rollRdd(msg, params) { async rollRdd(msg, params) {
if (params.length == 0) { if (params.length == 0) {
RdDRollResolution.open(); RdDRollResolutionTable.open();
} }
else { else {
let flatParams = params.reduce((a, b) => `${a} ${b}`); let flatParams = params.reduce((a, b) => `${a} ${b}`);

View File

@ -4,7 +4,6 @@ import { Misc } from "./misc.js";
import { RdDBonus } from "./rdd-bonus.js"; import { RdDBonus } from "./rdd-bonus.js";
import { RdDCombat } from "./rdd-combat.js"; import { RdDCombat } from "./rdd-combat.js";
import { RdDDice } from "./rdd-dice.js"; import { RdDDice } from "./rdd-dice.js";
import { RdDRollTables } from "./rdd-rolltables.js";
/** /**
* difficultés au delà de -10 * difficultés au delà de -10
@ -48,8 +47,8 @@ const specialResults = [
const reussites = [ const reussites = [
{ code: "etotal", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: true, ptTache: -4, ptQualite: -6, quality: "Echec total", condition: (target, roll) => roll >= target.etotal && roll <= 100 }, { code: "etotal", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: true, ptTache: -4, ptQualite: -6, quality: "Echec total", condition: (target, roll) => roll >= target.etotal && roll <= 100 },
{ code: "epart", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: false, ptTache: -2, ptQualite: -4, quality: "Echec particulier", condition: (target, roll) => (roll >= target.epart && roll < target.etotal) }, { code: "epart", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: false, ptTache: -2, ptQualite: -4, quality: "Echec particulier", condition: (target, roll) => (roll >= target.epart && roll < target.etotal) },
{ code: "echec", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: false, isETotal: false, ptTache: 0, ptQualite: -2, quality: "Echec normal", condition: (target, roll) => (roll > target.score && roll < target.etotal) }, { code: "echec", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: false, isETotal: false, ptTache: 0, ptQualite: -2, quality: "Echec normal", condition: (target, roll) => (roll > target.norm && roll < target.etotal) },
{ code: "norm", isPart: false, isSign: false, isSuccess: true, isEchec: false, isEPart: false, isETotal: false, ptTache: 1, ptQualite: 0, quality: "Réussite normale", condition: (target, roll) => (roll > target.sign && roll <= target.score) }, { code: "norm", isPart: false, isSign: false, isSuccess: true, isEchec: false, isEPart: false, isETotal: false, ptTache: 1, ptQualite: 0, quality: "Réussite normale", condition: (target, roll) => (roll > target.sign && roll <= target.norm) },
{ code: "sign", isPart: false, isSign: true, isSuccess: true, isEchec: false, isEPart: false, isETotal: false, ptTache: 2, ptQualite: 1, quality: "Réussite significative", condition: (target, roll) => (roll > target.part && roll <= target.sign) }, { code: "sign", isPart: false, isSign: true, isSuccess: true, isEchec: false, isEPart: false, isETotal: false, ptTache: 2, ptQualite: 1, quality: "Réussite significative", condition: (target, roll) => (roll > target.part && roll <= target.sign) },
{ code: "part", isPart: true, isSign: true, isSuccess: true, isEchec: false, isEPart: false, isETotal: false, ptTache: 3, ptQualite: 2, quality: "Réussite Particulière!", condition: (target, roll) => (roll > 0 && roll <= target.part) }, { code: "part", isPart: true, isSign: true, isSuccess: true, isEchec: false, isEPart: false, isETotal: false, ptTache: 3, ptQualite: 2, quality: "Réussite Particulière!", condition: (target, roll) => (roll > 0 && roll <= target.part) },
{ code: "error", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: true, ptTache: 0, ptQualite: 0, quality: "Jet de dés invalide", condition: (target, roll) => (roll <= 0 || roll > 100) } { code: "error", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: true, ptTache: 0, ptQualite: 0, quality: "Jet de dés invalide", condition: (target, roll) => (roll <= 0 || roll > 100) }
@ -102,8 +101,9 @@ export class RdDResolutionTable {
static async displayRollData(rollData, userName, template = 'chat-resultat-general.html') { static async displayRollData(rollData, userName, template = 'chat-resultat-general.html') {
let html = await RdDResolutionTable.buildRollDataHtml(rollData, template); ChatUtility.chatWithRollMode(
ChatUtility.chatWithRollMode({ content: html }, userName) { content: await RdDResolutionTable.buildRollDataHtml(rollData, template) },
userName)
} }
static _buildAjustements(rollData) { static _buildAjustements(rollData) {
@ -180,7 +180,7 @@ export class RdDResolutionTable {
rolled.caracValue = caracValue; rolled.caracValue = caracValue;
rolled.finalLevel = finalLevel; rolled.finalLevel = finalLevel;
rolled.bonus = bonus; rolled.bonus = bonus;
rolled.factor = RdDResolutionTable._getFractionHtml(diviseur); rolled.factorHtml = RdDResolutionTable._getFractionHtml(diviseur);
return rolled; return rolled;
} }
@ -218,7 +218,7 @@ export class RdDResolutionTable {
if (difficulte < -10) { if (difficulte < -10) {
return duplicate(levelDown.find(levelData => levelData.level == difficulte)); return duplicate(levelDown.find(levelData => levelData.level == difficulte));
} }
return duplicate(this.resolutionTable[caracValue][difficulte + 10]); return duplicate(RdDResolutionTable.resolutionTable[caracValue][difficulte + 10]);
} }
static isAjustementAstrologique(rollData) { static isAjustementAstrologique(rollData) {
@ -287,41 +287,52 @@ export class RdDResolutionTable {
return { return {
niveau: niveau, niveau: niveau,
score: percentage, score: percentage,
norm: Math.min(99, percentage),
sign: this._reussiteSignificative(percentage), sign: this._reussiteSignificative(percentage),
part: this._reussitePart(percentage), part: this._reussitePart(percentage),
epart: this._echecParticulier(percentage), epart: this._echecParticulier(percentage),
etotal: this._echecTotal(percentage) etotal: this._echecTotal(percentage)
} };
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static _reussiteSignificative(score) { static _reussiteSignificative(percentage) {
return Math.floor(score / 2); return Math.floor(percentage / 2);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static _reussitePart(score) { static _reussitePart(percentage) {
return Math.ceil(score / 5); return Math.ceil(percentage / 5);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static _echecParticulier(score) { static _echecParticulier(percentage) {
return Math.ceil(score / 5) + 80; const epart = Math.ceil(percentage / 5) + 80;
return epart >= 100 ? 101 : epart;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static _echecTotal(score) { static _echecTotal(percentage) {
return Math.ceil(score / 10) + 91; const etotal = Math.ceil(percentage / 10) + 91;
return percentage >= 100 ? 101 : Math.min(etotal, 100);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static buildHTMLResults(caracValue, levelValue) { static buildHTMLResults(caracValue, levelValue) {
let cell = this.computeChances(caracValue, levelValue); let cell = this.computeChances(caracValue, levelValue);
let descr = $('<span class="span-valeur competence-label">'); cell.epart = cell.epart>99? 'N/A' : cell.epart;
descr.append("Particulière : " + cell.part + " - Significative : " + cell.sign + " - Réussite : " + cell.score); cell.etotal = cell.etotal>100? 'N/A' : cell.etotal;
descr.append("<br>Echec Particulier : " + cell.epart + " - Echec Total : " + cell.etotal); cell.score = Math.min(cell.score, 99);
descr.append("</span>");
return descr; return `
<span class="span-valeur competence-label">
Particulière: <span class="rdd-roll-part">${cell.part}</span>
- Significative: <span class="rdd-roll-sign">${cell.sign}</span>
- Réussite: <span class="rdd-roll-norm">${cell.score}</span>
- Echec Particulier: <span class="rdd-roll-epart">${cell.epart}</span>
- Echec Total: <span class="rdd-roll-etotal">${cell.etotal}</span>
</span>
`
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -342,10 +353,10 @@ export class RdDResolutionTable {
maxLevel = Math.max(Math.min(maxLevel, 22), minLevel + countColonnes); maxLevel = Math.max(Math.min(maxLevel, 22), minLevel + countColonnes);
let table = $("<table class='table-resolution'/>") let table = $("<table class='table-resolution'/>")
.append(this._buildHTMLHeader(this.resolutionTable[0], minLevel, maxLevel)); .append(this._buildHTMLHeader(RdDResolutionTable.resolutionTable[0], minLevel, maxLevel));
for (var rowIndex = minCarac; rowIndex <= maxCarac; rowIndex++) { for (var rowIndex = minCarac; rowIndex <= maxCarac; rowIndex++) {
table.append(this._buildHTMLRow(this.resolutionTable[rowIndex], rowIndex, caracValue, levelValue, minLevel, maxLevel)); table.append(this._buildHTMLRow(RdDResolutionTable.resolutionTable[rowIndex], rowIndex, caracValue, levelValue, minLevel, maxLevel));
} }
table.append("</table>"); table.append("</table>");
return table; return table;

View File

@ -7,20 +7,18 @@ const titleTableDeResolution = 'Table de résolution';
* @extends {Dialog} * @extends {Dialog}
*/ */
/* -------------------------------------------- */ /* -------------------------------------------- */
export class RdDRollResolution extends Dialog { export class RdDRollResolutionTable extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async open(rollData = {}) { static async open(rollData = {}) {
RdDRollResolution._setDefaultOptions(rollData); RdDRollResolutionTable._setDefaultOptions(rollData);
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.html', rollData); let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.html', rollData);
const dialog = new RdDRollResolution(rollData, html); const dialog = new RdDRollResolutionTable(rollData, html);
dialog.render(true); dialog.render(true);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static _setDefaultOptions(rollData) { static _setDefaultOptions(rollData) {
let defRollData = { let defRollData = {
show: { title: titleTableDeResolution }, show: { title: titleTableDeResolution },
ajustementsConditions: CONFIG.RDD.ajustementsConditions, ajustementsConditions: CONFIG.RDD.ajustementsConditions,
@ -62,8 +60,8 @@ export class RdDRollResolution extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
async onAction(html) { async onAction(html) {
await RdDResolutionTable.rollData(this.rollData); await RdDResolutionTable.rollData(this.rollData);
console.log("RdDRollResolution -=>", this.rollData, this.rollData.rolled); console.log("RdDRollResolutionTable -=>", this.rollData, this.rollData.rolled);
await RdDResolutionTable.displayRollData(rollData, game.user.name) await RdDResolutionTable.displayRollData(this.rollData, game.user.name);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -50,7 +50,8 @@ export class RdDRoll extends Dialog {
isMalusEncombrementTotal: RdDItemCompetence.isMalusEncombrementTotal(rollData.competence), isMalusEncombrementTotal: RdDItemCompetence.isMalusEncombrementTotal(rollData.competence),
useMalusEncTotal: false, useMalusEncTotal: false,
encTotal: actor.getEncombrementTotal(), encTotal: actor.getEncombrementTotal(),
ajustementAstrologique: actor.ajustementAstrologique() ajustementAstrologique: actor.ajustementAstrologique(),
surprise: actor.getSurprise()
} }
mergeObject(rollData, defaultRollData, { overwrite: false }); mergeObject(rollData, defaultRollData, { overwrite: false });
} }

View File

@ -1,11 +1,10 @@
/* Common useful functions shared between objects */ /* Common useful functions shared between objects */
import { TMRUtility } from "./tmr-utility.js";
import { RdDRollTables } from "./rdd-rolltables.js"; import { RdDRollTables } from "./rdd-rolltables.js";
import { ChatUtility } from "./chat-utility.js"; import { ChatUtility } from "./chat-utility.js";
import { RdDItemCompetence } from "./item-competence.js"; import { RdDItemCompetence } from "./item-competence.js";
import { RdDCombat } from "./rdd-combat.js"; import { RdDCombat } from "./rdd-combat.js";
import { RdDRollResolution } from "./rdd-roll-resolution.js"; import { RdDRollResolutionTable } from "./rdd-roll-resolution-table.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
const level_category = { const level_category = {
@ -92,7 +91,7 @@ const fatigueMarche = { "aise": { "4":1, "6":2, "8":3, "10":4, "12":6 },
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Static tables for commands /table */ /* Static tables for commands /table */
const table2func = { "rdd": { descr: "rdd: Ouvre la table de résolution", func: RdDRollResolution.open }, const table2func = { "rdd": { descr: "rdd: Ouvre la table de résolution", func: RdDRollResolutionTable.open },
"queues": { descr: "queues: Tire une queue de Dragon", func: RdDRollTables.getQueue}, "queues": { descr: "queues: Tire une queue de Dragon", func: RdDRollTables.getQueue},
"ombre": { descr: "ombre: Tire une Ombre de Dragon", func: RdDRollTables.getOmbre }, "ombre": { descr: "ombre: Tire une Ombre de Dragon", func: RdDRollTables.getOmbre },
"tetehr": { descr: "tetehr: Tire une Tête de Dragon pour Hauts Revants", fund: RdDRollTables.getTeteHR}, "tetehr": { descr: "tetehr: Tire une Tête de Dragon pour Hauts Revants", fund: RdDRollTables.getTeteHR},
@ -198,6 +197,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html', 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html',
// messages tchat // messages tchat
'systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html',
'systems/foundryvtt-reve-de-dragon/templates/chat-resultat-appelchance.html', 'systems/foundryvtt-reve-de-dragon/templates/chat-resultat-appelchance.html',
'systems/foundryvtt-reve-de-dragon/templates/chat-resultat-attaque.html', 'systems/foundryvtt-reve-de-dragon/templates/chat-resultat-attaque.html',
'systems/foundryvtt-reve-de-dragon/templates/chat-resultat-parade.html', 'systems/foundryvtt-reve-de-dragon/templates/chat-resultat-parade.html',

View File

@ -396,7 +396,7 @@ table {border: 1px solid #7a7971;}
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background:linear-gradient(150deg, rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7)); background:linear-gradient(150deg, rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7));
} }
.rdd-need-significative{ .rdd-diviseur{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background:linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2)); background:linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2));
} }
@ -410,6 +410,11 @@ table {border: 1px solid #7a7971;}
background-color: lightblue; background-color: lightblue;
} }
#resolutionValeurs{
font-size: 0.8rem;
padding: 5px;
}
/* ======================================== */ /* ======================================== */
/* Sheet */ /* Sheet */
.window-app.sheet .window-content .sheet-header{ .window-app.sheet .window-content .sheet-header{

View File

@ -0,0 +1,23 @@
<div>
<span {{#if ajustements}}class="tooltip" {{/if}}>
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
{{#if ajustements}}
<div class="tooltiptext ttt-ajustements">
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
{{/if}}
{{#if rolled.factorHtml}}<span class="rdd-diviseur">&times;{{{rolled.factorHtml}}}</span>{{/if}}
</span>
<span>= {{rolled.score}}%</span>
</div>
<div>
<span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span>
</div>

View File

@ -0,0 +1,10 @@
<h4>
{{alias}} s'accorde: {{entite}}
</h4>
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<hr>
<div>{{#if rolled.isSuccess}}
{{alias}} s'est accordé à {{entite}}
{{else}}ne s'est pas accordé à {{entite}}, il pourra réessayer à sa prochaine attaque.
{{/if}}
</div>

View File

@ -1,22 +1,7 @@
<h4> <h4>
{{alias}} fait appel à la chance {{alias}} fait appel à la chance
<br><span class="tooltip">
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span> = {{rolled.score}}%
</h4> </h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div> {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
{{~#if rolled.isSuccess}} {{~#if rolled.isSuccess}}
<hr> <hr>
<span>Un point de chance est dépensé, l'action peut être retentée!</span> <span>Un point de chance est dépensé, l'action peut être retentée!</span>

View File

@ -1,24 +1,6 @@
<h4> <h4>{{alias}} attaque: {{arme.name}}</h4>
{{alias}} attaque: {{arme.name}} <div>{{selectedCarac.label}} / {{competence.name}}, difficulté {{diffLibre}}</div>
<br>{{selectedCarac.label}} / {{competence.name}}, difficulté {{diffLibre}} {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<br><span class="tooltip">
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div>
<hr> <hr>
{{#if tactique}} {{#if tactique}}
<div> <div>

View File

@ -1,26 +1,10 @@
<h4> <h4>
{{alias}} {{#if show.title}}{{show.title}}: {{/if}} {{alias}} {{show.title}}:
{{#if selectedCarac}}{{selectedCarac.label}} {{#if selectedCarac}}{{selectedCarac.label}}
{{#if competence}} / {{competence.name}}{{/if}} {{#if competence}} / {{competence.name}}{{/if}}
{{/if}} {{/if}}
<br><span class="tooltip">
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4> </h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div> {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<hr> <hr>
<div> <div>
<span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} ajustement Qualité {{numberFormat rolled.ptQualite decimals=0 sign=true}}{{/if}}</span> <span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} ajustement Qualité {{numberFormat rolled.ptQualite decimals=0 sign=true}}{{/if}}</span>

View File

@ -1,23 +1,6 @@
<h4> <h4>{{alias}} esquive</h4>
{{alias}} esquive: {{selectedCarac.label}} / {{competence.name}}, difficulté {{diffLibre}} <div>{{selectedCarac.label}} / {{competence.name}} attaque à {{diffLibre}}</div>
<br><span class="tooltip"> {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div>
<hr> <hr>
<div> <div>
{{#if rolled.isSuccess}} {{#if rolled.isSuccess}}

View File

@ -2,27 +2,10 @@
{{alias}} {{#if show.title}}{{show.title}}: {{/if}} {{alias}} {{#if show.title}}{{show.title}}: {{/if}}
{{#if selectedCarac}}{{selectedCarac.label}} {{#if selectedCarac}}{{selectedCarac.label}}
{{#if competence}} / {{competence.name}}{{/if}} {{#if competence}} / {{competence.name}}{{/if}}
à {{diffLibre}}
{{/if}} {{/if}}
<br><span {{#if ajustements}}class="tooltip"{{/if}}>
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
{{#if ajustements}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
{{/if}}
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4> </h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div> {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<hr> <hr>
<div> <div>
<span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} ajustement Qualité {{numberFormat rolled.ptQualite decimals=0 sign=true}}{{/if}}</span> <span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} ajustement Qualité {{numberFormat rolled.ptQualite decimals=0 sign=true}}{{/if}}</span>

View File

@ -1,24 +1,6 @@
<h4> <h4>{{alias}} pare: {{arme.name}}</h4>
{{alias}} pare: {{arme.name}} <div>{{selectedCarac.label}} / {{competence.name}}, attaque à {{diffLibre}}</div>
<br>{{selectedCarac.label}} / {{competence.name}}, difficulté {{diffLibre}} {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<br><span class="tooltip">
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div>
<hr> <hr>
<div> <div>
{{#if rolled.isSuccess}} {{#if rolled.isSuccess}}

View File

@ -1,48 +1,24 @@
<h4> <h4>
{{alias}} {{#if isSortReserve}}met en réserve{{else}}lance{{/if}} le {{alias}} {{#if isSortReserve}}met en réserve{{else}}lance{{/if}}
{{selectedSort.data.isrituel}}rituel{{else}}sort{{/if}} le {{#if selectedSort.data.isrituel}}rituel{{else}}sort{{/if}}
{{selectedSort.name}} (r {{selectedSort.data.ptreve_reel}}) {{selectedSort.name}}
<br>
<span class="tooltip">
{{competence.name}}: {{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4> </h4>
<div>Pour {{selectedSort.data.ptreve_reel}} points de rêve en {{coordLabel}} ({{coord}})</div> <div>Pour {{selectedSort.data.ptreve_reel}} point{{~#if (gt selectedSort.data.ptreve_reel 1)}}s{{/if}} de rêve en {{coordLabel}} ({{coord}}).
<div> {{#if show.reveInsuffisant}}
<span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span> <span>Pas assez de rêve!</span>
{{#if show.reveInsuffisant}}<span>Pas assez de rêve!</span>{{/if}} {{/if}}
</div> </div>
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<hr> <hr>
<div> <div>
<span> <span>
{{#if rolled.isETotal}} {{#if rolled.isETotal}}Echec TOTAL
Echec TOTAL du sort! {{else if rolled.isEchec}}Echec
{{else if rolled.isEchec}} {{else}}Réussite{{/if}}
Echec du sort, du {{#if selectedSort.data.isrituel}}rituel{{else}}sort{{/if}},
{{else}} {{#if (eq depenseReve 0)}}pas de dépense de rêve
Réussite du sort, {{else if (eq depenseReve 1)}}1 point de rêve a été dépensé
{{/if~}} {{else}}{{depenseReve}} points de rêve ont été dépensés
</span> {{~/if}}.
<span>
{{#if (eq depenseReve 0)}}
pas de dépense de rêve
{{else if (eq depenseReve 1)}}
1 point de rêve a été dépensé
{{else}}
{{depenseReve}} points de rêve ont été dépensés
{{/if}}
</span> </span>
</div> </div>

View File

@ -1,28 +1,12 @@
<h4> <h4>
{{alias}} travaille à sa t&acirc;che {{tache.name}} {{alias}} travaille à sa t&acirc;che {{tache.name}}
<br>{{selectedCarac.label}} / {{competence.name}} <br>{{selectedCarac.label}}/{{competence.name}}
<span class="tooltip">
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
<div class="tooltiptext ttt-ajustements">
<div>Ajustements</div>
{{#each ajustements as |item key|}}
<div class="{{#if item.strong}}strong-text{{/if}}">
{{#if item.descr}}
{{{item.descr}}}
{{else}}
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
{{/if}}
</div>
{{/each}}
</div>
</span>
{{#if rolled.factor}}<label class="rdd-need-significative">(&times;{{{rolled.factor}}})</label>{{/if}} = {{rolled.score}}%
</h4> </h4>
<div><span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span></div> {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<hr> <hr>
<div> <div>
Après {{tache.data.periodicite}} vous avez obtenu {{rolled.ptTache}} points de tâche, Après {{tache.data.periodicite}} vous avez obtenu {{rolled.ptTache}} point{{~#if (gt rolled.ptTache 1)}}s{{/if}} de tâche,
votre avancement est de <span class="rdd-roll-{{#if (gt tache.data.points_de_tache_courant 0)}}norm{{else}}etotal{{/if}}">{{tache.data.points_de_tache_courant}} sur {{tache.data.points_de_tache}}</span> Points de Tâche. votre avancement est de <span class="rdd-roll-{{#if (gt tache.data.points_de_tache_courant 0)}}norm{{else}}etotal{{/if}}">{{tache.data.points_de_tache_courant}} sur {{tache.data.points_de_tache}}</span> point{{~#if (gt tache.data.points_de_tache_courant 1)}}s{{/if}} de tâche.
{{#if tache.data.fatigue}}<br><span>Vous êtes fatigué de {{tache.data.fatigue}} cases.</span>{{/if}} {{#if tache.data.fatigue}}<br><span>Vous vous êtes fatigué de {{tache.data.fatigue}} case{{~#if (gt tache.data.fatigue 1)}}s{{/if}}.</span>{{/if}}
{{#if rolled.isETotal}}<br><span>Votre échec total augmente de 1 la difficulté de la tâche!</span>{{/if~}} {{#if rolled.isETotal}}<br><span>Votre échec total augmente de 1 la difficulté de la tâche!</span>{{/if~}}
</div> </div>