import { moduleName } from '../globals.js'; import { PowerEffect } from './basePowers.js'; export class BlindEffect extends PowerEffect { get name() { return 'Blind'; } get icon() { return 'icons/skills/wounds/injury-eyes-blood-red.webp'; } get duration() { return 0; } get isTargeted() { return true; } get hasAoe() { return true; } get basePowerPoints() { return 2; } getPrimaryEffectChanges() { const changes = [ { key: 'system.stats.globalMods.trait', value: -2, priority: 0, mode: foundry.CONST.ACTIVE_EFFECT_MODES.ADD, }, ]; return changes; } get description() { return ( super.description + `

${this.data.raise ? -4 : -2} penalty to all actions involving sight.

Shake off attempts at end of turns with a Vigor ${this.data.strong ? '-2 ' : ''} roll as a free action. Success removes 2 points of penalties. A raise removes the effect.

` ); } async createSecondaryEffects(maintId) { const docs = await super.createSecondaryEffects(maintId); if (this.data.raise) { const strong = this.data.strong; const doc = this.createEffectDocument(this.icon, `Blinded (${strong ? 'Strong, ' : ''}Raise)`, [ { key: 'system.stats.globalMods.trait', value: -2, priority: 0, mode: foundry.CONST.ACTIVE_EFFECT_MODES.ADD, }, ]); doc.duration.seconds = 594; doc.description = this.description + '

This is the raise effect which can be shaken off separately.

'; doc.flags[moduleName].maintId = maintId; docs.push(doc); } return docs; } get modifiers() { const mods = super.modifiers; mods.push({ name: 'Strong', type: 'checkbox', value: 1, id: 'strong', epic: false, effect: false, }); mods.push({ type: 'select', default: 'none', name: 'Area of Effect', id: 'aoe', epic: true, choices: { none: 'None', mbt: 'Medium Blast Template', lbt: 'Large Blast Template', }, effects: { none: null, mbt: null, lbt: null }, values: { none: 0, mbt: 2, lbt: 3 }, }); return mods; } get effectName() { const strong = this.data.strong; return `Blinded${strong ? ' (Strong)' : ''}`; } get chatMessageEffects() { const list = super.chatMessageEffects; if (this.data.aoe !== 'none') { list.push(this.data.aoe.toUpperCase()); } return list; } }