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" ;
2022-09-07 18:47:56 +02:00
import { RdDHerbes } from "./rdd-herbes.js" ;
2021-01-01 21:11:56 +01:00
import { RdDUtility } from "./rdd-utility.js" ;
2022-10-04 01:58:49 +02:00
const typesObjetsEquipement = [
"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" ]
2022-10-04 23:23:43 +02:00
const typesObjetsDraconiques = [ "queue" , "ombre" , "souffle" , "tete" , "signedraconique" , "sortreserve" ]
const typesObjetsConnaissance = [ "meditation" , "recettealchimique" , "sort" ]
const typesObjetsEffet = [ "possession" , "poison" , "maladie" ]
const typesObjetsCompetence = [ "competence" , "compcreature" ]
2022-10-04 01:58:49 +02:00
const encBrin = 0.00005 ; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
const encPepin = 0.0007 ; / * u n p é p i n d e g e m m e = 1 / 1 0 c m 3 = 1 / 1 0 0 0 l = 3 . 5 / 1 0 0 0 k g = 7 / 2 0 0 0 k g = 7 / 1 0 0 0 e n c
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
2021-05-18 19:50:24 +02:00
export const defaultItemImg = {
competence : "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp" ,
compcreature : "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" ,
2021-05-18 19:50:24 +02:00
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" ,
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" ,
2021-05-18 19:50:24 +02:00
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
export class RdDItem extends Item {
2022-09-07 18:47:56 +02:00
constructor ( itemData , context ) {
if ( ! itemData . img ) {
itemData . img = defaultItemImg [ itemData . type ] ;
2021-05-18 19:50:24 +02:00
}
2022-09-07 18:47:56 +02:00
super ( itemData , context ) ;
2021-05-18 19:50:24 +02:00
}
2022-10-04 01:58:49 +02:00
static getTypesObjetsEquipement ( ) {
2022-06-12 08:17:59 +02:00
return typesObjetsEquipement
2021-04-06 23:36:35 +02:00
}
2021-04-11 18:43:32 +02:00
2021-04-06 23:36:35 +02:00
static getTypesOeuvres ( ) {
2022-06-12 08:17:59 +02:00
return typesObjetsOeuvres
2021-04-06 23:36:35 +02:00
}
2021-04-11 18:43:32 +02:00
2022-10-08 14:25:31 +02:00
isCompetencePersonnage ( ) {
return this . type == 'competence'
}
2021-05-06 21:34:07 +02:00
isCompetence ( ) {
2022-10-04 23:23:43 +02:00
return typesObjetsCompetence . includes ( this . type )
2021-05-06 21:34:07 +02:00
}
2022-10-04 01:58:49 +02:00
isEquipement ( ) {
return typesObjetsEquipement . includes ( this . type )
}
2022-10-04 23:23:43 +02:00
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
}
2021-05-10 18:39:35 +02:00
2022-10-04 23:23:43 +02:00
getItemGroup ( ) {
if ( this . isEquipement ( ) ) 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" ;
}
2021-12-10 01:18:59 +01:00
isConteneurNonVide ( ) {
2022-04-30 23:42:55 +02:00
return this . isConteneur ( ) && ( this . system . contenu ? . length ? ? 0 ) > 0 ;
2021-12-10 01:18:59 +01:00
}
isConteneurVide ( ) {
2022-04-30 23:42:55 +02:00
return this . isConteneur ( ) && ( this . system . contenu ? . length ? ? 0 ) == 0 ;
2021-12-10 01:18:59 +01:00
}
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-05-06 21:36:40 +02:00
}
2021-04-13 22:42:39 +02:00
2022-10-04 01:58:49 +02:00
getQuantite ( ) {
return Math . round ( this . isConteneur ( ) ? 1 : ( this . system . quantite ? ? 0 ) )
2021-05-27 22:40:12 +02:00
}
2022-10-04 01:58:49 +02:00
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 ;
2022-10-04 01:58:49 +02:00
case 'gemme' :
return encPepin * this . system . taille ;
2021-04-13 22:42:39 +02:00
}
2022-10-04 01:58:49 +02:00
return Math . max ( this . system . encombrement ? ? 0 , 0 ) ;
}
prixTotalDeniers ( ) {
return this . getQuantite ( ) * this . valeurDeniers ( )
}
valeurDeniers ( ) {
return Math . max ( Math . round ( this . system . cout ? ( this . system . cout * 100 ) : ( this . system . valeur _deniers ? ? 0 ) ) , 0 )
2021-04-13 22:42:39 +02:00
}
2021-04-06 23:36:35 +02:00
prepareDerivedData ( ) {
super . prepareDerivedData ( ) ;
2021-12-05 16:48:18 +01:00
if ( this . isEquipement ( ) ) {
2022-10-04 01:58:49 +02:00
this . system . encTotal = this . getEncTotal ( ) ;
2021-12-05 16:48:18 +01:00
if ( this . isPotion ( ) ) {
this . prepareDataPotion ( )
}
2022-09-07 00:09:17 +02:00
this . system . actionPrincipale = this . getActionPrincipale ( { warnIfNot : false } ) ;
2021-04-08 20:37:11 +02:00
}
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' ) ) {
2022-10-08 14:25:31 +02:00
// TODO: utiliser calculPointsRepos / calculPointsGuerison
this . system . puissance = RdDHerbes . calculPuissancePotion ( this ) ;
2021-04-12 00:16:23 +02:00
}
}
2021-04-08 20:37:11 +02:00
}
2021-04-11 18:47:00 +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' ;
2022-09-16 23:27:26 +02:00
case 'herbe' : return this . isHerbeAPotion ( ) ? this . _actionOrWarnQuantiteZero ( 'Décoction' , warn ) : undefined ;
case 'queue' : case 'ombre' : return this . system . refoulement > 0 ? 'Refouler' : undefined ;
}
return undefined ;
}
_actionOrWarnQuantiteZero ( actionName , warn ) {
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. ` ) ;
2022-09-07 18:47:56 +02:00
await this . update ( { "system.quantite" : 0 } ) ;
2021-04-13 22:42:39 +02:00
}
2021-04-12 01:03:37 +02:00
}
else {
2022-09-07 18:47:56 +02:00
await this . update ( { "system.quantite" : reste } ) ;
2021-04-12 01:03:37 +02:00
}
2021-04-11 18:47:00 +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é
2022-09-25 17:51:57 +02:00
messageEquipementDifferent ( other ) {
if ( ! other || ! this . isEquipement ( ) ) return undefined ;
2022-09-07 00:09:17 +02:00
let message = undefined ;
2022-10-04 01:58:49 +02:00
if ( this . system . quantite == undefined ) {
message = ` Impossible de regrouper des ${ this . type } , ils ne sont pas empilables ` ;
}
else if ( this . type != other . type ) {
message = ` Impossible de regrouper des ${ this . type } avec des ${ other . type } ` ;
2022-09-07 00:09:17 +02:00
}
else if ( this . name != other . name ) {
message = ` Impossible de regrouper ${ this . name } avec ${ other . name } ` ;
}
else {
const differences = Object . entries ( this . system )
2022-10-04 01:58:49 +02:00
. filter ( ( [ key , value ] ) => ! [ 'quantite' , 'cout' ] . includes ( key ) && value != other . system [ key ] ) ;
2022-09-07 00:09:17 +02:00
if ( differences . length > 0 ) {
message = ` Impossible de regrouper les ${ this . type } ${ this . name } : ` ;
for ( const [ key , value ] of differences ) {
message += ` <br> ${ key } : ${ value } vs ${ other . system [ key ] } ` ;
}
2021-06-02 23:41:25 +02:00
}
2022-09-07 00:09:17 +02:00
}
2022-09-25 17:51:57 +02:00
return message ;
2021-04-13 22:42:39 +02:00
}
2021-05-07 17:27:02 +02:00
async proposerVente ( ) {
console . log ( this ) ;
2021-12-10 01:18:59 +01:00
if ( this . isConteneurNonVide ( ) ) {
2022-10-07 19:05:56 +02:00
ui . notifications . warn ( ` Votre ${ this . name } n'est pas vide, pas possible de le proposer ` ) ;
2021-12-10 01:18:59 +01:00
return ;
}
2022-10-07 19:05:56 +02:00
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
}
2022-10-07 19:05:56 +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
/* -------------------------------------------- */
2021-06-08 00:32:27 +02:00
getProprietes ( ) {
2022-06-12 09:46:58 +02:00
return this [ ` _ ${ this . type } ChatData ` ] ( ) ;
2021-06-08 00:32:27 +02:00
}
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 ) ;
2021-06-08 00:32:27 +02:00
const properties = this . getProprietes ( ) ;
2021-01-01 21:11:56 +01:00
chatData [ "properties" ] = properties
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 (
2021-04-06 23:36:35 +02:00
{
compendium : "postedItem" ,
2021-04-11 18:47:00 +02:00
payload : chatData ,
2021-04-06 23:36:35 +02:00
} ) ;
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 ) {
2021-04-11 18:47:00 +02:00
return condition ? [ ` <b> ${ name } </b>: ${ val } ` ] : [ ] ;
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
_objetChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-05-07 17:27:02 +02:00
let properties = [ ] . concat (
RdDItem . propertyIfDefined ( 'Résistance' , tplData . resistance , tplData . resistance ) ,
RdDItem . propertyIfDefined ( 'Qualité' , tplData . qualite , tplData . qualite ) ,
RdDItem . propertyIfDefined ( 'Encombrement' , tplData . encombrement ) ,
) ;
2021-01-01 21:11:56 +01:00
return properties ;
}
2021-04-11 18:47:00 +02:00
/* -------------------------------------------- */
_nourritureboissonChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-04-11 18:47:00 +02:00
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 ) ,
2021-04-16 00:29:08 +02:00
RdDItem . propertyIfDefined ( 'Exotisme' , tplData . exotisme , tplData . exotisme < 0 ) ,
2021-05-07 17:27:02 +02:00
RdDItem . propertyIfDefined ( 'Qualité' , tplData . qualite , tplData . qualite ) ,
RdDItem . propertyIfDefined ( 'Encombrement' , tplData . encombrement ) ,
2021-04-11 18:47:00 +02:00
) ;
return properties ;
}
2021-01-01 21:11:56 +01:00
/* -------------------------------------------- */
_armeChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <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 } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_conteneurChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Capacité</b>: ${ tplData . capacite } Enc. ` ,
` <b>Encombrement</b>: ${ tplData . encombrement } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_munitionChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Encombrement</b>: ${ tplData . encombrement } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_armureChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Protection</b>: ${ tplData . protection } ` ,
` <b>Détérioration</b>: ${ tplData . deterioration } ` ,
` <b>Malus armure</b>: ${ tplData . malus } ` ,
` <b>Encombrement</b>: ${ tplData . encombrement } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_competenceChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <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 } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_competencecreatureChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Catégorie</b>: ${ tplData . categorie } ` ,
` <b>Niveau</b>: ${ tplData . niveau } ` ,
` <b>Caractéristique</b>: ${ tplData . carac _value } ` ,
` <b>XP</b>: ${ tplData . xp } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_sortChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Draconic</b>: ${ tplData . draconic } ` ,
` <b>Difficulté</b>: ${ tplData . difficulte } ` ,
` <b>Case TMR</b>: ${ tplData . caseTMR } ` ,
` <b>Points de Rêve</b>: ${ tplData . ptreve } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_herbeChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Milieu</b>: ${ tplData . milieu } ` ,
` <b>Rareté</b>: ${ tplData . rarete } ` ,
` <b>Catégorie</b>: ${ tplData . categorie } ` ,
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_ingredientChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Milieu</b>: ${ tplData . milieu } ` ,
` <b>Rareté</b>: ${ tplData . rarete } ` ,
` <b>Catégorie</b>: ${ tplData . categorie } ` ,
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_tacheChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Caractéristique</b>: ${ tplData . carac } ` ,
` <b>Compétence</b>: ${ tplData . competence } ` ,
` <b>Périodicité</b>: ${ tplData . periodicite } ` ,
` <b>Fatigue</b>: ${ tplData . fatigue } ` ,
2022-01-25 22:06:10 +01:00
` <b>Difficulté</b>: ${ tplData . difficulte } `
] . concat ( [
tplData . cacher _points _de _tache ? [ ] : ` <b>Points de Tâche</b>: ${ tplData . points _de _tache } `
] ) . concat ( [
` <b>Points de Tâche atteints</b>: ${ tplData . points _de _tache _courant } ` ]
) ;
2021-01-01 21:11:56 +01:00
return properties ;
}
/* -------------------------------------------- */
_livreChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <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 } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_potionChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Rareté</b>: ${ tplData . rarete } ` ,
` <b>Catégorie</b>: ${ tplData . categorie } ` ,
` <b>Encombrement</b>: ${ tplData . encombrement } ` ,
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_queueChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Refoulement</b>: ${ tplData . refoulement } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_ombreChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Refoulement</b>: ${ tplData . refoulement } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_souffleChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [ ] ;
return properties ;
}
/* -------------------------------------------- */
_teteChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [ ] ;
return properties ;
}
/* -------------------------------------------- */
_tarotChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Concept</b>: ${ tplData . concept } ` ,
` <b>Aspect</b>: ${ tplData . aspect } ` ,
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_nombreastralChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Valeur</b>: ${ tplData . value } ` ,
` <b>Jour</b>: ${ tplData . jourlabel } ` ,
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_monnaieChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Valeur en Deniers</b>: ${ tplData . valeur _deniers } ` ,
` <b>Encombrement</b>: ${ tplData . encombrement } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_meditationChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <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 } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
/* -------------------------------------------- */
_casetmrChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-01-01 21:11:56 +01:00
let properties = [
2021-04-11 18:47:00 +02:00
` <b>Coordonnée</b>: ${ tplData . coord } ` ,
` <b>Spécificité</b>: ${ tplData . specific } `
2021-01-01 21:11:56 +01:00
]
return properties ;
}
2021-10-29 21:31:58 +02:00
/* -------------------------------------------- */
_maladieChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-10-29 21:31:58 +02:00
let properties
if ( tplData . identifie ) {
properties = [
` <b>Malignité</b>: ${ tplData . malignite } ` ,
` <b>Périodicité</b>: ${ tplData . periodicite } ` ,
` <b>Dommages</b>: ${ tplData . dommages } `
]
if ( tplData . remedesconnus ) {
2021-12-05 16:48:18 +01:00
properties . push ( ` <b>Remedes</b>: ${ tplData . remedes } ` )
2021-10-29 21:31:58 +02:00
}
} else {
properties = [
2021-12-05 16:48:18 +01:00
` <b>Inconnue</b> ` ]
2021-10-29 21:31:58 +02:00
}
return properties ;
}
/* -------------------------------------------- */
_poisonChatData ( ) {
return this . _maladieChatData ( ) ;
}
/* -------------------------------------------- */
_gemmeChatData ( ) {
2022-06-12 09:46:58 +02:00
const tplData = this . system
2021-10-29 21:31:58 +02:00
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 properties ;
}
2021-01-01 21:11:56 +01:00
}