add summon effects

This commit is contained in:
Mike Bloy 2024-06-09 17:59:37 -05:00
parent d520f8e137
commit cc14b28d40
2 changed files with 98 additions and 6 deletions

View File

@ -59,7 +59,14 @@ import { SmiteEffect } from './smite.js';
import { SoundSilenceEffect } from './soundSilence.js';
import { SpeakLanguageEffect } from './speakLanguage.js';
import { StunEffect } from './stun.js';
import { SummonAllyEffect } from './summon.js';
import {
SummonAllyEffect,
SummonMonsterEffect,
SummonNaturesAllyEffect,
SummonPlanarAllyEffect,
SummonAnimalEffect,
SummonUndeadEffect,
} from './summon.js';
import { TelekinesisEffect } from './telekinesis.js';
import { TeleportEffect } from './teleport.js';
import { TimeStopEffect } from './timeStop.js';
@ -149,6 +156,11 @@ const PowerClasses = {
'speak-language': SpeakLanguageEffect,
stun: StunEffect,
'summon-ally': SummonAllyEffect,
'summon-animal': SummonAnimalEffect,
'summon-monster': SummonMonsterEffect,
'summon-natures-ally': SummonNaturesAllyEffect,
'summon-planar-ally': SummonPlanarAllyEffect,
'summon-undead': SummonUndeadEffect,
telekinesis: TelekinesisEffect,
teleport: TeleportEffect,
'time-stop': TimeStopEffect,

View File

@ -1,3 +1,4 @@
import { moduleName } from '../globals.js';
import { BaseSummonEffect } from './summonSupport.js';
class BaseAllyEffect extends BaseSummonEffect {
@ -17,6 +18,10 @@ class BaseAllyEffect extends BaseSummonEffect {
return false;
}
get isRaisable() {
return false;
}
get summonCount() {
return 1 + (this?.data?.additionalAllies ?? 0);
}
@ -33,6 +38,10 @@ class BaseAllyEffect extends BaseSummonEffect {
return true;
}
get commonActorPool() {
return true;
}
get modifiers() {
const mods = super.modifiers;
mods.push({
@ -68,12 +77,25 @@ class BaseAllyEffect extends BaseSummonEffect {
return mods;
}
actorValue(actor) {
const values = this.values;
if (actor.name.toLowerCase() in values) {
return values[actor.name.toLowerCase()];
prepActors() {
const actors = super.prepActors();
if (!this.commonActorPool) {
return actors;
}
return 0;
const newActors = {};
for (const key of Object.keys(actors)) {
const actor = actors[key];
const summon = actor.getFlag(moduleName, 'summonData');
if (summon?.powers?.[this.name]) {
newActors[key] = actor;
}
}
return newActors;
}
actorValue(actor) {
const summon = actor.getFlag(moduleName, 'summonData');
return summon?.cost ?? 0;
}
get powerPoints() {
@ -225,10 +247,18 @@ export class SummonAllyEffect extends BaseAllyEffect {
return `${this.actorFolderBase}/${this.name}`;
}
get commonActorPool() {
return false;
}
get icon() {
return 'icons/magic/control/silhouette-hold-beam-blue.webp';
}
get isRaisable() {
return true;
}
actorValue(actor) {
const values = {
attendant: 1,
@ -405,3 +435,53 @@ export class SummonAllyEffect extends BaseAllyEffect {
return desc;
}
}
export class SummonMonsterEffect extends BaseAllyEffect {
get name() {
return 'Summon Monster';
}
get icon() {
return 'icons/magic/symbols/mask-metal-silver-white.webp';
}
}
export class SummonNaturesAllyEffect extends BaseAllyEffect {
get name() {
return "Summon Nature's Ally";
}
get icon() {
return 'icons/magic/symbols/mask-yellow-orange.webp';
}
}
export class SummonAnimalEffect extends BaseAllyEffect {
get name() {
return 'Summon Animal';
}
get icon() {
return 'icons/magic/symbols/mask-yellow-orange.webp';
}
}
export class SummonPlanarAllyEffect extends BaseAllyEffect {
get name() {
return 'Summon Planar Ally';
}
get icon() {
return 'icons/magic/symbols/rune-sigil-horned-blue.webp';
}
}
export class SummonUndeadEffect extends BaseAllyEffect {
get name() {
return 'Summon Undead';
}
get icon() {
return 'icons/magic/death/skeleton-glow-yellow-black.webp';
}
}