Merge pull request 'Utilisation de system dans les Item/Actor Sheet' (#551) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10

Reviewed-on: #551
This commit is contained in:
uberwald 2022-09-07 23:08:26 +02:00
commit 9cbb12e900
90 changed files with 786 additions and 815 deletions

View File

@ -30,8 +30,8 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
let formData = await super.getData()
//console.log("Creature : ", formData, formData.system)
formData.calc = {
caracTotal: RdDCarac.computeTotal(formData.data.carac),
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
caracTotal: RdDCarac.computeTotal(formData.system.carac),
resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
surEncombrementMessage: this.actor.getMessageSurEncombrement()
}

View File

@ -25,23 +25,21 @@ export class RdDActorEntiteSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
const objectData = this.object;
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
// actor: this.object,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(this.actor.system),
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
system: foundry.utils.deepClone(this.actor.system),
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
// items: items,
limited: this.object.limited,
limited: this.actor.limited,
options: this.options,
owner: this.document.isOwner,
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
owner: this.actor.isOwner,
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
};
formData.options.isGM = game.user.isGM;
@ -141,6 +139,6 @@ export class RdDActorEntiteSheet extends ActorSheet {
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
return this.actor.update(formData);
}
}

View File

@ -36,23 +36,22 @@ export class RdDActorSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
const objectData = this.object.system
this.timerRecherche = undefined;
let formData = {
title: this.title,
id: this.object.id,
type: this.object.type,
img: this.object.img,
name: this.object.name,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(this.actor.system),
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
limited: this.object.limited,
system: foundry.utils.deepClone(this.actor.system),
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
limited: this.actor.limited,
options: this.options,
owner: this.document.isOwner,
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
owner: this.actor.isOwner,
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
}
RdDUtility.filterItemsPerTypeForSheet(formData)
@ -65,13 +64,13 @@ export class RdDActorSheet extends ActorSheet {
formData.calc = {
comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.competences),
competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.competences),
caracTotal: RdDCarac.computeTotal(formData.data.carac, formData.data.beaute),
caracTotal: RdDCarac.computeTotal(formData.system.carac, formData.system.beaute),
// Mise à jour de l'encombrement total et du prix de l'équipement
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
fatigue: RdDUtility.calculFatigueHtml(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
fatigue: RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max),
resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
surEncombrementMessage: this.actor.getMessageSurEncombrement()
};
@ -79,9 +78,9 @@ export class RdDActorSheet extends ActorSheet {
item.system.isVisible = this.options.recherche
? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value);
});
Object.values(formData.data.carac).forEach(c => {
Object.values(formData.system.carac).forEach(c => {
RdDCarac.levelUp(c);
});
@ -89,9 +88,9 @@ export class RdDActorSheet extends ActorSheet {
// toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
formData.combat = duplicate(formData.armes ?? []);
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.data.carac);
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac);
formData.esquives = this.actor.getCompetences("Esquive");
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.data.carac);
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
this.armesList = formData.combat;
@ -101,8 +100,8 @@ export class RdDActorSheet extends ActorSheet {
formData.hautreve = {
isDemiReve: this.actor.getEffectByLabel("Demi-rêve"),
sortsReserve: formData.data.reve.reserve.list,
rencontres: duplicate(formData.data.reve.rencontre.list),
sortsReserve: formData.system.reve.reserve.list,
rencontres: duplicate(formData.system.reve.rencontre.list),
casesTmr: formData.itemsByType.casetmr,
cacheTMR: this.actor.isTMRCache()
}
@ -330,7 +329,7 @@ export class RdDActorSheet extends ActorSheet {
});
// Initiative pour l'arme
html.find('.arme-initiative a').click(async event => {
let combatant = game.combat.combatants.find(c => c.actor._id == this.actor._id);
let combatant = game.combat.combatants.find(c => c.actor.id == this.actor.id);
if (combatant) {
let action = this._getEventArmeCombat(event);
RdDCombatManager.rollInitiativeAction(combatant._id, action);
@ -451,7 +450,7 @@ export class RdDActorSheet extends ActorSheet {
// On pts de reve change
html.find('.pointsreve-value').change(async event => {
let reveValue = event.currentTarget.value;
this.actor.update({ "data.reve.reve.value": reveValue });
this.actor.update({ "system.reve.reve.value": reveValue });
});
// On seuil de reve change
@ -568,7 +567,7 @@ export class RdDActorSheet extends ActorSheet {
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
return this.actor.update(formData);
}
async splitItem(item) {
@ -579,9 +578,9 @@ export class RdDActorSheet extends ActorSheet {
async _onSplitItem(item, split) {
if (split >= 1 && split < item.system.quantite) {
await item.diminuerQuantite(split);
const itemData = duplicate(item);
itemData.system.quantite = split;
await this.actor.createEmbeddedDocuments('Item', [itemData])
const splitItem = duplicate(item);
splitItem.system.quantite = split;
await this.actor.createEmbeddedDocuments('Item', [splitItem])
}
}

View File

@ -27,21 +27,20 @@ export class RdDActorVehiculeSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
const objectData = this.object
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(this.object.system),
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
limited: this.object.limited,
system: foundry.utils.deepClone(this.actor.system),
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
limited: this.actor.limited,
options: this.options,
owner: this.document.isOwner,
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
owner: this.actor.isOwner,
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
};
RdDUtility.filterItemsPerTypeForSheet(formData);
@ -160,6 +159,6 @@ export class RdDActorVehiculeSheet extends ActorSheet {
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
return this.actor.update(formData);
}
}

View File

@ -35,6 +35,14 @@ import { RdDItem } from "./item.js";
import { RdDPossession } from "./rdd-possession.js";
import { ENTITE_BLURETTE, ENTITE_INCARNE, ENTITE_NONINCARNE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
const POSSESSION_SANS_DRACONIC = {
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
name: 'Sans draconic',
system: {
niveau: 0,
defaut_carac: "reve",
}
};
/* -------------------------------------------- */
/**
@ -63,23 +71,23 @@ export class RdDActor extends Actor {
}
}
static remoteActorCall(data, canExecuteLocally = () => Misc.isUniqueConnectedGM()) {
static remoteActorCall(callData, canExecuteLocally = () => Misc.isUniqueConnectedGM()) {
if (canExecuteLocally()) {
RdDActor.onRemoteActorCall(data);
RdDActor.onRemoteActorCall(callData);
return false;
}
else {
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_remote_actor_call", data: data });
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_remote_actor_call", data: callData });
return true;
}
}
static onRemoteActorCall(data) {
const actor = game.actors.get(data?.actorId);
static onRemoteActorCall(callData) {
const actor = game.actors.get(callData?.actorId);
if (Misc.isOwnerPlayerOrUniqueConnectedGM(actor)) { // Seul le joueur choisi effectue l'appel: le joueur courant si propriétaire de l'actor, ou le MJ sinon
const args = data.args;
console.info(`RdDActor.onRemoteActorCall: pour l'Actor ${data.actorId}, appel de RdDActor.${data.method}(`, ...args, ')');
actor[data.method](...args);
const args = callData.args;
console.info(`RdDActor.onRemoteActorCall: pour l'Actor ${callData.actorId}, appel de RdDActor.${callData.method}(`, ...args, ')');
actor[callData.method](...args);
}
}
@ -95,8 +103,8 @@ export class RdDActor extends Actor {
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} actorData Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
* @param {Object} actorData Barebones actor template data which this function adds onto.
* @param {Object} options Additional options which customize the creation workflow.
*
*/
static async create(actorData, options) {
@ -110,7 +118,7 @@ export class RdDActor extends Actor {
if (actorData.items) {
let actor = await super.create(actorData, options);
if (isPersonnage) {
await actor.checkMonnaiePresence(actorData.items);
await actor.checkMonnaiePresence();
}
return actor;
}
@ -175,7 +183,7 @@ export class RdDActor extends Actor {
this.computePrixTotalEquipement();
this.computeEtatGeneral();
// Sanity check
await this.checkMonnaiePresence(actorData.items);
await this.checkMonnaiePresence();
}
/* -------------------------------------------- */
@ -189,9 +197,9 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async checkMonnaiePresence(items) { // Ajout opportuniste si les pièces n'existent pas.
if (!items) return; // Sanity check during import
let manquantes = Monnaie.monnaiesManquantes(items);
async checkMonnaiePresence() { // Ajout opportuniste si les pièces n'existent pas.
if (!this.items) return; // Sanity check during import
let manquantes = Monnaie.monnaiesManquantes(this.itemTypes['monnaie']);
//console.log("Manque : ", manquantes);
if (manquantes.length > 0) {
await this.createEmbeddedDocuments('Item', manquantes, { renderSheet: false });
@ -313,13 +321,11 @@ export class RdDActor extends Actor {
}
listItemsData(type) {
return this.filterItemsData(it => it.type == type);
}
filterItemsData(filter) {
return this.items.map(it => it).filter(filter)
return this.itemTypes[type];
}
filterItems(filter) {
return this.items.filter(it => filter(it))
return this.items.filter(filter);
}
getItemOfType(idOrName, type) {
@ -358,32 +364,26 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
getDraconicList() {
return this.items.filter(it => it.type == 'competence' && it.system.categorie == 'draconic')
.sort(Misc.descending(it => it.system.niveau))
}
/* -------------------------------------------- */
getBestDraconic() {
const list = this.getDraconicList()
.sort(Misc.descending(it => it.system.niveau))
return duplicate(list[0])
}
getDraconicOuPossession() {
const possessions = this.items.filter(it => it.type == 'competencecreature' && it.system.ispossession)
.sort(Misc.descending(it => it.system.niveau));
if (possessions.length > 0) {
return duplicate(possessions[0]);
}
const draconics = this.getDraconicList().filter(it => it.system.niveau >= 0);
if (draconics.length > 0) {
return duplicate(draconics[0]);
}
return {
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
name: 'Sans draconic',
data: {
niveau: 0,
defaut_carac: "reve",
}
};
const draconics = [...this.getDraconicList().filter(it => it.system.niveau >= 0),
POSSESSION_SANS_DRACONIC]
.sort(Misc.descending(it => it.system.niveau));
return duplicate(draconics[0]);
}
getPossession(possessionId) {
return this.items.find(it => it.type == 'possession' && it.system.possessionid == possessionId);
}
@ -397,7 +397,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async verifierPotionsEnchantees() {
let potionsEnchantees = this.filterItemsData(it => it.type == 'potion' && it.system.categorie.toLowerCase().includes('enchant'));
let potionsEnchantees = this.filterItems(it => it.type == 'potion' && it.system.categorie.toLowerCase().includes('enchant'));
for (let potion of potionsEnchantees) {
if (!potion.system.prpermanent) {
console.log(potion);
@ -882,8 +882,6 @@ export class RdDActor extends Actor {
if (caracName == 'Taille') {
return;
}
// if ( isNaN(caracXP) || typeof(caracXP) != 'number') caracXP = 0;
//await this.update({ [`data.carac.${caracName}.xp`]: caracXP });
this.checkCaracXP(caracName);
}
@ -1181,7 +1179,7 @@ export class RdDActor extends Actor {
item.estContenu = undefined;
}
if (item.type == 'conteneur' && item.system.contenu.length > 0) {
corrections.push({ _id: itemData._id, 'system.contenu': [] });
corrections.push({ _id: item.id, 'system.contenu': [] });
}
}
if (corrections.length > 0) {
@ -1352,7 +1350,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async computeMalusArmure() {
const newMalusArmure = this.filterItemsData(it => it.type == 'armure' && it.system.equipe)
const newMalusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe)
.map(it => it.system.malus ?? 0)
.reduce(Misc.sum(), 0);
// Mise à jour éventuelle du malus armure
@ -1364,7 +1362,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
computePrixTotalEquipement() {
this.prixTotalEquipement = this.filterItemsData(it => it.system.prixTotal)
this.prixTotalEquipement = this.filterItems(it => it.system.prixTotal)
.map(it => it.system.prixTotal ?? 0)
.reduce(Misc.sum(), 0);
// Mise à jour valeur totale de l'équipement
@ -1374,6 +1372,9 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
computeResumeBlessure(blessures = undefined) {
blessures = blessures ?? this.system.blessures;
if (!blessures) {
return "Pas de blessures possibles";
}
let nbLegeres = this.countBlessures(blessures.legeres.liste);
let nbGraves = this.countBlessures(blessures.graves.liste);
let nbCritiques = this.countBlessures(blessures.critiques.liste);
@ -1393,11 +1394,11 @@ export class RdDActor extends Actor {
resume += ",";
resume += " une CRITIQUE !";
}
return resume;
}
else {
resume = "Aucune blessure";
return "Aucune blessure";
}
return resume;
}
/* -------------------------------------------- */
@ -1515,7 +1516,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
buildTMRInnaccessible() {
const tmrInnaccessibles = this.filterItemsData(it => Draconique.isCaseTMR(it) &&
const tmrInnaccessibles = this.filterItems(it => Draconique.isCaseTMR(it) &&
EffetsDraconiques.isInnaccessible(it));
return tmrInnaccessibles.map(it => it.system.coord);
}
@ -1648,8 +1649,11 @@ export class RdDActor extends Actor {
}
countBlessuresNonSoigneeByName(name) {
let blessures = this.system.blessures[name].liste;
return blessures.filter(b => b.active && !b.psdone).length;
if (this.system.blessures) {
let blessures = this.system.blessures[name].liste;
return blessures.filter(b => b.active && !b.psdone).length;
}
return 0;
}
/* -------------------------------------------- */
@ -1766,7 +1770,6 @@ export class RdDActor extends Actor {
}
}
compteur.value = result.newValue;
//console.log(name, inc, data.value, result.newValue, minValue, data.max);
// If endurance lost, then the same amount of fatigue cannot be recovered
if (ReglesOptionelles.isUsing("appliquer-fatigue") && sante.fatigue && fatigue > 0) {
sante.fatigue.value = Math.max(sante.fatigue.value + fatigue, this._computeFatigueMin());
@ -1948,15 +1951,16 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async consommerNourritureboisson(item, choix = { doses: 1, seForcer: false, supprimerSiZero: false }) {
if (itemData.type != 'nourritureboisson') {
if (item.type != 'nourritureboisson') {
return;
}
if (choix.doses > itemData.system.quantite) {
ui.notifications.warn(`Il n'y a pas assez de ${itemData.name} pour manger ${choix.doses}`)
if (choix.doses > item.system.quantite) {
ui.notifications.warn(`Il n'y a pas assez de ${item.name} pour manger ${choix.doses}`)
return;
}
if (!this._apprecierCuisine(itemData, choix.seForcer)) {
ui.notifications.info(`${this.name} ne n'arrive pas à manger de ${itemData.name}`)
if (!this._apprecierCuisine(item, choix.seForcer)) {
ui.notifications.info(`${this.name} ne n'arrive pas à manger de ${item.name}`)
return;
}
await this.manger(item, choix.doses, { diminuerQuantite: false });
@ -1964,10 +1968,10 @@ export class RdDActor extends Actor {
await item.diminuerQuantite(choix.doses, choix);
}
async _apprecierCuisine(itemData, seForcer) {
const surmonteExotisme = await this._surmonterExotisme(itemData, seForcer);
async _apprecierCuisine(item, seForcer) {
const surmonteExotisme = await this._surmonterExotisme(item, seForcer);
if (surmonteExotisme) {
await this.apprecier('gout', 'cuisine', itemData.system.qualite, itemData.system.boisson ? "apprécie la boisson" : "apprécie le plat");
await this.apprecier('gout', 'cuisine', item.system.qualite, item.system.boisson ? "apprécie la boisson" : "apprécie le plat");
}
else if (seForcer) {
await this.jetDeMoral('malheureux');
@ -1979,10 +1983,10 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async _surmonterExotisme(itemData) {
const exotisme = Math.min(itemData.system.exotisme, itemData.system.qualite, 0);
async _surmonterExotisme(item) {
const exotisme = Math.min(item.system.exotisme, item.system.qualite, 0);
if (exotisme < 0) {
const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${itemData.name}` });
const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${item.name}` });
return rolled.isSuccess;
}
return true;
@ -2007,14 +2011,13 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async boire(item, doses, options = { diminuerQuantite: true }) {
const itemData = item;
const desaltere = itemData.system.desaltere;
const desaltere = item.system.desaltere;
if (desaltere > 0) {
await this.updateCompteurValue('eau', Misc.keepDecimals(this.system.compteurs.eau.value + desaltere * doses, 1));
}
if (item.isAlcool()) {
for (let i = 0; i < doses; i++) {
await this.saouler(itemData.system.force, item);
await this.saouler(item.system.force, item);
}
}
await item.diminuerQuantite(doses, options);
@ -2268,7 +2271,6 @@ export class RdDActor extends Actor {
let tmr = TMRUtility.getTMR(coord);
let letfilteredList = []
for (let sort of sortList) {
//console.log(sort.name, sort.data.caseTMR.toLowerCase(), sort.data.caseTMRspeciale.toLowerCase(), coord.toLowerCase() );
if (sort.system.caseTMR.toLowerCase().includes('variable')) {
letfilteredList.push(sort);
} else if (sort.system.caseTMRspeciale.toLowerCase().includes('variable')) {
@ -2575,8 +2577,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async creerTacheDepuisLivre(item, options = { renderSheet: true }) {
const itemData = item
const nomTache = "Lire " + itemData.name;
const nomTache = "Lire " + item.name;
const filterTacheLecture = it => it.type == 'tache' && it.name == nomTache;
let tachesExistantes = this.filterItems(filterTacheLecture);
if (tachesExistantes.length == 0) {
@ -2585,12 +2586,12 @@ export class RdDActor extends Actor {
system: {
carac: 'intellect',
competence: 'Ecriture',
difficulte: itemData.system.difficulte,
difficulte: item.system.difficulte,
periodicite: "60 minutes",
fatigue: 2,
points_de_tache: itemData.system.points_de_tache,
points_de_tache: item.system.points_de_tache,
points_de_tache_courant: 0,
description: "Lecture du livre " + item.name + " - XP : " + itemData.system.xp + " - Compétences : " + itemData.system.competence
description: "Lecture du livre " + item.name + " - XP : " + item.system.xp + " - Compétences : " + item.system.competence
}
}
await this.createEmbeddedDocuments('Item', [tache], options);
@ -2870,8 +2871,11 @@ export class RdDActor extends Actor {
if (this.currentTMR) this.currentTMR.minimize(); // Hide
let draconicList = this.getDraconicList()
.map(draconic => duplicate(draconic))
.map(draconic => { draconic.system.defaut_carac = "intellect"; return draconic; });
.map(draconic => {
let draconicLecture = duplicate(draconic);
draconicLecture.system.defaut_carac = "intellect";
return draconicLecture;
});
const intellect = this.system.carac.intellect;
let rollData = {
@ -2989,7 +2993,7 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
checkDesirLancinant() {
let queue = this.filterItemsData(it => it.type == 'queue' || it.type == 'ombre')
let queue = this.filterItems(it => it.type == 'queue' || it.type == 'ombre')
.filter(it => Grammar.toLowerCaseNoAccent(it.name).includes('desir lancinant'));
return (queue.length > 0);
}
@ -3056,23 +3060,23 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async resetNombreAstral(data) {
async resetNombreAstral() {
let toDelete = this.listItemsData('nombreastral');
const deletions = toDelete.map(it => it._id);
await this.deleteEmbeddedDocuments("Item", deletions);
}
/* -------------------------------------------- */
async ajouteNombreAstral(data) {
async ajouteNombreAstral(callData) {
// Gestion expérience (si existante)
data.competence = this.getCompetence("astrologie")
data.selectedCarac = this.system.carac["vue"];
this.appliquerAjoutExperience(data, 'hide');
callData.competence = this.getCompetence("astrologie")
callData.selectedCarac = this.system.carac["vue"];
this.appliquerAjoutExperience(callData, 'hide');
// Ajout du nombre astral
const item = {
name: "Nombre Astral", type: "nombreastral", data:
{ value: data.nbAstral, istrue: data.isvalid, jourindex: Number(data.date), jourlabel: game.system.rdd.calendrier.getDateFromIndex(Number(data.date)) }
name: "Nombre Astral", type: "nombreastral", system:
{ value: callData.nbAstral, istrue: callData.isvalid, jourindex: Number(callData.date), jourlabel: game.system.rdd.calendrier.getDateFromIndex(Number(callData.date)) }
};
await this.createEmbeddedDocuments("Item", [item]);
@ -3218,15 +3222,15 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
getArmeParade(armeParadeId) {
const item = armeParadeId ? this.getEmbeddedDocument('Item', armeParadeId) : undefined;
return RdDItemArme.getArmeData(item);
return RdDItemArme.getArme(item);
}
/* -------------------------------------------- */
verifierForceMin(itemData) {
if (itemData.type == 'arme' && itemData.system.force > this.system.carac.force.value) {
verifierForceMin(item) {
if (item.type == 'arme' && item.system.force > this.system.carac.force.value) {
ChatMessage.create({
content: `<strong>${this.name} s'est équipé(e) de l'arme ${itemData.name}, mais n'a pas une force suffisante pour l'utiliser normalement </strong>
(${itemData.system.force} nécessaire pour une Force de ${this.system.carac.force.value})`
content: `<strong>${this.name} s'est équipé(e) de l'arme ${item.name}, mais n'a pas une force suffisante pour l'utiliser normalement </strong>
(${item.system.force} nécessaire pour une Force de ${this.system.carac.force.value})`
});
}
}
@ -3251,10 +3255,10 @@ export class RdDActor extends Actor {
let armeData = attackerRoll.arme;
let protection = 0;
const armures = this.items.filter(it => it.type == "armure" && it.system.equipe);
for (const itemData of armures) {
protection += await RdDDice.rollTotal(itemData.system.protection.toString());
for (const armure of armures) {
protection += await RdDDice.rollTotal(armure.system.protection.toString());
if (dmg > 0) {
this._deteriorerArmure(itemData, dmg);
this._deteriorerArmure(armure, dmg);
dmg = 0;
}
}
@ -3273,39 +3277,39 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
_deteriorerArmure(item, dmg) {
let itemData = duplicate(item);
if (!ReglesOptionelles.isUsing('deteriorationArmure') || itemData.system.protection == '0') {
_deteriorerArmure(armure, dmg) {
armure = duplicate(armure);
if (!ReglesOptionelles.isUsing('deteriorationArmure') || armure.system.protection == '0') {
return;
}
itemData.system.deterioration = (itemData.system.deterioration ?? 0) + dmg;
if (itemData.system.deterioration >= 10) {
itemData.system.deterioration -= 10;
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(itemData.system.protection);
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) {
itemData.system.protection = 0;
armure.system.protection = 0;
} else {
itemData.system.protection = '' + (res[1] ?? '1') + 'd' + armure + malus;
armure.system.protection = '' + (res[1] ?? '1') + 'd' + armure + malus;
}
}
else if (/\d+/.exec(itemData.system.protection)) {
itemData.system.protection = "1d" + itemData.system.protection;
else if (/\d+/.exec(armure.system.protection)) {
armure.system.protection = "1d" + armure.system.protection;
}
else {
ui.notifications.warn(`La valeur d'armure de votre ${item.name} est incorrecte`);
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 " + itemData.system.protection });
ChatMessage.create({ content: "Votre armure s'est détériorée, elle protège maintenant de " + armure.system.protection });
}
this.updateEmbeddedDocuments('Item', [itemData]);
this.updateEmbeddedDocuments('Item', [armure]);
}
/* -------------------------------------------- */
async encaisser() {
let data = { ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() };
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', data);
let dialogData = { ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() };
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', dialogData);
new RdDEncaisser(html, this).render(true);
}
@ -3486,8 +3490,8 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
/** @override */
getRollData() {
const data = super.getRollData();
return data;
const rollData = super.getRollData();
return rollData;
}
/* -------------------------------------------- */
@ -3578,20 +3582,19 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
getFortune() {
let monnaies = Monnaie.filtrerMonnaies(this.items);
let monnaies = this.itemTypes['monnaie'];
if (monnaies.length < 4) {
ui.notifications.error("Problème de monnaies manquantes, impossible de payer correctement!")
throw "Problème de monnaies manquantes, impossible de payer correctement!";
}
return monnaies.map(m => this.system)
.map(tpl => tpl.valeur_deniers * Number(tpl.quantite))
return monnaies.map(m => Number(m.system.valeur_deniers) * Number(m.system.quantite))
.reduce(Misc.sum(), 0);
}
/* -------------------------------------------- */
async optimizeArgent(fortuneTotale) {
let monnaies = Monnaie.filtrerMonnaies(this.items);
let parValeur = Misc.classifyFirst(monnaies, it => this.system.valeur_deniers);
let monnaies = this.itemTypes['monnaie'];
let parValeur = Misc.classifyFirst(monnaies, it => it.system.valeur_deniers);
let nouvelleFortune = {
1000: Math.floor(fortuneTotale / 1000), // or
100: Math.floor(fortuneTotale / 100) % 10, // argent
@ -3716,7 +3719,7 @@ export class RdDActor extends Actor {
const buttonAcheter = html.find(".button-acheter")[0];
const vente = DialogItemAchat.prepareVenteData(buttonAcheter, achat.vendeurId, vendeur, acheteur);
const itemId = vente.item._id;
const isItemEmpilable = "quantite" in vente.item.data;
const isItemEmpilable = "quantite" in vente.item.system;
const coutDeniers = Math.floor((achat.prixTotal ?? 0) * 100);
achat.quantiteTotal = (achat.choix.nombreLots ?? 1) * (vente.tailleLot);
@ -3748,7 +3751,7 @@ export class RdDActor extends Actor {
type: vente.item.type,
img: vente.item.img,
name: vente.item.name,
data: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
system: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
}
let listeAchat = isItemEmpilable ? [achatData] : Array.from({ length: achat.quantiteTotal }, (_, i) => achatData)
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat)

View File

@ -1,7 +1,6 @@
import { Misc } from "./misc.js";
import { SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
export const MESSAGE_DATA = 'message-data';
/**
* Class providing helper methods to get the list of users, and
@ -19,61 +18,50 @@ export class ChatUtility {
/* -------------------------------------------- */
static notifyUser(userId, level = 'info', message) {
const data = {
const socketData = {
userId: userId, level: level, message: message
};
if (game.user.id == userId) {
ChatUtility.onNotifyUser(data);
ChatUtility.onNotifyUser(socketData);
}
else {
game.socket.emit(SYSTEM_SOCKET_ID, {
msg: "msg_user_ui_notifications", data: data
msg: "msg_user_ui_notifications", data: socketData
});
}
}
static onNotifyUser(data) {
if (game.user.id == data.userId) {
switch (data.level) {
case 'warn': ui.notifications.warn(data.message); break;
case 'error': ui.notifications.error(data.message); break;
default: ui.notifications.info(data.message); break;
static onNotifyUser(socketData) {
if (game.user.id == socketData.userId) {
switch (socketData.level) {
case 'warn': ui.notifications.warn(socketData.message); break;
case 'error': ui.notifications.error(socketData.message); break;
default: ui.notifications.info(socketData.message); break;
}
}
}
/* -------------------------------------------- */
static onRemoveMessages(data) {
static onRemoveMessages(socketData) {
if (Misc.isUniqueConnectedGM()) {
if (data.part) {
const toDelete = game.messages.filter(it => it.data.content.includes(data.part));
if (socketData.part) {
const toDelete = game.messages.filter(it => it.content.includes(socketData.part));
toDelete.forEach(it => it.delete());
}
if (data.messageId) {
game.messages.get(data.messageId)?.delete();
if (socketData.messageId) {
game.messages.get(socketData.messageId)?.delete();
}
}
}
static onRemoveMessages(data) {
if (Misc.isUniqueConnectedGM()) {
if (data.part) {
const toDelete = game.messages.filter(it => it.content.includes(data.part));
toDelete.forEach(it => it.delete());
}
if (data.messageId) {
game.messages.get(data.messageId)?.delete();
}
}
}
/* -------------------------------------------- */
static removeMessages(data) {
static removeMessages(socketData) {
if (Misc.isUniqueConnectedGM()) {
ChatUtility.onRemoveMessages(data);
ChatUtility.onRemoveMessages(socketData);
}
else {
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_delete_chat_message", data: data });
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_delete_chat_message", data: socketData });
}
}
@ -154,17 +142,17 @@ export class ChatUtility {
}
/* -------------------------------------------- */
static handleGMChatMessage(data) {
console.log("blindMessageToGM", data);
static handleGMChatMessage(socketData) {
console.log("blindMessageToGM", socketData);
if (game.user.isGM) { // message privé pour GM only
data.user = game.user.id;
ChatMessage.create(data);
socketData.user = game.user.id;
ChatMessage.create(socketData);
}
}
static async setMessageData(chatMessage, key, data) {
if (data) {
await chatMessage.setFlag(SYSTEM_RDD, key, JSON.stringify(data));
static async setMessageData(chatMessage, key, flag) {
if (flag) {
await chatMessage.setFlag(SYSTEM_RDD, key, JSON.stringify(flag));
}
}

View File

@ -93,7 +93,7 @@ export class DialogCreateSigneDraconique extends Dialog {
async setEphemere(ephemere) {
this.dialogData.signe.system.ephemere = ephemere;
HtmlUtility._showControlWhen($(".signe-data-duree"), ephemere);
HtmlUtility._showControlWhen($(".signe-system-duree"), ephemere);
}
async onSelectActor(event) {

View File

@ -38,22 +38,22 @@ export class DialogConsommer extends Dialog {
/* -------------------------------------------- */
static prepareData(actor, item) {
const itemData = duplicate(item);
item = duplicate(item);
let consommerData = {
item: itemData,
item: item,
cuisine: actor.getCompetence('cuisine'),
choix: {
doses: 1,
seForcer: false,
}
}
switch (itemData.type) {
switch (item.type) {
case 'nourritureboisson':
consommerData.title = itemData.system.boisson ? `${itemData.name}: boire une dose` : `${itemData.name}: manger une portion`;
consommerData.buttonName = itemData.system.boisson ? "Boire" : "Manger";
consommerData.title = item.system.boisson ? `${item.name}: boire une dose` : `${item.name}: manger une portion`;
consommerData.buttonName = item.system.boisson ? "Boire" : "Manger";
break;
case 'potion':
consommerData.title = `${itemData.name}: boire la potion`;
consommerData.title = `${item.name}: boire la potion`;
consommerData.buttonName = "Boire";
break;
}
@ -61,11 +61,11 @@ export class DialogConsommer extends Dialog {
return consommerData;
}
static calculDoses(consommerData) {
const doses = consommerData.choix.doses;
consommerData.totalSust = Misc.keepDecimals(doses * (consommerData.item.system.sust ?? 0), 2);
consommerData.totalDesaltere = consommerData.item.system.boisson
? Misc.keepDecimals(doses * (consommerData.item.system.desaltere ?? 0), 2)
static calculDoses(consommer) {
const doses = consommer.choix.doses;
consommer.totalSust = Misc.keepDecimals(doses * (consommer.item.system.sust ?? 0), 2);
consommer.totalDesaltere = consommer.item.system.boisson
? Misc.keepDecimals(doses * (consommer.item.system.desaltere ?? 0), 2)
: 0;
}

View File

@ -4,15 +4,14 @@ import { Misc } from "./misc.js";
export class DialogItemVente extends Dialog {
static async create(item, callback) {
const itemData = item
const quantite = item.isConteneur() ? 1 : itemData.system.quantite;
const quantite = item.isConteneur() ? 1 : item.system.quantite;
const venteData = {
item: itemData,
item: item,
alias: item.actor?.name ?? game.user.name,
vendeurId: item.actor?.id,
prixOrigine: itemData.system.cout,
prixUnitaire: itemData.system.cout,
prixLot: itemData.system.cout,
prixOrigine: item.system.cout,
prixUnitaire: item.system.cout,
prixLot: item.system.cout,
tailleLot: 1,
quantiteNbLots: quantite,
quantiteMaxLots: quantite,

View File

@ -3,10 +3,9 @@ import { Misc } from "./misc.js";
export class DialogSplitItem extends Dialog {
static async create(item, callback) {
const itemData = item
const splitData = {
item: itemData,
choix: { quantite: 1, max: itemData.system.quantite - 1 }
item: item,
choix: { quantite: 1, max: item.system.quantite - 1 }
};
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-split.html`, splitData);
return new DialogSplitItem(item, splitData, html, callback)

View File

@ -1,9 +0,0 @@
/* -------------------------------------------- */
import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
// Activate chat listeners defined
// Hooks.on('renderChatLog', (log, html, data) => {
// RdDUtility.chatListeners(html);
// });

View File

@ -19,18 +19,16 @@ const nomCategorieParade = {
/* -------------------------------------------- */
export class RdDItemArme extends Item {
static isArme(itemData) {
itemData = itemData
return (itemData.type == 'competencecreature' && itemData.system.iscombat) || itemData.type == 'arme';
static isArme(item) {
return (item.type == 'competencecreature' && item.system.iscombat) || item.type == 'arme';
}
/* -------------------------------------------- */
static getArmeData(armeData) {
armeData = armeData
switch (armeData ? armeData.type : '') {
case 'arme': return armeData;
static getArme(arme) {
switch (arme ? arme.type : '') {
case 'arme': return arme;
case 'competencecreature':
return RdDItemCompetenceCreature.toActionArme(armeData);
return RdDItemCompetenceCreature.toActionArme(arme);
}
return RdDItemArme.mainsNues();
}
@ -160,17 +158,18 @@ export class RdDItemArme extends Item {
return armeData;
}
static isArmeUtilisable(itemData) {
return itemData.type == 'arme' && itemData.system.equipe && (itemData.system.resistance > 0 || itemData.system.portee_courte > 0);
static isArmeUtilisable(arme) {
return arme.type == 'arme' && arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0);
}
static ajoutCorpsACorps(armes, competences, carac) {
let corpsACorps = competences.find(it => it.name == 'Corps à corps') ?? { system: { niveau: -6 } };
let init = RdDCombatManager.calculInitiative(corpsACorps.system.niveau, carac['melee'].value);
armes.push(RdDItemArme.mainsNues({ niveau: corpsACorps.system.niveau, initiative: init }));
//armes.push(RdDItemArme.empoignade({ niveau: corpsACorps.system.niveau, initiative: init }));
}
static corpsACorps(actorData) {
static corpsACorps(mainsNuesActor) {
const corpsACorps = {
name: 'Corps à corps',
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_corps_a_corps.webp',
@ -185,20 +184,20 @@ export class RdDItemArme extends Item {
categorie_parade: 'sans-armes'
}
};
mergeObject(corpsACorps.system, actorData ?? {}, { overwrite: false });
mergeObject(corpsACorps.system, mainsNuesActor ?? {}, { overwrite: false });
return corpsACorps;
}
static mainsNues(actorData) {
const mainsNues = RdDItemArme.corpsACorps(actorData)
static mainsNues(mainsNuesActor) {
const mainsNues = RdDItemArme.corpsACorps(mainsNuesActor)
mainsNues.name = 'Mains nues'
mainsNues.system.cac = 'pugilat'
mainsNues.system.baseInit = 4
return mainsNues;
}
static empoignade(actorData) {
const empoignade = RdDItemArme.corpsACorps(actorData)
static empoignade(mainsNuesActor) {
const empoignade = RdDItemArme.corpsACorps(mainsNuesActor)
empoignade.name = 'Empoignade'
empoignade.system.cac = 'empoignade'
empoignade.system.baseInit = 3

View File

@ -195,17 +195,17 @@ export class RdDItemCompetence extends Item {
}
/* -------------------------------------------- */
static isVisible(itemData) {
return Number(itemData.system.niveau) != RdDItemCompetence.getNiveauBase(itemData.system.categorie);
static isVisible(item) {
return Number(item.system.niveau) != RdDItemCompetence.getNiveauBase(item.system.categorie);
}
static nomContientTexte(itemData, texte) {
return Grammar.toLowerCaseNoAccent(itemData.name).includes(Grammar.toLowerCaseNoAccent(texte))
static nomContientTexte(item, texte) {
return Grammar.toLowerCaseNoAccent(item.name).includes(Grammar.toLowerCaseNoAccent(texte))
}
/* -------------------------------------------- */
static isNiveauBase(itemData) {
return Number(itemData.system.niveau) == RdDItemCompetence.getNiveauBase(itemData.system.categorie);
static isNiveauBase(item) {
return Number(item.system.niveau) == RdDItemCompetence.getNiveauBase(item.system.categorie);
}
/* -------------------------------------------- */

View File

@ -38,14 +38,12 @@ export class RdDItemCompetenceCreature extends Item {
}
/* -------------------------------------------- */
static isCompetenceAttaque(itemData) {
itemData = itemData
return itemData.type == 'competencecreature' && itemData.system.iscombat;
static isCompetenceAttaque(item) {
return item.type == 'competencecreature' && item.system.iscombat;
}
/* -------------------------------------------- */
static isCompetenceParade(itemData) {
itemData = itemData
return itemData.type == 'competencecreature' && itemData.system.isparade;
static isCompetenceParade(item) {
return item.type == 'competencecreature' && item.system.isparade;
}
}

View File

@ -1,6 +1,6 @@
import { Misc } from "./misc.js";
const monnaiesData = [
const MONNAIES_STANDARD = [
{
name: "Etain (1 denier)", type: 'monnaie',
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
@ -26,27 +26,28 @@ const monnaiesData = [
export class Monnaie {
static isSystemMonnaie(item) {
let present = monnaiesData.find(monnaie => monnaie.system.valeur_deniers == item?.system?.valeur_deniers);
let present = MONNAIES_STANDARD.find(monnaie => monnaie.system.valeur_deniers == item?.system?.valeur_deniers);
return present;
}
static monnaiesData() {
return monnaiesData;
return MONNAIES_STANDARD;
}
static filtrerMonnaies(items) {
return items.filter(it => it.type == 'monnaie');
}
static monnaiesManquantes(items) {
const valeurs = Monnaie.filtrerMonnaies(items)
.map(it => it.system.valeur_deniers);
const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != monnaie.system?.valeur_deniers))
static monnaiesManquantes(disponibles) {
const manquantes = MONNAIES_STANDARD.filter(standard => !disponibles.find(disponible => Monnaie.deValeur(disponible, standard.system?.valeur_deniers)));
if (manquantes.length>0) {
console.error('monnaiesManquantes', manquantes, ' avec monnaies', disponibles, MONNAIES_STANDARD);
}
return []; //manquantes;
}
static deValeur(monnaie, v) {
return v != monnaie.system.valeur_deniers
static deValeur(monnaie, valeur) {
return valeur == monnaie.system.valeur_deniers
}
static arrondiDeniers(sols) {

View File

@ -32,7 +32,7 @@ export class RdDItemSheet extends ItemSheet {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
if ("cout" in this.object.system && this.object.isVideOuNonConteneur()) {
if ("cout" in this.item.system && this.item.isVideOuNonConteneur()) {
buttons.unshift({
class: "vendre",
icon: "fas fa-comments-dollar",
@ -61,22 +61,24 @@ export class RdDItemSheet extends ItemSheet {
/* -------------------------------------------- */
async getData() {
let formData = {
id: this.object.id,
title: this.object.name,
type: this.object.type,
img: this.object.img,
name: this.object.name,
data: this.object.system,
id: this.item.id,
title: this.item.name,
type: this.item.type,
img: this.item.img,
name: this.item.name,
system: this.item.system,
// TODO: v10 remove
data: this.item.system,
isGM: game.user.isGM,
actorId: this.actor?.id,
owner: this.document.isOwner,
owner: this.item.isOwner,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
isSoins: false
}
if (this.actor) {
formData.isOwned = true;
if (this.object.type == 'conteneur') {
if (this.item.type == 'conteneur') {
this.prepareConteneurData(formData);
}
}
@ -92,15 +94,15 @@ export class RdDItemSheet extends ItemSheet {
console.log(formData.competences)
}
if (formData.type == 'recettealchimique') {
RdDAlchimie.processManipulation(this.object, this.actor && this.actor.id);
RdDAlchimie.processManipulation(this.item, this.actor && this.actor.id);
}
if (formData.type == 'gemme') {
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
RdDGemme.calculDataDerivees(formData.data);
RdDGemme.calculDataDerivees(this.item);
}
if (formData.type == 'potion') {
if (this.dateUpdated) {
formData.data.prdate = this.dateUpdated;
formData.system.prdate = this.dateUpdated;
this.dateUpdated = undefined;
}
RdDHerbes.updatePotionData(formData);
@ -119,7 +121,7 @@ export class RdDItemSheet extends ItemSheet {
RdDUtility.filterEquipementParType(formData)
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
formData.subItems = formData.conteneurs.find(it => it._id == this.object.id)?.subItems;
formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;
}
@ -128,15 +130,15 @@ export class RdDItemSheet extends ItemSheet {
activateListeners(html) {
super.activateListeners(html);
if (this.object.type == 'conteneur') {
if (this.item.type == 'conteneur') {
this.form.ondragstart = (event) => this._onDragStart(event);
this.form.ondrop = (event) => this._onDrop(event);
}
let itemSheetDialog = this;
HtmlUtility._showControlWhen($(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.object.isOwned);
HtmlUtility._showControlWhen($(".item-magique"), this.object.isMagique());
HtmlUtility._showControlWhen($(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned);
HtmlUtility._showControlWhen($(".item-magique"), this.item.isMagique());
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
@ -145,8 +147,8 @@ export class RdDItemSheet extends ItemSheet {
html.find(".categorie").change(event => this._onSelectCategorie(event));
html.find('.sheet-competence-xp').change((event) => {
if (this.object.type == 'competence') {
RdDUtility.checkThanatosXP(this.object.name);
if (this.item.type == 'competence') {
RdDUtility.checkThanatosXP(this.item.name);
}
});
@ -219,16 +221,16 @@ export class RdDItemSheet extends ItemSheet {
async _onSelectCategorie(event) {
event.preventDefault();
if (this.object.isCompetence()) {
if (this.item.isCompetence()) {
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
this.object.system.base = level;
this.item.system.base = level;
$("#base").val(level);
}
}
/* -------------------------------------------- */
get template() {
let type = this.object.type
let type = this.item.type
return `systems/foundryvtt-reve-de-dragon/templates/item-${type}-sheet.html`;
}
@ -239,7 +241,7 @@ export class RdDItemSheet extends ItemSheet {
// Données de bonus de cases ?
formData = RdDItemSort.buildBonusCaseStringFromFormData(formData);
return this.object.update(formData);
return this.item.update(formData);
}
async _onDragStart(event) {
@ -252,28 +254,28 @@ export class RdDItemSheet extends ItemSheet {
const dragData = {
actorId: this.actor.id,
type: "Item",
data: item
data: item.system
};
event.dataTransfer.setData("text/plain", JSON.stringify(dragData));
}
async _onDrop(event) {
// Try to extract the data
let data;
// Try to extract the dragData
let dragData;
try {
data = JSON.parse(event.dataTransfer.getData('text/plain'));
dragData = JSON.parse(event.dataTransfer.getData('text/plain'));
} catch (err) {
return false;
}
const allowed = Hooks.call("dropActorSheetData", this.actor, this, data);
const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData);
if (allowed === false) return;
// Handle different data types
switch (data.type) {
// Handle different dragData types
switch (dragData.type) {
case "Item":
return this._onDropItem(event, data);
return this._onDropItem(event, dragData);
}
return super._onDrop(event);
}
@ -281,7 +283,7 @@ export class RdDItemSheet extends ItemSheet {
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
if (this.actor) {
const dropParams = RdDSheetUtility.prepareItemDropParameters(this.object.id, this.actor.id, dragData, this.objetVersConteneur);
const dropParams = RdDSheetUtility.prepareItemDropParameters(this.item.id, this.actor.id, dragData, this.objetVersConteneur);
await this.actor.processDropItem(dropParams);
await this.render(true);
}

View File

@ -40,17 +40,17 @@ export class RdDSigneDraconiqueItemSheet extends ItemSheet {
/* -------------------------------------------- */
async getData() {
const formData = duplicate(this.object);
const formData = duplicate(this.item);
mergeObject(formData, {
title: formData.name,
isGM: game.user.isGM,
owner: this.document.isOwner,
owner: this.actor.isOwner,
isOwned: this.actor ? true : false,
actorId: this.actor?.id,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
});
formData.tmrs = TMRUtility.listSelectedTMR(formData.data.typesTMR ?? []);
formData.tmrs = TMRUtility.listSelectedTMR(formData.system.typesTMR ?? []);
return formData;
}
@ -68,21 +68,21 @@ export class RdDSigneDraconiqueItemSheet extends ItemSheet {
async setSigneAleatoire() {
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique();
this.object.update(newSigne);
this.item.update(newSigne);
}
async onSelectTmr(event) {
event.preventDefault();
const selectedTMR = $(".select-tmr").val();
this.object.update({ 'data.typesTMR': selectedTMR });
this.item.update({ 'system.typesTMR': selectedTMR });
}
async onValeurXpSort(event) {
const codeReussite = event.currentTarget.attributes['data-typereussite']?.value ?? 0;
const xp = Number(event.currentTarget.value);
const oldValeur = this.object.system.valeur;
const oldValeur = this.item.system.valeur;
const newValeur = RdDItemSigneDraconique.calculValeursXpSort(codeReussite, xp, oldValeur);
await this.object.update({ 'data.valeur': newValeur });
await this.item.update({ 'system.valeur': newValeur });
}
/* -------------------------------------------- */

View File

@ -18,12 +18,11 @@ const DIFFICULTE_LECTURE_SIGNE_MANQUE = +11;
export class RdDItemSigneDraconique {
static prepareSigneDraconiqueMeditation(meditation, rolled) {
meditation = meditation
return {
name: "de la " + meditation.name,
type: "signedraconique",
img: meditation.img,
data: {
system: {
typesTMR: [TMRUtility.typeTmrName(meditation.system.tmr)],
difficulte: rolled.isSuccess ? RdDItemSigneDraconique.getDiffSigneMeditation(rolled.code) : DIFFICULTE_LECTURE_SIGNE_MANQUE,
ephemere: true,
@ -75,7 +74,7 @@ export class RdDItemSigneDraconique {
name: await RdDItemSigneDraconique.randomSigneDescription(),
type: "signedraconique",
img: defaultItemImg.signedraconique,
data: {
system: {
typesTMR: await RdDItemSigneDraconique.randomTmrs(modele.nbCases),
ephemere: options?.ephemere == undefined ? RdDDice.rollTotal("1d2") == 2 : options.ephemere,
duree: "1 round",

View File

@ -59,30 +59,30 @@ export class RdDItemSort extends Item {
return undefined;
}
/* -------------------------------------------- */
/** Met à jour les données de formulaire
* si static des bonus de cases sont présents
* */
static buildBonusCaseStringFromFormData( formData ) {
if ( formData.bonusValue ) {
let list = [];
let caseCheck = {};
for(let i=0; i<formData.bonusValue.length; i++) {
let coord = formData.caseValue[i] || 'A1';
coord = coord.toUpperCase();
if ( TMRUtility.verifyTMRCoord( coord ) ) { // Sanity check
let bonus = formData.bonusValue[i] || 0;
if ( bonus > 0 && caseCheck[coord] == undefined ) {
caseCheck[coord] = bonus;
list.push( coord+":"+bonus );
}
/* -------------------------------------------- */
/** Met à jour les données de formulaire
* si static des bonus de cases sont présents
* */
static buildBonusCaseStringFromFormData( formData ) {
if ( formData.bonusValue ) {
let list = [];
let caseCheck = {};
for(let i=0; i<formData.bonusValue.length; i++) {
let coord = formData.caseValue[i] || 'A1';
coord = coord.toUpperCase();
if ( TMRUtility.verifyTMRCoord( coord ) ) { // Sanity check
let bonus = formData.bonusValue[i] || 0;
if ( bonus > 0 && caseCheck[coord] == undefined ) {
caseCheck[coord] = bonus;
list.push( coord+":"+bonus );
}
}
formData.bonusValue = undefined;
formData.caseValue = undefined;
formData['data.bonuscase'] = list.toString(); // Reset
}
return formData;
formData.bonusValue = undefined;
formData.caseValue = undefined;
formData.system.bonuscase = list.toString(); // Reset
}
return formData;
}
/* -------------------------------------------- */
@ -106,7 +106,7 @@ export class RdDItemSort extends Item {
// Sauvegarde/update
let bonuscase = StringList.toString();
//console.log("Bonus cae :", bonuscase);
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'data.bonuscase': bonuscase }] );
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'system.bonuscase': bonuscase }] );
}
/* -------------------------------------------- */

View File

@ -1,6 +1,7 @@
import { DialogItemVente } from "./dialog-item-vente.js";
import { Grammar } from "./grammar.js";
import { Misc } from "./misc.js";
import { RdDHerbes } from "./rdd-herbes.js";
import { RdDUtility } from "./rdd-utility.js";
const typesObjetsEquipement = ["objet", "arme", "armure", "gemme", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "nourritureboisson", "monnaie"]
@ -41,11 +42,11 @@ export const defaultItemImg = {
/* -------------------------------------------- */
export class RdDItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
constructor(itemData, context) {
if (!itemData.img) {
itemData.img = defaultItemImg[itemData.type];
}
super(data, context);
super(itemData, context);
}
static getTypeObjetsEquipement() {
@ -126,7 +127,8 @@ export class RdDItem extends Item {
this.system.magique = categorie.includes('enchante');
if (this.system.magique) {
if (categorie.includes('soin') || categorie.includes('repos')) {
this.system.puissance = this.system.herbebonus * this.system.pr;
// TODO: utiliser calculePointsRepos / calculePointsGuerison
this.system.puissance = RdDHerbes.calculePuissancePotion(this);
}
}
}
@ -180,11 +182,11 @@ export class RdDItem extends Item {
}
else {
ui.notifications.notify(`Il ne vous reste plus de ${this.name}, vous pouvez le supprimer de votre équipement, ou trouver un moyen de vous en procurer.`);
await this.update({ "data.quantite": 0 });
await this.update({ "system.quantite": 0 });
}
}
else {
await this.update({ "data.quantite": reste });
await this.update({ "system.quantite": reste });
}
}
}

View File

@ -17,12 +17,12 @@ export class RdDAlchimie {
//console.log("RESULT ", result);
if (result[1] && result[2]) {
let commande = Misc.upperFirst(result[1]);
let replacement = this[`_alchimie${commande}`](recetteData, result[2], actorId);
let replacement = this[`_alchimie${commande}`](recette, result[2], actorId);
manip = manip.replace(result[0], replacement);
}
}
}
recetteData.recette.manipulation_update = manip;
recette.system.manipulation_update = manip;
}
/* -------------------------------------------- */

View File

@ -12,23 +12,23 @@ export class RdDAstrologieJoueur extends Dialog {
/* -------------------------------------------- */
static async create(actor, dialogConfig) {
let data = {
let dialogData = {
nombres: this.organizeNombres(actor),
dates: game.system.rdd.calendrier.getJoursSuivants(10),
etat: actor.getEtatGeneral(),
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
astrologie: RdDItemCompetence.findCompetence(actor.items, 'Astrologie')
}
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', dialogData);
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
if (dialogConfig.options) {
mergeObject(options, dialogConfig.options, { overwrite: true });
}
return new RdDAstrologieJoueur(html, actor, data);
return new RdDAstrologieJoueur(html, actor, dialogData);
}
/* -------------------------------------------- */
constructor(html, actor, data) {
constructor(html, actor, dialogData) {
let myButtons = {
saveButton: { label: "Fermer", callback: html => this.quitDialog() }
@ -41,7 +41,7 @@ export class RdDAstrologieJoueur extends Dialog {
super(dialogConf, dialogOptions);
this.actor = actor;
this.dataNombreAstral = duplicate(data);
this.dataNombreAstral = duplicate(dialogData);
}
/* -------------------------------------------- */
@ -63,7 +63,7 @@ export class RdDAstrologieJoueur extends Dialog {
/* -------------------------------------------- */
requestJetAstrologie() {
let data = {
let socketData = {
id: this.actor.id,
carac_vue: this.actor.system.carac['vue'].value,
etat: this.dataNombreAstral.etat,
@ -73,11 +73,11 @@ export class RdDAstrologieJoueur extends Dialog {
userId: game.user.id
}
if (Misc.isUniqueConnectedGM()) {
game.system.rdd.calendrier.requestNombreAstral(data);
game.system.rdd.calendrier.requestNombreAstral(socketData);
} else {
game.socket.emit(SYSTEM_SOCKET_ID, {
msg: "msg_request_nombre_astral",
data: data
data: socketData
});
}
this.close();

View File

@ -223,7 +223,7 @@ export class RdDCalendrier extends Application {
checkMaladie( periode) {
for (let actor of game.actors) {
if (actor.type == 'personnage') {
let maladies = actor.filterItems( item => (item.type == 'maladie' || (item.type == 'poison' && item.system.active) ) && item.system.periodicite.toLowerCase().includes(periode) );
let maladies = actor.items.find( item => (item.type == 'maladie' || (item.type == 'poison' && item.system.active) ) && item.system.periodicite.toLowerCase().includes(periode) );
for (let maladie of maladies) {
if ( maladie.system.identifie) {
ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
@ -444,9 +444,9 @@ export class RdDCalendrier extends Application {
/* -------------------------------------------- */
updateDisplay() {
let data = this.fillCalendrierData();
// Rebuild data
let dateHTML = `Jour ${data.jourMois} de ${data.nomMois} (${data.nomSaison})`
let calendrier = this.fillCalendrierData();
// Rebuild text du calendrier
let dateHTML = `Jour ${calendrier.jourMois} de ${calendrier.nomMois} (${calendrier.nomSaison})`
if (game.user.isGM) {
dateHTML = dateHTML + " - NA: " + (this.getCurrentNombreAstral() ?? "indéterminé");
}
@ -454,13 +454,13 @@ export class RdDCalendrier extends Application {
handle.innerHTML = dateHTML;
}
for (let heure of document.getElementsByClassName("calendar-heure-texte")) {
heure.innerHTML = data.nomHeure;
heure.innerHTML = calendrier.nomHeure;
}
for (const minute of document.getElementsByClassName("calendar-time-disp")) {
minute.innerHTML = `${data.minutesRelative} minutes`;
minute.innerHTML = `${calendrier.minutesRelative} minutes`;
}
for (const heureImg of document.getElementsByClassName("calendar-heure-img")) {
heureImg.src = data.iconHeure;
heureImg.src = calendrier.iconHeure;
}
}

View File

@ -101,35 +101,35 @@ export class RdDCarac {
}
/* -------------------------------------------- */
static computeCarac(data) {
data.carac.force.value = Math.min(data.carac.force.value, parseInt(data.carac.taille.value) + 4);
static computeCarac(system) {
system.carac.force.value = Math.min(system.carac.force.value, parseInt(system.carac.taille.value) + 4);
data.carac.derobee.value = Math.floor(parseInt(((21 - data.carac.taille.value)) + parseInt(data.carac.agilite.value)) / 2);
let bonusDomKey = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2);
system.carac.derobee.value = Math.floor(parseInt(((21 - system.carac.taille.value)) + parseInt(system.carac.agilite.value)) / 2);
let bonusDomKey = Math.floor((parseInt(system.carac.force.value) + parseInt(system.carac.taille.value)) / 2);
bonusDomKey = Math.min(Math.max(bonusDomKey, 0), 32); // Clamp de securite
let tailleData = tableCaracDerivee[bonusDomKey];
data.attributs.plusdom.value = tailleData.plusdom;
system.attributs.plusdom.value = tailleData.plusdom;
data.attributs.sconst.value = RdDCarac.calculSConst(data.carac.constitution.value);
data.attributs.sust.value = tableCaracDerivee[Number(data.carac.taille.value)].sust;
system.attributs.sconst.value = RdDCarac.calculSConst(system.carac.constitution.value);
system.attributs.sust.value = tableCaracDerivee[Number(system.carac.taille.value)].sust;
data.attributs.encombrement.value = (parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2;
data.carac.melee.value = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.agilite.value)) / 2);
data.carac.tir.value = Math.floor((parseInt(data.carac.vue.value) + parseInt(data.carac.dexterite.value)) / 2);
data.carac.lancer.value = Math.floor((parseInt(data.carac.tir.value) + parseInt(data.carac.force.value)) / 2);
system.attributs.encombrement.value = (parseInt(system.carac.force.value) + parseInt(system.carac.taille.value)) / 2;
system.carac.melee.value = Math.floor((parseInt(system.carac.force.value) + parseInt(system.carac.agilite.value)) / 2);
system.carac.tir.value = Math.floor((parseInt(system.carac.vue.value) + parseInt(system.carac.dexterite.value)) / 2);
system.carac.lancer.value = Math.floor((parseInt(system.carac.tir.value) + parseInt(system.carac.force.value)) / 2);
data.sante.vie.max = Math.ceil((parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value)) / 2);
system.sante.vie.max = Math.ceil((parseInt(system.carac.taille.value) + parseInt(system.carac.constitution.value)) / 2);
data.sante.vie.value = Math.min(data.sante.vie.value, data.sante.vie.max)
data.sante.endurance.max = Math.max(parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value), parseInt(data.sante.vie.max) + parseInt(data.carac.volonte.value));
data.sante.endurance.value = Math.min(data.sante.endurance.value, data.sante.endurance.max);
data.sante.fatigue.max = data.sante.endurance.max * 2;
data.sante.fatigue.value = Math.min(data.sante.fatigue.value, data.sante.fatigue.max);
system.sante.vie.value = Math.min(system.sante.vie.value, system.sante.vie.max)
system.sante.endurance.max = Math.max(parseInt(system.carac.taille.value) + parseInt(system.carac.constitution.value), parseInt(system.sante.vie.max) + parseInt(system.carac.volonte.value));
system.sante.endurance.value = Math.min(system.sante.endurance.value, system.sante.endurance.max);
system.sante.fatigue.max = system.sante.endurance.max * 2;
system.sante.fatigue.value = Math.min(system.sante.fatigue.value, system.sante.fatigue.max);
//Compteurs
data.reve.reve.max = data.carac.reve.value;
data.compteurs.chance.max = data.carac.chance.value;
system.reve.reve.max = system.carac.reve.value;
system.compteurs.chance.max = system.carac.chance.value;
}

View File

@ -79,7 +79,7 @@ export class RdDCombatManager extends Combat {
/************************************************************************************/
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
// Structure input data
ids = typeof ids === "string" ? [ids] : ids;
const currentId = this.combatant._id;
// calculate initiative
@ -93,7 +93,7 @@ export class RdDCombatManager extends Combat {
rollFormula = RdDCombatManager.formuleInitiative(2, competence.system.carac_value, competence.system.niveau, 0);
}
} else {
const armeCombat = combatant.actor.items.find(it => it.type == 'arme' && itemData.system.equipe)
const armeCombat = combatant.actor.itemTypes['arme'].find(it => it.system.equipe)
const compName = (armeCombat == undefined) ? "Corps à corps" : armeCombat.system.competence;
const competence = RdDItemCompetence.findCompetence(combatant.actor.items, compName);
if (competence) {
@ -202,7 +202,7 @@ export class RdDCombatManager extends Combat {
return {
name: p.name,
action: 'conjurer',
data: {
system: {
competence: p.name,
possessionid: p.system.possessionid,
}
@ -231,7 +231,7 @@ export class RdDCombatManager extends Combat {
actions = actions.concat(RdDCombatManager.listActionsArmes(armes, competences, actor.system.carac));
if (actor.system.attributs.hautrevant.value) {
actions.push({ name: "Draconic", action: 'haut-reve', data: { initOnly: true, competence: "Draconic" } });
actions.push({ name: "Draconic", action: 'haut-reve', system: { initOnly: true, competence: "Draconic" } });
}
}
@ -892,8 +892,7 @@ export class RdDCombat {
/* -------------------------------------------- */
_filterArmesParade(defender, competence) {
let items = defender.items;
items = items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
let items = defender.items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
for (let item of items) {
item.system.nbUsage = defender.getItemUse(item.id); // Ajout du # d'utilisation ce round
}
@ -960,10 +959,10 @@ export class RdDCombat {
async parade(attackerRoll, armeParadeId) {
const arme = this.defender.getArmeParade(armeParadeId);
console.log("RdDCombat.parade >>>", attackerRoll, armeParadeId, arme);
const competence = this.system?.competence;
const competence = arme?.system?.competence;
if (competence == undefined)
{
console.error("Pas de compétence de parade associée à ", arme) ;
console.error("Pas de compétence de parade associée à ", arme?.name, armeParadeId) ;
return;
}
@ -1144,7 +1143,7 @@ export class RdDCombat {
resistance -= perteResistance;
defenderRoll.show.deteriorationArme = resistance <= 0 ? 'brise' : 'perte';
defenderRoll.show.perteResistance = perteResistance;
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'data.resistance': resistance }]);
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'system.resistance': resistance }]);
}
}
} else {
@ -1160,7 +1159,7 @@ export class RdDCombat {
resistance -= dmg;
defenderRoll.show.deteriorationArme = resistance <= 0 ? 'brise' : 'perte';
defenderRoll.show.perteResistance = dmg;
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'data.resistance': resistance }]);
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'system.resistance': resistance }]);
}
}
// Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132)
@ -1274,7 +1273,7 @@ export class RdDCombat {
/* -------------------------------------------- */
static async displayActorCombatStatus(combat, actor) {
let data = {
let formData = {
combatId: combat._id,
alias: actor.name,
etatGeneral: actor.getEtatGeneral(),
@ -1286,13 +1285,13 @@ export class RdDCombat {
isCritique: false
}
if (actor.countBlessuresNonSoigneeByName("critiques") > 0) { // Pour éviter le cumul grave + critique
data.isCritique = true;
formData.isCritique = true;
} else if (actor.countBlessuresNonSoigneeByName("graves") > 0) {
data.isGrave = true;
formData.isGrave = true;
}
ChatUtility.createChatWithRollMode(actor.name, {
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-summary.html`, data)
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-summary.html`, formData)
});
}
}

View File

@ -358,7 +358,7 @@ export class RdDCommands {
async supprimerSignesDraconiquesEphemeres() {
game.actors.forEach(actor => {
const ephemeres = actor.filterItems(item => item.type = 'signedraconique' && item.system.ephemere)
const ephemeres = actor.items.find(item => item.type = 'signedraconique' && item.system.ephemere)
.map(item => item.id);
if (ephemeres.length > 0) {
actor.deleteEmbeddedDocuments("Item", ephemeres);

View File

@ -3,11 +3,11 @@ import { Misc } from "./misc.js";
export class RddCompendiumOrganiser {
static init() {
Hooks.on('renderCompendium', async (pack, html, data) => RddCompendiumOrganiser.onRenderCompendium(pack, html, data))
Hooks.on('renderCompendium', async (pack, html, compendiumData) => RddCompendiumOrganiser.onRenderCompendium(pack, html, compendiumData))
}
static async onRenderCompendium(compendium, html, data) {
console.log('onRenderCompendium', compendium, html, data);
static async onRenderCompendium(compendium, html, compendiumData) {
console.log('onRenderCompendium', compendium, html, compendiumData);
const pack = compendium.collection
if (pack.metadata.system === SYSTEM_RDD) {
html.find('.directory-item').each((i, element) => {

View File

@ -18,18 +18,19 @@ const tableGemmes = {
export class RdDGemme extends Item {
static getGemmeTypeOptionList() {
// TODO: look how to map object key-value pairs
let options = ""
for (let gemmeKey in tableGemmes) {
let gemmeData = tableGemmes[gemmeKey];
options += `<option value="${gemmeKey}">${gemmeData.label}</option>`
options += `<option value="${gemmeKey}">${tableGemmes[gemmeKey].label}</option>`
}
return options;
}
static calculDataDerivees(data) {
data.cout = (data.taille * data.purete) + data.qualite;
data.inertie = 7 - data.purete;
data.enchantabilite = data.taille - data.inertie;
static calculDataDerivees(gemme) {
gemme.system.cout = (gemme.system.taille * gemme.system.purete) + gemme.system.qualite;
gemme.system.inertie = 7 - gemme.system.purete;
gemme.system.enchantabilite = gemme.system.taille - gemme.system.inertie;
}
}

View File

@ -1,6 +1,4 @@
/* -------------------------------------------- */
import { RdDUtility } from "./rdd-utility.js";
import { Misc } from "./misc.js";
import { RdDCalendrier } from "./rdd-calendrier.js";
/* -------------------------------------------- */
@ -22,12 +20,11 @@ export class RdDHerbes extends Item {
}
/* -------------------------------------------- */
static buildHerbesList(listHerbes, max) {
static buildHerbesList(listeHerbes, max) {
let list = {}
for ( let herbe of listHerbes) {
let herbeData = herbe.system
let brins = max - herbeData.niveau;
list[herbe.name] = `${herbe.name} (Bonus: ${herbeData.niveau}, Brins: ${brins})`;
for ( let herbe of listeHerbes) {
let brins = max - herbe.system.niveau;
list[herbe.system.name] = `${herbe.system.name} (Bonus: ${herbe.system.niveau}, Brins: ${brins})`;
}
list['Autre'] = 'Autre (Bonus: variable, Brins: variable)'
return list;
@ -39,36 +36,39 @@ export class RdDHerbes extends Item {
formData.herbesRepos = this.buildHerbesList(this.herbesRepos, 7);
formData.jourMoisOptions = RdDCalendrier.buildJoursMois();
formData.dateActuelle = game.system.rdd.calendrier.getDateFromIndex();
formData.splitDate = game.system.rdd.calendrier.getNumericDateFromIndex(formData.data.prdate);
formData.splitDate = game.system.rdd.calendrier.getNumericDateFromIndex(formData.system.prdate);
if (formData.data.categorie.includes('Soin') ) {
if (formData.system.categorie.includes('Soin') ) {
formData.isHerbe = true;
this.computeHerbeBonus(formData, this.herbesSoins, 12);
} else if (formData.data.categorie.includes('Repos')) {
} else if (formData.system.categorie.includes('Repos')) {
formData.isRepos = true;
this.computeHerbeBonus(formData, this.herbesRepos, 7);
}
}
/* -------------------------------------------- */
static calculePointsRepos( data ) {
return data.herbebonus * data.pr;
static calculePuissancePotion( potion ) {
return potion.system.herbebonus * potion.system.pr;
}
/* -------------------------------------------- */
static calculePointsGuerison( data ){
return data.herbebonus * data.pr;
static calculePointsRepos( potion ) {
return potion.system.herbebonus * potion.system.pr;
}
/* -------------------------------------------- */
static calculePointsGuerison( potion ){
return potion.system.herbebonus * potion.system.pr;
}
/* -------------------------------------------- */
static computeHerbeBonus( formData, herbesList, max) {
if ( Number(formData.data.herbebrins) ) {
let herbe = herbesList.find(item => item.name.toLowerCase() == formData.data.herbe.toLowerCase() );
if ( Number(formData.system.herbebrins) ) {
let herbe = herbesList.find(item => item.name.toLowerCase() == formData.system.herbe.toLowerCase() );
if( herbe ) {
let herbeData = herbe.system;
let brinsBase = max - herbeData.niveau;
//console.log(herbeData, brinsBase, formData.data.herbebrins);
formData.data.herbebonus = Math.max(herbeData.niveau - Math.max(brinsBase - formData.data.herbebrins, 0), 0);
let brinsBase = max - herbe.system.niveau;
formData.system.herbebonus = Math.max(herbe.system.niveau - Math.max(brinsBase - formData.system.herbebrins, 0), 0);
}
}
}

View File

@ -159,7 +159,7 @@ export class RdDPossession {
let possessionData = {
name: "Possession en cours de " + attacker.name, type: 'possession',
img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
data: { description: "", typepossession: attacker.name, possede: false, possessionid: randomID(16), possesseurid: attacker.id, possedeid: defender.id, date: 0, compteur: 0 }
system: { description: "", typepossession: attacker.name, possede: false, possessionid: randomID(16), possesseurid: attacker.id, possedeid: defender.id, date: 0, compteur: 0 }
}
// Creates only the possession on the personnage side
let poss = await defender.createEmbeddedDocuments('Item', [possessionData])

View File

@ -166,7 +166,7 @@ export class RdDRoll extends Dialog {
function onLoad() {
let rollData = dialog.rollData;
console.log('Ouverture RdDRoll', rollData);
// Update html, according to data
// Update html, according to rollData
if (rollData.competence) {
const defaut_carac = rollData.competence.system.defaut_carac
// Set the default carac from the competence item

View File

@ -21,17 +21,14 @@ export class RdDSheetUtility {
}
static prepareItemDropParameters(destItemId, actorId, dragData, objetVersConteneur) {
console.log("ID", dragData)
const item = fromUuidSync(dragData.uuid)
let itemId = item.id
//const itemId = dragData.id || dragData.data._id
return {
destId: destItemId,
targetActorId: actorId,
itemId: itemId,
itemId: item.id,
sourceActorId: item.actor.id,
srcId: objetVersConteneur[itemId],
onEnleverConteneur: () => { delete objetVersConteneur[itemId]; },
srcId: objetVersConteneur[item.id],
onEnleverConteneur: () => { delete objetVersConteneur[item.id]; },
onAjouterDansConteneur: (itemId, conteneurId) => { objetVersConteneur[itemId] = conteneurId; }
}
}
@ -47,10 +44,10 @@ export class RdDSheetUtility {
static async _onSplitItem(item, split, actor) {
if (split >= 1 && split < item.system.quantite) {
await item.diminuerQuantite(split);
const itemData = duplicate(item);
const splitItem = duplicate(item);
// todo: ajouter dans le même conteneur?
itemData.system.quantite = split;
await actor.createEmbeddedDocuments('Item', [itemData])
splitItem.system.quantite = split;
await actor.createEmbeddedDocuments('Item', [splitItem])
}
}
}

View File

@ -267,7 +267,6 @@ export class RdDTMRDialog extends Dialog {
if (ReglesOptionelles.isUsing("appliquer-fatigue")) {
let fatigueItem = document.getElementById("tmr-fatigue-table");
//console.log("Refresh : ", actorData.data.sante.fatigue.value);
fatigueItem.innerHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(this.actor.system.sante.fatigue.value, this.actor.system.sante.endurance.max).html() + "</table>";
}
}
@ -819,7 +818,7 @@ export class RdDTMRDialog extends Dialog {
//this.updateSortReserve();
console.log("declencheSortEnReserve", sortReserve)
this._tellToUserAndGM(`Vous avez déclenché le sort en réserve <strong> ${sortReserve.sort.name}</strong>
avec ${sortReserve.sort.system.ptreve_reel} points de Rêve
avec ${sortReserve.sort.data.ptreve_reel} points de Rêve
en ${sortReserve.coord} (${TMRUtility.getTMRLabel(sortReserve.coord)})
`);
this.close();
@ -873,7 +872,6 @@ export class RdDTMRDialog extends Dialog {
if (this.viewOnly) {
return;
}
let clickOddq = RdDTMRDialog._computeEventOddq(event.data.originalEvent);
await this._onClickTMRPos(clickOddq); // Vérifier l'état des compteurs reve/fatigue/vie
}

View File

@ -8,7 +8,7 @@ export class RdDTokenHud {
static init() {
// Integration du TokenHUD
Hooks.on('renderTokenHUD', (app, html, data) => { RdDTokenHud.addTokenHudExtensions(app, html, data._id) });
Hooks.on('renderTokenHUD', (app, html, token) => { RdDTokenHud.addTokenHudExtensions(app, html, token._id) });
}
/* -------------------------------------------- */
@ -63,7 +63,7 @@ export class RdDTokenHud {
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
const action = actionsCombat[actionIndex];
if (action.action == 'conjurer') {
actor.conjurerPossession(actor.getPossession(action.data.possessionid));
actor.conjurerPossession(actor.getPossession(action.system.possessionid));
}
else {
actor.rollArme(action);
@ -76,7 +76,7 @@ export class RdDTokenHud {
case 'inc': return RdDCombatManager.incDecInit(combatantId, 0.01);
case 'dec': return RdDCombatManager.incDecInit(combatantId, -0.01);
case 'autre': return RdDCombatManager.rollInitiativeAction(combatantId,
{ name: "Autre action", action: 'autre', data: { initOnly: true, competence: "Autre action" } });
{ name: "Autre action", action: 'autre', system: { initOnly: true, competence: "Autre action" } });
}
}

View File

@ -104,7 +104,7 @@ export class RdDUtility {
/* -------------------------------------------- */
static async init() {
Hooks.on("renderChatMessage", async (app, html, msg) => RdDUtility.onRenderChatMessage(app, html, msg));
Hooks.on('renderChatLog', (log, html, data) => RdDUtility.chatListeners(html));
Hooks.on('renderChatLog', (log, html, chatLog) => RdDUtility.chatListeners(html));
}
/* -------------------------------------------- */
@ -445,16 +445,16 @@ export class RdDUtility {
/* -------------------------------------------- */
static calculEncContenu(conteneur, objets) {
const contenuDatas = (conteneur.system.contenu ?? []).filter(id => id != undefined)
.map(id => objets.find(it => (id == it._id)))
const contenus = (conteneur.system.contenu ?? []).filter(id => id != undefined)
.map(id => objets.find(it => (id == it.id)))
.filter(it => it);
let enc = Number(conteneur.system.encombrement ?? 0) * Number(conteneur.system.quantite ?? 1);
for (let itemData of contenuDatas) {
if (itemData.type == 'conteneur') {
enc += RdDUtility.calculEncContenu(itemData, objets);
for (let contenu of contenus) {
if (contenu.type == 'conteneur') {
enc += RdDUtility.calculEncContenu(contenu, objets);
}
else {
enc += Number(itemData.system.encombrement ?? 0) * Number(itemData.system.quantite ?? 1)
enc += Number(contenu.system.encombrement ?? 0) * Number(contenu.system.quantite ?? 1)
}
}
return enc
@ -653,9 +653,9 @@ export class RdDUtility {
}
/* -------------------------------------------- */
static async responseNombreAstral(data) {
let actor = game.actors.get(data.id);
actor.ajouteNombreAstral(data);
static async responseNombreAstral(callData) {
let actor = game.actors.get(callData.id);
actor.ajouteNombreAstral(callData);
}
/* -------------------------------------------- */
@ -753,7 +753,7 @@ export class RdDUtility {
static getSelectedActor(msgPlayer = undefined) {
if (canvas.tokens.controlled.length == 1) {
let token = canvas.tokens.controlled[0];
if (token.actor && token.actorLink) {
if (token.actor) {
return token.actor;
}
if (msgPlayer != undefined) {
@ -776,7 +776,7 @@ export class RdDUtility {
static createMonnaie(name, valeur_deniers, img = "", enc = 0.01) {
let piece = {
name: name, type: 'monnaie', img: img, _id: randomID(16),
data: {
dasystemta: {
quantite: 0,
valeur_deniers: valeur_deniers,
encombrement: enc,

View File

@ -468,10 +468,10 @@ export class TMRRencontres {
}
/* -------------------------------------------- */
static async onPostEchecTourbillonRouge(tmrDialog, data) {
await data.actor.reveActuelIncDec(-2); // -2 pts de Reve a chaque itération
TMRRencontres._toubillonner(tmrDialog, data.actor, 4);
await data.actor.santeIncDec("vie", -1); // Et -1 PV
static async onPostEchecTourbillonRouge(tmrDialog, rencontre) {
await rencontre.actor.reveActuelIncDec(-2); // -2 pts de Reve a chaque itération
TMRRencontres._toubillonner(tmrDialog, rencontre.actor, 4);
await rencontre.actor.santeIncDec("vie", -1); // Et -1 PV
}
/* -------------------------------------------- */

View File

@ -9,11 +9,11 @@ const registeredEffects = [
* Définition des informations d'une "draconique" (queue, ombre, tête, souffle) qui influence les TMR
*/
export class Draconique {
static isCaseTMR(itemData) { return itemData.type == 'casetmr'; }
static isQueueDragon(itemData) { return itemData.type == 'queue' || itemData.type == 'ombre'; }
static isSouffleDragon(itemData) { return itemData.type == 'souffle'; }
static isTeteDragon(itemData) { return itemData.type == 'tete'; }
static isQueueSouffle(itemData) { return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData); }
static isCaseTMR(item) { return item.type == 'casetmr'; }
static isQueueDragon(item) { return item.type == 'queue' || item.type == 'ombre'; }
static isSouffleDragon(item) { return item.type == 'souffle'; }
static isTeteDragon(item) { return item.type == 'tete'; }
static isQueueSouffle(item) { return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item); }
tmrLabel(linkData) { return TMRUtility.getTMRLabel(linkData.system.coord); }
@ -38,8 +38,7 @@ export class Draconique {
* @returns true si l'item correspond
*/
match(item) {
const itemData = item;
return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData) || Draconique.isTeteDragon(itemData);
return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item) || Draconique.isTeteDragon(item);
}
/**

View File

@ -112,7 +112,7 @@ export class EffetsDraconiques {
}
static filterItems(actor, filter, name) {
return actor.filter(filter)
return actor.filterItems(filter)
.filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
}

View File

@ -25,7 +25,7 @@ export class PixiTMR {
for (const [name, img] of Object.entries(PixiTMR.textures)) {
loader = loader.add(name, img);
}
loader.onLoad.add((error, reason) => { console.log("ERROR", error, reason) });
loader.onError.add((error, reason) => { console.log("ERROR", error, reason) });
loader.load( (loader, resources) => {
onLoad(loader, resources);
for (let onAnimate of this.callbacksOnAnimate) {

View File

@ -13,7 +13,7 @@ export class SortReserve extends Draconique {
async onActorCreateOwned(actor, item) { }
code() { return 'sort' }
tooltip(sort) { return `${sort.name}, r${sort.system.ptreve_reel}` }
tooltip(sort) { return `${sort.name}, r${sort.data.ptreve_reel}` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/scroll.webp' }
createSprite(pixiTMR) {

View File

@ -41,7 +41,7 @@
<div class="grid grid-2col">
<div class="flex-group-left flexcol">
<ol class="carac-list alterne-list">
{{#each data.carac as |carac key|}}
{{#each system.carac as |carac key|}}
<li class="flexrow list-item" data-attribute="{{key}}">
{{#if (eq key 'taille')}}
<span class="carac-label flexrow" name="system.carac.{{key}}.label">{{carac.label}}</span>
@ -61,7 +61,7 @@
</div>
<div class="flex-group-left flexcol">
<ol class="carac-list alterne-list">
{{#each data.attributs as |attr key|}}
{{#each system.attributs as |attr key|}}
<li class="flexrow list-item" data-attribute="{{key}}">
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}}</span>
<input type="text" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" />
@ -70,20 +70,20 @@
<li class="flexrow list-item" data-attribute="vie">
<span class="competence-label" name="system.sante.vie.label">Vie</span>
<span class="flexrow" >
<input type="text" name="system.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number" /> /
<input type="text" name="system.sante.vie.max" value="{{data.sante.vie.max}}" data-dtype="Number" />
<input type="text" name="system.sante.vie.value" value="{{system.sante.vie.value}}" data-dtype="Number" /> /
<input type="text" name="system.sante.vie.max" value="{{system.sante.vie.max}}" data-dtype="Number" />
</span>
</li>
<li class="flexrow list-item" data-attribute="endurance">
<span class="competence-label" name="system.sante.endurance.label">Endurance</span>
<span class="flexrow" >
<input type="text" name="system.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number" /> /
<input type="text" name="system.sante.endurance.max" value="{{data.sante.endurance.max}}" data-dtype="Number" />
<input type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number" /> /
<input type="text" name="system.sante.endurance.max" value="{{system.sante.endurance.max}}" data-dtype="Number" />
</span>
</li>
<li class="flexrow list-item" data-attribute="etat">
<span class="competence-label" name="system.compteurs.etat.label">Etat Général</span>
<input type="text" value="{{data.compteurs.etat.value}}" disabled />
<input type="text" value="{{system.compteurs.etat.value}}" disabled />
</li>
</ol>
</div>
@ -134,12 +134,12 @@
<div class="form-group">
<span class="item-name"><h4>Race</h4></span>
<input type="text" name="system.race" value="{{data.race}}" data-dtype="String" />
<input type="text" name="system.race" value="{{system.race}}" data-dtype="String" />
</div>
<div class="form-group editor">
<span class="item-name"><h4>Description</h4>
{{editor data.description target="system.description" button=true owner=owner editable=true}}
{{editor system.description target="system.description" button=true owner=owner editable=true}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}

View File

@ -32,7 +32,7 @@
<div class="grid grid-2col">
<div class="flex-group-left flexcol">
<ol class="carac-list alterne-list">
{{#each data.carac as |carac key|}}
{{#each system.carac as |carac key|}}
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
{{#if (eq key 'taille')}}
<span class="carac-label flexrow" name="system.carac.{{key}}.label">{{carac.label}}</span>
@ -52,8 +52,8 @@
<ol class="carac-list alterne-list">
<li class="caracteristique flexrow list-item">
<span class="carac-label flexrow" name="catEntite">Catégorie : </span>
<select name="system.definition.categorieentite" value="{{data.definition.categorieentite}}" data-dtype="String">
{{#select data.definition.categorieentite}}
<select name="system.definition.categorieentite" value="{{system.definition.categorieentite}}" data-dtype="String">
{{#select system.definition.categorieentite}}
<option value="cauchemar">Cauchemar</option>
<option value="reve">Rêve</option>
{{/select}}
@ -61,15 +61,15 @@
</li>
<li class="caracteristique flexrow list-item">
<span class="carac-label flexrow" name="typeEntite">Type d'entité : </span>
<select name="system.definition.typeentite" value="{{data.definition.typeentite}}" data-dtype="String">
{{#select data.definition.typeentite}}
<select name="system.definition.typeentite" value="{{system.definition.typeentite}}" data-dtype="String">
{{#select system.definition.typeentite}}
<option value="incarne">Incarnée</option>
<option value="nonincarne">Non Incarnée</option>
<option value="blurette">Blurete</option>
<option value="blurette">Blurette</option>
{{/select}}
</select>
</li>
{{#each data.attributs as |attr key|}}
{{#each system.attributs as |attr key|}}
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="system.attributs.{{key}}.label">{{attr.label}} : </span>
<span><input class="attribut-value flexrow" type="text" name="system.attributs.{{key}}.value"
@ -79,9 +79,9 @@
<li class="caracteristique flexrow list-item" data-attribute="endurance">
<span class="competence-label flexrow" name="system.sante.endurance.label">Endurance : </span>
<span><input class="sante-value flexrow" type="text" name="system.sante.endurance.value"
value="{{data.sante.endurance.value}}" data-dtype="Number" /></span><span>/ </span>
value="{{system.sante.endurance.value}}" data-dtype="Number" /></span><span>/ </span>
<span><input class="sante-value flexrow" type="text" name="system.sante.endurance.max"
value="{{data.sante.endurance.max}}" data-dtype="Number" /></span>
value="{{system.sante.endurance.max}}" data-dtype="Number" /></span>
</li>
</ol>
</div>
@ -131,7 +131,7 @@
{{!-- Biography Tab --}}
<div class="tab description" data-group="primary" data-tab="description">
<div class="form-group editor">
{{editor data.description target="system.description" button=true owner=owner editable=true}}
{{editor system.description target="system.description" button=true owner=owner editable=true}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
</div>

View File

@ -13,15 +13,15 @@
</thead>
<tbody>
<tr class="table-row alterne-row" ><td/><td colspan="4">Légères</td></tr>
{{#each data.blessures.legeres.liste as |bless key|}}
{{#each system.blessures.legeres.liste as |bless key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Légère"}}
{{/each}}
<tr class="table-row alterne-row"><td/><td colspan="4">Graves</td></tr>
{{#each data.blessures.graves.liste as |bless key|}}
{{#each system.blessures.graves.liste as |bless key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="grave" title="Grave"}}
{{/each}}
<tr class="table-row alterne-row"><td/><td colspan="4">Critiques</td></tr>
{{#each data.blessures.critiques.liste as |bless key|}}
{{#each system.blessures.critiques.liste as |bless key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="critique" title="Critique"}}
{{/each}}
</tbody>

View File

@ -1,7 +1,7 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
<span class="item-name"><h4>Equipement</h4></span>
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{system.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
{{#if options.isGM}}
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>

View File

@ -13,8 +13,8 @@
<label class="compteur">
<a class="jet-vie">Vie</a>
<a class="vie-moins"><i class="fas fa-minus-square"></i></a>
<input class="resource-content" type="text" name="system.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>
<span>/ {{data.sante.vie.max}}</span>
<input class="resource-content" type="text" name="system.sante.vie.value" value="{{system.sante.vie.value}}" data-dtype="Number"/>
<span>/ {{system.sante.vie.max}}</span>
<a class="vie-plus"><i class="fas fa-plus-square"></i></a>
</label>
</li>
@ -22,8 +22,8 @@
<label class="compteur">
<a class="jet-endurance">Endurance</a>
<a class="endurance-moins"><i class="fas fa-minus-square"></i></a>
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number"/>
<span>/ {{data.sante.endurance.max}}</span>
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number"/>
<span>/ {{system.sante.endurance.max}}</span>
<a class="endurance-plus"><i class="fas fa-plus-square"></i></a>
</label>
</li>
@ -32,8 +32,8 @@
<span class="tooltiptext ttt-fatigue">{{{calc.fatigue.html}}}</span>
Fatigue
<a class="fatigue-moins"><i class="fas fa-minus-square"></i></a>
<input class="resource-content" id="fatigue-value" type="text" name="system.sante.fatigue.value" value="{{data.sante.fatigue.value}}" data-dtype="Number" />
<span>/ {{data.sante.fatigue.max}}</span>
<input class="resource-content" id="fatigue-value" type="text" name="system.sante.fatigue.value" value="{{system.sante.fatigue.value}}" data-dtype="Number" />
<span>/ {{system.sante.fatigue.max}}</span>
<a class="fatigue-plus"><i class="fas fa-plus-square"></i></a>
</label>
</li>
@ -41,8 +41,8 @@
<label class="compteur">
<span class="ptreve-actuel"><a>Rêve</a></span>
<a class="ptreve-actuel-moins"><i class="fas fa-minus-square"></i></a>
<input class="resource-content" id="pointsreve-value" type="text" name="system.reve.reve.value" value="{{data.reve.reve.value}}" data-dtype="Number" />
<span>/ {{data.reve.seuil.value}}</span>
<input class="resource-content" id="pointsreve-value" type="text" name="system.reve.reve.value" value="{{system.reve.reve.value}}" data-dtype="Number" />
<span>/ {{system.reve.seuil.value}}</span>
<a class="ptreve-actuel-plus"><i class="fas fa-plus-square"></i></a>
</label>
</li>
@ -52,7 +52,7 @@
<span class="encaisser-direct"><a title="Encaisser des dommages"><img class="button-img" src="icons/svg/bones.svg" alt="Encaisser des dommages"/></a></span>
<span class="gm-only remise-a-neuf"><a title="Remise à neuf"><img class="button-img" src="icons/svg/regen.svg" alt="Remise à neuf"/></a></span>
<span class="repos"><a title="Repos"><img class="button-img" src="icons/svg/sleep.svg" alt="Se reposer"/></a></span>
{{#if data.attributs.hautrevant.value}}
{{#if system.attributs.hautrevant.value}}
<span class="monte-tmr"><a title="Montée dans les Terres M&eacute;dianes !" {{#if hautreve.isDemiReve}}disabled{{/if}}><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg" alt="Montée dans les Terres M&eacute;dianes !"/></a></span>
<span class="monte-tmr-rapide"><a title="Montée accélérée dans les Terres M&eacute;dianes !"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg" alt="Montée accélérée dans les Terres M&eacute;dianes !"/></a></span>
<span class="visu-tmr"><a title="Regarder les Terres M&eacute;dianes"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-view.svg" alt="Regarder les Terres M&eacute;dianes"/></a></span>
@ -65,8 +65,8 @@
<span>{{calc.resumeBlessures}}</span>
</div>
<div class="flexrow">
<span>{{data.compteurs.etat.label}}: {{data.compteurs.etat.value}}</span>
<span>{{data.compteurs.surenc.label}}: {{data.compteurs.surenc.value}}</span>
<span>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</span>
<span>{{system.compteurs.surenc.label}}: {{system.compteurs.surenc.value}}</span>
</div>
<div class="flexrow">
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-effects-partial.html"}}
@ -100,7 +100,7 @@
<div class="grid grid-2col">
<div class="flex-group-left flexcol">
<ul class="carac-list alterne-list">
{{#each data.carac as |carac key|}}
{{#each system.carac as |carac key|}}
{{#if carac.isLevelUp}}
<li class="caracteristique flexrow item-list xp-level-up" data-attribute="{{key}}">
{{else}}
@ -149,10 +149,10 @@
<ul class="carac-list">
<li class="caracteristique flexrow list-item">
<span class="carac-label" name="beaute">Beauté&nbsp;:</span>
<input class="description-value" type="text" name="system.beaute" value="{{data.beaute}}" data-dtype="String" {{#unless @root.options.editCaracComp}}disabled{{/unless}}/>
<input class="description-value" type="text" name="system.beaute" value="{{system.beaute}}" data-dtype="String" {{#unless @root.options.editCaracComp}}disabled{{/unless}}/>
<label class="carac-xp"/>
</li>
{{#each data.attributs as |attr key|}}
{{#each system.attributs as |attr key|}}
{{#unless (eq key 'hautrevant')}}
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}}&nbsp;:</span>
@ -169,10 +169,10 @@
<ul class="carac-list alterne-list">
<li class="caracteristique flexrow list-item">
<span class="attribut-label chance-actuelle"><a>Chance actuelle</a></span>
<input class="description-value compteur-edit" type="text" name="chance" value="{{data.compteurs.chance.value}}" data-dtype="number"/>
<input class="description-value compteur-edit" type="text" name="chance" value="{{system.compteurs.chance.value}}" data-dtype="number"/>
<span class="utiliser-attribut" style="padding-left: 5px"><a class="chance-appel">Utiliser</a></span>
</li>
{{#each data.compteurs as |compteur key|}}
{{#each system.compteurs as |compteur key|}}
{{#if (eq compteur.label 'Chance')}}
{{else if (eq compteur.label 'Experience')}}
{{else if compteur.isInput}}
@ -240,7 +240,7 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.tir) categorie="Compétences de Tir"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.lancer) categorie="Compétences de Lancer"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.connaissance) categorie="Connaissances"}}
{{#if (or data.attributs.hautrevant.value options.vueDetaillee)}}
{{#if (or system.attributs.hautrevant.value options.vueDetaillee)}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.draconic) categorie="Draconic"}}
{{/if}}
@ -248,7 +248,7 @@
<ul class="item-list">
<li class="item flexrow">
<span class="generic-label">Stress transformé</span>
<input class="compteur-edit" type="text" name="experience" value="{{data.compteurs.experience.value}}" data-dtype="number" size="3"/>
<input class="compteur-edit" type="text" name="experience" value="{{system.compteurs.experience.value}}" data-dtype="number" size="3"/>
</li>
<li class="item flexrow">
@ -444,13 +444,13 @@
{{!-- hautreve Tab --}}
<div class="tab hautreve " data-group="primary" data-tab="hautreve" style="height:200px">
<div>
{{#if data.attributs.hautrevant.value}}
{{#if system.attributs.hautrevant.value}}
<h3>Haut rêvant</h3>
{{else}}
<h3>Vous n'avez pas le don de haut-rêve! Il faut attribuer la Tête de Dragon 'Don de Haut Rêve' si votre personnage est ou devient Haut-Rêvant.</h3>
{{/if}}
<ul class="item-list">
{{#if data.attributs.hautrevant.value}}
{{#if system.attributs.hautrevant.value}}
{{#if options.isGM}}
<li class="item flexrow">
<span>
@ -464,23 +464,23 @@
<li class="item flexrow">
{{#if options.isGM}}
<span class="competence-label flex-shrink">Demi rêve :
<span>{{caseTmr-label data.reve.tmrpos.coord}}</span>
<span>{{caseTmr-label system.reve.tmrpos.coord}}</span>
</span>
<span>
<input class="competence-value" type="text" name="system.reve.tmrpos.coord" value="{{data.reve.tmrpos.coord}}" data-dtype="String"/>
<input class="competence-value" type="text" name="system.reve.tmrpos.coord" value="{{system.reve.tmrpos.coord}}" data-dtype="String"/>
</span>
{{else}}
<span class="competence-label flex-shrink">Demi rêve :
{{#unless hautreve.cacheTMR}}
<span>{{caseTmr-label data.reve.tmrpos.coord}}</span>
<span>{{caseTmr-label system.reve.tmrpos.coord}}</span>
{{/unless}}
</span>
<span>
{{#if hautreve.cacheTMR}}
??
{{else}}
{{data.reve.tmrpos.coord}}
{{system.reve.tmrpos.coord}}
{{/if}}
</span>
{{/if}}
@ -490,9 +490,9 @@
<span class="competence-label">Seuil de Rêve :</span>
<span>
{{#if options.isGM}}
<input class="seuil-reve-value" type="text" name="system.reve.seuil.value" value="{{data.reve.seuil.value}}" data-dtype="Number"/>
<input class="seuil-reve-value" type="text" name="system.reve.seuil.value" value="{{system.reve.seuil.value}}" data-dtype="Number"/>
{{else}}
{{data.reve.seuil.value}}
{{system.reve.seuil.value}}
{{/if}}
</span>
</li>
@ -500,9 +500,9 @@
<span class="competence-label">Refoulement : </span>
<span>
{{#if options.isGM}}
<input class="competence-value" type="text" name="system.reve.refoulement.value" value="{{data.reve.refoulement.value}}" data-dtype="Number"/>
<input class="competence-value" type="text" name="system.reve.refoulement.value" value="{{system.reve.refoulement.value}}" data-dtype="Number"/>
{{else}}
{{data.reve.refoulement.value}}
{{system.reve.refoulement.value}}
{{/if}}
</span>
</li>
@ -562,7 +562,7 @@
{{/each}}
</ul>
{{/if}}
{{#if data.attributs.hautrevant.value}}
{{#if system.attributs.hautrevant.value}}
{{#if (and options.isGM signesdraconiques.length)}}
<h3>Signes draconiques</h3>
<ul class="item-list alterne-list">
@ -676,50 +676,50 @@
<article class="flexrow">
<ul class="item-list alterne-list">
<li class="item flexrow list-item">
<label for="data.race">Race :</label>
<input class="flex-grow" type="text" name="system.race" value="{{data.race}}" data-dtype="String"/>
<label for="system.race">Race :</label>
<input class="flex-grow" type="text" name="system.race" value="{{system.race}}" data-dtype="String"/>
</li>
<li class="item flexrow list-item">
<label for="data.sexe">Sexe :</label>
<input class="flex-grow" type="text" name="system.sexe" value="{{data.sexe}}" data-dtype="String"/>
<label for="system.sexe">Sexe :</label>
<input class="flex-grow" type="text" name="system.sexe" value="{{system.sexe}}" data-dtype="String"/>
</li>
<li class="item flexrow list-item">
<label for="data.age">Age :</label>
<input class="flex-grow" type="text" name="system.age" value="{{data.age}}" data-dtype="String"/>
<label for="system.age">Age :</label>
<input class="flex-grow" type="text" name="system.age" value="{{system.age}}" data-dtype="String"/>
</li>
<li class="item flexrow list-item">
<label for="data.poids">Poids :</label>
<input class="flex-grow" type="text" name="system.poids" value="{{data.poids}}" data-dtype="String"/>
<label for="system.poids">Poids :</label>
<input class="flex-grow" type="text" name="system.poids" value="{{system.poids}}" data-dtype="String"/>
</li>
<li class="item flexrow list-item">
<label for="data.taille">Taille :</label>
<input class="flex-grow" type="text" name="system.taille" value="{{data.taille}}" data-dtype="String"/>
<label for="system.taille">Taille :</label>
<input class="flex-grow" type="text" name="system.taille" value="{{system.taille}}" data-dtype="String"/>
</li>
</ul>
<ul class="item-list alterne-list">
<li class="item flexrow list-item">
<label for="data.main">Main directrice :</label>
<input type="text" name="system.main" value="{{data.main}}" data-dtype="String"/>
<label for="system.main">Main directrice :</label>
<input type="text" name="system.main" value="{{system.main}}" data-dtype="String"/>
</li>
<li class="item flexrow list-item">
<label for="data.heure">Heure de naissance :</label>
<select type="text" name="system.heure" value="{{data.heure}}" data-dtype="String">
{{#select data.heure}}
<label for="system.heure">Heure de naissance :</label>
<select type="text" name="system.heure" value="{{system.heure}}" data-dtype="String">
{{#select system.heure}}
{{>"systems/foundryvtt-reve-de-dragon/templates/heures-select-option.html"}}
{{/select}}
</select>
</li>
<li class="item flexrow list-item">
<label>Beauté :</label>
<input type="text" value="{{data.beaute}}" data-dtype="String" disabled/>
<input type="text" value="{{system.beaute}}" data-dtype="String" disabled/>
</li>
<li class="item flexrow list-item">
<label for="data.cheveux">Cheveux :</label>
<input class="flex-grow" type="text" name="system.cheveux" value="{{data.cheveux}}" data-dtype="String"/>
<label for="system.cheveux">Cheveux :</label>
<input class="flex-grow" type="text" name="system.cheveux" value="{{system.cheveux}}" data-dtype="String"/>
</li>
<li class="item flexrow list-item">
<label for="data.yeux">Yeux :</label>
<input class="flex-grow" type="text" name="system.yeux" value="{{data.yeux}}" data-dtype="String"/>
<label for="system.yeux">Yeux :</label>
<input class="flex-grow" type="text" name="system.yeux" value="{{system.yeux}}" data-dtype="String"/>
</li>
</ul>
</article>
@ -727,16 +727,16 @@
<article class="flexcol">
<h3>Biographie : </h3>
<div class="form-group editor">
{{editor data.biographie target="system.biographie" button=true owner=owner editable=editable}}
{{editor system.biographie target="system.biographie" button=true owner=owner editable=editable}}
</div>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor data.notes target="system.notes" button=true owner=owner editable=editable}}
{{editor system.notes target="system.notes" button=true owner=owner editable=editable}}
</div>
<h3>Journal d'Experience</h3>
<div class="form-group editor">
<ul class="item-list alterne-list">
{{#each data.experiencelog as |xp key|}}
{{#each system.experiencelog as |xp key|}}
<li class="item flexrow list-item">
<label class="flex-shrink">{{xp.mode}} </label>
<label class="flex-grow">{{xp.valeur}} {{xp.raison}} </label>

View File

@ -28,38 +28,38 @@
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Catégorie</span>
<select name="system.categorie" class="categorie" data-dtype="String">
{{#select data.categorie}}
{{#select system.categorie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html"}}
{{/select}}
</select>
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Résistance</span>
<input class="competence-value flexrow" type="text" name="system.resistance" value="{{data.resistance}}" data-dtype="Number" />
<input class="competence-value flexrow" type="text" name="system.resistance" value="{{system.resistance}}" data-dtype="Number" />
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Structure</span>
<input class="competence-value flexrow" type="text" name="system.structure" value="{{data.structure}}" data-dtype="Number" />
<input class="competence-value flexrow" type="text" name="system.structure" value="{{system.structure}}" data-dtype="Number" />
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Vitesse</span>
<input class="competence-value flexrow" type="text" name="system.vitesse" value="{{data.vitesse}}" data-dtype="String" />
<input class="competence-value flexrow" type="text" name="system.vitesse" value="{{system.vitesse}}" data-dtype="String" />
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Bonus</span>
<input class="competence-value flexrow" type="text" name="system.bonus" value="{{data.bonus}}" data-dtype="String" />
<input class="competence-value flexrow" type="text" name="system.bonus" value="{{system.bonus}}" data-dtype="String" />
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Manoeuvrabilité</span>
<input class="competence-value flexrow" type="text" name="system.manoeuvrabilite" value="{{data.manoeuvrabilite}}" data-dtype="String" />
<input class="competence-value flexrow" type="text" name="system.manoeuvrabilite" value="{{system.manoeuvrabilite}}" data-dtype="String" />
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Equipage</span>
<input class="competence-value flexrow" type="text" name="system.equipage" value="{{data.equipage}}" data-dtype="Number" />
<input class="competence-value flexrow" type="text" name="system.equipage" value="{{system.equipage}}" data-dtype="Number" />
</li>
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
<span class="carac-label flexrow" name="categorie">Capacité d'Encombrement</span>
<input class="competence-value flexrow" type="text" name="system.capacite_encombrement" value="{{data.capacite_encombrement}}" data-dtype="Number" />
<input class="competence-value flexrow" type="text" name="system.capacite_encombrement" value="{{system.capacite_encombrement}}" data-dtype="Number" />
</li>
</ol>
</div>
@ -75,7 +75,7 @@
{{!-- Biography Tab --}}
<div class="tab description" data-group="primary" data-tab="description">
<div class="form-group editor">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
{{editor content=system.description target="system.description" button=true owner=owner editable=editable}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
</div>

View File

@ -6,4 +6,4 @@
{{#if vendeur}}à {{vendeur.name}}{{/if}}:
{{quantiteTotal}} {{item.name}} pour {{prixTotal}} sols.
</p>
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" item.data}}
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" item.system}}

View File

@ -1,16 +1,16 @@
<img class="chat-icon" src="{{img}}" alt="potion de repos" />
<h4>
{{alias}} a bu une <strong>{{name}}{{#if data.magique}} enchantée{{/if}}</strong>
{{alias}} a bu une <strong>{{name}}{{#if system.magique}} enchantée{{/if}}</strong>
</h4>
<hr>
<div>
{{#if data.magique}}
{{#if system.magique}}
Le Jet de Résistance est {{#if rolled.isSuccess}}réussi{{else}}échoué{{/if}}.
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
{{/if}}
<br>Les effets de la potions sont à gérer manuellement, en fonction de sa nature
{{#if data.magique}}
{{#if rolled.isEchec}}et de son enchantement ({{data.pr}} Points de Rêve)
{{#if system.magique}}
{{#if rolled.isEchec}}et de son enchantement ({{system.pr}} Points de Rêve)
{{else}}son enchantement n'a pas d'effet
{{/if}}
{{/if}}.

View File

@ -1,27 +1,27 @@
<img class="chat-icon" src="{{img}}" alt="potion de repos" />
<h4>
{{alias}} a bu une <strong>{{name}}{{#if data.magique}} enchantée{{/if}}</strong>
{{alias}} a bu une <strong>{{name}}{{#if system.magique}} enchantée{{/if}}</strong>
</h4>
<hr>
<div>
{{#if data.magique}}
{{#if system.magique}}
Le Jet de Résistance est {{#if rolled.isSuccess}}réussi{{else}}échoué{{/if}}.
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
{{#if rolled.isEchec}}
<br>La potion fait effet !
{{alias}} a perdu 1 point de rêve et s'endort pour {{guerisonDureeValue}} {{guerisonDureeUnite}} et
se récupère {{caseFatigueReel}} cases de fatigue.<br>
{{#if data.reposalchimique}}
{{#if system.reposalchimique}}
De plus, la potion étant alchimique, {{alias}} est en aphasie pendant cette durée.
{{#if aphasiePermanente}}
Malheureusement, l'aphasie est permanente tant que {{alias}} ne réussit pas un jet de VOLONTE à 0 à Chateau Dormant (le moral compte).
{{/if}}
{{/if}}
{{else}}
<br>La potion ne fait pas effet ! Elle vous octroie tout de même un bonus de {{data.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
<br>La potion ne fait pas effet ! Elle vous octroie tout de même un bonus de {{system.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
{{/if}}
{{else}}
Une fois consommée (vers fin Lyre), elle vous octroie un bonus de {{data.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
Une fois consommée (vers fin Lyre), elle vous octroie un bonus de {{system.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
{{/if}}
<br>La potion a été supprimée de l'équipement.
</div>

View File

@ -1,10 +1,10 @@
<img class="chat-icon" src="{{img}}" alt="potion de soin" />
<h4>
{{alias}} a bu une <strong>{{name}}{{#if data.magique}} enchantée{{/if}}</strong>
{{alias}} a bu une <strong>{{name}}{{#if system.magique}} enchantée{{/if}}</strong>
</h4>
<hr>
<div>
{{#if data.magique}}
{{#if system.magique}}
Le Jet de Résistance est {{#if rolled.isSuccess}}réussi{{else}}échoué{{/if}}.
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
{{#if rolled.isEchec}}
@ -16,10 +16,10 @@
{{/each}}
</ul>
{{else}}
<br>La potion ne fait pas effet ! Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{data.herbebonus}} (appliqué automatiquement).
<br>La potion ne fait pas effet ! Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{system.herbebonus}} (appliqué automatiquement).
{{/if}}
{{else}}
Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{data.herbebonus}} (appliqué automatiquement).
Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{system.herbebonus}} (appliqué automatiquement).
{{/if}}
<br>La potion a été supprimée de l'équipement.
</div>

View File

@ -1,6 +1,6 @@
<form class="skill-roll-dialog">
<div class="form-group">
<label>Fabriquer une potion de {{data.categorie}} de {{name}}</label>
<label>Fabriquer une potion de {{system.categorie}} de {{name}}</label>
</div>
<div class="form-group">

View File

@ -19,7 +19,7 @@
<div id="tableAjustements" class="flexrow"></div>
</div>
</div>
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
<div id="tableResolution"></div>
<div id="tableProbaReussite"></div>

View File

@ -8,7 +8,7 @@
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
</div>
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
</div>
<div class="flex-group-left">
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}}

View File

@ -32,7 +32,7 @@
<div id="tableAjustements" class="flexrow"></div>
</div>
</div>
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
<div id="tableResolution"></div>
<div id="tableProbaReussite"></div>
</form>

View File

@ -9,85 +9,85 @@
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="form-group">
<label for="data.competence">Compétence associée</label>
<select name="data.competence" id="competence" data-dtype="String">
{{#select data.competence}}
<label for="system.competence">Compétence associée</label>
<select name="system.competence" id="competence" data-dtype="String">
{{#select system.competence}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence.html"}}
{{/select}}
</select>
</div>
<div class="form-group">
<label for="data.dommages">Dommages </label>
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="String"/>
<label for="system.dommages">Dommages </label>
<input class="attribute-value" type="text" name="system.dommages" value="{{system.dommages}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="data.resistance">Résistance </label>
<input class="attribute-value" type="text" name="data.resistance" value="{{data.resistance}}" data-dtype="Number"/>
<label for="system.resistance">Résistance </label>
<input class="attribute-value" type="text" name="system.resistance" value="{{system.resistance}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.categorie_parade">Catégorie parade </label>
<select name="data.categorie_parade" id="categorie_parade" data-dtype="String">
{{#select data.categorie_parade}}
<label for="system.categorie_parade">Catégorie parade </label>
<select name="system.categorie_parade" id="categorie_parade" data-dtype="String">
{{#select system.categorie_parade}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html"}}
{{/select}}
</select>
</div>
<div class="form-group">
<label for="data.encombrement">Encombrement </label>
<input class="attribute-value" type="text" name="data.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<label for="system.encombrement">Encombrement </label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.force">Force min. </label>
<input class="attribute-value" type="text" name="data.force" value="{{data.force}}" data-dtype="String"/>
<label for="system.force">Force min. </label>
<input class="attribute-value" type="text" name="system.force" value="{{system.force}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="data.rapide">Arme rapide ? </label>
<input class="attribute-value" type="checkbox" name="data.rapide" {{#if data.rapide}}checked{{/if}}/>
<label for="system.rapide">Arme rapide ? </label>
<input class="attribute-value" type="checkbox" name="system.rapide" {{#if system.rapide}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="data.unemain">A Une main ? </label>
<input class="attribute-value" type="checkbox" name="data.unemain" {{#if data.unemain}}checked{{/if}}/>
<label for="system.unemain">A Une main ? </label>
<input class="attribute-value" type="checkbox" name="system.unemain" {{#if system.unemain}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="data.deuxmains">A Deux mains ? </label>
<input class="attribute-value" type="checkbox" name="data.deuxmains" {{#if data.deuxmains}}checked{{/if}}/>
<label for="system.deuxmains">A Deux mains ? </label>
<input class="attribute-value" type="checkbox" name="system.deuxmains" {{#if system.deuxmains}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="data.portee_courte">Portée courte </label>
<input class="attribute-value" type="text" name="data.portee_courte" value="{{data.portee_courte}}" data-dtype="Number"/>
<label for="system.portee_courte">Portée courte </label>
<input class="attribute-value" type="text" name="system.portee_courte" value="{{system.portee_courte}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.portee_moyenne">Portée moyenne </label>
<input class="attribute-value" type="text" name="data.portee_moyenne" value="{{data.portee_moyenne}}" data-dtype="Number"/>
<label for="system.portee_moyenne">Portée moyenne </label>
<input class="attribute-value" type="text" name="system.portee_moyenne" value="{{system.portee_moyenne}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.portee_extreme">Portée extrême </label>
<input class="attribute-value" type="text" name="data.portee_extreme" value="{{data.portee_extreme}}" data-dtype="Number"/>
<label for="system.portee_extreme">Portée extrême </label>
<input class="attribute-value" type="text" name="system.portee_extreme" value="{{system.portee_extreme}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.penetration">Pénétration </label>
<input class="attribute-value" type="text" name="data.penetration" value="{{data.penetration}}" data-dtype="Number"/>
<label for="system.penetration">Pénétration </label>
<input class="attribute-value" type="text" name="system.penetration" value="{{system.penetration}}" data-dtype="Number"/>
</div>
<div class="form-group item-cout">
<label for="data.cout">Prix (sols) </label>
<input class="attribute-value" type="text" name="data.cout" value="{{data.cout}}" data-dtype="Number"/>
<label for="system.cout">Prix (sols) </label>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.magique">Magique ? </label>
<input class="attribute-value" type="checkbox" name="data.magique" {{#if data.magique}}checked{{/if}}/>
<label for="system.magique">Magique ? </label>
<input class="attribute-value" type="checkbox" name="system.magique" {{#if system.magique}}checked{{/if}}/>
</div>
<div class="form-group item-magique">
<label for="data.resistance_magique">Résistance magique </label>
<input class="attribute-value" type="text" name="data.resistance_magique" value="{{data.resistance_magique}}" data-dtype="Number"/>
<label for="system.resistance_magique">Résistance magique </label>
<input class="attribute-value" type="text" name="system.resistance_magique" value="{{system.resistance_magique}}" data-dtype="Number"/>
</div>
<div class="form-group item-magique">
<label for="data.ecaille_efficacite">Nombre d'Ecailles d'Efficacité </label>
<input class="attribute-value" type="text" name="data.ecaille_efficacite" value="{{data.ecaille_efficacite}}" data-dtype="Number"/>
<label for="system.ecaille_efficacite">Nombre d'Ecailles d'Efficacité </label>
<input class="attribute-value" type="text" name="system.ecaille_efficacite" value="{{system.ecaille_efficacite}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="data.initpremierround">Classe d'initiative au premier round (mêlée seulement) </label>
<select name="data.initpremierround" id="initpremierround" data-dtype="String">
{{#select data.initpremierround}}
<label for="system.initpremierround">Classe d'initiative au premier round (mêlée seulement) </label>
<select name="system.initpremierround" id="initpremierround" data-dtype="String">
{{#select system.initpremierround}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.html"}}
{{/select}}
</select>

View File

@ -10,23 +10,23 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Protection</label>
<input class="attribute-value" type="text" name="data.protection" value="{{data.protection}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.protection" value="{{system.protection}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Encombrement </label>
<input class="attribute-value" type="text" name="data.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Détérioration</label>
<input class="attribute-value" type="text" name="data.deterioration" value="{{data.deterioration}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.deterioration" value="{{system.deterioration}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Malus Armure </label>
<input class="attribute-value" type="text" name="data.malus" value="{{data.malus}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.malus" value="{{system.malus}}" data-dtype="Number"/>
</div>
<div class="form-group item-cout">
<label for="xp">Prix (sols) </label>
<input class="attribute-value" type="text" name="data.cout" value="{{data.cout}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,12 +10,12 @@
<section class="sheet-body">
<div class="form-group">
<label for="niveau">Coordonnées TMR </label>
<input class="attribute-value" type="text" name="data.coord" value="{{data.coord}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.coord" value="{{system.coord}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="niveau">Mode spécifique</label>
<select name="data.specific" id="specific" data-dtype="String">
{{#select data.specific}}
<select name="system.specific" id="specific" data-dtype="String">
{{#select system.specific}}
{{>"systems/foundryvtt-reve-de-dragon/templates/casetmr-specific-list.html"}}
{{/select}}
</select>

View File

@ -10,11 +10,11 @@
<section class="sheet-body">
<div class="form-group">
<label class="alchimie-title" for="xp">Niveau</label>
<input class="attribute-value" type="text" name="data.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="data.reference" value="{{data.reference}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.reference" value="{{system.reference}}" data-dtype="String"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -17,52 +17,52 @@
<div class="form-group">
<label>Catégorie </label>
<select name="system.categorie" class="categorie" data-dtype="String">
{{#select data.categorie}}
{{#select system.categorie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-competence.html"}}
{{/select}}
</select>
</div>
<div class="form-group">
<label for="niveau">Niveau </label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">XP </label>
<input class="attribute-value sheet-competence-xp" type="text" name="system.xp" value="{{data.xp}}" data-dtype="Number"/>
<input class="attribute-value sheet-competence-xp" type="text" name="system.xp" value="{{system.xp}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="base">Niveau de base </label>
{{#if isGM}}
<select name="system.base" id="base" data-dtype="Number">
{{#select data.base}}
{{#select system.base}}
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-base.html"}}
{{/select}}
</select>
{{else}}
<label id="base">{{data.base}}</label>
<label id="base">{{system.base}}</label>
{{/if}}
</div>
<div class="form-group">
<label for="defaut_carac">Caractéristique par défaut </label>
<select name="system.defaut_carac" id="defaut_carac" data-dtype="String">
{{#select data.defaut_carac}}
{{#select system.defaut_carac}}
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html"}}
{{/select}}
</select>
</div>
<div class="form-group">
<label for="default_diffLibre">Difficulté libre par défaut</label>
<input class="attribute-value" type="text" name="system.default_diffLibre" value="{{data.default_diffLibre}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.default_diffLibre" value="{{system.default_diffLibre}}" data-dtype="Number"/>
</div>
{{#if (eq data.categorie 'draconic')}}
{{#if (eq system.categorie 'draconic')}}
<div class="form-group">
<label for="xp">XP Sort </label>
<input class="attribute-value" type="text" name="system.xp_sort" value="{{data.xp_sort}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.xp_sort" value="{{system.xp_sort}}" data-dtype="Number"/>
</div>
{{/if}}
<div class="form-group">
<label for="niveau_archetype">Niveau d'Archetype</label>
<input class="attribute-value" type="text" name="system.niveau_archetype" value="{{data.niveau_archetype}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau_archetype" value="{{system.niveau_archetype}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,39 +10,39 @@
<section class="sheet-body">
<div class="form-group">
<label for="niveau">Niveau </label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="niveau">Valeur de Caractéristique </label>
<input class="attribute-value" type="text" name="system.carac_value" value="{{data.carac_value}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.carac_value" value="{{system.carac_value}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="default_diffLibre">Difficulté libre par défaut</label>
<input class="attribute-value" type="text" name="system.default_diffLibre" value="{{data.default_diffLibre}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.default_diffLibre" value="{{system.default_diffLibre}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Arme ? </label>
<input class="attribute-value" type="checkbox" name="system.iscombat" {{#if data.iscombat}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.iscombat" {{#if system.iscombat}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Parade ? </label>
<input class="attribute-value" type="checkbox" name="system.isparade" {{#if data.isparade}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.isparade" {{#if system.isparade}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Possession ? </label>
<input class="attribute-value" type="checkbox" name="system.ispossession" {{#if data.ispossession}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.ispossession" {{#if system.ispossession}}checked{{/if}}/>
</div>
<div class="form-group">
<label>Catégorie parade </label>
<select name="system.categorie_parade" id="categorie_parade" data-dtype="String">
{{#select data.categorie_parade}}
{{#select system.categorie_parade}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html"}}
{{/select}}
</select>
</div>
<div class="form-group">
<label for="niveau">Dommages (+dom), si applicable </label>
<input class="attribute-value" type="text" name="system.dommages" value="{{data.dommages}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.dommages" value="{{system.dommages}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,19 +10,19 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Encombrement </label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Capacite (points d'Encombrement portable)</label>
<input class="attribute-value" type="text" name="system.capacite" value="{{data.capacite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.capacite" value="{{system.capacite}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Qualité</label>
<input class="attribute-value" type="text" name="system.qualite" value="{{data.qualite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"/>
</div>
<div class="form-group item-cout">
<label for="xp">Prix (sols) </label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
</div>
{{#if isOwned}}
<div class="flexcol">

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label class="alchimie-title" for="xp">Type</label>
<select name="system.type" data-dtype="String">
{{#select data.type}}
{{#select system.type}}
<option value="recreative">Récréative</option>
<option value="soliste">Soliste</option>
{{/select}}
@ -19,19 +19,19 @@
</div>
<div class="form-group">
<label class="alchimie-title" for="xp">Agilité ?</label>
<input class="attribute-value" type="checkbox" name="system.agilite" {{#if data.agilite}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.agilite" {{#if system.agilite}}checked{{/if}}/>
</div>
<div class="form-group">
<label class="alchimie-title" for="xp">Apparence ?</label>
<input class="attribute-value" type="checkbox" name="system.apparence" {{#if data.apparence}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.apparence" {{#if system.apparence}}checked{{/if}}/>
</div>
<div class="form-group">
<label class="alchimie-title" for="xp">Niveau</label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="system.reference" value="{{data.reference}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.reference" value="{{system.reference}}" data-dtype="String"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -11,42 +11,42 @@
<div class="form-group">
<label>Type</label>
<select name="system.type" id="type" data-dtype="String">
{{#select data.type}}
{{#select system.type}}
{{{gemmeTypeList}}}
{{/select}}
</select>
</div>
<div class="form-group">
<label>Taille</label>
<input class="attribute-value" type="text" name="system.taille" value="{{data.taille}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.taille" value="{{system.taille}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Pureté</label>
<input class="attribute-value" type="text" name="system.purete" value="{{data.purete}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.purete" value="{{system.purete}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Qualité</label>
<input class="attribute-value" type="text" name="system.qualite" value="{{data.qualite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Encombrement</label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Quantité</label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Inertie</label>
<input class="attribute-value" type="text" name="system.inertie" value="{{data.inertie}}" data-dtype="Number" disabled/>
<input class="attribute-value" type="text" name="system.inertie" value="{{system.inertie}}" data-dtype="Number" disabled/>
</div>
<div class="form-group">
<label>Enchantabilité</label>
<input class="attribute-value" type="text" name="system.enchantabilite" value="{{data.enchantabilite}}" data-dtype="Number" disabled/>
<input class="attribute-value" type="text" name="system.enchantabilite" value="{{system.enchantabilite}}" data-dtype="Number" disabled/>
</div>
<div class="form-group">
<label>Prix</label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number" disabled/>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" disabled/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -16,24 +16,24 @@
<div class="flexcol">
<div class="form-group">
<label>Niveau (si applicable)</label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Quantité (Pépins ou Brins)</label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group item-cout">
<label>Prix (sols)</label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Milieu</label>
<input class="attribute-value" type="text" name="system.milieu" value="{{data.milieu}}" data-dtype="String" />
<input class="attribute-value" type="text" name="system.milieu" value="{{system.milieu}}" data-dtype="String" />
</div>
<div class="form-group">
<label>Fréquence</label>
<select name="system.rarete" class="rarete" data-dtype="String">
{{#select data.rarete}}
{{#select system.rarete}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html"}}
{{/select}}
</select>
@ -41,7 +41,7 @@
<div class="form-group">
<label>Catégorie</label>
<select name="system.categorie" class="categorie" data-dtype="String">
{{#select data.categorie}}
{{#select system.categorie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html"}}
{{/select}}
</select>

View File

@ -11,29 +11,29 @@
<div class="flexcol">
<div class="form-group">
<label>Niveau (si applicable) </label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Quantité (Pépins ou Brins)</label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Encombrement</label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number" />
</div>
<div class="form-group item-cout">
<label>Prix (sols)</label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
</div>
</div>
<div class="form-group">
<label>Milieu</label>
<input class="attribute-value" type="text" name="system.milieu" value="{{data.milieu}}" data-dtype="String" />
<input class="attribute-value" type="text" name="system.milieu" value="{{system.milieu}}" data-dtype="String" />
</div>
<div class="form-group">
<label>Fréquence</label>
<select name="system.rarete" class="rarete" data-dtype="String">
{{#select data.rarete}}
{{#select system.rarete}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html"}}
{{/select}}
</select>
@ -41,7 +41,7 @@
<div class="form-group">
<label>Catégorie</label>
<select name="system.categorie" class="categorie" data-dtype="String">
{{#select data.categorie}}
{{#select system.categorie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html"}}
{{/select}}
</select>

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label class="alchimie-title" for="xp">Type</label>
<select name="system.type" data-dtype="String">
{{#select data.type}}
{{#select system.type}}
<option value="adressehasard">Adresse/Hasard</option>
<option value="de">Dés</option>
<option value="carte">Cartes</option>
@ -21,15 +21,15 @@
</div>
<div class="form-group">
<label class="alchimie-title" for="xp">Base</label>
<input class="attribute-value" type="text" name="system.base" value="{{data.base}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.base" value="{{system.base}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label class="alchimie-title" for="xp">Caractéristique/Compétence</label>
<input class="attribute-value" type="text" name="system.caraccomp" value="{{data.caraccomp}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.caraccomp" value="{{system.caraccomp}}" data-dtype="String"/>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="system.reference" value="{{data.reference}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.reference" value="{{system.reference}}" data-dtype="String"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -15,12 +15,12 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Auteur</label>
<input class="attribute-value" type="text" name="system.auteur" value="{{data.auteur}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.auteur" value="{{system.auteur}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select data.competence}}
{{#select system.competence}}
{{#each competences as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
@ -29,35 +29,35 @@
</div>
<div class="form-group">
<label for="xp">Difficulté</label>
<input class="attribute-value" type="number" name="system.difficulte" value="{{data.difficulte}}" data-dtype="Number"/>
<input class="attribute-value" type="number" name="system.difficulte" value="{{system.difficulte}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Points de tâches</label>
<input class="attribute-value" type="number" name="system.points_de_tache" value="{{data.points_de_tache}}" data-dtype="Number"/>
<input class="attribute-value" type="number" name="system.points_de_tache" value="{{system.points_de_tache}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Expérience</label>
<input class="attribute-value" type="number" name="system.xp" value="{{data.xp}}" data-dtype="Number"/>
<input class="attribute-value" type="number" name="system.xp" value="{{system.xp}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Niveau minimum</label>
<input class="attribute-value" type="text" name="system.niveau_minimum" value="{{data.niveau_minimum}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau_minimum" value="{{system.niveau_minimum}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Niveau maximum</label>
<input class="attribute-value" type="text" name="system.niveau_maximum" value="{{data.niveau_maximum}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau_maximum" value="{{system.niveau_maximum}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Encombrement </label>
<input class="attribute-value" type="number" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<input class="attribute-value" type="number" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Quantité </label>
<input class="attribute-value" type="number" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="number" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group item-cout">
<label for="xp">Prix (sols) </label>
<input class="attribute-value" type="number" name="system.cout" value="{{data.cout}}" data-dtype="Number"/>
<input class="attribute-value" type="number" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -2,7 +2,7 @@
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
{{#if (or isGM data.identifie)}}
{{#if (or isGM system.identifie)}}
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
{{else}}
<h1 class="charname">Inconnue</h1>
@ -12,31 +12,31 @@
{{!-- Sheet Body --}}
<section class="sheet-body">
{{#if (or isGM data.identifie)}}
{{#if (or isGM system.identifie)}}
<div class="form-group">
<label for="xp">Identifiée ? </label>
<input class="attribute-value" type="checkbox" name="system.identifie" {{#if data.identifie}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.identifie" {{#if system.identifie}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Malignité </label>
<input class="attribute-value" type="text" name="system.malignite" value="{{data.malignite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.malignite" value="{{system.malignite}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Périodicité</label>
<input class="attribute-value" type="text" name="system.periodicite" value="{{data.periodicite}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.periodicite" value="{{system.periodicite}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Dommages</label>
<input class="attribute-value" type="text" name="system.dommages" value="{{data.dommages}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.dommages" value="{{system.dommages}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Remedes Connus ? </label>
<input class="attribute-value" type="checkbox" name="system.remedesconnus" {{#if data.remedesconnus}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.remedesconnus" {{#if system.remedesconnus}}checked{{/if}}/>
</div>
{{#if (or isGM data.remedesconnus)}}
{{#if (or isGM system.remedesconnus)}}
<div class="form-group">
<label for="xp">Remèdes </label>
<input class="attribute-value" type="text" name="system.remedes" value="{{data.remedes}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.remedes" value="{{system.remedes}}" data-dtype="String"/>
</div>
{{/if}}
{{/if}}

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label for="xp">Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select data.competence}}
{{#select system.competence}}
{{#each competences as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
@ -20,36 +20,36 @@
</div>
<div class="form-group">
<label for="xp">Thème</label>
<input class="attribute-value" type="text" name="system.theme" value="{{data.theme}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.theme" value="{{system.theme}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Support</label>
<input class="attribute-value" type="text" name="system.support" value="{{data.support}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.support" value="{{system.support}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Heure</label>
<select name="system.heure" id="heure" data-dtype="String">
{{#select data.heure}}
{{#select system.heure}}
{{>"systems/foundryvtt-reve-de-dragon/templates/heures-select-option.html"}}
{{/select}}
</select>
</div>
<div class="form-group">
<label for="xp">Purification</label>
<input class="attribute-value" type="text" name="system.purification" value="{{data.purification}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.purification" value="{{system.purification}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Vêture</label>
<input class="attribute-value" type="text" name="system.veture" value="{{data.veture}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.veture" value="{{system.veture}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Comportement</label>
<input class="attribute-value" type="text" name="system.comportement" value="{{data.comportement}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.comportement" value="{{system.comportement}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Case TMR</label>
<select name="system.tmr" id="tmr" data-dtype="String">
{{#select data.tmr}}
{{#select system.tmr}}
{{>"systems/foundryvtt-reve-de-dragon/templates/sort-tmr.html"}}
{{/select}}
</select>
@ -58,7 +58,7 @@
<label for="xp">Malus</label>
{{#if isGM}}
<select name="system.malus" id="malus" data-dtype="Number">
{{#select data.malus}}
{{#select system.malus}}
<option value="0">0</option>
<option value="-1">-1</option>
<option value="-2">-2</option>
@ -73,7 +73,7 @@
{{/select}}
</select>
{{else}}
<label>>{{data.malus}}</label>
<label>>{{system.malus}}</label>
{{/if}}
</div>

View File

@ -10,19 +10,19 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Quantité</label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Valeur en Deniers</label>
{{#if isGM}}
<input class="attribute-value" type="text" name="system.valeur_deniers" value="{{data.valeur_deniers}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.valeur_deniers" value="{{system.valeur_deniers}}" data-dtype="Number"/>
{{else}}
<label for="xp">{{data.valeur_deniers}}</label>
<label for="xp">{{system.valeur_deniers}}</label>
{{/if}}
</div>
<div class="form-group">
<label for="xp">Encombrement</label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,19 +10,19 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Encombrement </label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Quantité </label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="xp">Qualité</label>
<input class="attribute-value" type="text" name="system.qualite" value="{{data.qualite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"/>
</div>
<div class="form-group item-cout">
<label for="xp">Prix (sols) </label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,11 +10,11 @@
<section class="sheet-body">
<div class="form-group">
<label class="alchimie-title" for="xp">Niveau</label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="system.reference" value="{{data.reference}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.reference" value="{{system.reference}}" data-dtype="String"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,19 +10,19 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Nombre</label>
<input class="attribute-value" type="text" name="system.value" value="{{data.value}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.value" value="{{system.value}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Nombre valide ? </label>
<input class="attribute-value" type="checkbox" name="system.istrue" {{#if data.istrue}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.istrue" {{#if system.istrue}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Index du jour concerné</label>
<input class="attribute-value" type="text" name="system.jourindex" value="{{data.jourindex}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.jourindex" value="{{system.jourindex}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Label du jour</label>
<input class="attribute-value" type="text" name="system.jourlabel" value="{{data.jourlabel}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.jourlabel" value="{{system.jourlabel}}" data-dtype="String"/>
</div>
</section>

View File

@ -9,49 +9,49 @@
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="form-group">
<label for="data.sust">Sustentation</label>
<input class="attribute-value" type="text" name="system.sust" value="{{data.sust}}" data-dtype="Number" />
<label for="system.sust">Sustentation</label>
<input class="attribute-value" type="text" name="system.sust" value="{{system.sust}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="data.boisson">Boisson</label>
<input class="attribute-value" type="checkbox" name="system.boisson" {{#if data.boisson}}checked{{/if}} />
<label for="system.boisson">Boisson</label>
<input class="attribute-value" type="checkbox" name="system.boisson" {{#if system.boisson}}checked{{/if}} />
</div>
{{#if data.boisson}}
{{#if system.boisson}}
<div class="form-group">
<label for="data.desaltere">Désaltère de</label>
<input class="attribute-value" type="text" name="system.desaltere" value="{{data.desaltere}}" data-dtype="Number" />
<label for="system.desaltere">Désaltère de</label>
<input class="attribute-value" type="text" name="system.desaltere" value="{{system.desaltere}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="data.alcoolise">Alcoolisée</label>
<input class="attribute-value" type="checkbox" name="system.alcoolise" {{#if data.alcoolise}}checked{{/if}} />
<label for="system.alcoolise">Alcoolisée</label>
<input class="attribute-value" type="checkbox" name="system.alcoolise" {{#if system.alcoolise}}checked{{/if}} />
</div>
{{#if data.alcoolise}}
{{#if system.alcoolise}}
<div class="form-group">
<label>Force de l'alcool par dose</label>
<input class="attribute-value" type="text" name="system.force" value="{{data.force}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.force" value="{{system.force}}" data-dtype="Number" />
</div>
{{/if}}
{{/if}}
<div class="form-group">
<label for="data.qualite">Qualité</label>
<input class="attribute-value" type="text" name="dasystemta.qualite" value="{{data.qualite}}" data-dtype="Number" />
<label for="system.qualite">Qualité</label>
<input class="attribute-value" type="text" name="dasystemta.qualite" value="{{system.qualite}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="data.exotisme">Exotisme</label>
<input class="attribute-value" type="text" name="system.exotisme" value="{{data.exotisme}}" data-dtype="Number" />
<label for="system.exotisme">Exotisme</label>
<input class="attribute-value" type="text" name="system.exotisme" value="{{system.exotisme}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="data.encombrement">Encombrement</label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}"
<label for="system.encombrement">Encombrement</label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}"
data-dtype="Number" />
</div>
<div class="form-group">
<label for="data.quantite">Quantité</label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<label for="system.quantite">Quantité</label>
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group item-cout">
<label for="data.cout">Prix (sols) </label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number" />
<label for="system.cout">Prix (sols) </label>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,23 +10,23 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Encombrement </label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Quantité </label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="xp">Résistance</label>
<input class="attribute-value" type="text" name="system.resistance" value="{{data.resistance}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.resistance" value="{{system.resistance}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Qualité</label>
<input class="attribute-value" type="text" name="system.qualite" value="{{data.qualite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.qualite" value="{{system.qualite}}" data-dtype="Number"/>
</div>
<div class="form-group item-cout">
<label for="xp">Prix (sols) </label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label>Caractéristique</label>
<select name="system.default_carac" id="default_carac" data-dtype="String">
{{#select data.default_carac}}
{{#select system.default_carac}}
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html"}}
{{/select}}
</select>
@ -19,7 +19,7 @@
<div class="form-group">
<label>Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select data.competence}}
{{#select system.competence}}
{{#each competences as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
@ -28,11 +28,11 @@
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="system.reference" value="{{data.reference}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.reference" value="{{system.reference}}" data-dtype="String"/>
</div>
<div class="form-group">
<label>Niveau</label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,7 +10,7 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Refoulement</label>
<input class="attribute-value" type="text" name="system.refoulement" value="{{data.refoulement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.refoulement" value="{{system.refoulement}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -2,7 +2,7 @@
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
{{#if (or isGM data.identifie)}}
{{#if (or isGM system.identifie)}}
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
{{else}}
<h1 class="charname">Inconnue</h1>
@ -14,33 +14,33 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Actif ? </label>
<input class="attribute-value" type="checkbox" name="system.active" {{#if data.active}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.active" {{#if system.active}}checked{{/if}}/>
</div>
{{#if (or isGM data.identifie)}}
{{#if (or isGM system.identifie)}}
<div class="form-group">
<label for="xp">Identifiée ? </label>
<input class="attribute-value" type="checkbox" name="system.identifie" {{#if data.identifie}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.identifie" {{#if system.identifie}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Malignité </label>
<input class="attribute-value" type="text" name="system.malignite" value="{{data.malignite}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.malignite" value="{{system.malignite}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Périodicité</label>
<input class="attribute-value" type="text" name="system.periodicite" value="{{data.periodicite}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.periodicite" value="{{system.periodicite}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Dommages</label>
<input class="attribute-value" type="text" name="system.dommages" value="{{data.dommages}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.dommages" value="{{system.dommages}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Remedes Connus ? </label>
<input class="attribute-value" type="checkbox" name="system.remedesconnus" {{#if data.remedesconnus}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.remedesconnus" {{#if system.remedesconnus}}checked{{/if}}/>
</div>
{{#if (or isGM data.remedesconnus)}}
{{#if (or isGM system.remedesconnus)}}
<div class="form-group">
<label for="xp">Remèdes </label>
<input class="attribute-value" type="text" name="system.remedes" value="{{data.remedes}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.remedes" value="{{system.remedes}}" data-dtype="String"/>
</div>
{{/if}}
{{/if}}

View File

@ -10,15 +10,15 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Type de possession </label>
<input class="attribute-value" type="text" name="system.typepossession" value="{{data.typepossession}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.typepossession" value="{{system.typepossession}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Possédé ? </label>
<input class="attribute-value" type="checkbox" name="system.istrue" {{#if data.istrue}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.istrue" {{#if system.istrue}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Compteur </label>
<input class="attribute-value" type="text" name="system.compteur" value="{{data.compteur}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.compteur" value="{{system.compteur}}" data-dtype="Number"/>
</div>

View File

@ -15,20 +15,20 @@
<section class="sheet-body">
<div class="form-group">
<label>Encombrement</label>
<input class="attribute-value" type="text" name="system.encombrement" value="{{data.encombrement}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.encombrement" value="{{system.encombrement}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Quantité </label>
<input class="attribute-value" type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.quantite" value="{{system.quantite}}" data-dtype="Number" />
</div>
<div class="form-group item-cout">
<label>Prix (sols)</label>
<input class="attribute-value" type="text" name="system.cout" value="{{data.cout}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.cout" value="{{system.cout}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Fréquence</label>
<select name="system.rarete" class="rarete" data-dtype="String">
{{#select data.rarete}}
{{#select system.rarete}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html"}}
{{/select}}
</select>
@ -36,7 +36,7 @@
<div class="form-group">
<label>Catégorie</label>
<select name="system.categorie" class="categoriepotion" data-dtype="String">
{{#select data.categorie}}
{{#select system.categorie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-potion.html"}}
{{/select}}
</select>
@ -45,46 +45,46 @@
<div class="form-group">
<label>Herbe</label>
<select name="system.herbe" class="herbe" data-dtype="String">
{{selectOptions herbesSoins selected=data.herbe localize=false}}
{{selectOptions herbesSoins selected=system.herbe localize=false}}
</select>
</div>
<div class="form-group">
<label>Nombre de brins</label>
<input class="attribute-value" type="text" name="system.herbebrins" value="{{data.herbebrins}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.herbebrins" value="{{system.herbebrins}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Bonus</label>
<input class="attribute-value" type="text" name="system.herbebonus" value="{{data.herbebonus}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.herbebonus" value="{{system.herbebonus}}" data-dtype="Number" />
</div>
{{/if}}
{{#if isRepos}}
<div class="form-group">
<label>Herbe</label>
<select name="system.herbe" class="herbe" data-dtype="String">
{{selectOptions herbesRepos selected=data.herbe localize=false}}
{{selectOptions herbesRepos selected=system.herbe localize=false}}
</select>
</div>
<div class="form-group">
<label>Nombre de brins</label>
<input class="attribute-value" type="text" name="system.herbebrins" value="{{data.herbebrins}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.herbebrins" value="{{system.herbebrins}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Bonus</label>
<input class="attribute-value" type="text" name="system.herbebonus" value="{{data.herbebonus}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.herbebonus" value="{{system.herbebonus}}" data-dtype="Number" />
</div>
<div class="form-group">
<label>Repos Alchimique ?</label>
<input class="attribute-value" type="checkbox" name="system.reposalchimique" {{#if data.reposalchimique}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.reposalchimique" {{#if system.reposalchimique}}checked{{/if}}/>
</div>
{{/if}}
{{#if data.magique}}
{{#if system.magique}}
<div class="form-group">
<label>Points de rêve</label>
<input class="attribute-value" type="text" name="system.pr" value="{{data.pr}}" data-dtype="Number" />
<input class="attribute-value" type="text" name="system.pr" value="{{system.pr}}" data-dtype="Number" />
</div>
<div class="form-group">
<label for="xp">Permanente ? </label>
<input class="attribute-value" type="checkbox" name="system.prpermanent" {{#if data.prpermanent}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.prpermanent" {{#if system.prpermanent}}checked{{/if}}/>
</div>
{{#if isHerbe}}
<div class="form-group">

View File

@ -10,7 +10,7 @@
<section class="sheet-body">
<div class="form-group">
<label for="xp">Refoulement</label>
<input class="attribute-value" type="text" name="system.refoulement" value="{{data.refoulement}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.refoulement" value="{{system.refoulement}}" data-dtype="Number"/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -10,30 +10,30 @@
<section class="sheet-body">
<div class="form-group">
<label class="alchimie-title" for="xp">But</label>
<input class="attribute-value" type="text" name="system.but" value="{{data.but}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.but" value="{{system.but}}" data-dtype="String"/>
</div>
<div class="flexcol">
<span><label class="alchimie-title">Manipulation : </label></span>
<div class="form-group medium-editor">
{{editor data.manipulation_update target="system.manipulation" button=true owner=owner editable=editable}}
{{editor system.manipulation_update target="system.manipulation" button=true owner=owner editable=editable}}
</div>
</div>
<div class="flexcol">
<span><label class="alchimie-title">Utilisation : </label></span>
<div class="form-group small-editor">
{{editor data.utilisation target="system.utilisation" button=true owner=owner editable=editable}}
{{editor system.utilisation target="system.utilisation" button=true owner=owner editable=editable}}
</div>
</div>
<div class="flexcol">
<span><label class="alchimie-title">Enchantement : </label></span>
<div class="form-group small-editor">
{{editor data.enchantement target="system.enchantement" button=true owner=owner editable=editable}}
{{editor system.enchantement target="system.enchantement" button=true owner=owner editable=editable}}
</div>
</div>
<div class="flexcol">
<span><label class="alchimie-title">Sur-effet : </label></span>
<div class="form-group small-editor">
{{editor data.sureffet target="system.sureffet" button=true owner=owner editable=editable}}
{{editor system.sureffet target="system.sureffet" button=true owner=owner editable=editable}}
</div>
</div>

View File

@ -10,28 +10,28 @@
<section class="sheet-body">
<div class="form-group">
<label>Niveau</label>
<input class="attribute-value" type="text" name="system.niveau" value="{{data.niveau}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Durée</label>
<input class="attribute-value" type="text" name="system.duree" value="{{data.duree}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.duree" value="{{system.duree}}" data-dtype="String"/>
</div>system
<div class="form-group">
<label>Sust</label>
<input class="attribute-value" type="text" name="system.sust" value="{{data.sust}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.sust" value="{{system.sust}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Exotisme</label>
<input class="attribute-value" type="text" name="system.exotisme" value="{{data.exotisme}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.exotisme" value="{{system.exotisme}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="system.reference" value="{{data.reference}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.reference" value="{{system.reference}}" data-dtype="String"/>
</div>
<div class="flexcol">
<span><label>Ingrédients : </label></span>
<div class="form-group editor">
{{editor data.ingredients target="system.ingredients" button=true owner=owner editable=editable}}
{{editor system.ingredients target="system.ingredients" button=true owner=owner editable=editable}}
</div>
</div>

View File

@ -5,11 +5,11 @@
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
<div class="resource">
<label>Quantity</label>
<input type="text" name="system.quantity" value="{{data.quantity}}" data-dtype="Number"/>
<input type="text" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</div>
<div class="resource">
<label>Weight</label>
<input type="text" name="system.weight" value="{{data.weight}}" data-dtype="Number"/>
<input type="text" name="system.weight" value="{{system.weight}}" data-dtype="Number"/>
</div>
</div>
</header>
@ -25,7 +25,7 @@
{{!-- Description Tab --}}
<div class="tab" data-group="primary" data-tab="description">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor system.description target="system.description" button=true owner=owner editable=editable}}
</div>
{{!-- Attributes Tab --}}
@ -39,7 +39,7 @@
</header>
<ol class="attributes-list">
{{#each data.attributes as |attr key|}}
{{#each system.attributes as |attr key|}}
<li class="attribute flexrow" data-attribute="{{key}}">
<input class="attribute-key" type="text" name="system.attributes.{{key}}.key" value="{{key}}"/>
{{#if attr.isCheckbox}}

View File

@ -10,31 +10,31 @@
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="form-group">
<label for="data.difficulte">Difficulte</label>
<input class="attribute-value" type="number" name="system.difficulte" value="{{data.difficulte}}"
<label for="system.difficulte">Difficulte</label>
<input class="attribute-value" type="number" name="system.difficulte" value="{{system.difficulte}}"
data-dtype="Number" />
</div>
<div class="form-group">
<label for="data.valeur.norm">Expérience en sorts</label>
<label for="system.valeur.norm">Expérience en sorts</label>
<div class="flexrow">
<input class="signe-xp-sort" type="number" name="system.valeur.norm" data-typereussite="norm"
value="{{data.valeur.norm}}" min="1" max="100" data-dtype="Number" />
value="{{system.valeur.norm}}" min="1" max="100" data-dtype="Number" />
<span>Sign.</span>
<input class="signe-xp-sort" type="number" name="system.valeur.sign" data-typereussite="sign"
value="{{data.valeur.sign}}" min="1" max="100" data-dtype="Number" />
value="{{system.valeur.sign}}" min="1" max="100" data-dtype="Number" />
<span>Part.</span>
<input class="signe-xp-sort" type="number" name="system.valeur.part" data-typereussite="part"
value="{{data.valeur.part}}" min="1" max="100" data-dtype="Number" />
value="{{system.valeur.part}}" min="1" max="100" data-dtype="Number" />
</div>
</div>
<div class="form-group">
<label for="data.ephemere">Ephémère</label>
<input class="attribute-value" type="checkbox" name="system.ephemere" {{#if data.ephemere}}checked{{/if}} />
<label for="system.ephemere">Ephémère</label>
<input class="attribute-value" type="checkbox" name="system.ephemere" {{#if system.ephemere}}checked{{/if}} />
</div>
{{#if data.ephemere}}
{{#if system.ephemere}}
<div class="form-group">
<label for="data.duree">Durée</label>
<input class="attribute-value" type="text" name="system.duree" value="{{data.duree}}" data-dtype="String" />
<label for="system.duree">Durée</label>
<input class="attribute-value" type="text" name="system.duree" value="{{system.duree}}" data-dtype="String" />
</div>
{{/if}}
<div class="form-group">

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label>Draconic </label>
<select name="system.draconic" id="draconic" data-dtype="String">
{{#select data.draconic}}
{{#select system.draconic}}
{{>"systems/foundryvtt-reve-de-dragon/templates/sort-draconic.html"}}
{{/select}}
</select>
@ -19,7 +19,7 @@
<div class="form-group">
<label for="xp">Case TMR </label>
<select name="system.caseTMR" id="caseTMR" data-dtype="String">
{{#select data.caseTMR}}
{{#select system.caseTMR}}
{{>"systems/foundryvtt-reve-de-dragon/templates/sort-tmr.html"}}
<option value="special">Case spéciale TMR (saisie ci-dessous)</option>
{{/select}}
@ -27,43 +27,43 @@
</div>
<div class="form-group">
<label for="xp">Case TMR Spéciale </label>
<input class="attribute-value" type="text" name="system.caseTMRspeciale" value="{{data.caseTMRspeciale}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.caseTMRspeciale" value="{{system.caseTMRspeciale}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Difficulté </label>
<input class="attribute-value" type="text" name="system.difficulte" value="{{data.difficulte}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.difficulte" value="{{system.difficulte}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Coût en Rêve </label>
<input class="attribute-value" type="text" name="system.ptreve" value="{{data.ptreve}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.ptreve" value="{{system.ptreve}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Coût en Seuil </label>
<input class="attribute-value" type="text" name="system.coutseuil" value="{{data.coutseuil}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.coutseuil" value="{{system.coutseuil}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="rituel">Rituel </label>
<input class="attribute-value" type="checkbox" name="system.isrituel" {{#if data.isrituel}}checked{{/if}}/>
<input class="attribute-value" type="checkbox" name="system.isrituel" {{#if system.isrituel}}checked{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Durée </label>
<input class="attribute-value" type="text" name="system.duree" value="{{data.duree}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.duree" value="{{system.duree}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Portée </label>
<input class="attribute-value" type="text" name="system.portee" value="{{data.portee}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.portee" value="{{system.portee}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Cible </label>
<input class="attribute-value" type="text" name="system.cible" value="{{data.cible}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.cible" value="{{system.cible}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Jet de Resistance</label>
<input class="attribute-value" type="text" name="system.JR" value="{{data.JR}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.JR" value="{{system.JR}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">XP </label>
<input class="attribute-value" type="text" name="system.xp" value="{{data.xp}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.xp" value="{{system.xp}}" data-dtype="Number"/>
</div>
{{#if owner}}
{{#each bonusCaseList as |bcData key|}}

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label for="xp">Caractéristique</label>
<select name="system.carac" id="caracselect" data-dtype="String">
{{#select data.carac}}
{{#select system.carac}}
{{#each caracList as |carac key|}}
<option value="{{key}}">{{carac.label}}</option>
{{/each}}
@ -21,7 +21,7 @@
<div class="form-group">
<label for="xp">Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select data.competence}}
{{#select system.competence}}
{{#each competences as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
@ -30,24 +30,24 @@
</div>
<div class="form-group">
<label for="xp">Difficulté</label>
<input class="attribute-value" type="text" name="system.difficulte" value="{{data.difficulte}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.difficulte" value="{{system.difficulte}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Périodicité</label>
<input class="attribute-value" type="text" name="system.periodicite" value="{{data.periodicite}}" data-dtype="String"/>
<input class="attribute-value" type="text" name="system.periodicite" value="{{system.periodicite}}" data-dtype="String"/>
</div>
<div class="form-group">
<label for="xp">Fatigue</label>
<input class="attribute-value" type="text" name="system.fatigue" value="{{data.fatigue}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.fatigue" value="{{system.fatigue}}" data-dtype="Number"/>
</div>
{{#if isGM}}
<div class="form-group">
<label for="xp">Cacher les Points de Tâches nécessaires au joueur</label>
<input class="attribute-value" type="checkbox" name="system.cacher_points_de_tache" value="{{data.cacher_points_de_tache}}" {{checked data.cacher_points_de_tache}}/>
<input class="attribute-value" type="checkbox" name="system.cacher_points_de_tache" value="{{system.cacher_points_de_tache}}" {{checked system.cacher_points_de_tache}}/>
</div>
<div class="form-group">
<label for="xp">Points de tâches nécessaires</label>
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{data.points_de_tache}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{system.points_de_tache}}" data-dtype="Number"/>
</div>
{{else}}
<div class="form-group">
@ -55,22 +55,22 @@
{{#if system.cacher_points_de_tache}}
<input class="attribute-value" type="text" value="?????" data-dtype="Number" disabled/>
{{else}}
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{data.points_de_tache}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{system.points_de_tache}}" data-dtype="Number"/>
{{/if}}
</div>
{{/if}}
<hr>
<div class="form-group">
<label for="xp">Points de tâches obtenus</label>
<input class="attribute-value" type="text" name="system.points_de_tache_courant" value="{{data.points_de_tache_courant}}" data-dtype="Number"/>
<input class="attribute-value" type="text" name="system.points_de_tache_courant" value="{{system.points_de_tache_courant}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label for="xp">Nombre de Succès</label>
<input class="attribute-value" type="text" name="system.nb_jet_succes" value="{{data.nb_jet_succes}}" data-dtype="Number" {{#if isGM}}{{else}}disabled{{/if}}/>
<input class="attribute-value" type="text" name="system.nb_jet_succes" value="{{system.nb_jet_succes}}" data-dtype="Number" {{#if isGM}}{{else}}disabled{{/if}}/>
</div>
<div class="form-group">
<label for="xp">Nombre d'Echecs</label>
<input class="attribute-value" type="text" name="system.nb_jet_echec" value="{{data.nb_jet_echec}}" data-dtype="Number" {{#if isGM}}{{else}}disabled{{/if}}/>
<input class="attribute-value" type="text" name="system.nb_jet_echec" value="{{system.nb_jet_echec}}" data-dtype="Number" {{#if isGM}}{{else}}disabled{{/if}}/>
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}

View File

@ -11,12 +11,12 @@
<div class="flexcol">
<div class="form-group">
<label>Aspect</label>
<input class="attribute-value" type="text" name="system.concept" value="{{data.concept}}" data-dtype="String" />
<input class="attribute-value" type="text" name="system.concept" value="{{system.concept}}" data-dtype="String" />
</div>
<div class="form-group">
<label>Sens</label>
<select name="system.aspect" id="aspect" data-dtype="String">
{{#select data.aspect}}
{{#select system.aspect}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html"}}
{{/select}}
</select>

View File

@ -1,14 +1,14 @@
<div class="flexcol">
<span><label>Description : </label></span>
<div class="form-group editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor system.description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
{{#if isGM}}
<div class="flexcol">
<span><label>Description (MJ seulement): </label></span>
<div class="form-group editor">
{{editor data.descriptionmj target="system.descriptionmj" button=true owner=owner editable=editable}}
{{editor system.descriptionmj target="system.descriptionmj" button=true owner=owner editable=editable}}
</div>
</div>
{{/if}}

View File

@ -4,7 +4,7 @@
<img class="chat-icon" src="{{img}}" title="{{name}}" />
{{/if}}
<p class="card-content">{{{data.description}}}</p>
<p class="card-content">{{{system.description}}}</p>
<p>
{{#each properties as |property p|}}
<span>{{{property}}}</span><br>