Add rollTables

This commit is contained in:
2022-08-05 10:04:42 +02:00
parent cb54f6eda3
commit 2517149ab4
840 changed files with 77 additions and 40 deletions

View File

@ -302,7 +302,7 @@ export class CrucibleActor extends Actor {
// Compute whole enc
let enc = 0
for (let item of equipments) {
item.data.idrDice = CrucibleUtility.getDiceFromLevel(Number(item.data.idr))
//item.data.idrDice = CrucibleUtility.getDiceFromLevel(Number(item.data.idr))
if (item.data.equipped) {
if (item.data.iscontainer) {
enc += item.data.contentsEnc
@ -323,23 +323,6 @@ export class CrucibleActor extends Actor {
this.encCurrent = enc
this.containersTree = equipments.filter(item => item.data.containerid == "") // Returns the root of equipements without container
// Manages slow effect
let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity())
this.encHindrance = Math.floor(this.encCurrent / this.getEncumbranceCapacity())
//console.log("Capacity", overCapacity, this.encCurrent / this.getEncumbranceCapacity() )
let effect = this.data.items.find(item => item.type == "effect" && item.data.data.slow)
if (overCapacity >= 4) {
if (!effect) {
effect = await CrucibleUtility.getEffectFromCompendium("Slowed")
effect.data.slow = true
this.createEmbeddedDocuments('Item', [effect])
}
} else {
if (effect) {
this.deleteEmbeddedDocuments('Item', [effect.id])
}
}
}
/* -------------------------------------------- */
@ -589,7 +572,8 @@ export class CrucibleActor extends Actor {
let armor = this.getEquippedArmor()
if (armor) {
armor = duplicate(armor)
let diceValue = armor.data.absorprionroll
let diceColor = armor.data.absorprionroll
let rollTable = CrucibleUtility.getRollTableFromDiceColor( diceColor)
}
}