Merge branch 'master-misc' into 'master'

Utiliser des polices pour les dés

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!223
This commit is contained in:
Leratier Bretonnien 2021-05-01 21:50:58 +00:00
commit c31202fbd3
11 changed files with 80 additions and 33 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1483,7 +1483,7 @@ export class RdDActor extends Actor {
async ethylismeTest() { async ethylismeTest() {
const actorData = Misc.data(this); const actorData = Misc.data(this);
let rollData = { let rollData = {
vieValue: actorData.data.sante.vie.value, vieValue: actorData.data.sante.vie.max,
etat: this.getEtatGeneral() - Math.min(0, actorData.data.compteurs.ethylisme.value), // Pour les jets d'Ethylisme, on ignore le degré d'éthylisme (p.162) etat: this.getEtatGeneral() - Math.min(0, actorData.data.compteurs.ethylisme.value), // Pour les jets d'Ethylisme, on ignore le degré d'éthylisme (p.162)
diffNbDoses: -Number(actorData.data.compteurs.ethylisme.nb_doses || 0), diffNbDoses: -Number(actorData.data.compteurs.ethylisme.nb_doses || 0),
finalLevel: 0, finalLevel: 0,

View File

@ -11,9 +11,9 @@ const dossierIconesHeures = 'systems/foundryvtt-reve-de-dragon/icons/heures/'
const heuresList = ["vaisseau", "sirene", "faucon", "couronne", "dragon", "epees", "lyre", "serpent", "poissonacrobate", "araignee", "roseau", "chateaudormant"]; const heuresList = ["vaisseau", "sirene", "faucon", "couronne", "dragon", "epees", "lyre", "serpent", "poissonacrobate", "araignee", "roseau", "chateaudormant"];
const heuresDef = { const heuresDef = {
"vaisseau": { label: "Vaisseau", lettreFont: 'v', saison: "printemps", heure: 0, icon: 'hd01.svg' }, "vaisseau": { label: "Vaisseau", lettreFont: 'v', saison: "printemps", heure: 0, icon: 'hd01.svg' },
"sirene": { label: "Sirène", lettreFont: 'S', saison: "printemps", heure: 1, icon: 'hd02.svg' }, "sirene": { label: "Sirène", lettreFont: 'i', saison: "printemps", heure: 1, icon: 'hd02.svg' },
"faucon": { label: "Faucon", lettreFont: 'f', saison: "printemps", heure: 2, icon: 'hd03.svg' }, "faucon": { label: "Faucon", lettreFont: 'f', saison: "printemps", heure: 2, icon: 'hd03.svg' },
"couronne": { label: "Couronne", lettreFont: 'C', saison: "ete", heure: 3, icon: 'hd04.svg' }, "couronne": { label: "Couronne", lettreFont: '', saison: "ete", heure: 3, icon: 'hd04.svg' },
"dragon": { label: "Dragon", lettreFont: 'd', saison: "ete", heure: 4, icon: 'hd05.svg' }, "dragon": { label: "Dragon", lettreFont: 'd', saison: "ete", heure: 4, icon: 'hd05.svg' },
"epees": { label: "Epées", lettreFont: 'e', saison: "ete", heure: 5, icon: 'hd06.svg' }, "epees": { label: "Epées", lettreFont: 'e', saison: "ete", heure: 5, icon: 'hd06.svg' },
"lyre": { label: "Lyre", lettreFont: 'l', saison: "automne", heure: 6, icon: 'hd07.svg' }, "lyre": { label: "Lyre", lettreFont: 'l', saison: "automne", heure: 6, icon: 'hd07.svg' },

View File

@ -165,11 +165,25 @@ export class RdDCommands {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
help(msg, table = undefined) { async help(msg) {
this.help(msg, undefined);
}
async help(msg, table) {
let list = [] let list = []
this._buildSubTableHelp(list, table || this.commandsTable); this._buildSubTableHelp(list, table || this.commandsTable);
const messageAide = list.reduce((a, b) => a + '</li><li class="list-item">' + b);
RdDCommands._chatAnswer(msg, `Commandes disponibles<ul class="alterne-list"><li class="list-item">${messageAide}</li></ul>`); let html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/settings/dialog-aide-commands.html", { commands: list });
let d = new Dialog(
{
title: "Commandes disponibles dans le tchat",
content: html,
buttons: {},
},
{
width: 600, height: 500,
});
d.render(true);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -220,23 +234,23 @@ export class RdDCommands {
} }
let actors = canvas.tokens.controlled.map(it => it.actor).filter(it => it); let actors = canvas.tokens.controlled.map(it => it.actor).filter(it => it);
if (actors && actors.length > 0){ if (actors && actors.length > 0) {
let length = params.length; let length = params.length;
let diff = Number(params[length-1]); let diff = Number(params[length - 1]);
if (Number.isInteger(Number(diff))){ if (Number.isInteger(Number(diff))) {
length --; length--;
} }
else { else {
diff = 0; diff = 0;
} }
const caracName = params[0]; const caracName = params[0];
const compName = length>1 ? params.slice(1, length).reduce((a, b) => `${a} ${b}`): undefined; const compName = length > 1 ? params.slice(1, length).reduce((a, b) => `${a} ${b}`) : undefined;
for (let actor of actors) { for (let actor of actors) {
await actor.rollCaracCompetence(caracName, compName, diff); await actor.rollCaracCompetence(caracName, compName, diff);
} }
return; return;
} }
else{ else {
ui.notifications.warn("Sélectionnez au moins un personnage pour lancer les dés") ui.notifications.warn("Sélectionnez au moins un personnage pour lancer les dés")
} }
} }

View File

@ -6,18 +6,15 @@ function img(src) {
return `<img src="${src}" class="dice-img" />` return `<img src="${src}" class="dice-img" />`
} }
function iconHeure(heure){ function iconHeure(heure) {
if (heure<10) { if (heure < 10) {
heure = '0'+heure; heure = '0' + heure;
} }
return `systems/foundryvtt-reve-de-dragon/icons/heures/hd${heure}.webp` return `systems/foundryvtt-reve-de-dragon/icons/heures/hd${heure}.webp`
} }
const imagesHeures = [1, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12].map(it => iconHeure(it));
const signeDragon = 'systems/foundryvtt-reve-de-dragon/icons/heures/hdragon.webp'; const imgSigneDragon = img(imagesHeures[4]);
const imgSigneDragon = img(signeDragon);
const labelsDeDragon = ['1', '2', '3', '4', '5', '6', signeDragon, '0'];
const bumpsDeDragon = [, , , , , , signeDragon,];
const signeHeure = 'systems/foundryvtt-reve-de-dragon/icons/heures/hd';
/** De7 pour les jets de rencontre */ /** De7 pour les jets de rencontre */
export class De7 extends Die { export class De7 extends Die {
@ -25,7 +22,13 @@ export class De7 extends Die {
static DENOMINATION = "7"; static DENOMINATION = "7";
static diceSoNiceData(system) { static diceSoNiceData(system) {
return { type: "d7", labels: labelsDeDragon, bumpMaps: bumpsDeDragon, system: system } return {
type: "d7",
font: "HeuresDraconiques",
fontScale : 0.7,
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
system: system
}
} }
constructor(termData) { constructor(termData) {
@ -45,7 +48,7 @@ export class De7 extends Die {
static getResultLabel(result) { static getResultLabel(result) {
switch (result) { switch (result) {
case 7: return imgSigneDragon case 7: return imgSigneDragon;
} }
return result; return result;
} }
@ -56,7 +59,13 @@ export class DeDraconique extends Die {
static DENOMINATION = "r"; static DENOMINATION = "r";
static diceSoNiceData(system) { static diceSoNiceData(system) {
return { type: "dr", labels: labelsDeDragon, bumpMaps: bumpsDeDragon, system: system } return {
type: "dr",
font: "HeuresDraconiques",
fontScale : 0.7,
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
system: system
}
} }
constructor(termData) { constructor(termData) {
@ -76,14 +85,13 @@ export class DeDraconique extends Die {
static getResultLabel(result) { static getResultLabel(result) {
switch (result) { switch (result) {
case 7: return imgSigneDragon case 7: return imgSigneDragon;
case 8: return 0;
} }
return result; return result;
} }
} }
const imagesHeures = [1, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12].map(it => iconHeure(it));
/** De 12 avec les heures */ /** De 12 avec les heures */
export class DeHeure extends Die { export class DeHeure extends Die {
@ -93,8 +101,8 @@ export class DeHeure extends Die {
static diceSoNiceData(system) { static diceSoNiceData(system) {
return { return {
type: "dh", type: "dh",
labels: imagesHeures, font: "HeuresDraconiques",
bumpMaps: imagesHeures, labels: ['v', 'i', 'f', 'o', 'd', 'e', 'l', 's', 'p', 'a', 'r', 'c'],
system: system system: system
} }
} }
@ -105,7 +113,7 @@ export class DeHeure extends Die {
} }
static getResultLabel(result) { static getResultLabel(result) {
return img(imagesHeures[result]); return img(imagesHeures[result-1]);
} }
} }

View File

@ -20,9 +20,14 @@
src: url('../fonts/CaslonAntique.ttf') format("truetype"); src: url('../fonts/CaslonAntique.ttf') format("truetype");
} }
@font-face { @font-face {
font-family: "heures Draconiques"; font-family: 'HeuresDraconiques';
src: url('../fonts/heures_draconiques.ttf') format("truetype"); src:
} url('../fonts/heuresdraconiques2.woff') format('woff'),
url('../fonts/heuresdraconiques2.woff2') format('woff2'),
url('../fonts/heuresdraconiques2.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
:root { :root {
/* =================== 1. ACTOR SHEET FONT STYLES =========== */ /* =================== 1. ACTOR SHEET FONT STYLES =========== */

View File

@ -0,0 +1,20 @@
<h3>Dés spéciaux</h3>
<ul class="alterne-list">
<li class="list-item">
<strong>/roll 1d7</strong>: lance un dé de rencontre
</li>
<li class="list-item">
<strong>/roll 1dr</strong>: lance un dé draconique (de 0à 7, relance et additionne en cas de 7)
</li>
<li class="list-item">
<strong>/roll 1dh</strong>: lance le dé des heures (de 1 à 12)
</li>
</ul>
<h3>Commandes disponibles</h3>
<ul class="alterne-list">
{{#each commands as |command key|}}
<li class="list-item">
{{{command}}}
</li>
{{/each}}
</ul>