Compare commits

...

30 Commits

Author SHA1 Message Date
9ee14b3b56 Add .db again? 2023-06-04 22:17:02 +02:00
3203fae111 Add .db again? 2023-06-04 20:53:15 +02:00
755301275b Add .db again? 2023-06-04 20:51:49 +02:00
f6d5dc9d7c Add .db again? 2023-06-04 20:49:55 +02:00
5e9b47af1f Add .db again? 2023-06-04 20:47:47 +02:00
18dfb36a78 v11 release 2023-05-29 13:47:08 +02:00
febccd508f v11 release 2023-05-29 13:40:38 +02:00
b147f8937b v11 release 2023-05-29 13:33:31 +02:00
55a93b317a v10/v11 compat 2023-05-29 08:50:13 +02:00
02a630152d v10/v11 compat 2023-05-29 08:50:08 +02:00
ad8ac0de77 v10/v11 compat 2023-05-29 08:42:16 +02:00
dceb6f026f v10/v11 compat 2023-05-29 08:41:59 +02:00
ad37ee1b8e v10/v11 compat 2023-05-29 08:38:22 +02:00
4d40e2fe59 Merge pull request 'cherry-pick changements v10' (#647) from VincentVk/foundryvtt-reve-de-dragon:v11 into v11
Reviewed-on: #647
2023-05-29 07:47:58 +02:00
9d7e57d9fb Changelog v11 2023-05-28 22:11:16 +02:00
717029e572 Tri des listes d'items 2023-05-28 22:11:16 +02:00
d6f8976298 Utilisation de la dateReel du calendrier 2023-05-28 22:11:16 +02:00
92e93cbbea Refonte du journal d'expérience
Reprise du journal d'expérience pour:
- afficher ancienne/nouvelle valeur
- la valeur du changement
- si c'est manuel / automatique
- identifier les dépenses de stress
- identifier les augmentations de compétences
- les changements des compteurs
2023-05-28 22:11:16 +02:00
994eaad9a9 Ajout des acteurs accordés aux entités 2023-05-28 22:11:16 +02:00
cfed7e2afa v10/v11 compat 2023-05-25 21:16:59 +02:00
436f9e6fa4 v10/v11 compat 2023-05-25 21:06:03 +02:00
18a50197cd v10/v11 compat 2023-05-25 21:05:43 +02:00
b6910612f8 v10/v11 compat 2023-05-25 21:04:27 +02:00
4ba1ec8a2e v10/v11 compat 2023-05-25 21:04:02 +02:00
75a0f7c322 v10/v11 compat 2023-05-25 20:40:59 +02:00
e2a9f55740 Initial commit for v11 support 2023-05-25 20:39:53 +02:00
1e0788cde8 Merge pull request 'v11' (#645) from VincentVk/foundryvtt-reve-de-dragon:v11 into v11
Reviewed-on: #645
2023-05-25 20:37:01 +02:00
c10195f753 Version 10.7.13 2023-05-25 20:23:54 +02:00
4d7317b964 Gestion de l'armure
Correction de la détérioration d'une armure variable

Séparation du code d'armure dans l'Item RdDArmureItem
2023-05-25 20:20:43 +02:00
7b1fa009bb Utilisation de constantes pour les types
(sans effet)
2023-05-12 22:56:59 +02:00
32 changed files with 688 additions and 372 deletions

4
.gitignore vendored
View File

@@ -8,3 +8,7 @@ todo.md
/jsconfig.json /jsconfig.json
/package.json /package.json
/package-lock.json /package-lock.json
/packs/*/
/packs/*/CURRENT
/packs/*/LOG
/packs/*/LOCK

View File

@@ -1,6 +1,19 @@
--- ---
# v11.0
# v10.7 - L'os de Semolosse # v10.7 - L'os de Semolosse
## v10.7.14 - l'expérience de Semolosse
- Affichage des personnages accordés sur les fiches des entités
- Refonte du journal d'expérience
- disponible pour les personnages des joueurs
- explication "comptable" des changements (dépense ou ajout, changements de niveaux, ...)
- tri alphabétique des différentes listes (sorts, recettes, oeuvres, ...)
## v10.7.13 - l'armure de Semolosse
- Fix: en cas d'armure variable, la détérioration diminue le dé d'armure
## v10.7.12 ## v10.7.12
- Fix: si le MJ gère les changements de jours, l'option "sieste" de la fenêtre de repos est prise par défaut si chateau dormant n'est pas passé - Fix: si le MJ gère les changements de jours, l'option "sieste" de la fenêtre de repos est prise par défaut si chateau dormant n'est pas passé

View File

@@ -1,54 +1,56 @@
{ {
"ACTOR": { "TYPES": {
"TypePersonnage": "Personnage", "Actor": {
"TypeCreature": "Créature", "Personnage": "Personnage",
"TypeEntite": "Entité de cauchemar", "Creature": "Créature",
"TypeCommerce": "Commerce", "Entite": "Entité de cauchemar",
"TypeVehicule": "Véhicule" "Commerce": "Commerce",
}, "Vehicule": "Véhicule"
"ITEM": { },
"TypeArme": "Arme", "Item": {
"TypeArmure": "Armure", "Arme": "Arme",
"TypeBlessure": "Blessure", "Armure": "Armure",
"TypeCasetmr": "TMR spéciale", "Blessure": "Blessure",
"TypeChant": "Chant", "Casetmr": "TMR spéciale",
"TypeCompetence": "Compétence", "Chant": "Chant",
"TypeCompetencecreature": "Compétence de créature", "Competence": "Compétence",
"TypeConteneur": "Conteneur", "Competencecreature": "Compétence de créature",
"TypeDanse": "Danse", "Conteneur": "Conteneur",
"TypeExtraitpoetique": "Extrait poetique", "Danse": "Danse",
"TypeFaune": "Faune", "Extraitpoetique": "Extrait poetique",
"TypeGemme": "Gemme", "Faune": "Faune",
"TypeHerbe": "Herbe", "Gemme": "Gemme",
"TypeIngredient": "Ingrédient", "Herbe": "Herbe",
"TypeJeu": "Jeu", "Ingredient": "Ingrédient",
"TypeLivre": "Livre", "Jeu": "Jeu",
"TypeMaladie": "Maladie", "Livre": "Livre",
"TypeMeditation": "Méditation", "Maladie": "Maladie",
"TypeMonnaie": "Monnaie", "Meditation": "Méditation",
"TypeMunition": "Munition", "Monnaie": "Monnaie",
"TypeMusique": "Musique", "Munition": "Munition",
"TypeNombreastral": "Nombre astral", "Musique": "Musique",
"TypeNourritureboisson": "Nourriture & boisson", "Nombreastral": "Nombre astral",
"TypeObjet": "Objet", "Nourritureboisson": "Nourriture & boisson",
"TypeOeuvre": "Oeuvre", "Objet": "Objet",
"TypeOmbre": "Ombre de Thanatos", "Oeuvre": "Oeuvre",
"TypePlante": "Plante", "Ombre": "Ombre de Thanatos",
"TypePoison": "Poison", "Plante": "Plante",
"TypePossession": "Possession", "Poison": "Poison",
"TypePotion": "Potion", "Possession": "Possession",
"TypeQueue": "Queue de Dragon", "Potion": "Potion",
"TypeRecettealchimique": "Recette alchimique", "Queue": "Queue de Dragon",
"TypeRecettecuisine": "Recette de cuisine", "Recettealchimique": "Recette alchimique",
"TypeRencontre": "Rencontre TMR", "Recettecuisine": "Recette de cuisine",
"TypeService": "Service", "Rencontre": "Rencontre TMR",
"TypeSignedraconique": "Signe draconique", "Service": "Service",
"TypeSort": "Sort", "Signedraconique": "Signe draconique",
"TypeSortreserve": "Sort en réserve", "Sort": "Sort",
"TypeSouffle": "Souffle de Dragon", "Sortreserve": "Sort en réserve",
"TypeTache": "Tâche", "Souffle": "Souffle de Dragon",
"TypeTarot": "Carte de tarot", "Tache": "Tâche",
"TypeTete": "te de Dragon" "Tarot": "Carte de tarot",
"Tete": "Tête de Dragon"
}
}, },
"EFFECT": { "EFFECT": {
"StatusStunned": "Sonné", "StatusStunned": "Sonné",

View File

@@ -1,4 +1,6 @@
import { RdDActorSheet } from "./actor-sheet.js"; import { RdDActorSheet } from "./actor-sheet.js";
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
import { RdDUtility } from "./rdd-utility.js";
export class RdDActorEntiteSheet extends RdDActorSheet { export class RdDActorEntiteSheet extends RdDActorSheet {
@@ -13,6 +15,12 @@ export class RdDActorEntiteSheet extends RdDActorSheet {
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }] dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
}); });
} }
async getData() {
let formData = await super.getData();
formData.resonances = this.actor.system.sante.resonnance.actors.map(actorId => game.actors.get(actorId))
.map(actor => { return { id: actor.id, name: actor.name, img: actor.img } })
return formData
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/** @override */ /** @override */
@@ -35,6 +43,23 @@ export class RdDActorEntiteSheet extends RdDActorSheet {
let compName = event.currentTarget.attributes.compname.value; let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value)); this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
}); });
this.html.find('.resonance-delete').click(async event => {
const li = RdDSheetUtility.getEventElement(event);
const actorId = li.data("actor-id");
if (actorId) {
const actorResonance = game.actors.get(actorId);
RdDUtility.confirmerSuppressionSubacteur(this, actorResonance, li, () => {
console.log('Delete : ', actorId);
this.removeSubacteur(actorId);
RdDUtility.slideOnDelete(this, li);
});
}
});
}
async removeSubacteur(actorId) {
let newResonances = this.actor.system.sante.resonnance.actors.filter(id => id != actorId);
await this.actor.update({ 'system.sante.resonnance.actors': newResonances }, { renderSheet: false });
} }
} }

View File

