Compare commits
3 Commits
fvtt-pegas
...
fvtt-pegas
Author | SHA1 | Date | |
---|---|---|---|
8a8bd489f3 | |||
43724596fb | |||
e06572c221 |
@ -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})` })
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
}
|
Reference in New Issue
Block a user