diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 741776e..700b5ab 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -2086,13 +2086,34 @@ export class PegasusActor extends Actor { level += Number(armour.system.armourdicevalue) } } - //console.log(">>>> AMROR, ", level, arc.armourlevel) if (level != Number(arc.armourlevel)) { arc.armourlevel = level setTimeout(500, this.update({ [`system.arcs.${arcKey}`]: arc })) } } + // Shield management + if (item.type == "vehiclemodule" && item.system.category == "shield") { + let shieldsList = this.items.filter(item => item.type == "vehiclemodule" && item.system.category == "shield") || [] + shieldsList.push(item) + let level = 0 + for (let armour of shieldsList) { + if (armour.system.shielddicevalue > 0) { + level += Number(armour.system.shielddicevalue) + } + } + let shift = 500 + for( let loc of __LocationsArmour) { + let arcKey = loc + "arc" + let arc = duplicate(this.system.arcs[arcKey]) + if (level != Number(arc.shieldlevel)) { + arc.shieldlevel = level + setTimeout(shift, this.update({ [`system.arcs.${arcKey}`]: arc })) + shift += 200 + } + } + } + return true }