MDL/ADRL fixes + MR fixes

This commit is contained in:
LeRatierBretonnien 2023-09-19 11:41:58 +02:00
parent 7d6408f6b7
commit 26f2fba457
4 changed files with 14 additions and 7 deletions

View File

@ -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") {

View File

@ -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: `<div>${combatant.actor.name} is performing ${ticData[num].text}</div`
};
ChatMessage.create(chatData);

View File

@ -787,7 +787,7 @@ export class PegasusUtility {
// De-actived used effects from perks
let toRem = []
for (let effect of rollData.effectsList) {
if (effect.effect && effect.effect.system.isUsed && effect.effect.system.oneuse) {
if (effect?.effect?.system.isUsed && effect.effect.system.oneuse) {
effect.defenderTokenId = rollData.defenderTokenId
if (effect.foreign) {
if (game.user.isGM) {

View File

@ -252,7 +252,7 @@
],
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "11.0.18",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.18.zip",
"version": "11.0.19",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.19.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}