foundryvtt-reve-de-dragon/module/item.js

599 lines
20 KiB
JavaScript
Raw Normal View History

2021-05-07 17:27:02 +02:00
import { DialogItemVente } from "./dialog-item-vente.js";
2021-04-12 00:16:23 +02:00
import { Grammar } from "./grammar.js";
import { RdDHerbes } from "./rdd-herbes.js";
2021-01-01 21:11:56 +01:00
import { RdDUtility } from "./rdd-utility.js";
const typesObjetsInventaire = [
"arme",
"armure",
"conteneur",
"gemme",
"herbe",
"ingredient",
"livre",
"monnaie",
"munition",
"nourritureboisson",
"objet",
"potion",
]
2022-06-12 08:17:59 +02:00
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]
const typesObjetsDraconiques = ["queue", "ombre", "souffle", "tete", "signedraconique", "sortreserve", "rencontre"]
const typesObjetsConnaissance = ["meditation", "recettealchimique", "sort"]
const typesObjetsEffet = ["possession", "poison", "maladie"]
const typesObjetsCompetence = ["competence", "competencecreature"]
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
densité 3.5 (~2.3 à 4, parfois plus) -- https://www.juwelo.fr/guide-des-pierres/faits-et-chiffres/
*/
2021-04-13 22:42:39 +02:00
export const defaultItemImg = {
competence: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
competencecreature: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp",
armure: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp",
conteneur: "systems/foundryvtt-reve-de-dragon/icons/objets/sac_a_dos.webp",
sort: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
2021-11-10 20:03:04 +01:00
herbe: "systems/foundryvtt-reve-de-dragon/icons/botanique/Endorlotte.webp",
ingredient: "systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp",
livre: "systems/foundryvtt-reve-de-dragon/icons/objets/livre.webp",
potion: "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp",
rencontre: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
queue: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
ombre: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp",
tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
meditation: "systems/foundryvtt-reve-de-dragon/icons/meditations_ecrits/meditation_alchimie.webp",
recettealchimique: "systems/foundryvtt-reve-de-dragon/icons/competence_alchimie.webp",
chant: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
danse: "systems/foundryvtt-reve-de-dragon/icons/arts/danse_0.webp",
jeu: "systems/foundryvtt-reve-de-dragon/icons/arts/jeux_petasse.webp",
recettecuisine: "systems/foundryvtt-reve-de-dragon/icons/arts/recette_cuisine_1.webp",
musique: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
maladie: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/maladie.webp",
poison: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/venin.webp",
oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp",
nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp",
signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp",
2022-06-12 08:17:59 +02:00
gemme: "systems/foundryvtt-reve-de-dragon/icons/gemmes/almaze.webp",
2022-09-17 16:07:38 +02:00
possession: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
sortreserve: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
extraitpoetique: "systems/foundryvtt-reve-de-dragon/icons/competence_ecriture.webp",
tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp",
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
export class RdDItem extends Item {
static getDefaultImg(itemType) {
return defaultItemImg[itemType];
}
static isItemInventaire(newLocal) {
return typesObjetsInventaire.includes(newLocal.type);
}
static isFieldInventaireModifiable(type, field) {
switch (field) {
case 'quantite':
if (['conteneur'].includes(type)) {
return false;
}
break;
case 'cout':
if (['monnaie'].includes(type)) {
return game.user.isGM;
}
break;
}
return true;
}
static getUniteQuantite(type) {
switch (type) {
case "monnaie": return "(Pièces)"
case "herbe": return "(Brins)"
case "ingredient": return "(Pépins ou Brins)"
}
return '';
}
constructor(itemData, context) {
if (!itemData.img) {
itemData.img = RdDItem.getDefaultImg(itemData.type);
}
super(itemData, context);
}
static getItemTypesInventaire() {
return typesObjetsInventaire
}
2021-04-11 18:43:32 +02:00
static getTypesOeuvres() {
2022-06-12 08:17:59 +02:00
return typesObjetsOeuvres
}
2021-04-11 18:43:32 +02:00
isCompetencePersonnage() {
return this.type == 'competence'
}
isCompetenceCreature() {
return this.type == 'competencecreature'
}
2021-05-06 21:34:07 +02:00
isCompetence() {
return typesObjetsCompetence.includes(this.type)
2021-05-06 21:34:07 +02:00
}
isInventaire() {
return RdDItem.isItemInventaire(this)
}
isOeuvre() {
return typesObjetsOeuvres.includes(this.type)
}
isDraconique() {
return typesObjetsDraconiques.includes(this.type)
}
isEffet() {
return typesObjetsEffet.includes(this.type)
}
isConnaissance() {
return typesObjetsConnaissance.includes(this.type)
}
2021-04-13 22:42:39 +02:00
isConteneur() {
2022-04-30 23:42:55 +02:00
return this.type == 'conteneur';
2021-04-13 22:42:39 +02:00
}
getItemGroup() {
if (this.isInventaire()) return "equipement";
if (this.isOeuvre()) return "oeuvre";
if (this.isDraconique()) return "draconique";
if (this.isConnaissance()) return "connaissance";
if (this.isEffet()) return "effet";
if (this.isCompetence()) return "competence";
return "autres";
}
isConteneurNonVide() {
2022-04-30 23:42:55 +02:00
return this.isConteneur() && (this.system.contenu?.length ?? 0) > 0;
}
isConteneurVide() {
2022-04-30 23:42:55 +02:00
return this.isConteneur() && (this.system.contenu?.length ?? 0) == 0;
}
isVideOuNonConteneur() {
2022-04-30 23:42:55 +02:00
return !this.isConteneur() || (this.system.contenu?.length ?? 0) == 0;
2021-05-07 17:27:02 +02:00
}
2021-04-13 22:42:39 +02:00
isAlcool() {
2022-04-30 23:42:55 +02:00
return this.type == 'nourritureboisson' && this.system.boisson && this.system.alcoolise;
2021-04-13 22:42:39 +02:00
}
2021-12-05 23:30:57 +01:00
isHerbeAPotion() {
2022-04-30 23:42:55 +02:00
return this.type == 'herbe' && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos');
2021-12-05 23:30:57 +01:00
}
2021-04-13 22:42:39 +02:00
isPotion() {
2022-06-12 09:46:58 +02:00
return this.type == 'potion';
2021-04-13 22:42:39 +02:00
}
2021-04-20 23:16:18 +02:00
isCristalAlchimique() {
2022-04-30 23:42:55 +02:00
return this.type == 'objet' && Grammar.toLowerCaseNoAccent(this.name) == 'cristal alchimique' && this.system.quantite > 0;
2021-04-20 23:16:18 +02:00
}
2021-05-07 17:27:02 +02:00
isMagique() {
2022-06-12 08:17:59 +02:00
return this.system.magique
}
2021-04-13 22:42:39 +02:00
getQuantite() {
return Math.round(this.isConteneur() ? 1 : (this.system.quantite ?? 0))
}
getEncTotal() {
return this.getEnc() * this.getQuantite();
}
2021-04-13 22:42:39 +02:00
getEnc() {
2022-06-12 08:17:59 +02:00
switch (this.type) {
2021-04-13 22:42:39 +02:00
case 'herbe':
return encBrin;
case 'gemme':
return encPepin * this.system.taille;
2021-04-13 22:42:39 +02:00
}
return Math.max(this.system.encombrement ?? 0, 0);
}
valeurTotale() {
return this.getQuantite() * this.valeur()
}
valeur() {
return this.system.cout ?? 0
2021-04-13 22:42:39 +02:00
}
prepareDerivedData() {
super.prepareDerivedData();
if (this.isInventaire()) {
this.system.encTotal = this.getEncTotal();
2021-12-05 16:48:18 +01:00
if (this.isPotion()) {
this.prepareDataPotion()
}
this.system.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
}
2021-04-12 00:16:23 +02:00
}
prepareDataPotion() {
2022-06-12 08:17:59 +02:00
const categorie = Grammar.toLowerCaseNoAccent(this.system.categorie);
this.system.magique = categorie.includes('enchante');
if (this.system.magique) {
2021-04-12 00:16:23 +02:00
if (categorie.includes('soin') || categorie.includes('repos')) {
// TODO: utiliser calculPointsRepos / calculPointsGuerison
this.system.puissance = RdDHerbes.calculPuissancePotion(this);
2021-04-12 00:16:23 +02:00
}
}
}
2021-04-12 00:16:23 +02:00
getActionPrincipale(options = { warnIfNot: true }) {
2022-09-16 23:27:26 +02:00
const warn = options.warnIfNot;
switch (this.type) {
2022-09-23 00:57:02 +02:00
case 'nourritureboisson': return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
2022-09-16 23:27:26 +02:00
case 'potion': return this._actionOrWarnQuantiteZero('Boire', warn);
case 'livre': return this._actionOrWarnQuantiteZero('Lire', warn);
2022-09-23 00:57:02 +02:00
case 'conteneur': return 'Ouvrir';
case 'herbe': return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
case 'queue': case 'ombre': return this.system.refoulement > 0 ? 'Refouler' : undefined;
2022-09-16 23:27:26 +02:00
}
return undefined;
}
_actionOrWarnQuantiteZero(actionName, warn) {
2022-09-16 23:27:26 +02:00
if ((this.system.quantite ?? 0) <= 0) {
if (warn) {
2022-06-12 08:17:59 +02:00
ui.notifications.warn(`Vous n'avez plus de ${this.name}.`);
2021-04-11 23:01:10 +02:00
}
2021-04-12 00:16:23 +02:00
return undefined;
2021-04-11 23:01:10 +02:00
}
2022-09-16 23:27:26 +02:00
else {
return actionName;
2021-04-11 23:01:10 +02:00
}
}
2021-04-12 01:03:37 +02:00
async diminuerQuantite(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
if (options.diminuerQuantite == false) return;
2021-04-13 22:42:39 +02:00
await this.quantiteIncDec(-nombre, options);
}
async quantiteIncDec(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
2022-06-12 08:17:59 +02:00
const quantite = Number(this.system.quantite ?? -1);
2021-05-07 17:27:02 +02:00
if (quantite >= 0) {
2021-04-14 21:51:29 +02:00
const reste = Math.max(quantite + Number(nombre), 0);
2021-04-13 22:42:39 +02:00
if (reste == 0) {
2021-05-07 17:27:02 +02:00
if (options.supprimerSiZero) {
2022-06-12 08:17:59 +02:00
ui.notifications.notify(`${this.name} supprimé de votre équipement`);
2021-04-13 22:42:39 +02:00
await this.delete();
}
else {
2022-06-12 08:17:59 +02:00
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({ "system.quantite": 0 });
2021-04-13 22:42:39 +02:00
}
2021-04-12 01:03:37 +02:00
}
else {
await this.update({ "system.quantite": reste });
2021-04-12 01:03:37 +02:00
}
}
}
2021-04-13 22:42:39 +02:00
/* -------------------------------------------- */
// détermine si deux équipements sont similaires: de même type, et avec les même champs hormis la quantité
isInventaireEmpilable(other) {
if (!other || !this.isInventaire()) {
return [false, undefined];
}
if (this.system.quantite == undefined) {
return [false, `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`];
}
else if (this.type != other.type) {
return [false, `Impossible de regrouper des ${this.type} avec des ${other.type}`];
}
else if (this.name != other.name) {
return [false, `Impossible de regrouper ${this.name} avec ${other.name}`];
}
else {
const differences = Object.entries(this.system)
.filter(([key, value]) => !['quantite', 'cout', 'encTotal'].includes(key) && value != other.system[key]);
if (differences.length > 0) {
let message = `Impossible de regrouper les ${this.type} ${this.name}: `;
for (const [key, value] of differences) {
message += `<br>${key}: ${value} vs ${other.system[key]}`;
}
return [false, message];
2021-06-02 23:41:25 +02:00
}
}
return [true, undefined];
2021-04-13 22:42:39 +02:00
}
2021-05-07 17:27:02 +02:00
async proposerVente() {
console.log(this);
if (this.isConteneurNonVide()) {
ui.notifications.warn(`Votre ${this.name} n'est pas vide, pas possible de le proposer`);
return;
}
await DialogItemVente.display(this, async (vente) => {
vente["properties"] = this.getProprietes();
if (vente.isOwned) {
if (vente.quantiteNbLots * vente.tailleLot > vente.quantiteMax) {
ui.notifications.warn(`Vous avez ${vente.quantiteMax} ${vente.item.name}, ce n'est pas suffisant pour vendre ${vente.quantiteNbLots} de ${vente.tailleLot}`)
return;
}
2021-05-07 17:27:02 +02:00
}
vente.jsondata = JSON.stringify(vente.item);
console.log(vente);
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
ChatMessage.create(RdDUtility.chatDataSetup(html));
});
2021-05-07 17:27:02 +02:00
}
2021-04-13 22:42:39 +02:00
2021-10-29 21:31:58 +02:00
/* -------------------------------------------- */
getProprietes() {
2022-06-12 09:46:58 +02:00
return this[`_${this.type}ChatData`]();
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
2021-12-05 16:48:18 +01:00
async postItem(modeOverride) {
2021-01-01 21:11:56 +01:00
console.log(this);
2022-06-12 09:46:58 +02:00
let chatData = duplicate(this);
2022-11-05 18:06:30 +01:00
chatData["properties"] = this.getProprietes();
2021-05-07 17:27:02 +02:00
if (this.actor) {
chatData.actor = { id: this.actor.id };
2021-04-14 22:40:12 +02:00
}
2021-01-01 21:11:56 +01:00
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
2021-01-01 21:11:56 +01:00
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-item.html', chatData).then(html => {
2021-10-29 21:31:58 +02:00
let chatOptions = RdDUtility.chatDataSetup(html, modeOverride);
2021-01-01 21:11:56 +01:00
ChatMessage.create(chatOptions)
});
}
2021-05-07 17:27:02 +02:00
static propertyIfDefined(name, val, condition = (it) => true) {
return condition ? [`<b>${name}</b>: ${val}`] : [];
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
_objetChatData() {
2022-11-05 18:06:30 +01:00
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),
2021-05-07 17:27:02 +02:00
);
2021-01-01 21:11:56 +01:00
}
/* -------------------------------------------- */
_nourritureboissonChatData() {
2022-11-05 18:06:30 +01:00
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),
);
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
_armeChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_conteneurChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Capacité</b>: ${this.system.capacite} Enc.`,
`<b>Encombrement</b>: ${this.system.encombrement}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_munitionChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Encombrement</b>: ${this.system.encombrement}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_armureChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_competenceChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_competencecreatureChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_sortChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_herbeChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Milieu</b>: ${this.system.milieu}`,
`<b>Rareté</b>: ${this.system.rarete}`,
`<b>Catégorie</b>: ${this.system.categorie}`,
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_ingredientChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Milieu</b>: ${this.system.milieu}`,
`<b>Rareté</b>: ${this.system.rarete}`,
`<b>Catégorie</b>: ${this.system.categorie}`,
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_tacheChatData() {
2022-11-05 18:06:30 +01:00
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}`
2022-01-25 22:06:10 +01:00
].concat([
this.system.cacher_points_de_tache ? [] : `<b>Points de Tâche</b>: ${this.system.points_de_tache}`
2022-01-25 22:06:10 +01:00
]).concat([
2022-11-05 18:06:30 +01:00
`<b>Points de Tâche atteints</b>: ${this.system.points_de_tache_courant}`]
2022-01-25 22:06:10 +01:00
);
2021-01-01 21:11:56 +01:00
}
/* -------------------------------------------- */
_livreChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_potionChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Rareté</b>: ${this.system.rarete}`,
`<b>Catégorie</b>: ${this.system.categorie}`,
`<b>Encombrement</b>: ${this.system.encombrement}`,
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_queueChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Refoulement</b>: ${this.system.refoulement}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_ombreChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Refoulement</b>: ${this.system.refoulement}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_souffleChatData() {
2022-11-05 18:06:30 +01:00
return [];
2021-01-01 21:11:56 +01:00
}
/* -------------------------------------------- */
_teteChatData() {
2022-11-05 18:06:30 +01:00
return [];
2021-01-01 21:11:56 +01:00
}
/* -------------------------------------------- */
_tarotChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Concept</b>: ${this.system.concept}`,
`<b>Aspect</b>: ${this.system.aspect}`,
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_nombreastralChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Valeur</b>: ${this.system.value}`,
`<b>Jour</b>: ${this.system.jourlabel}`,
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_monnaieChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Valeur en Sols</b>: ${this.system.cout}`,
2022-11-05 18:06:30 +01:00
`<b>Encombrement</b>: ${this.system.encombrement}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_meditationChatData() {
2022-11-05 18:06:30 +01:00
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}`
2021-01-01 21:11:56 +01:00
]
}
/* -------------------------------------------- */
_rencontreChatData() {
if (this.system.coord) {
return [
`<b>Force</b>: ${this.system.force}`,
`<b>Coordonnées</b>: ${this.system.coord}`,
]
}
return [
`<b>Force</b>: ${this.system.force}`,
`<b>Refoulement</b>: ${this.system.refoulement}`,
`<b>Présent de cités</b>: ${this.system.presentCite}`,
]
}
/* -------------------------------------------- */
2021-01-01 21:11:56 +01:00
_casetmrChatData() {
2022-11-05 18:06:30 +01:00
return [
`<b>Coordonnée</b>: ${this.system.coord}`,
`<b>Spécificité</b>: ${this.system.specific}`
2021-01-01 21:11:56 +01:00
]
}
2021-10-29 21:31:58 +02:00
/* -------------------------------------------- */
_maladieChatData() {
2022-11-05 18:06:30 +01:00
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}`
]
2022-11-05 18:06:30 +01:00
if (this.system.remedesconnus) {
properties.push(`<b>Remedes</b>: ${this.system.remedes}`)
2021-10-29 21:31:58 +02:00
}
return properties;
}
/* -------------------------------------------- */
_poisonChatData() {
return this._maladieChatData();
}
/* -------------------------------------------- */
_gemmeChatData() {
2022-11-05 18:06:30 +01:00
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}`,
2021-10-29 21:31:58 +02:00
]
}
2021-01-01 21:11:56 +01:00
}