diff --git a/src/module/powers/farsight.js b/src/module/powers/farsight.js new file mode 100644 index 0000000..6773379 --- /dev/null +++ b/src/module/powers/farsight.js @@ -0,0 +1,61 @@ +import { PowerEffect } from './basePowers.js'; + +export class FarsightEffect extends PowerEffect { + get name() { + return 'Farsight'; + } + + get duration() { + return 5; + } + + get icon() { + return 'icons/magic/perception/eye-ringed-green.webp'; + } + + get hasAdditionalRecipients() { + return true; + } + + get additionalRecipientCost() { + return 1; + } + + get isTargeted() { + return true; + } + + get modifiers() { + const mods = super.modifiers; + mods.push({ + name: 'Greater Farsight', + id: 'greater', + value: 2, + type: 'checkbox', + default: false, + epic: true, + effect: false, + }); + return mods; + } + + get description() { + let text = super.description; + text += `
See in detail up to + ${this.data.raise && this.data.greater ? 'two miles' : 'a mile'}. + `; + if (this.data.greater) { + text += 'Ignore all Range penalties.'; + } else if (this.data.raise) { + text += 'Halve all Range penalties.'; + } + text += '
'; + return text; + } + + get effectName() { + const greater = this.data.greater; + const raise = this.data.raise; + return `${greater ? 'Greater ' : ''}Faright ${raise ? '(major)' : ''}`; + } +} diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index e080a7b..8541001 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -25,6 +25,7 @@ import { ElementalManipulationEffect } from './elementalManipulation.js'; import { EmpathyEffect } from './empathy.js'; import { EntangleEffect } from './entangle.js'; import { EnvironmentalProtectionEffect } from './environmentalProtection.js'; +import { FarsightEffect } from './farsight.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -57,6 +58,7 @@ const PowerClasses = { empathy: EmpathyEffect, entangle: EntangleEffect, 'environmental-protection': EnvironmentalProtectionEffect, + farsight: FarsightEffect, 'lower-trait': BoostLowerTraitEffect, };