Compare commits

...

3 Commits

Author SHA1 Message Date
8a8bd489f3 Fix #77 2022-10-03 17:18:10 +02:00
43724596fb Fix #77 2022-10-03 17:17:28 +02:00
e06572c221 Fix #77 2022-10-03 15:32:22 +02:00
3 changed files with 33 additions and 4 deletions

View File

@ -260,7 +260,7 @@ export class PegasusActor extends Actor {
let effect = duplicate(__bonusEffect)
effect.name = `${name} Tactician Bonus Dice`
effect.system.effectlevel = level
effect.system.stataffected = "all"
effect.system.stataffected = "mr"
effect.system.bonusdice = true
await this.createEmbeddedDocuments('Item', [effect])
ChatMessage.create({ content: `Tactician Bonus Dice has been added to ${this.name} (${level})` })

View File

@ -1148,6 +1148,16 @@ export class PegasusUtility {
applyDef.actor.removeTacticianEffect()
}
}
//Delete all effects if no more tacticians (ie deleted case)
if (tacticianTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) {
if (token.actor.hasTacticianBonus()) {
token.actor.removeTacticianEffect()
}
}
}
}
/* -------------------------------------------- */
@ -1188,6 +1198,15 @@ export class PegasusUtility {
applyDef.actor.removeEnhancerEffect()
}
}
// Delete all effects if no more tacticians (ie deleted case)
if (enhancerTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) {
if (token.actor.hasEnhancerBonus()) {
token.actor.removeEnhancerEffect()
}
}
}
}
/* -------------------------------------------- */
@ -1227,6 +1246,16 @@ export class PegasusUtility {
applyDef.actor.removeAgitatorHindrance()
}
}
// Delete all effects if no more tacticians (ie deleted case)
if (agitatorTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) {
if (token.actor.addAgitatorHindrance()) {
token.actor.removeAgitatorHindrance()
}
}
}
}
/* -------------------------------------------- */
@ -1234,7 +1263,7 @@ export class PegasusUtility {
// Small optimization
let now = Date.now()
if ( now - this.lastRoleEffectProcess < 300 ) {
if (now - this.lastRoleEffectProcess < 300) {
return // Save some processing
}
this.lastRoleEffectProcess = now

View File

@ -253,7 +253,7 @@
],
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.0.29",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.29.zip",
"version": "10.0.31",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.31.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}