From d1fdc5a97f016fbc00fbfa44e074c6fe21d65d5b Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Sat, 16 Sep 2023 20:31:34 +0200 Subject: [PATCH] Varioux fixes --- modules/pegasus-actor.js | 16 ++++++++++----- modules/pegasus-combat.js | 29 ++++++++++++++++++++++++--- system.json | 4 ++-- templates/pegasus-combat-tracker.html | 6 +++++- 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 22d5587..c331731 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -771,6 +771,11 @@ export class PegasusActor extends Actor { let myself = this let combat = duplicate(myself.system.combat) combat.stunlevel += incDec + let daze = this.effects.find( e => e.label == "Daze") + + if (daze && combat.stunlevel == 0) { + this.deleteEmbeddedDocuments("ActiveEffect", [ daze.id ] ) + } if (combat.stunlevel >= 0) { myself.update({ 'system.combat': combat }) let chatData = { @@ -778,10 +783,11 @@ export class PegasusActor extends Actor { rollMode: game.settings.get("core", "rollMode"), whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')) } - this.createEmbeddedDocuments("ActiveEffect", [ - { label: 'EFFECT.StatusDaze', icon: 'icons/svg/daze.svg', flags: { core: { statusId: 'daze' } } } - ]) - + if (!daze) { + this.createEmbeddedDocuments("ActiveEffect", [ + { label: 'Daze', icon: 'icons/svg/daze.svg', flags: { core: { statusId: 'daze' } } } + ]) + } if (incDec > 0) { chatData.content = `
${this.name} suffered a Stun level. 0 ) { + if ( this.system.combat.stunlevel > 0 ) { ui.notifications.warn("Unable to gain/use Momentum while stunned") return } diff --git a/modules/pegasus-combat.js b/modules/pegasus-combat.js index cc8e74d..e0d47fa 100644 --- a/modules/pegasus-combat.js +++ b/modules/pegasus-combat.js @@ -16,6 +16,7 @@ export class PegasusCombatTracker extends CombatTracker { let combatData = await super.getData() for (let t of combatData.turns) { let c = game.combat.combatants.get(t.id) + t.displayTIC = (c.actor.isOwner && c.actor.hasPlayerOwner) || (c.actor.type == "npc" && game.user.isGM) let TICs = c.getFlag("world", "TICs") if (TICs) { t.TICs = TICs @@ -23,7 +24,7 @@ export class PegasusCombatTracker extends CombatTracker { t.TICs = [] } } - console.log("CBT", combatData) + //console.log("CBT", combatData) return combatData } @@ -88,13 +89,24 @@ export class PegasusCombat extends Combat { selectActor(combatantId) { const combatant = game.combat.combatants.get(combatantId) if (combatant) { + let TICs = combatant.getFlag("world", "TICs") || [] + let allRevealed = true + for(let tic of TICs) { + if (!tic.revealed ) { + allRevealed = false + } + } + let msg = `
${combatant.actor.name} has been nominated to act, ${combatant.actor.name} choose which TIC you wish to activate!${combatant.actor.name} has used all its TIC's please choose a different character.${combatant.actor.name} has been nominated to act, ${combatant.actor.name} choose which TIC you wish to activate!${combatant.actor.name} : This Action has already been performed please choose a different TIC { diff --git a/system.json b/system.json index ac2f04c..4e34a3c 100644 --- a/system.json +++ b/system.json @@ -252,7 +252,7 @@ ], "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "11.0.11", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.11.zip", + "version": "11.0.12", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.12.zip", "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" } \ No newline at end of file diff --git a/templates/pegasus-combat-tracker.html b/templates/pegasus-combat-tracker.html index 8cac80d..0ce7b48 100644 --- a/templates/pegasus-combat-tracker.html +++ b/templates/pegasus-combat-tracker.html @@ -101,7 +101,11 @@ {{#if tic.revealed}} ACTED {{else}} - TIC: {{add index 1}} + {{#if ../displayTIC}} + {{tic.text}} + {{else}} + TIC: {{add index 1}} + {{/if}} {{/if}} {{/each}}