From 1a69116c064f4fb5b04d9c70e34faab45b13c778 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Thu, 10 Mar 2022 21:39:12 +0100 Subject: [PATCH] Add fight options --- module/actor/actor.js | 11 +++++++++++ module/system/bol-combat.js | 2 +- system.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index 8f7b4b0..af32d91 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -56,6 +56,17 @@ export class BoLActor extends Actor { get aptitudes() { return Object.values(this.data.data.aptitudes) } + + /* -------------------------------------------- */ + clearRoundModifiers( ) { // Process data/items that are finished at end of a round + let foList = this.fightoptions + for(let fo of foList) { + if (fo.data.properties.used) { + this.updateEmbeddedDocuments("Item", [ {_id: fo._id, 'data.properties.used': false}] ) + } + } + } + /* -------------------------------------------- */ get defenseValue() { let defMod = 0 diff --git a/module/system/bol-combat.js b/module/system/bol-combat.js index 2d7600e..0127a77 100644 --- a/module/system/bol-combat.js +++ b/module/system/bol-combat.js @@ -55,7 +55,7 @@ export class BoLCombatManager extends Combat { let combatants = this.combatants.contents for (let c of combatants) { let actor = game.actors.get( c.data.actorId ) - //actor.clearRoundModifiers() + actor.clearRoundModifiers() } super.nextRound() } diff --git a/system.json b/system.json index d6765ca..f80191b 100644 --- a/system.json +++ b/system.json @@ -7,7 +7,7 @@ "url": "https://github.com/ZigmundKreud/bol", "license": "LICENSE.txt", "flags": {}, - "version": "1.2.0", + "version": "1.2.1", "templateVersion": 22, "minimumCoreVersion": "0.8.6", "compatibleCoreVersion": "9",