diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 9e4c2c9..a979bf6 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -495,7 +495,7 @@ export class PegasusActor extends Actor { /* -------------------------------------------- */ async activateViceOrVirtue(itemId) { let item = this.items.find(item => item.id == itemId) - if (item && item.system) { + if (item?.system) { let nrg = duplicate(this.system.nrg) if (!item.system.activated) { // Current value @@ -581,7 +581,7 @@ export class PegasusActor extends Actor { /* -------------------------------------------- */ async activatePower(itemId) { let item = this.items.find(item => item.id == itemId) - if (item && item.system) { + if (item?.system) { let nrg = duplicate(this.system.nrg) if (!item.system.activated) { // Current value @@ -1517,6 +1517,11 @@ export class PegasusActor extends Actor { let effect = await PegasusUtility.getEffectFromCompendium("Fear") this.createEmbeddedDocuments('Item', [effect]) } + } else { // Remove fear if healed + let fear = this.items.find(it => it.name.toLowerCase() == "fear" && it.type == "effect") + if (fear) { + this.deleteEmbeddedDocuments('Item', [fear.id]) + } } /* Manage flag state for status */ this.defeatedDisplayed = this.defeatedDisplayed && this.system.secondary.health.status != "defeated" @@ -1934,6 +1939,10 @@ export class PegasusActor extends Actor { for (let effect of effects) { if (effect.system.hindrance) { hindrancesDices += effect.system.effectlevel + if ( effect.system.oneuse) { + effect.system.isUSed = true // Ensure deletion + this.deleteEmbeddedDocuments('Item', [effect.id]) + } } } if (statKey.toLowerCase() == "stl" && this.system.secondary.concealment.status == "exposed") { diff --git a/modules/pegasus-combat.js b/modules/pegasus-combat.js index d26fb13..873267d 100644 --- a/modules/pegasus-combat.js +++ b/modules/pegasus-combat.js @@ -104,7 +104,6 @@ export class PegasusCombat extends Combat { user: game.user.id, alias: combatant.actor.name, rollMode: game.settings.get("core", "rollMode"), - whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')), content: msg } ChatMessage.create(chatData); @@ -153,7 +152,6 @@ export class PegasusCombat extends Combat { user: game.user.id, alias: combatant.actor.name, rollMode: game.settings.get("core", "rollMode"), - whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')), content: `