import { moduleName } from '../globals.js'; import { PowerEffect } from './basePowers.js'; export class InvisibliltyEffect extends PowerEffect { get name() { return 'Invisibility'; } get duration() { return 5; } get icon() { return 'icons/svg/invisible.svg'; } get hasAdditionalRecipients() { return true; } get additionalRecipientCost() { return 3; } get basePowerPoints() { return 5; } get isTargeted() { return true; } get isRaisable() { return true; } get modifiers() { const mods = super.modifiers; mods.push({ name: 'Duration', type: 'checkbox', id: 'Duration', value: 2, epic: true, effect: false, }); return mods; } get description() { let text = super.description + `

The subject is invisible, except for a vague blur or outline. Any action taken against it that requires sight is made at ${this.data.raise ? -6 : -4}, including Notice rolls. This penalty is reduced by 2 if the invisible character's position is given away by some environmental circumstance.

`; if (this.data.duration) { text += `

This long-duration invisibility ends immediately if the subject attempts a damage-causing attack or targets an unwilling character with a power.

`; } return text; } async parseValues() { await super.parseValues(); const doc = await PowerEffect.getStatus('EFFECT.StatusInvisible', 'Invisible'); doc.description = `

From ${this.source.name} casting ${this.name}

`; doc.flags = mergeObject(doc.flags ?? {}, { [moduleName]: { powerEffect: true } }); this.basePrimaryEffectDoc = doc; } get basePrimaryEffect() { return this.basePrimaryEffectDoc; } }