@@ -129,7 +129,11 @@ export class RdDActorSheet extends RdDBaseActorSheet {
const actorId = li.data("actor-id"); const actorId = li.data("actor-id");
if (actorId) { if (actorId) {
const subActor = game.actors.get(actorId); const subActor = game.actors.get(actorId);
RdDUtility.confirmerSuppressionSubacteur(this, subActor, li); RdDUtility.confirmerSuppressionSubacteur(this, subActor, li, () => {
console.log('Delete : ', subActor.id);
this.actor.removeSubacteur(subActor.id);
RdDUtility.slideOnDelete(this, li);
});
} }
}); });
this.html.find('.experiencelog-delete').click(async event => { this.html.find('.experiencelog-delete').click(async event => {
@@ -142,6 +146,13 @@ export class RdDActorSheet extends RdDBaseActorSheet {
const key = Number(li.data("key") ?? -1); const key = Number(li.data("key") ?? -1);
await this.actor.deleteExperienceLog(0, key + 1); await this.actor.deleteExperienceLog(0, key + 1);
}); });
this.html.find("input.derivee-value[name='system.compteurs.stress.value']").change(async event => {
this.actor.updateCompteurValue("stress", parseInt(event.target.value));
});
this.html.find("input.derivee-value[name='system.compteurs.experience.value']").change(async event => {
this.actor.updateCompteurValue("experience", parseInt(event.target.value));
});
this.html.find('.encaisser-direct').click(async event => { this.html.find('.encaisser-direct').click(async event => {
this.actor.encaisser(); this.actor.encaisser();
}) })

View File

@@ -37,6 +37,7 @@ import { RdDTimestamp } from "./time/rdd-timestamp.js";
import { RdDItemBlessure } from "./item/blessure.js"; import { RdDItemBlessure } from "./item/blessure.js";
import { AppAstrologie } from "./sommeil/app-astrologie.js"; import { AppAstrologie } from "./sommeil/app-astrologie.js";
import { RdDEmpoignade } from "./rdd-empoignade.js"; import { RdDEmpoignade } from "./rdd-empoignade.js";
import { ExperienceLog, XP_TOPIC } from "./actor/experience-log.js";
const POSSESSION_SANS_DRACONIC = { const POSSESSION_SANS_DRACONIC = {
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp', img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
@@ -821,31 +822,40 @@ export class RdDActor extends RdDBaseActor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCarac(caracName, caracValue) { async updateCarac(caracName, to) {
if (caracName == "force") { if (caracName == "force") {
if (Number(caracValue) > this.getTaille() + 4) { if (Number(to) > this.getTaille() + 4) {
ui.notifications.warn("Votre FORCE doit être au maximum de TAILLE+4"); ui.notifications.warn("Votre FORCE doit être au maximum de TAILLE+4");
return; return;
} }
} }
if (caracName == "reve") { if (caracName == "reve") {
if (caracValue > Misc.toInt(this.system.reve.seuil.value)) { if (to > Misc.toInt(this.system.reve.seuil.value)) {
this.setPointsDeSeuil(caracValue); this.setPointsDeSeuil(to);
} }
} }
if (caracName == "chance") { if (caracName == "chance") {
if (caracValue > Misc.toInt(this.system.compteurs.chance.value)) { if (to > Misc.toInt(this.system.compteurs.chance.value)) {
this.setPointsDeChance(caracValue); this.setPointsDeChance(to);
} }
} }
await this.update({ [`system.carac.${caracName}.value`]: caracValue }); let selectedCarac = RdDActor._findCaracByName(this.system.carac, caracName);
const from = selectedCarac.value
await this.update({ [`system.carac.${caracName}.value`]: to });
await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCaracXP(caracName, caracXP) { async updateCaracXP(caracName, to) {
if (caracName == 'Taille') { if (caracName == 'Taille') {
return; return;
} }
let selectedCarac = RdDActor._findCaracByName(this.system.carac, caracName);
if (!selectedCarac.derivee) {
const from = Number(selectedCarac.xp);
await this.update({ [`system.carac.${caracName}.xp`]: to });
await ExperienceLog.add(this, XP_TOPIC.XPCARAC, from, to, caracName);
}
this.checkCaracXP(caracName); this.checkCaracXP(caracName);
} }
@@ -857,16 +867,19 @@ export class RdDActor extends RdDBaseActor {
let carac = RdDActor._findCaracByName(this.system.carac, caracName); let carac = RdDActor._findCaracByName(this.system.carac, caracName);
if (carac) { if (carac) {
carac = duplicate(carac); carac = duplicate(carac);
let xp = Number(carac.xp); const fromXp = Number(carac.xp);
let value = Number(carac.value); const fromValue = Number(carac.value);
while (xp >= RdDCarac.getCaracNextXp(value) && xp > 0) { let toXp = fromXp;
xp -= RdDCarac.getCaracNextXp(value); let toValue = fromValue;
value++; while (toXp >= RdDCarac.getCaracNextXp(toValue) && toXp > 0) {
toXp -= RdDCarac.getCaracNextXp(toValue);
toValue++;
} }
carac.xp = xp; carac.xp = toXp;
carac.value = value; carac.value = toValue;
await this.update({ [`system.carac.${caracName}`]: carac }); await this.update({ [`system.carac.${caracName}`]: carac });
this.updateExperienceLog("Carac +", xp, caracName + " passée à " + value); await ExperienceLog.add(this, XP_TOPIC.XPCARAC, fromXp, toXp, caracName);
await ExperienceLog.add(this, XP_TOPIC.CARAC, fromValue, toValue, caracName);
} }
} }
@@ -874,17 +887,20 @@ export class RdDActor extends RdDBaseActor {
async updateCompetenceXPAuto(idOrName) { async updateCompetenceXPAuto(idOrName) {
let competence = this.getCompetence(idOrName); let competence = this.getCompetence(idOrName);
if (competence) { if (competence) {
let xp = Number(competence.system.xp); const fromXp = Number(competence.system.xp);
let niveau = Number(competence.system.niveau); const fromNiveau = Number(competence.system.niveau);
while (xp >= RdDItemCompetence.getCompetenceNextXp(niveau) && xp > 0) { let toXp = fromXp;
xp -= RdDItemCompetence.getCompetenceNextXp(niveau); let toNiveau = fromNiveau;
niveau++; while (toXp >= RdDItemCompetence.getCompetenceNextXp(toNiveau) && toXp > 0) {
toXp -= RdDItemCompetence.getCompetenceNextXp(toNiveau);
toNiveau++;
} }
await competence.update({ await competence.update({
"system.xp": xp, "system.xp": toXp,
"system.niveau": niveau, "system.niveau": toNiveau,
}); });
this.updateExperienceLog("Compétence +", xp, competence.name + " passée à " + niveau); await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name);
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name);
} }
} }
@@ -893,29 +909,33 @@ export class RdDActor extends RdDBaseActor {
if (!competence) { if (!competence) {
return; return;
} }
const stress = this.system.compteurs.experience.value; const fromXp = competence.system.xp;
const niveau = Number(competence.system.niveau); const fromXpStress = this.system.compteurs.experience.value;
const xpSuivant = RdDItemCompetence.getCompetenceNextXp(niveau); const fromNiveau = Number(competence.system.niveau);
const xpRequis = xpSuivant - competence.system.xp; const xpSuivant = RdDItemCompetence.getCompetenceNextXp(fromNiveau);
if (stress <= 0 || niveau >= competence.system.niveau_archetype) { const xpRequis = xpSuivant - fromXp;
if (fromXpStress <= 0 || fromNiveau >= competence.system.niveau_archetype) {
ui.notifications.info(`La compétence ne peut pas augmenter! ui.notifications.info(`La compétence ne peut pas augmenter!
stress disponible: ${stress} stress disponible: ${fromXpStress}
expérience requise: ${xpRequis} expérience requise: ${xpRequis}
niveau : ${niveau} niveau : ${fromNiveau}
archétype : ${competence.system.niveau_archetype}`); archétype : ${competence.system.niveau_archetype}`);
return; return;
} }
const xpUtilise = Math.max(0, Math.min(stress, xpRequis)); const xpUtilise = Math.max(0, Math.min(fromXpStress, xpRequis));
const gainNiveau = (xpUtilise >= xpRequis || xpRequis <= 0) ? 1 : 0; const gainNiveau = (xpUtilise >= xpRequis || xpRequis <= 0) ? 1 : 0;
const nouveauNiveau = niveau + gainNiveau; const toNiveau = fromNiveau + gainNiveau;
const nouveauXp = gainNiveau > 0 ? Math.max(competence.system.xp - xpSuivant, 0) : (competence.system.xp + xpUtilise); const newXp = gainNiveau > 0 ? Math.max(fromXp - xpSuivant, 0) : (fromXp + xpUtilise);
await competence.update({ await competence.update({
"system.xp": nouveauXp, "system.xp": newXp,
"system.niveau": nouveauNiveau, "system.niveau": toNiveau,
}); });
const stressTransformeRestant = Math.max(0, stress - xpUtilise); const toXpStress = Math.max(0, fromXpStress - xpUtilise);
await this.update({ "system.compteurs.experience.value": stressTransformeRestant }); await this.update({ "system.compteurs.experience.value": toXpStress });
this.updateExperienceLog('Dépense stress', xpUtilise, `Stress en ${competence.name} ${gainNiveau ? "pour passer à " + nouveauNiveau : ""}`);
await ExperienceLog.add(this, XP_TOPIC.TRANSFORM, fromXpStress, toXpStress, `Dépense stress`);
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, newXp, competence.name);
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@@ -941,49 +961,57 @@ export class RdDActor extends RdDBaseActor {
async updateCompetence(idOrName, compValue) { async updateCompetence(idOrName, compValue) {
let competence = this.getCompetence(idOrName); let competence = this.getCompetence(idOrName);
if (competence) { if (competence) {
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie); let toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie);
const tronc = RdDItemCompetence.getListTronc(competence.name).filter(it => { this.notifyCompetencesTronc(competence, toNiveau);
const comp = this.getCompetence(it); const fromNiveau = competence.system.niveau;
const niveauTr = competence ? competence.system.niveau : 0; await this.updateEmbeddedDocuments('Item', [{ _id: competence.id, 'system.niveau': toNiveau }]);
return niveauTr < 0 && niveauTr < nouveauNiveau; await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true);
}); } else {
if (tronc.length > 0) { console.log("Competence not found", idOrName);
let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : "; }
for (let troncName of tronc) { }
message += "<br>" + troncName;
} notifyCompetencesTronc(competence, toNiveau) {
ui.notifications.info(message); const listTronc = RdDItemCompetence.getListTronc(competence.name).filter(it => {
const autreComp = this.getCompetence(it);
const niveauTr = autreComp?.system.niveau ?? 0;
return niveauTr < 0 && niveauTr < toNiveau;
});
if (listTronc.length > 0) {
ui.notifications.info(
"Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : <br>"
+ Misc.join(listTronc, '<br>'));
}
}
/* -------------------------------------------- */
async updateCompetenceXP(idOrName, toXp) {
let competence = this.getCompetence(idOrName);
if (competence) {
if (isNaN(toXp) || typeof (toXp) != 'number') toXp = 0;
const fromXp = competence.system.xp;
this.checkCompetenceXP(idOrName, toXp);
await this.updateEmbeddedDocuments('Item', [{ _id: competence.id, 'system.xp': toXp }]);
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name, true);
if (toXp > fromXp) {
RdDUtility.checkThanatosXP(idOrName);
} }
const update = { _id: competence.id, 'system.niveau': nouveauNiveau };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
} else { } else {
console.log("Competence not found", idOrName); console.log("Competence not found", idOrName);
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetenceXP(idOrName, newXp) { async updateCompetenceXPSort(idOrName, toXpSort) {
let competence = this.getCompetence(idOrName); let competence = this.getCompetence(idOrName);
if (competence) { if (competence) {
if (isNaN(newXp) || typeof (newXp) != 'number') newXp = 0; if (isNaN(toXpSort) || typeof (toXpSort) != 'number') toXpSort = 0;
this.checkCompetenceXP(idOrName, newXp); const fromXpSort = competence.system.xp_sort;
const update = { _id: competence.id, 'system.xp': newXp }; await this.updateEmbeddedDocuments('Item', [{ _id: competence.id, 'system.xp_sort': toXpSort }]);
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, competence.name, true);
this.updateExperienceLog("XP", newXp, "XP modifié en " + competence.name); if (toXpSort > fromXpSort) {
} else { RdDUtility.checkThanatosXP(idOrName);
console.log("Competence not found", idOrName); }
}
RdDUtility.checkThanatosXP(idOrName);
}
/* -------------------------------------------- */
async updateCompetenceXPSort(idOrName, compValue) {
let competence = this.getCompetence(idOrName);
if (competence) {
if (isNaN(compValue) || typeof (compValue) != 'number') compValue = 0;
const update = { _id: competence.id, 'system.xp_sort': compValue };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + competence.name);
} else { } else {
console.log("Competence not found", idOrName); console.log("Competence not found", idOrName);
} }
@@ -993,26 +1021,12 @@ export class RdDActor extends RdDBaseActor {
async updateCompetenceArchetype(idOrName, compValue) { async updateCompetenceArchetype(idOrName, compValue) {
let competence = this.getCompetence(idOrName); let competence = this.getCompetence(idOrName);
if (competence) { if (competence) {
compValue = compValue ?? 0; await this.updateEmbeddedDocuments('Item', [{ _id: competence.id, 'system.niveau_archetype': Math.max(compValue ?? 0, 0) }]);
const update = { _id: competence.id, 'system.niveau_archetype': compValue };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
} else { } else {
console.log("Competence not found", idOrName); console.log("Competence not found", idOrName);
} }
} }
/* -------------------------------------------- */
async updateExperienceLog(modeXP, valeurXP, raisonXP = 'Inconnue') {
let d = new Date();
let expLog = duplicate(this.system.experiencelog);
expLog.push({
mode: Misc.upperFirst(modeXP), valeur: valeurXP, raison: Misc.upperFirst(raisonXP),
daterdd: game.system.rdd.calendrier.dateCourante(),
datereel: `${d.getDate()}/${d.getMonth() + 1}/${d.getFullYear()}`
});
await this.update({ [`system.experiencelog`]: expLog });
}
async deleteExperienceLog(from, count) { async deleteExperienceLog(from, count) {
if (from >= 0 && count > 0) { if (from >= 0 && count > 0) {
let expLog = duplicate(this.system.experiencelog); let expLog = duplicate(this.system.experiencelog);
@@ -1021,24 +1035,27 @@ export class RdDActor extends RdDBaseActor {
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompteurValue(fieldName, fieldValue, raison = 'Inconnue') { async updateCompteurValue(fieldName, to) {
await this.update({ [`system.compteurs.${fieldName}.value`]: fieldValue }); const from = this.system.compteurs[fieldName].value
await this.addStressExperienceLog(fieldName, fieldValue, 'forcé: ' + raison); await this.update({ [`system.compteurs.${fieldName}.value`]: to });
await this.addStressExperienceLog(fieldName, from, to, fieldName, true);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async addCompteurValue(fieldName, fieldValue, raison = 'Inconnue') { async addCompteurValue(fieldName, add, raison) {
let oldValue = this.system.compteurs[fieldName].value; let from = this.system.compteurs[fieldName].value;
await this.update({ [`system.compteurs.${fieldName}.value`]: Number(oldValue) + Number(fieldValue) }); const to = Number(from) + Number(add);
await this.addStressExperienceLog(fieldName, fieldValue, raison); await this.update({ [`system.compteurs.${fieldName}.value`]: to });
await this.addStressExperienceLog(fieldName, from, to, raison);
} }
async addStressExperienceLog(fieldName, fieldValue, raison) { async addStressExperienceLog(topic, from, to, raison, manuel) {
switch (fieldName) { switch (topic) {
case 'stress': case 'experience': case 'stress':
await this.updateExperienceLog(fieldName, fieldValue, raison); return await ExperienceLog.add(this, XP_TOPIC.STRESS, from, to, raison, manuel)
case 'experience':
return await ExperienceLog.add(this, XP_TOPIC.TRANSFORM, from, to, raison, manuel)
} }
} }
@@ -1843,14 +1860,14 @@ export class RdDActor extends RdDBaseActor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async transformerStress() { async transformerStress() {
const stress = Number(this.system.compteurs.stress.value); const fromStress = Number(this.system.compteurs.stress.value);
if (this.system.sommeil?.insomnie || stress <= 0) { if (this.system.sommeil?.insomnie || fromStress <= 0) {
return; return;
} }
const stressRoll = await this._stressRoll(this.getReveActuel()); const stressRoll = await this._stressRoll(this.getReveActuel());
const conversion = Math.floor(stress * stressRoll.factor / 100); const conversion = Math.floor(fromStress * stressRoll.factor / 100);
let dissolution = Math.max(0, Number(this.system.compteurs.dissolution.value)); let dissolution = Math.max(0, Number(this.system.compteurs.dissolution.value));
let exaltation = Math.max(0, Number(this.system.compteurs.exaltation.value)); let exaltation = Math.max(0, Number(this.system.compteurs.exaltation.value));
const annule = Math.min(dissolution, exaltation); const annule = Math.min(dissolution, exaltation);
@@ -1862,8 +1879,8 @@ export class RdDActor extends RdDBaseActor {
alias: this.name, alias: this.name,
selectedCarac: this.system.carac.reve, selectedCarac: this.system.carac.reve,
rolled: stressRoll, rolled: stressRoll,
stress: stress, stress: fromStress,
perte: Math.min(conversion, stress), perte: Math.min(conversion, fromStress),
convertis: conversion - perteDissolution, convertis: conversion - perteDissolution,
xp: conversion - perteDissolution + exaltation, xp: conversion - perteDissolution + exaltation,
dissolution: dissolution, dissolution: dissolution,
@@ -1875,15 +1892,18 @@ export class RdDActor extends RdDBaseActor {
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.html`, stressRollData) content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.html`, stressRollData)
}); });
const toStress = Math.max(fromStress - stressRollData.perte - 1, 0);
const fromXpSress = Number(this.system.compteurs.experience.value);
const toXpStress = fromXpSress + Number(stressRollData.xp);
const updates = { const updates = {
"system.compteurs.stress.value": Math.max(stress - stressRollData.perte - 1, 0), "system.compteurs.stress.value": toStress,
"system.compteurs.experience.value": Number(this.system.compteurs.experience.value) + Number(stressRollData.xp), "system.compteurs.experience.value": toXpStress,
"system.compteurs.dissolution.value": dissolution - perteDissolution, "system.compteurs.dissolution.value": dissolution - perteDissolution,
"system.compteurs.exaltation.value": 0 "system.compteurs.exaltation.value": 0
} }
await this.update(updates); await this.update(updates);
await ExperienceLog.add(this, XP_TOPIC.STRESS, fromStress, toStress, 'Transformation')
this.updateExperienceLog('XP', stressRollData.xp, "Transformation du stress"); await ExperienceLog.add(this, XP_TOPIC.TRANSFORM, fromXpSress, toXpStress, 'Transformation')
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@@ -2709,8 +2729,10 @@ export class RdDActor extends RdDBaseActor {
} }
rollData.xpSort = RdDItemSigneDraconique.getXpSortSigneDraconique(rollData.rolled.code, rollData.signe); rollData.xpSort = RdDItemSigneDraconique.getXpSortSigneDraconique(rollData.rolled.code, rollData.signe);
if (rollData.xpSort > 0) { if (rollData.xpSort > 0) {
await this.updateEmbeddedDocuments("Item", [{ _id: compData._id, 'system.xp_sort': Misc.toInt(compData.system.xp_sort) + rollData.xpSort }]); const fromXp = Number(compData.system.xp_sort);
await this.updateExperienceLog("XP Sort", rollData.xpSort, "Signe draconique en " + rollData.competence.name); const toXp = fromXp + rollData.xpSort;
await this.updateEmbeddedDocuments("Item", [{ _id: compData._id, 'system.xp_sort': toXp }]);
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXp, toXp, `${rollData.competence.name} : signe draconique`);
} }
await this.deleteEmbeddedDocuments("Item", [rollData.signe._id]); await this.deleteEmbeddedDocuments("Item", [rollData.signe._id]);
await RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-lecture-signedraconique.html'); await RdDResolutionTable.displayRollData(rollData, this.name, 'chat-resultat-lecture-signedraconique.html');
@@ -2824,11 +2846,12 @@ export class RdDActor extends RdDBaseActor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async _xpCompetence(xpData) { async _xpCompetence(xpData) {
if (xpData.competence) { if (xpData.competence) {
const newXp = Misc.toInt(xpData.competence.system.xp) + xpData.xpCompetence; const from = Number(xpData.competence.system.xp);
let update = { _id: xpData.competence._id, 'system.xp': newXp }; const to = from + xpData.xpCompetence;
let update = { _id: xpData.competence._id, 'system.xp': to };
await this.updateEmbeddedDocuments('Item', [update]); await this.updateEmbeddedDocuments('Item', [update]);
xpData.checkComp = await this.checkCompetenceXP(xpData.competence.name, undefined, false); xpData.checkComp = await this.checkCompetenceXP(xpData.competence.name, undefined, false);
this.updateExperienceLog("XP", xpData.xpCompetence, "XP gagné en " + xpData.competence.name); await ExperienceLog.add(this, XP_TOPIC.XP, from, to, xpData.competence.name);
} }
} }
@@ -2838,10 +2861,12 @@ export class RdDActor extends RdDBaseActor {
let carac = duplicate(this.system.carac); let carac = duplicate(this.system.carac);
let selectedCarac = RdDActor._findCaracByName(carac, xpData.caracName); let selectedCarac = RdDActor._findCaracByName(carac, xpData.caracName);
if (!selectedCarac.derivee) { if (!selectedCarac.derivee) {
selectedCarac.xp = Misc.toInt(selectedCarac.xp) + xpData.xpCarac; const from = Number(selectedCarac.xp);
const to = from + xpData.xpCarac;
selectedCarac.xp = to;
await this.update({ "system.carac": carac }); await this.update({ "system.carac": carac });
xpData.checkCarac = await this.checkCaracXP(selectedCarac.label, false); xpData.checkCarac = await this.checkCaracXP(selectedCarac.label, false);
this.updateExperienceLog("XP", xpData.xpCarac, "XP gagné en " + xpData.caracName); await ExperienceLog.add(this, XP_TOPIC.XPCARAC, from, to, xpData.caracName);
} else { } else {
xpData.caracRepartitionManuelle = true; xpData.caracRepartitionManuelle = true;
} }
@@ -3149,8 +3174,8 @@ export class RdDActor extends RdDBaseActor {
const armures = this.items.filter(it => it.type == "armure" && it.system.equipe); const armures = this.items.filter(it => it.type == "armure" && it.system.equipe);
for (const armure of armures) { for (const armure of armures) {
protection += await RdDDice.rollTotal(armure.system.protection.toString()); protection += await RdDDice.rollTotal(armure.system.protection.toString());
if (dmg > 0) { if (dmg > 0 && attackerRoll.dmg.encaisserSpecial != "noarmure") {
this._deteriorerArmure(armure, dmg); armure.deteriorerArmure(dmg);
dmg = 0; dmg = 0;
} }
} }
@@ -3168,35 +3193,6 @@ export class RdDActor extends RdDBaseActor {
return protection; return protection;
} }
/* -------------------------------------------- */
_deteriorerArmure(armure, dmg) {
armure = duplicate(armure);
if (!ReglesOptionelles.isUsing('deteriorationArmure') || armure.system.protection == '0') {
return;
}
armure.system.deterioration = (armure.system.deterioration ?? 0) + dmg;
if (armure.system.deterioration >= 10) {
armure.system.deterioration -= 10;
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(armure.system.protection);
if (res) {
let malus = Misc.toInt(res[3]) - 1;
let armure = Misc.toInt(res[2]);
if (armure + malus <= 0) {
armure.system.protection = 0;
} else {
armure.system.protection = '' + (res[1] ?? '1') + 'd' + armure + malus;
}
}
else if (/\d+/.exec(armure.system.protection)) {
armure.system.protection = "1d" + armure.system.protection;
}
else {
ui.notifications.warn(`La valeur d'armure de votre ${armure.name} est incorrecte`);
}
ChatMessage.create({ content: "Votre armure s'est détériorée, elle protège maintenant de " + armure.system.protection });
}
this.updateEmbeddedDocuments('Item', [armure]);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async encaisser() { async encaisser() {

View File

@@ -0,0 +1,39 @@
export const XP_TOPIC = {
XP: { code: 'xp', label: 'xp' },
XPSORT: { code: 'xpsort', label: 'xp sort' },
NIVEAU: { code: 'niveau', label: 'Niveau' },
XPCARAC: { code: 'xpcarac', label: 'xp carac' },
CARAC: { code: 'carac', label: 'Carac' },
STRESS: { code: 'stress', label: 'Stress' },
TRANSFORM: { code: 'xps', label: 'Transformé' },
}
export class ExperienceLog {
static async add(actor, topic, from, to, raison, manuel = false) {
if (!actor.hasPlayerOwner || !actor.isPersonnage()) {
return
}
if (from == to) {
return
}
const newXpLog = {
mode: topic?.code ?? topic,
raison: (manuel ? '(manuel) ' : '') + raison,
from: from,
to: to,
valeur: to - from,
daterdd: game.system.rdd.calendrier.dateCourante(),
datereel: game.system.rdd.calendrier.dateReel().replace('T', ' ')
};
console.log('ExperienceLog.add', newXpLog)
const newExperienceLog = (actor.system.experiencelog ?? []).concat([newXpLog]);
await actor.update({ [`system.experiencelog`]: newExperienceLog });
}
static labelTopic(topic) {
const xpt = Object.values(XP_TOPIC).find(it => it.code == topic);
return xpt?.label ?? xpt?.code ?? topic;
}
}

View File

@@ -25,23 +25,13 @@ export class DialogChronologie extends Dialog {
journalId: game.settings.get(SYSTEM_RDD, LATEST_USED_JOURNAL_ID), journalId: game.settings.get(SYSTEM_RDD, LATEST_USED_JOURNAL_ID),
journaux: game.journal.filter(it => it.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)), journaux: game.journal.filter(it => it.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)),
timestamp: game.system.rdd.calendrier.timestamp, timestamp: game.system.rdd.calendrier.timestamp,
dateReel: DialogChronologie.getCurrentDateTime() dateReel: game.system.rdd.calendrier.dateReel()
}; };
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-chronologie.html", dialogData); const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-chronologie.html", dialogData);
const dialog = new DialogChronologie(html, dialogData); const dialog = new DialogChronologie(html, dialogData);
dialog.render(true); dialog.render(true);
} }
static getCurrentDateTime() {
return new Date().toLocaleString("sv-SE", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit"
}).replace(" ", "T");
}
constructor(html, dialogData) { constructor(html, dialogData) {
const options = { const options = {
classes: ["DialogChronologie"], classes: ["DialogChronologie"],
@@ -124,7 +114,7 @@ export class DialogChronologie extends Dialog {
heure: RdDTimestamp.definition(this.html.find("form.rdddialogchrono :input[name='chronologie.heure']").val()), heure: RdDTimestamp.definition(this.html.find("form.rdddialogchrono :input[name='chronologie.heure']").val()),
minute: this.html.find("form.rdddialogchrono :input[name='chronologie.minute']").val(), minute: this.html.find("form.rdddialogchrono :input[name='chronologie.minute']").val(),
}, },
dateReel: this.html.find("form.rdddialogchrono :input[name='dateReel']").val().replace('T', ' ') dateReel: this.html.find("form.rdddialogchrono :input[name='dateReel']").val()
} }
} }

View File

@@ -7,34 +7,71 @@ import { RdDUtility } from "./rdd-utility.js";
import { SystemCompendiums } from "./settings/system-compendiums.js"; import { SystemCompendiums } from "./settings/system-compendiums.js";
import { RdDRaretes } from "./item/raretes.js"; import { RdDRaretes } from "./item/raretes.js";
export const TYPES = {
competence: 'competence',
competencecreature: 'competencecreature',
arme: 'arme',
armure: 'armure',
conteneur: 'conteneur',
sort: 'sort',
herbe: 'herbe',
faune: 'faune',
ingredient: 'ingredient',
livre: 'livre',
potion: 'potion',
rencontre: 'rencontre',
queue: 'queue',
ombre: 'ombre',
souffle: 'souffle',
tete: 'tete',
meditation: 'meditation',
recettealchimique: 'recettealchimique',
chant: 'chant',
danse: 'danse',
jeu: 'jeu',
recettecuisine: 'recettecuisine',
musique: 'musique',
maladie: 'maladie',
poison: 'poison',
oeuvre: 'oeuvre',
nourritureboisson: 'nourritureboisson',
service: 'service',
signedraconique: 'signedraconique',
gemme: 'gemme',
possession: 'possession',
sortreserve: 'sortreserve',
extraitpoetique: 'extraitpoetique',
tarot: 'tarot',
empoignade: 'empoignade'
}
const typesInventaireMateriel = [ const typesInventaireMateriel = [
"arme", TYPES.arme,
"armure", TYPES.armure,
"conteneur", TYPES.conteneur,
"faune", TYPES.faune,
"gemme", TYPES.gemme,
"herbe", TYPES.herbe,
"plante", TYPES.plante,
"ingredient", TYPES.ingredient,
"livre", TYPES.livre,
"monnaie", TYPES.monnaie,
"munition", TYPES.munition,
"nourritureboisson", TYPES.nourritureboisson,
"objet", TYPES.objet,
"potion", TYPES.potion,
] ]
const typesInventaire = { const typesInventaire = {
materiel: typesInventaireMateriel, materiel: typesInventaireMateriel,
all: ['service'].concat(typesInventaireMateriel), all: ['service'].concat(typesInventaireMateriel),
} }
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"] const typesObjetsOeuvres = [TYPES.oeuvre, TYPES.recettecuisine, TYPES.musique, TYPES.chant, TYPES.danse, TYPES.jeu]
const typesObjetsDraconiques = ["queue", "ombre", "souffle", "tete", "signedraconique", "sortreserve", "rencontre"] const typesObjetsDraconiques = [TYPES.queue, TYPES.ombre, TYPES.souffle, TYPES.tete, TYPES.signedraconique, TYPES.sortreserve, TYPES.rencontre]
const typesObjetsConnaissance = ["meditation", "recettealchimique", "sort"] const typesObjetsConnaissance = [TYPES.meditation, TYPES.recettealchimique, TYPES.sort]
const typesObjetsEffet = ["possession", "poison", "maladie", "blessure"] const typesObjetsEffet = [TYPES.possession, TYPES.poison, TYPES.maladie, TYPES.blessure]
const typesObjetsCompetence = ["competence", "competencecreature"] const typesObjetsCompetence = [TYPES.competence, TYPES.competencecreature]
const typesObjetsTemporels = ["blessure", "poison", "maladie", "queue", "ombre", "souffle", "signedraconique", "rencontre"] const typesObjetsTemporels = [TYPES.blessure, TYPES.poison, TYPES.maladie, TYPES.queue, TYPES.ombre, TYPES.souffle, TYPES.signedraconique, TYPES.rencontre]
const typesObjetsEquipable = ['arme', 'armure', 'objet']; const typesObjetsEquipable = [TYPES.arme, TYPES.armure, TYPES.objet];
const typesEnvironnement = typesInventaireMateriel; const typesEnvironnement = typesInventaireMateriel;
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
@@ -93,12 +130,12 @@ export class RdDItem extends Item {
static isFieldInventaireModifiable(type, field) { static isFieldInventaireModifiable(type, field) {
switch (field) { switch (field) {
case 'quantite': case 'quantite':
if (['conteneur'].includes(type)) { if ([TYPES.conteneur].includes(type)) {
return false; return false;
} }
break; break;
case 'cout': case 'cout':
if (['monnaie'].includes(type)) { if ([TYPES.monnaie].includes(type)) {
return game.user.isGM; return game.user.isGM;
} }
break; break;
@@ -146,15 +183,15 @@ export class RdDItem extends Item {
getUniteQuantite() { getUniteQuantite() {
switch (this.type) { switch (this.type) {
case "monnaie": return "(Pièces)" case TYPES.monnaie: return "(Pièces)"
case "herbe": case TYPES.herbe:
switch (this.system.categorie) { switch (this.system.categorie) {
case 'Alchimie': case 'Repos': case 'Soin': case 'Alchimie': case 'Repos': case 'Soin':
return "(Brins)" return "(Brins)"
case 'Cuisine': return ''; case 'Cuisine': return '';
} }
return ''; return '';
case "ingredient": return "(Pépins ou Brins)" case TYPES.ingredient: return "(Pépins ou Brins)"
} }
return ''; return '';
} }
@@ -163,26 +200,27 @@ export class RdDItem extends Item {
return typesObjetsEquipable.includes(this.type) return typesObjetsEquipable.includes(this.type)
} }
isCompetencePersonnage() { return this.type == 'competence' } isCompetencePersonnage() { return this.type == TYPES.competence }
isCompetenceCreature() { return this.type == 'competencecreature' } isCompetenceCreature() { return this.type == TYPES.competencecreature }
isConteneur() { return this.type == 'conteneur'; } isConteneur() { return this.type == TYPES.conteneur; }
isMonnaie() { return this.type == 'monnaie'; } isMonnaie() { return this.type == TYPES.monnaie; }
isPotion() { return this.type == 'potion'; } isPotion() { return this.type == TYPES.potion; }
isNourritureBoisson() { return this.type == 'nourritureboisson'; } isNourritureBoisson() { return this.type == TYPES.nourritureboisson; }
isService() { return this.type == 'service'; } isService() { return this.type == TYPES.service; }
isCompetence() { return typesObjetsCompetence.includes(this.type) } isCompetence() { return typesObjetsCompetence.includes(this.type) }
isTemporel() { return typesObjetsTemporels.includes(this.type) } isTemporel() { return typesObjetsTemporels.includes(this.type) }
isOeuvre() { return typesObjetsOeuvres.includes(this.type) } isOeuvre() { return typesObjetsOeuvres.includes(this.type) }
isDraconique() { return RdDItem.getItemTypesDraconiques().includes(this.type) } isDraconique() { return RdDItem.getItemTypesDraconiques().includes(this.type) }
isQueueDragon() { return [TYPES.queue, TYPES.ombre].includes(this.type) }
isEffet() { return typesObjetsEffet.includes(this.type) } isEffet() { return typesObjetsEffet.includes(this.type) }
isConnaissance() { return typesObjetsConnaissance.includes(this.type) } isConnaissance() { return typesObjetsConnaissance.includes(this.type) }
isInventaire(mode = 'materiel') { return RdDItem.getItemTypesInventaire(mode).includes(this.type); } isInventaire(mode = 'materiel') { return RdDItem.getItemTypesInventaire(mode).includes(this.type); }
isBoisson() { return this.isNourritureBoisson() && this.system.boisson; } isBoisson() { return this.isNourritureBoisson() && this.system.boisson; }
isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; } isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; }
isHerbeAPotion() { return this.type == 'herbe' && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); } isHerbeAPotion() { return this.type == TYPES.herbe && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); }
isBlessure() { return this.type == 'blessure' } isBlessure() { return this.type == TYPES.blessure }
isPresentDansMilieux(milieux) { isPresentDansMilieux(milieux) {
return this.getEnvironnements(milieux).length > 0 return this.getEnvironnements(milieux).length > 0
@@ -267,15 +305,15 @@ export class RdDItem extends Item {
getUtilisation() { getUtilisation() {
switch (this.type) { switch (this.type) {
case 'potion': case TYPES.potion:
switch (this.system.categorie) { switch (this.system.categorie) {
case 'Alchimie': case 'AlchimieEnchante': case 'AlchimieAutre': return 'alchimie' case 'Alchimie': case 'AlchimieEnchante': case 'AlchimieAutre': return 'alchimie'
case 'Cuisine': return 'cuisine' case 'Cuisine': return 'cuisine'
case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante': return 'soins' case 'Remede': case 'Repos': case 'ReposEnchante': case 'Soin': case 'SoinEnchante': return 'soins'
} }
return ''; return '';
case 'nourritureboisson': return 'cuisine'; case TYPES.nourritureboisson: return 'cuisine';
case 'herbe': case 'faune': case 'ingredient': case 'plante': case TYPES.herbe: case TYPES.faune: case TYPES.ingredient: case TYPES.plante:
switch (this.system.categorie) { switch (this.system.categorie) {
case 'Cuisine': return 'cuisine'; case 'Cuisine': return 'cuisine';
case 'Toxique': case 'Poison': return 'poison'; case 'Toxique': case 'Poison': return 'poison';
@@ -290,9 +328,9 @@ export class RdDItem extends Item {
getUtilisationCuisine() { getUtilisationCuisine() {
if (this.getUtilisation() == 'cuisine') { if (this.getUtilisation() == 'cuisine') {
switch (this.type) { switch (this.type) {
case 'nourritureboisson': case TYPES.nourritureboisson:
return 'pret'; return 'pret';
case 'herbe': case 'faune': case 'ingredient': case 'plante': case TYPES.herbe: case TYPES.faune: case TYPES.ingredient: case TYPES.plante:
return 'brut'; return 'brut';
} }
} }
@@ -300,7 +338,7 @@ export class RdDItem extends Item {
} }
isCristalAlchimique() { isCristalAlchimique() {
return this.type == 'objet' && Grammar.toLowerCaseNoAccent(this.name) == 'cristal alchimique' && this.system.quantite > 0; return this.type == TYPES.objet && Grammar.includesLowerCaseNoAccent(this.name, 'cristal alchimique') && this.system.quantite > 0;
} }
isMagique() { isMagique() {
@@ -328,11 +366,11 @@ export class RdDItem extends Item {
getEnc() { getEnc() {
switch (this.type) { switch (this.type) {
case 'service': case TYPES.service:
return 0; return 0;
case 'herbe': case TYPES.herbe:
return this.getEncHerbe(); return this.getEncHerbe();
case 'gemme': case TYPES.gemme:
return encPepin * this.system.taille; return encPepin * this.system.taille;
} }
return Math.max(this.system.encombrement ?? 0, 0); return Math.max(this.system.encombrement ?? 0, 0);
@@ -388,7 +426,7 @@ export class RdDItem extends Item {
getActionPrincipale(options = { warnIfNot: true }) { getActionPrincipale(options = { warnIfNot: true }) {
switch (this.type) { switch (this.type) {
case 'conteneur': return 'Ouvrir'; case TYPES.conteneur: return 'Ouvrir';
} }
if (this.actor?.isPersonnage()) { if (this.actor?.isPersonnage()) {
const warn = options.warnIfNot; const warn = options.warnIfNot;
@@ -396,11 +434,11 @@ export class RdDItem extends Item {
return 'Utiliser'; return 'Utiliser';
} }
switch (this.type) { switch (this.type) {
case 'nourritureboisson': return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn); case TYPES.nourritureboisson: return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
case 'potion': return this._actionOrWarnQuantiteZero('Boire', warn); case TYPES.potion: return this._actionOrWarnQuantiteZero('Boire', warn);
case 'livre': return this._actionOrWarnQuantiteZero('Lire', warn); case TYPES.livre: return this._actionOrWarnQuantiteZero('Lire', warn);
case 'herbe': return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined; case TYPES.herbe: return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
case 'queue': case 'ombre': return this.system.refoulement > 0 ? 'Refouler' : undefined; case TYPES.queue: case TYPES.ombre: return this.system.refoulement > 0 ? 'Refouler' : undefined;
} }
} }
return undefined; return undefined;
@@ -415,11 +453,11 @@ export class RdDItem extends Item {
return; return;
} }
switch (this.type) { switch (this.type) {
case 'potion': return await actor.consommerPotion(this, onActionItem); case TYPES.potion: return await actor.consommerPotion(this, onActionItem);
case 'livre': return await actor.actionLire(this); case TYPES.livre: return await actor.actionLire(this);
case 'conteneur': return await this.sheet.render(true); case TYPES.conteneur: return await this.sheet.render(true);
case 'herbe': return await actor.actionHerbe(this, onActionItem); case TYPES.herbe: return await actor.actionHerbe(this, onActionItem);
case 'queue': case 'ombre': return await actor.actionRefoulement(this); case TYPES.queue: case TYPES.ombre: return await actor.actionRefoulement(this);
} }
} }

51
module/item/armure.js Normal file
View File

@@ -0,0 +1,51 @@
import { RdDItem } from "../item.js";
import { Misc } from "../misc.js";
import { ReglesOptionelles } from "../settings/regles-optionelles.js";
export class RdDItemArmure extends RdDItem {
static get defaultIcon() {
return "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp";
}
deteriorerArmure(dmg) {
if (!ReglesOptionelles.isUsing('deteriorationArmure') || this.system.protection == '0') {
return;
}
let deterioration = (this.system.deterioration ?? 0) + dmg;
let protection = this.system.protection;
if (deterioration >= 10) {
deterioration -= 10;
protection = this.calculProtectionDeterioree();
ChatMessage.create({ content: `Votre armure ${this.name} s'est détériorée, elle protège maintenant de ${protection}` });
}
this.update({
system: {
deterioration: deterioration,
protection: protection
}
});
}
calculProtectionDeterioree() {
const protectionCourante = this.system.protection;
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(protectionCourante);
if (res) {
let protection = Misc.toInt(res[2]);
let malus = Misc.toInt(res[3]) - 1;
if (protection + malus <= 0) {
return 0;
} else {
return `1d${protection}${malus}`;
}
}
else if (/\d+/.exec(protectionCourante)) {
return `1d${protectionCourante}`;
}
else {
ui.notifications.warn(`La valeur d'armure de votre ${this.name} est incorrecte`);
return undefined;
}
}
}

View File

@@ -58,6 +58,7 @@ import { RdDConteneurItemSheet } from "./item/sheet-conteneur.js";
import { RdDSigneDraconiqueItemSheet } from "./item/sheet-signedraconique.js"; import { RdDSigneDraconiqueItemSheet } from "./item/sheet-signedraconique.js";
import { RdDItemInventaireSheet } from "./item/sheet-base-inventaire.js"; import { RdDItemInventaireSheet } from "./item/sheet-base-inventaire.js";
import { AppAstrologie } from "./sommeil/app-astrologie.js"; import { AppAstrologie } from "./sommeil/app-astrologie.js";
import { RdDItemArmure } from "./item/armure.js";
/** /**
* RdD system * RdD system
@@ -76,6 +77,7 @@ export class SystemReveDeDragon {
this.RdDUtility = RdDUtility; this.RdDUtility = RdDUtility;
this.RdDHotbar = RdDHotbar; this.RdDHotbar = RdDHotbar;
this.itemClasses = { this.itemClasses = {
armure: RdDItemArmure,
blessure: RdDItemBlessure, blessure: RdDItemBlessure,
maladie: RdDItemMaladie, maladie: RdDItemMaladie,
ombre: RdDItemOmbre, ombre: RdDItemOmbre,

View File

@@ -1052,6 +1052,7 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
static _computeEventOddq(origEvent) { static _computeEventOddq(origEvent) {
console.log("EVENT", origEvent)
let canvasRect = origEvent.target.getBoundingClientRect(); let canvasRect = origEvent.target.getBoundingClientRect();
let x = origEvent.clientX - canvasRect.left; let x = origEvent.clientX - canvasRect.left;
let y = origEvent.clientY - canvasRect.top; let y = origEvent.clientY - canvasRect.top;

View File

@@ -16,6 +16,7 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { RdDTimestamp } from "./time/rdd-timestamp.js"; import { RdDTimestamp } from "./time/rdd-timestamp.js";
import { RdDRaretes } from "./item/raretes.js"; import { RdDRaretes } from "./item/raretes.js";
import { RdDEmpoignade } from "./rdd-empoignade.js"; import { RdDEmpoignade } from "./rdd-empoignade.js";
import { ExperienceLog } from "./actor/experience-log.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
// This table starts at 0 -> niveau -10 // This table starts at 0 -> niveau -10
@@ -136,6 +137,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/resonances.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.html',
@@ -283,6 +285,9 @@ export class RdDUtility {
Handlebars.registerHelper('uniteQuantite', (itemId, actorId) => RdDUtility.getItem(itemId, actorId)?.getUniteQuantite()); Handlebars.registerHelper('uniteQuantite', (itemId, actorId) => RdDUtility.getItem(itemId, actorId)?.getUniteQuantite());
Handlebars.registerHelper('isFieldInventaireModifiable', (type, field) => RdDItem.isFieldInventaireModifiable(type, field)); Handlebars.registerHelper('isFieldInventaireModifiable', (type, field) => RdDItem.isFieldInventaireModifiable(type, field));
Handlebars.registerHelper('rarete-getChamp', (rarete, field) => RdDRaretes.getChamp(rarete, field)); Handlebars.registerHelper('rarete-getChamp', (rarete, field) => RdDRaretes.getChamp(rarete, field));
Handlebars.registerHelper('experienceLog-topic', topic => ExperienceLog.labelTopic(topic));
return loadTemplates(templatePaths); return loadTemplates(templatePaths);
} }
@@ -859,17 +864,13 @@ export class RdDUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static confirmerSuppressionSubacteur(sheet, subActor, htmlToDelete) { static confirmerSuppressionSubacteur(sheet, subActor, htmlToDelete, onSuppression = ()=>{}) {
RdDConfirm.confirmer({ RdDConfirm.confirmer({
settingConfirmer: "confirmation-supprimer-lien-acteur", settingConfirmer: "confirmation-supprimer-lien-acteur",
content: `<p>Etes vous certain de vouloir supprimer le lien vers ${subActor.name} ?</p>`, content: `<p>Etes vous certain de vouloir supprimer le lien vers ${subActor.name} ?</p>`,
title: 'Confirmer la suppression', title: 'Confirmer la suppression',
buttonLabel: 'Supprimer le lien', buttonLabel: 'Supprimer le lien',
onAction: () => { onAction: onSuppression
console.log('Delete : ', subActor.id);
sheet.actor.removeSubacteur(subActor.id);
RdDUtility.slideOnDelete(sheet, htmlToDelete);
}
}) })
} }

View File

@@ -105,10 +105,11 @@ export class RdDCalendrier extends Application {
} }
return buttons return buttons
} }
async maximize() {
/*async maximize() {
await super.maximize() await super.maximize()
this.render(true) this.render(true)
} }*/
async close() { } async close() { }
@@ -182,6 +183,16 @@ export class RdDCalendrier extends Application {
return this.timestamp.formatDate(); return this.timestamp.formatDate();
} }
dateReel() {
return new Date().toLocaleString("sv-SE", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit"
});
}
isAfterIndexDate(indexDate) { isAfterIndexDate(indexDate) {
// TODO: standardize // TODO: standardize
return indexDate < this.timestamp.indexDate; return indexDate < this.timestamp.indexDate;
@@ -263,6 +274,7 @@ export class RdDCalendrier extends Application {
/* -------------------------------------------- */ /* -------------------------------------------- */
async rebuildNombresAstraux(showDice = HIDE_DICE) { async rebuildNombresAstraux(showDice = HIDE_DICE) {
if (Misc.isUniqueConnectedGM()) { if (Misc.isUniqueConnectedGM()) {
console.log("Astral rebuild")
let newList = []; let newList = [];
for (let i = 0; i < MAX_NOMBRE_ASTRAL; i++) { for (let i = 0; i < MAX_NOMBRE_ASTRAL; i++) {
let dayIndex = this.timestamp.indexDate + i; let dayIndex = this.timestamp.indexDate + i;

View File

@@ -1,8 +1,10 @@
import { Draconique } from "./draconique.js"; import { Draconique } from "./draconique.js";
import { PixiTMR } from "./pixi-tmr.js";
export class CarteTmr extends Draconique { export class CarteTmr extends Draconique {
constructor() { constructor() {
console.log("Sprite create 1!!!!")
super(); super();
} }

View File

@@ -1,4 +1,4 @@
import { Misc } from "../misc.js"; import { TYPES } from "../item.js";
import { TMRUtility } from "../tmr-utility.js"; import { TMRUtility } from "../tmr-utility.js";
import { PixiTMR } from "./pixi-tmr.js"; import { PixiTMR } from "./pixi-tmr.js";
@@ -9,10 +9,10 @@ const registeredEffects = [
* Définition des informations d'une "draconique" (queue, ombre, tête, souffle) qui influence les TMR * Définition des informations d'une "draconique" (queue, ombre, tête, souffle) qui influence les TMR
*/ */
export class Draconique { export class Draconique {
static isCaseTMR(item) { return item.type == 'casetmr'; } static isCaseTMR(item) { return item.type == TYPES.casetmr; }
static isQueueDragon(item) { return item.type == 'queue' || item.type == 'ombre'; } static isQueueDragon(item) { return item.isQueueDragon(); }
static isSouffleDragon(item) { return item.type == 'souffle'; } static isSouffleDragon(item) {return item.type == TYPES.souffle; }
static isTeteDragon(item) { return item.type == 'tete'; } static isTeteDragon(item) { return item.type == TYPES.tete; }
static isQueueSouffle(item) { return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item); } static isQueueSouffle(item) { return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item); }
tmrLabel(linkData) { return TMRUtility.getTMRLabel(linkData.system.coord); } tmrLabel(linkData) { return TMRUtility.getTMRLabel(linkData.system.coord); }
@@ -91,6 +91,8 @@ export class Draconique {
coordTMR: coordTMR coordTMR: coordTMR
}; };
token[type ?? this.code()] = linkData; token[type ?? this.code()] = linkData;
console.log("SPRITE: ", token.sprite)
//PixiTMR.getImgFromCode()
pixiTMR.addTooltip(token.sprite, this.tooltip(linkData)); pixiTMR.addTooltip(token.sprite, this.tooltip(linkData));
return token; return token;
} }

View File

@@ -18,6 +18,7 @@ import { Periple } from "./periple.js";
import { UrgenceDraconique } from "./urgence-draconique.js"; import { UrgenceDraconique } from "./urgence-draconique.js";
import { Grammar } from "../grammar.js"; import { Grammar } from "../grammar.js";
import { AugmentationSeuil } from "./augmentation-seuil.js"; import { AugmentationSeuil } from "./augmentation-seuil.js";
import { TYPES } from "../item.js";
export class EffetsDraconiques { export class EffetsDraconiques {
@@ -114,46 +115,57 @@ export class EffetsDraconiques {
); );
} }
static filterItems(actor, filter, name) { static tetesDragon(actor, name) {
return actor.filterItems(filter) return actor.itemTypes[TYPES.tete].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
.filter(it => Grammar.includesLowerCaseNoAccent(it.name, name)); }
static soufflesDragon(actor, name) {
return actor.itemTypes[TYPES.souffle].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
}
static queuesDragon(actor, name) {
return actor.filterItems(it => it.isQueueDragon() && Grammar.includesLowerCaseNoAccent(it.name, name));
}
static queuesSoufflesDragon(actor, name) {
return actor.filterItems(it => [TYPES.queue, TYPES.ombre, TYPES.souffle].includes(it.type) && Grammar.includesLowerCaseNoAccent(it.name, name));
} }
static countAugmentationSeuil(actor) { static countAugmentationSeuil(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isTeteDragon, 'Augmentation du seuil de rêve').length; return EffetsDraconiques.tetesDragon(actor, 'Augmentation du seuil de rêve').length;
} }
static isDonDoubleReve(actor) { static isDonDoubleReve(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isTeteDragon, 'Don de double-rêve').length>0; return EffetsDraconiques.tetesDragon(actor, 'Don de double-rêve').length > 0;
} }
static isConnaissanceFleuve(actor) { static isConnaissanceFleuve(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isTeteDragon, 'connaissance du fleuve').length>0; return EffetsDraconiques.tetesDragon(actor, 'connaissance du fleuve').length > 0;
} }
static isReserveEnSecurite(actor) { static isReserveEnSecurite(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isTeteDragon, 'réserve en sécurité').length>0; return EffetsDraconiques.tetesDragon(actor, 'réserve en sécurité').length > 0;
} }
static isDeplacementAccelere(actor) { static isDeplacementAccelere(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isTeteDragon, ' déplacement accéléré').length>0; return EffetsDraconiques.tetesDragon(actor, 'déplacement accéléré').length > 0;
} }
static isDoubleResistanceFleuve(actor) { static isDoubleResistanceFleuve(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isSouffleDragon, 'résistance du fleuve').length>0; return EffetsDraconiques.soufflesDragon(actor, 'résistance du fleuve').length > 0;
} }
static countInertieDraconique(actor) { static countInertieDraconique(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isQueueDragon, 'inertie draconique').length; return EffetsDraconiques.queuesDragon(actor, 'inertie draconique').length;
} }
static countMonteeLaborieuse(actor) { static countMonteeLaborieuse(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isQueueSouffle, 'montée laborieuse').length; return EffetsDraconiques.queuesSoufflesDragon(actor, 'montée laborieuse').length;
} }
static mauvaiseRencontre(actor) { static mauvaiseRencontre(actor) {
const mauvaisesRencontres = EffetsDraconiques.filterItems(actor, Draconique.isQueueSouffle, 'mauvaise rencontre'); const mauvaisesRencontres = EffetsDraconiques.queuesSoufflesDragon(actor, 'mauvaise rencontre');
return mauvaisesRencontres.length>0 ? mauvaisesRencontres[0] : undefined; return mauvaisesRencontres.length > 0 ? mauvaisesRencontres[0] : undefined;
} }
static isPontImpraticable(actor) { static isPontImpraticable(actor) {
@@ -165,11 +177,11 @@ export class EffetsDraconiques {
} }
static isSujetInsomnie(actor) { static isSujetInsomnie(actor) {
return actor.items.find(it => ['queue', 'ombre'].includes(it.type) && Grammar.includesLowerCaseNoAccent(it.name, 'Insomnie')) ? true : false; return EffetsDraconiques.queuesDragon(actor, 'Insomnie').length > 0 ? true : false;
} }
static isPeage(actor) { static isPeage(actor) {
return EffetsDraconiques.filterItems(actor, Draconique.isSouffleDragon, 'péage').length > 0; return EffetsDraconiques.soufflesDragon(actor, 'péage').length > 0;
} }

View File

@@ -1,3 +1,4 @@
import { ExperienceLog, XP_TOPIC } from "../actor/experience-log.js";
import { ChatUtility } from "../chat-utility.js"; import { ChatUtility } from "../chat-utility.js";
import { Poetique } from "../poetique.js"; import { Poetique } from "../poetique.js";
import { RdDDice } from "../rdd-dice.js"; import { RdDDice } from "../rdd-dice.js";
@@ -53,9 +54,10 @@ export class EffetsRencontre {
static xp_sort_force = async (dialog, context) => { static xp_sort_force = async (dialog, context) => {
let competence = context.competence; let competence = context.competence;
if (competence) { if (competence) {
const xpSort = Misc.toInt(competence.system.xp_sort) + context.rencontre.system.force; const fromXpSort = Number(competence.system.xp_sort);
await this.updateEmbeddedDocuments("Item", [{ _id: compData._id, 'system.xp_sort': xpSort }]); const toXpSort = fromXpSort + context.rencontre.system.force;
await this.updateExperienceLog("XP Sort", xpSort, `Rencontre d'un ${context.rencontre.name} en TMR`); await this.updateEmbeddedDocuments("Item", [{ _id: compData._id, 'system.xp_sort': toXpSort }]);
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, `${competence.name} - ${context.rencontre.name} en TMR`);
} }
} }

View File

@@ -20,18 +20,20 @@ export class PixiTMR {
this.callbacksOnAnimate = []; this.callbacksOnAnimate = [];
} }
load( onLoad = (loader, resources) => {} ) { async load( onLoad = (loader, resources) => {} ) {
let loader = this.pixiApp.loader; // WIP - Deprecated since v7 : let loader = new PIXI.Loader();
for (const [name, img] of Object.entries(PixiTMR.textures)) { for (const [name, img] of Object.entries(PixiTMR.textures)) {
loader = loader.add(name, img); const texture = await PIXI.Assets.load(img);
let image = PIXI.Sprite.from(texture);
} }
loader.onError.add((error, reason) => { console.log("ERROR", error, reason) }); onLoad();
loader.load( (loader, resources) => { for (let onAnimate of this.callbacksOnAnimate) {
onLoad(loader, resources); onAnimate();
for (let onAnimate of this.callbacksOnAnimate) { }
onAnimate(); }
}
}); static getImgFromCode(code) {
return PixiTMR.textures[code]
} }
static register(name, img) { static register(name, img) {
@@ -44,7 +46,9 @@ export class PixiTMR {
} }
carteTmr(code) { carteTmr(code) {
const carteTmr = new PIXI.Sprite(PIXI.utils.TextureCache[code]); let img = PixiTMR.getImgFromCode(code)
const carteTmr = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
console.log(code, carteTmr)
// Setup the position of the TMR // Setup the position of the TMR
carteTmr.x = 0; carteTmr.x = 0;
carteTmr.y = 0; carteTmr.y = 0;
@@ -52,7 +56,8 @@ export class PixiTMR {
carteTmr.height = 860; carteTmr.height = 860;
// Rotate around the center // Rotate around the center
carteTmr.anchor.set(0); carteTmr.anchor.set(0);
carteTmr.interactive = true; carteTmr.eventMode = 'dynamic'; // PIXI 7 : Not sure ..
// This one is deprecated ; carteTmr.interactive = true;
carteTmr.buttonMode = true; carteTmr.buttonMode = true;
carteTmr.tmrObject = this; carteTmr.tmrObject = this;
if (!this.tmrObject.viewOnly) { if (!this.tmrObject.viewOnly) {
@@ -63,9 +68,10 @@ export class PixiTMR {
} }
sprite(code, options = {}) { sprite(code, options = {}) {
const texture = PIXI.utils.TextureCache[code]; let img = PixiTMR.getImgFromCode(code)
const texture = PIXI.utils.TextureCache[img];
if (!texture) { if (!texture) {
console.error("Texture manquante", code) console.error("Texture manquante", code, PIXI.utils.TextureCache)
return; return;
} }
let sprite = new PIXI.Sprite(texture); let sprite = new PIXI.Sprite(texture);
@@ -97,7 +103,8 @@ export class PixiTMR {
sprite.tooltip = new PIXI.Text(text, tooltipStyle); sprite.tooltip = new PIXI.Text(text, tooltipStyle);
sprite.tooltip.zIndex = tmrTokenZIndex.tooltip; sprite.tooltip.zIndex = tmrTokenZIndex.tooltip;
sprite.isOver = false; sprite.isOver = false;
sprite.interactive = true; // Deprecated : sprite.interactive = true;
sprite.eventMode = 'dynamic'; // PIXI 7 To be checked
sprite.on('pointerdown', event => this.onClickBackground(event)) sprite.on('pointerdown', event => this.onClickBackground(event))
.on('pointerover', () => this.onShowTooltip(sprite)) .on('pointerover', () => this.onShowTooltip(sprite))
.on('pointerout', () => this.onHideTooltip(sprite)); .on('pointerout', () => this.onHideTooltip(sprite));

File diff suppressed because one or more lines are too long

View File

@@ -1,12 +1,13 @@
{ {
"id": "foundryvtt-reve-de-dragon", "id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"version": "10.7.12", "version": "11.0.4",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.12.zip", "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.4.zip",
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "11",
"verified": "10" "verified": "11",
"maximum": "11"
}, },
"description": "Rêve de Dragon RPG for FoundryVTT", "description": "Rêve de Dragon RPG for FoundryVTT",
"authors": [ "authors": [
@@ -68,7 +69,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/competences.db", "path": "packs/competences.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -77,7 +81,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/arts-et-divertissements.db", "path": "packs/arts-et-divertissements.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -86,7 +92,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/competences-creatures.db", "path": "packs/competences-creatures.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -95,7 +104,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/competences-entites.db", "path": "packs/competences-entites.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -104,7 +116,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/sorts-oniros.db", "path": "packs/sorts-oniros.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -113,7 +127,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/sorts-hypnos.db", "path": "packs/sorts-hypnos.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -122,7 +138,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/sorts-narcos.db", "path": "packs/sorts-narcos.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -131,7 +149,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/sorts-thanatos.db", "path": "packs/sorts-thanatos.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -140,7 +160,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/equipement.db", "path": "packs/equipement.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -149,7 +171,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/maladies-et-poisons.db", "path": "packs/maladies-et-poisons.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -158,7 +183,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/rappel-des-regles.db", "path": "packs/rappel-des-regles.db",
"type": "JournalEntry", "type": "JournalEntry",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -167,7 +194,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/macros.db", "path": "packs/macros.db",
"type": "Macro", "type": "Macro",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -176,7 +205,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/queues-de-dragon.db", "path": "packs/queues-de-dragon.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -185,7 +217,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/ombres-de-thanatos.db", "path": "packs/ombres-de-thanatos.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -194,7 +229,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/souffles-de-dragon.db", "path": "packs/souffles-de-dragon.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -203,7 +241,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/tarot-draconique.db", "path": "packs/tarot-draconique.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -212,7 +252,9 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/extrait-poetique.db", "path": "packs/extrait-poetique.db",
"type": "Item", "type": "Item",
"private": false, "ownership": {
"PLAYER": "OBSERVER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -221,7 +263,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/tetes-de-dragon-pour-haut-revants.db", "path": "packs/tetes-de-dragon-pour-haut-revants.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -230,7 +275,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/tetes-de-dragon-pour-tous-personnages.db", "path": "packs/tetes-de-dragon-pour-tous-personnages.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -239,7 +287,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/rencontres.db", "path": "packs/rencontres.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -248,7 +299,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/tables-diverses.db", "path": "packs/tables-diverses.db",
"type": "RollTable", "type": "RollTable",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -257,7 +311,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/animaux.db", "path": "packs/animaux.db",
"type": "Actor", "type": "Actor",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -266,7 +323,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/voyageurs.db", "path": "packs/voyageurs.db",
"type": "Actor", "type": "Actor",
"private": false, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -275,7 +335,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/vehicules.db", "path": "packs/vehicules.db",
"type": "Actor", "type": "Actor",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -284,7 +347,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/archetypes.db", "path": "packs/archetypes.db",
"type": "Actor", "type": "Actor",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -293,7 +359,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/humanoides.db", "path": "packs/humanoides.db",
"type": "Actor", "type": "Actor",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -302,7 +371,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/entites-de-cauchemar.db", "path": "packs/entites-de-cauchemar.db",
"type": "Actor", "type": "Actor",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -311,7 +383,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/invocations.db", "path": "packs/invocations.db",
"type": "Actor", "type": "Actor",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -320,7 +395,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/faune-flore-mineraux.db", "path": "packs/faune-flore-mineraux.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -329,7 +407,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/meditations-et-ecrits.db", "path": "packs/meditations-et-ecrits.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -338,7 +419,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/recettes-alchimiques.db", "path": "packs/recettes-alchimiques.db",
"type": "Item", "type": "Item",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
}, },
{ {
@@ -347,7 +431,10 @@
"system": "foundryvtt-reve-de-dragon", "system": "foundryvtt-reve-de-dragon",
"path": "packs/scenes-rdd.db", "path": "packs/scenes-rdd.db",
"type": "Scene", "type": "Scene",
"private": true, "ownership": {
"PLAYER": "NONE",
"ASSISTANT": "OWNER"
},
"flags": {} "flags": {}
} }
], ],

View File

@@ -41,6 +41,9 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html"}}
</div> </div>
<div>
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/resonances.hbs"}}
</div>
</div> </div>
</div> </div>
<div class="form-group large-editor"> <div class="form-group large-editor">

View File

@@ -1,7 +1,7 @@
{{#if recettesAlchimiques.length}} {{#if recettesAlchimiques.length}}
<h3>Recettes Alchimiques</h3> <h3>Recettes Alchimiques</h3>
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each recettesAlchimiques as |recette id|}} {{#each (trier recettesAlchimiques) as |recette id|}}
<li class="item flexrow list-item" data-item-id="{{recette._id}}"><span class="competence-title recette-label item-edit"><a>{{recette.name}}</a></span> <li class="item flexrow list-item" data-item-id="{{recette._id}}"><span class="competence-title recette-label item-edit"><a>{{recette.name}}</a></span>
<div class="item-controls flex-shrink"> <div class="item-controls flex-shrink">
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a> <a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>

View File

@@ -61,7 +61,7 @@
{{/unless}} {{/unless}}
</label> </label>
</li> </li>
{{#each system.services as |service key|}} {{#each (trier system.services) as |service key|}}
<li class="item flexrow list-item" data-key="{{key}}"> <li class="item flexrow list-item" data-key="{{key}}">
<input {{@root.disabled}} type="text" name="services[{{key}}].name" value="{{service.name}}" data-dtype="String" /> <input {{@root.disabled}} type="text" name="services[{{key}}].name" value="{{service.name}}" data-dtype="String" />
<input {{@root.disabled}} type="checkbox" name="services[{{key}}].system.moral" {{#if service.system.moral}}checked{{/if}} /> <input {{@root.disabled}} type="checkbox" name="services[{{key}}].system.moral" {{#if service.system.moral}}checked{{/if}} />

View File

@@ -25,14 +25,14 @@
<span class="equipement-detail">Prix (sols)</span> <span class="equipement-detail">Prix (sols)</span>
<span class="equipement-actions">Actions</span> <span class="equipement-actions">Actions</span>
</li> </li>
{{#each objets as |item id|}} {{#each (trier objets) as |item id|}}
{{#unless item.estContenu}} {{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}} {{#if (ne item.type 'conteneur')}}
{{buildLigneInventaire item ../options}} {{buildLigneInventaire item ../options}}
{{/if}} {{/if}}
{{/unless}} {{/unless}}
{{/each}} {{/each}}
{{#each conteneurs as |conteneur id|}} {{#each (trier conteneurs) as |conteneur id|}}
{{buildLigneInventaire conteneur ../options}} {{buildLigneInventaire conteneur ../options}}
{{/each}} {{/each}}
</ul> </ul>

View File

@@ -1,7 +1,7 @@
{{#if meditations.length}} {{#if meditations.length}}
<h3>Méditations</h3> <h3>Méditations</h3>
<ul class="item-list"> <ul class="item-list">
{{#each meditations as |meditation key|}} {{#each (trier meditations) as |meditation key|}}
<li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}"> <li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}">
<img class="sheet-competence-img" src="{{meditation.img}}" /> <img class="sheet-competence-img" src="{{meditation.img}}" />
<span class="meditation-label flex-grow"><a data-item-id="{{meditation._id}}">{{meditation.name}} - {{meditation.system.competence}}</a></span> <span class="meditation-label flex-grow"><a data-item-id="{{meditation._id}}">{{meditation.name}} - {{meditation.system.competence}}</a></span>

View File

@@ -1,7 +1,7 @@
{{#if sortsReserve.length}} {{#if sortsReserve.length}}
<h3>Sorts en Réserve</h3> <h3>Sorts en Réserve</h3>
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each sortsReserve as |sort key|}} {{#each (trier sortsReserve) as |sort key|}}
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}"> <li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}">
<img class="sheet-competence-img" src="{{sort.img}}" /> <img class="sheet-competence-img" src="{{sort.img}}" />
<span class="item-edit"><a>{{#if sort.system.echectotal}}Echec total: {{/if}}{{sort.name}} r{{sort.system.ptreve}}</a></span> <span class="item-edit"><a>{{#if sort.system.echectotal}}Echec total: {{/if}}{{sort.name}} r{{sort.system.ptreve}}</a></span>

View File

@@ -1,7 +1,7 @@
{{#if sorts.length}} {{#if sorts.length}}
<h3>Sorts</h3> <h3>Sorts</h3>
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each sorts as |sort key|}} {{#each (trier sorts) as |sort key|}}
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}"> <li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}">
<img class="sheet-competence-img" src="{{sort.img}}" /> <img class="sheet-competence-img" src="{{sort.img}}" />
<span class="item-edit flex-grow-2"> <span class="item-edit flex-grow-2">

View File

@@ -1,18 +1,18 @@
<h3>Oeuvres diverses</h3><a class="chat-card-button creer-une-oeuvre">Créer une oeuvre</a> <h3>Oeuvres diverses</h3><a class="chat-card-button creer-une-oeuvre">Créer une oeuvre</a>
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each chants as |chant id|}} {{#each (trier chants) as |chant id|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=chant typeOeuvre="Chant" classOeuvre="chant-label"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=chant typeOeuvre="Chant" classOeuvre="chant-label"}}
{{/each}} {{/each}}
{{#each musiques as |musique id|}} {{#each (trier musiques) as |musique id|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=musique typeOeuvre="Musique" classOeuvre="musique-label"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=musique typeOeuvre="Musique" classOeuvre="musique-label"}}
{{/each}} {{/each}}
{{#each danses as |danse id|}} {{#each (trier danses) as |danse id|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=danse typeOeuvre="Danse" classOeuvre="danse-label"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=danse typeOeuvre="Danse" classOeuvre="danse-label"}}
{{/each}} {{/each}}
{{#each oeuvres as |oeuvre id|}} {{#each (trier oeuvres) as |oeuvre id|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=oeuvre typeOeuvre=oeuvre.system.competence classOeuvre="oeuvre-label"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=oeuvre typeOeuvre=oeuvre.system.competence classOeuvre="oeuvre-label"}}
{{/each}} {{/each}}
{{#each recettescuisine as |recette id|}} {{#each (trier recettescuisine) as |recette id|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=recette typeOeuvre="Recette de cuisine" classOeuvre="recettecuisine-label"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.html" oeuvre=recette typeOeuvre="Recette de cuisine" classOeuvre="recettecuisine-label"}}
{{/each}} {{/each}}
</ul> </ul>

View File

@@ -0,0 +1,12 @@
<span class="item-name"><h4>Personnages accordés</h4></span>
<ul class="item-list alterne-list">
{{#each resonances as |actor|}}
<li class="item flexrow list-item" data-actor-id="{{actor.id}}">
<img class="sheet-competence-img" src="{{actor.img}}" title="{{actor.name}}"/>
<span class="subacteur-label"><a>{{actor.name}}</a></span>
<div class="flex-shrink">
<a class="resonance-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>

View File

@@ -3,7 +3,7 @@
<li class="item flexrow"> <li class="item flexrow">
<label class="derivee-label" for="system.compteurs.experience.value">Stress transformé</label> <label class="derivee-label" for="system.compteurs.experience.value">Stress transformé</label>
{{#if options.vueDetaillee}} {{#if options.vueDetaillee}}
<input type="number" name="system.compteurs.experience.value" value="{{system.compteurs.experience.value}}" data-dtype="number" size="3"/> <input class="derivee-value" type="number" name="system.compteurs.experience.value" value="{{system.compteurs.experience.value}}" data-dtype="number" size="3"/>
{{else}} {{else}}
<label name="system.compteurs.experience.value">{{system.compteurs.experience.value}}</label> <label name="system.compteurs.experience.value">{{system.compteurs.experience.value}}</label>
{{/if}} {{/if}}

View File

@@ -1,14 +1,18 @@
<h3>Journal d'Experience</h3> <h3>Journal d'Experience</h3>
<div class="form-group large-editor"> <div class="form-group large-editor">
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each system.experiencelog as |xp key|}} {{#each system.experiencelog as |xplog key|}}
<li class="experiencelog flexrow list-item" data-key="{{key}}"> <li class="experiencelog flexrow list-item" data-key="{{key}}">
<label class="flex-grow">{{xp.valeur}} {{xp.raison}}</label> <label class="flex-shrink">{{xplog.valeur}} {{experienceLog-topic xplog.mode}} </label>
<label class="flex-shrink">{{xp.mode}}</label> {{#if (or xplog.from xplog.to)}}
<label class="flex-shrink">{{xp.daterdd}}</label> <label class="flex-grow">{{xplog.raison}}: de {{xplog.from}} à {{xplog.to}}</label>
<label class="flex-shrink">{{xp.datereel}}</label> {{else}}
<label class="flex-grow">{{xplog.raison}}</label>
{{/if}}
<label class="flex-shrink">{{xplog.daterdd}}</label>
<label class="flex-shrink">{{xplog.datereel}}</label>
{{#if @root.options.isGM}} {{#if @root.options.isGM}}
<span> <span class="flex-shrink">
<a class="experiencelog-delete" title="Supprimer"> <a class="experiencelog-delete" title="Supprimer">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>