Manage equipement
This commit is contained in:
parent
c7dc3b95eb
commit
ee3e568cd8
@ -776,13 +776,16 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
equiperObjet( itemID )
|
async equiperObjet( itemID )
|
||||||
{
|
{
|
||||||
let item = this.getOwnedItem(itemID);
|
let item = this.getOwnedItem(itemID);
|
||||||
if ( item && item.data.data ) {
|
if ( item && item.data.data ) {
|
||||||
let update = duplicate(item);
|
console.log(item);
|
||||||
update.data.equipe = !update.data.equipe;
|
//let update = duplicate(item);
|
||||||
this.updateEmbeddedEntity("OwnedItem", update);
|
let update = {_id: item._id, "data.equipe": !item.data.data.equipe };
|
||||||
|
//update.data.equipe = !update.data.equipe;
|
||||||
|
//console.log(update);
|
||||||
|
await this.updateEmbeddedEntity("OwnedItem", update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,6 +428,7 @@ export class RdDUtility {
|
|||||||
return { result: result, label: txt };
|
return { result: result, label: txt };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
static computeBlessuresSante( degats, mortalite="mortel" ) {
|
static computeBlessuresSante( degats, mortalite="mortel" ) {
|
||||||
let encaissement = RdDUtility.selectEncaissement(degats, mortalite)
|
let encaissement = RdDUtility.selectEncaissement(degats, mortalite)
|
||||||
let over20 = degats > 20 ? degats - 20 : 0
|
let over20 = degats > 20 ? degats - 20 : 0
|
||||||
@ -436,6 +437,7 @@ export class RdDUtility {
|
|||||||
return encaissement;
|
return encaissement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
static selectEncaissement( degats, mortalite ) {
|
static selectEncaissement( degats, mortalite ) {
|
||||||
const table = definitionsEncaissement[mortalite] === undefined ? definitionsEncaissement["mortel"] : definitionsEncaissement[mortalite];
|
const table = definitionsEncaissement[mortalite] === undefined ? definitionsEncaissement["mortel"] : definitionsEncaissement[mortalite];
|
||||||
for (let encaissement of table) {
|
for (let encaissement of table) {
|
||||||
@ -448,6 +450,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
static _evaluatePerte(formula, over20) {
|
static _evaluatePerte(formula, over20) {
|
||||||
console.log("_evaluatePerte", formula, over20 )
|
console.log("_evaluatePerte", formula, over20 )
|
||||||
let perte = new Roll(formula, { over20:over20})
|
let perte = new Roll(formula, { over20:over20})
|
||||||
|
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "0.9.28",
|
"version": "0.9.29",
|
||||||
"minimumCoreVersion": "0.7.5",
|
"minimumCoreVersion": "0.7.5",
|
||||||
"compatibleCoreVersion": "0.7.6",
|
"compatibleCoreVersion": "0.7.6",
|
||||||
"templateVersion": 41,
|
"templateVersion": 41,
|
||||||
|
Loading…
Reference in New Issue
Block a user