#191 - Ajout de la commande stress

This commit is contained in:
2021-05-19 22:44:14 +02:00
parent 7022c2134e
commit 3621a4e09d
5 changed files with 41 additions and 5 deletions

View File

@ -872,6 +872,12 @@ export class RdDActor extends Actor {
await this.update({ [`data.compteurs.${fieldName}.value`]: fieldValue });
}
/* -------------------------------------------- */
async addCompteurValue(fieldName, fieldValue) {
let oldValue = (Misc.templateData(this)).compteurs[fieldName].value;
await this.update({ [`data.compteurs.${fieldName}.value`]: Number(oldValue) + Number(fieldValue) } );
}
/* -------------------------------------------- */
async updateAttributeValue(fieldName, fieldValue) {
await this.update({ [`data.attributs.${fieldName}.value`]: fieldValue });
@ -1245,7 +1251,7 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async cacheTMRetMessage() {
await this.reinsertionAleatoire();
await this.reinsertionAleatoire("Action MJ");
await this.cacheTMR();
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_tmr_move", data: {
@ -2877,7 +2883,6 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
refreshTMRView(tmrData) {
console.log("REFRESH !!!!");
if (this.currentTMR) {
this.currentTMR.externalRefresh(tmrData)
}