Big WIP...

This commit is contained in:
2022-06-12 09:46:58 +02:00
parent 6b48839841
commit 0228d5bc56
55 changed files with 412 additions and 435 deletions

View File

@ -83,7 +83,7 @@ export class RdDItem extends Item {
return this.type == 'herbe' && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos');
}
isPotion() {
return Misc.data(this).type == 'potion';
return this.type == 'potion';
}
isEquipement() {
@ -192,10 +192,10 @@ export class RdDItem extends Item {
/* -------------------------------------------- */
// détermine si deux équipements sont similaires: de même type, et avec les même champs hormis la quantité
isEquipementSimilaire(other) {
const itemData = Misc.data(this)
const otherData = Misc.data(other)
const tplData = Misc.templateData(this)
const otherTplData = Misc.templateData(other)
const itemData = this
const otherData = other
const tplData = this
const otherTplData = other
if (!this.isEquipement()) return false;
if (itemData.type != otherData.type) return false;
if (itemData.name != otherData.name) return false;
@ -241,13 +241,13 @@ export class RdDItem extends Item {
/* -------------------------------------------- */
getProprietes() {
return this[`_${Misc.data(this).type}ChatData`]();
return this[`_${this.type}ChatData`]();
}
/* -------------------------------------------- */
async postItem(modeOverride) {
console.log(this);
let chatData = duplicate(Misc.data(this));
let chatData = duplicate(this);
const properties = this.getProprietes();
chatData["properties"] = properties
if (this.actor) {
@ -272,7 +272,7 @@ export class RdDItem extends Item {
/* -------------------------------------------- */
_objetChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [].concat(
RdDItem.propertyIfDefined('Résistance', tplData.resistance, tplData.resistance),
RdDItem.propertyIfDefined('Qualité', tplData.qualite, tplData.qualite),
@ -283,7 +283,7 @@ export class RdDItem extends Item {
/* -------------------------------------------- */
_nourritureboissonChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [].concat(
RdDItem.propertyIfDefined('Sustentation', tplData.sust, tplData.sust > 0),
RdDItem.propertyIfDefined('Désaltère', tplData.desaltere, tplData.boisson),
@ -296,7 +296,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_armeChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Compétence</b>: ${tplData.competence}`,
`<b>Dommages</b>: ${tplData.dommages}`,
@ -308,7 +308,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_conteneurChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Capacité</b>: ${tplData.capacite} Enc.`,
`<b>Encombrement</b>: ${tplData.encombrement}`
@ -317,7 +317,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_munitionChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Encombrement</b>: ${tplData.encombrement}`
]
@ -325,7 +325,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_armureChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Protection</b>: ${tplData.protection}`,
`<b>Détérioration</b>: ${tplData.deterioration}`,
@ -336,7 +336,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_competenceChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Catégorie</b>: ${tplData.categorie}`,
`<b>Niveau</b>: ${tplData.niveau}`,
@ -347,7 +347,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_competencecreatureChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Catégorie</b>: ${tplData.categorie}`,
`<b>Niveau</b>: ${tplData.niveau}`,
@ -358,7 +358,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_sortChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Draconic</b>: ${tplData.draconic}`,
`<b>Difficulté</b>: ${tplData.difficulte}`,
@ -369,7 +369,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_herbeChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Milieu</b>: ${tplData.milieu}`,
`<b>Rareté</b>: ${tplData.rarete}`,
@ -379,7 +379,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_ingredientChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Milieu</b>: ${tplData.milieu}`,
`<b>Rareté</b>: ${tplData.rarete}`,
@ -389,7 +389,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_tacheChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Caractéristique</b>: ${tplData.carac}`,
`<b>Compétence</b>: ${tplData.competence}`,
@ -405,7 +405,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_livreChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Compétence</b>: ${tplData.competence}`,
`<b>Auteur</b>: ${tplData.auteur}`,
@ -417,7 +417,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_potionChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Rareté</b>: ${tplData.rarete}`,
`<b>Catégorie</b>: ${tplData.categorie}`,
@ -427,7 +427,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_queueChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Refoulement</b>: ${tplData.refoulement}`
]
@ -435,7 +435,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_ombreChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Refoulement</b>: ${tplData.refoulement}`
]
@ -443,19 +443,19 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_souffleChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [];
return properties;
}
/* -------------------------------------------- */
_teteChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [];
return properties;
}
/* -------------------------------------------- */
_tarotChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Concept</b>: ${tplData.concept}`,
`<b>Aspect</b>: ${tplData.aspect}`,
@ -464,7 +464,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_nombreastralChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Valeur</b>: ${tplData.value}`,
`<b>Jour</b>: ${tplData.jourlabel}`,
@ -473,7 +473,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_monnaieChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Valeur en Deniers</b>: ${tplData.valeur_deniers}`,
`<b>Encombrement</b>: ${tplData.encombrement}`
@ -482,7 +482,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_meditationChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Thème</b>: ${tplData.theme}`,
`<b>Compétence</b>: ${tplData.competence}`,
@ -497,7 +497,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_casetmrChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Coordonnée</b>: ${tplData.coord}`,
`<b>Spécificité</b>: ${tplData.specific}`
@ -506,7 +506,7 @@ export class RdDItem extends Item {
}
/* -------------------------------------------- */
_maladieChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties
if (tplData.identifie) {
properties = [
@ -531,7 +531,7 @@ export class RdDItem extends Item {
/* -------------------------------------------- */
_gemmeChatData() {
const tplData = Misc.templateData(this);
const tplData = this.system
let properties = [
`<b>Pureté</b>: ${tplData.purete}`,
`<b>Taille</b>: ${tplData.taille}`,