forked from public/foundryvtt-reve-de-dragon
Cleanup & Reformatage
This commit is contained in:
275
module/item.js
275
module/item.js
@ -301,8 +301,7 @@ export class RdDItem extends Item {
|
||||
async postItem(modeOverride) {
|
||||
console.log(this);
|
||||
let chatData = duplicate(this);
|
||||
const properties = this.getProprietes();
|
||||
chatData["properties"] = properties
|
||||
chatData["properties"] = this.getProprietes();
|
||||
if (this.actor) {
|
||||
chatData.actor = { id: this.actor.id };
|
||||
}
|
||||
@ -325,254 +324,204 @@ export class RdDItem extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_objetChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [].concat(
|
||||
RdDItem.propertyIfDefined('Résistance', tplData.resistance, tplData.resistance),
|
||||
RdDItem.propertyIfDefined('Qualité', tplData.qualite, tplData.qualite),
|
||||
RdDItem.propertyIfDefined('Encombrement', tplData.encombrement),
|
||||
return [].concat(
|
||||
RdDItem.propertyIfDefined('Résistance', this.system.resistance, this.system.resistance),
|
||||
RdDItem.propertyIfDefined('Qualité', this.system.qualite, this.system.qualite),
|
||||
RdDItem.propertyIfDefined('Encombrement', this.system.encombrement),
|
||||
);
|
||||
return properties;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_nourritureboissonChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [].concat(
|
||||
RdDItem.propertyIfDefined('Sustentation', tplData.sust, tplData.sust > 0),
|
||||
RdDItem.propertyIfDefined('Désaltère', tplData.desaltere, tplData.boisson),
|
||||
RdDItem.propertyIfDefined('Force alcool', tplData.force, tplData.boisson && tplData.alcoolise),
|
||||
RdDItem.propertyIfDefined('Exotisme', tplData.exotisme, tplData.exotisme < 0),
|
||||
RdDItem.propertyIfDefined('Qualité', tplData.qualite, tplData.qualite),
|
||||
RdDItem.propertyIfDefined('Encombrement', tplData.encombrement),
|
||||
return [].concat(
|
||||
RdDItem.propertyIfDefined('Sustentation', this.system.sust, this.system.sust > 0),
|
||||
RdDItem.propertyIfDefined('Désaltère', this.system.desaltere, this.system.boisson),
|
||||
RdDItem.propertyIfDefined('Force alcool', this.system.force, this.system.boisson && this.system.alcoolise),
|
||||
RdDItem.propertyIfDefined('Exotisme', this.system.exotisme, this.system.exotisme < 0),
|
||||
RdDItem.propertyIfDefined('Qualité', this.system.qualite, this.system.qualite),
|
||||
RdDItem.propertyIfDefined('Encombrement', this.system.encombrement),
|
||||
);
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_armeChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Compétence</b>: ${tplData.competence}`,
|
||||
`<b>Dommages</b>: ${tplData.dommages}`,
|
||||
`<b>Force minimum</b>: ${tplData.force}`,
|
||||
`<b>Resistance</b>: ${tplData.resistance}`,
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`
|
||||
return [
|
||||
`<b>Compétence</b>: ${this.system.competence}`,
|
||||
`<b>Dommages</b>: ${this.system.dommages}`,
|
||||
`<b>Force minimum</b>: ${this.system.force}`,
|
||||
`<b>Resistance</b>: ${this.system.resistance}`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_conteneurChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Capacité</b>: ${tplData.capacite} Enc.`,
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`
|
||||
return [
|
||||
`<b>Capacité</b>: ${this.system.capacite} Enc.`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_munitionChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`
|
||||
return [
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_armureChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Protection</b>: ${tplData.protection}`,
|
||||
`<b>Détérioration</b>: ${tplData.deterioration}`,
|
||||
`<b>Malus armure</b>: ${tplData.malus}`,
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`
|
||||
return [
|
||||
`<b>Protection</b>: ${this.system.protection}`,
|
||||
`<b>Détérioration</b>: ${this.system.deterioration}`,
|
||||
`<b>Malus armure</b>: ${this.system.malus}`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_competenceChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Catégorie</b>: ${tplData.categorie}`,
|
||||
`<b>Niveau</b>: ${tplData.niveau}`,
|
||||
`<b>Caractéristique par défaut</b>: ${tplData.carac_defaut}`,
|
||||
`<b>XP</b>: ${tplData.xp}`
|
||||
return [
|
||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||
`<b>Niveau</b>: ${this.system.niveau}`,
|
||||
`<b>Caractéristique par défaut</b>: ${this.system.carac_defaut}`,
|
||||
`<b>XP</b>: ${this.system.xp}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_competencecreatureChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Catégorie</b>: ${tplData.categorie}`,
|
||||
`<b>Niveau</b>: ${tplData.niveau}`,
|
||||
`<b>Caractéristique</b>: ${tplData.carac_value}`,
|
||||
`<b>XP</b>: ${tplData.xp}`
|
||||
return [
|
||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||
`<b>Niveau</b>: ${this.system.niveau}`,
|
||||
`<b>Caractéristique</b>: ${this.system.carac_value}`,
|
||||
`<b>XP</b>: ${this.system.xp}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_sortChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Draconic</b>: ${tplData.draconic}`,
|
||||
`<b>Difficulté</b>: ${tplData.difficulte}`,
|
||||
`<b>Case TMR</b>: ${tplData.caseTMR}`,
|
||||
`<b>Points de Rêve</b>: ${tplData.ptreve}`
|
||||
return [
|
||||
`<b>Draconic</b>: ${this.system.draconic}`,
|
||||
`<b>Difficulté</b>: ${this.system.difficulte}`,
|
||||
`<b>Case TMR</b>: ${this.system.caseTMR}`,
|
||||
`<b>Points de Rêve</b>: ${this.system.ptreve}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_herbeChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Milieu</b>: ${tplData.milieu}`,
|
||||
`<b>Rareté</b>: ${tplData.rarete}`,
|
||||
`<b>Catégorie</b>: ${tplData.categorie}`,
|
||||
return [
|
||||
`<b>Milieu</b>: ${this.system.milieu}`,
|
||||
`<b>Rareté</b>: ${this.system.rarete}`,
|
||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_ingredientChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Milieu</b>: ${tplData.milieu}`,
|
||||
`<b>Rareté</b>: ${tplData.rarete}`,
|
||||
`<b>Catégorie</b>: ${tplData.categorie}`,
|
||||
return [
|
||||
`<b>Milieu</b>: ${this.system.milieu}`,
|
||||
`<b>Rareté</b>: ${this.system.rarete}`,
|
||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_tacheChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Caractéristique</b>: ${tplData.carac}`,
|
||||
`<b>Compétence</b>: ${tplData.competence}`,
|
||||
`<b>Périodicité</b>: ${tplData.periodicite}`,
|
||||
`<b>Fatigue</b>: ${tplData.fatigue}`,
|
||||
`<b>Difficulté</b>: ${tplData.difficulte}`
|
||||
return [
|
||||
`<b>Caractéristique</b>: ${this.system.carac}`,
|
||||
`<b>Compétence</b>: ${this.system.competence}`,
|
||||
`<b>Périodicité</b>: ${this.system.periodicite}`,
|
||||
`<b>Fatigue</b>: ${this.system.fatigue}`,
|
||||
`<b>Difficulté</b>: ${this.system.difficulte}`
|
||||
].concat([
|
||||
tplData.cacher_points_de_tache ? [] :`<b>Points de Tâche</b>: ${tplData.points_de_tache}`
|
||||
this.system.cacher_points_de_tache ? [] :`<b>Points de Tâche</b>: ${this.system.points_de_tache}`
|
||||
]).concat([
|
||||
`<b>Points de Tâche atteints</b>: ${tplData.points_de_tache_courant}`]
|
||||
`<b>Points de Tâche atteints</b>: ${this.system.points_de_tache_courant}`]
|
||||
);
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_livreChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Compétence</b>: ${tplData.competence}`,
|
||||
`<b>Auteur</b>: ${tplData.auteur}`,
|
||||
`<b>Difficulté</b>: ${tplData.difficulte}`,
|
||||
`<b>Points de Tâche</b>: ${tplData.points_de_tache}`,
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`
|
||||
return [
|
||||
`<b>Compétence</b>: ${this.system.competence}`,
|
||||
`<b>Auteur</b>: ${this.system.auteur}`,
|
||||
`<b>Difficulté</b>: ${this.system.difficulte}`,
|
||||
`<b>Points de Tâche</b>: ${this.system.points_de_tache}`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_potionChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Rareté</b>: ${tplData.rarete}`,
|
||||
`<b>Catégorie</b>: ${tplData.categorie}`,
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`,
|
||||
return [
|
||||
`<b>Rareté</b>: ${this.system.rarete}`,
|
||||
`<b>Catégorie</b>: ${this.system.categorie}`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`,
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_queueChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Refoulement</b>: ${tplData.refoulement}`
|
||||
return [
|
||||
`<b>Refoulement</b>: ${this.system.refoulement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_ombreChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Refoulement</b>: ${tplData.refoulement}`
|
||||
return [
|
||||
`<b>Refoulement</b>: ${this.system.refoulement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_souffleChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [];
|
||||
return properties;
|
||||
return [];
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_teteChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [];
|
||||
return properties;
|
||||
return [];
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_tarotChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Concept</b>: ${tplData.concept}`,
|
||||
`<b>Aspect</b>: ${tplData.aspect}`,
|
||||
return [
|
||||
`<b>Concept</b>: ${this.system.concept}`,
|
||||
`<b>Aspect</b>: ${this.system.aspect}`,
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_nombreastralChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Valeur</b>: ${tplData.value}`,
|
||||
`<b>Jour</b>: ${tplData.jourlabel}`,
|
||||
return [
|
||||
`<b>Valeur</b>: ${this.system.value}`,
|
||||
`<b>Jour</b>: ${this.system.jourlabel}`,
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_monnaieChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Valeur en Deniers</b>: ${tplData.valeur_deniers}`,
|
||||
`<b>Encombrement</b>: ${tplData.encombrement}`
|
||||
return [
|
||||
`<b>Valeur en Deniers</b>: ${this.system.valeur_deniers}`,
|
||||
`<b>Encombrement</b>: ${this.system.encombrement}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_meditationChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Thème</b>: ${tplData.theme}`,
|
||||
`<b>Compétence</b>: ${tplData.competence}`,
|
||||
`<b>Support</b>: ${tplData.support}`,
|
||||
`<b>Heure</b>: ${tplData.heure}`,
|
||||
`<b>Purification</b>: ${tplData.purification}`,
|
||||
`<b>Vêture</b>: ${tplData.veture}`,
|
||||
`<b>Comportement</b>: ${tplData.comportement}`,
|
||||
`<b>Case TMR</b>: ${tplData.tmr}`
|
||||
return [
|
||||
`<b>Thème</b>: ${this.system.theme}`,
|
||||
`<b>Compétence</b>: ${this.system.competence}`,
|
||||
`<b>Support</b>: ${this.system.support}`,
|
||||
`<b>Heure</b>: ${this.system.heure}`,
|
||||
`<b>Purification</b>: ${this.system.purification}`,
|
||||
`<b>Vêture</b>: ${this.system.veture}`,
|
||||
`<b>Comportement</b>: ${this.system.comportement}`,
|
||||
`<b>Case TMR</b>: ${this.system.tmr}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_casetmrChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Coordonnée</b>: ${tplData.coord}`,
|
||||
`<b>Spécificité</b>: ${tplData.specific}`
|
||||
return [
|
||||
`<b>Coordonnée</b>: ${this.system.coord}`,
|
||||
`<b>Spécificité</b>: ${this.system.specific}`
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
_maladieChatData() {
|
||||
const tplData = this.system
|
||||
let properties
|
||||
if (tplData.identifie) {
|
||||
properties = [
|
||||
`<b>Malignité</b>: ${tplData.malignite}`,
|
||||
`<b>Périodicité</b>: ${tplData.periodicite}`,
|
||||
`<b>Dommages</b>: ${tplData.dommages}`
|
||||
if (!this.system.identifie) {
|
||||
return [`<b>Inconnue</b>`]
|
||||
}
|
||||
let properties = [
|
||||
`<b>Malignité</b>: ${this.system.malignite}`,
|
||||
`<b>Périodicité</b>: ${this.system.periodicite}`,
|
||||
`<b>Dommages</b>: ${this.system.dommages}`
|
||||
]
|
||||
if (tplData.remedesconnus) {
|
||||
properties.push(`<b>Remedes</b>: ${tplData.remedes}`)
|
||||
}
|
||||
} else {
|
||||
properties = [
|
||||
`<b>Inconnue</b>`]
|
||||
if (this.system.remedesconnus) {
|
||||
properties.push(`<b>Remedes</b>: ${this.system.remedes}`)
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
@ -584,15 +533,13 @@ export class RdDItem extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_gemmeChatData() {
|
||||
const tplData = this.system
|
||||
let properties = [
|
||||
`<b>Pureté</b>: ${tplData.purete}`,
|
||||
`<b>Taille</b>: ${tplData.taille}`,
|
||||
`<b>Inertie</b>: ${tplData.inertie}`,
|
||||
`<b>Enchantabilité</b>: ${tplData.enchantabilite}`,
|
||||
`<b>Prix</b>: ${tplData.cout}`,
|
||||
return [
|
||||
`<b>Pureté</b>: ${this.system.purete}`,
|
||||
`<b>Taille</b>: ${this.system.taille}`,
|
||||
`<b>Inertie</b>: ${this.system.inertie}`,
|
||||
`<b>Enchantabilité</b>: ${this.system.enchantabilite}`,
|
||||
`<b>Prix</b>: ${this.system.cout}`,
|
||||
]
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user