/* globals Portal */ import { moduleName } from '../globals.js'; import { ActorFolderEffect } from './basePowers.js'; class BaseSummonEffect extends ActorFolderEffect { get name() { return 'Base Summon'; } get actorFolderBase() { return 'Summonables'; } get values() { return {}; } get hasIncreasedTrait() { return true; } get summonCount() { return 1 + (this?.data?.additionalAllies ?? 0); } get additionalName() { return 'Additional Allies'; } get additionalDesc() { return '(half base cost (round up))'; } get additionalEpic() { return true; } get modifiers() { const mods = super.modifiers; if (this.hasIncreasedTrait) { mods.push({ type: 'checkbox', name: 'Increased Trait (+1 per trait)', id: 'increasedTrait', value: 0, effect: false, epic: false, default: false, }); } mods.push({ type: 'number', name: `${this.additionalName} ${this.additionalDesc}`, value: 0, id: 'additionalAllies', default: 0, epic: this.additionalEpic, effect: false, }); mods.push({ type: 'checkbox', name: 'Mind Rider', id: 'mindRider', value: 1, effect: false, epic: false, default: false, }); return mods; } actorValue(actor) { const values = this.values; if (actor.name.toLowerCase() in values) { return values[actor.name.toLowerCase()]; } return 0; } async prepIncreasedTrait() { if (!(this.hasIncreasedTrait && this?.data?.increasedTrait)) { this.data.increasedTraitCount = 0; return; } const skillSet = new Set(); for (const skill of this.targetActor.items.filter((i) => i.type === 'skill')) { skillSet.add(skill.name); } for (const item of Object.values(this.data.embeddedUpdates.Item).filter((i) => i.type === 'skill')) { skillSet.add(item.name); } const skillList = Array.from(skillSet); skillList.sort(); const attrList = ['Agility', 'Smarts', 'Spirit', 'Strength', 'Vigor']; let html = `