add farsight

This commit is contained in:
Mike Bloy 2024-05-19 23:11:33 -05:00
parent b6a42818c8
commit 53563af7d0
2 changed files with 63 additions and 0 deletions

View File

@ -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 += `<p>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 += '</p>';
return text;
}
get effectName() {
const greater = this.data.greater;
const raise = this.data.raise;
return `${greater ? 'Greater ' : ''}Faright ${raise ? '(major)' : ''}`;
}
}

View File

@ -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,
};