add mind link

This commit is contained in:
Mike Bloy 2024-05-23 17:04:29 -05:00
parent ef1eb940d0
commit 27989ffdfb
4 changed files with 98 additions and 6 deletions

View File

@ -79,7 +79,7 @@ export class PowerFormApplication extends FormApplication {
} }
if (this.powerEffect.hasAdditionalRecipients && this.powerEffect.targets.length > 1) { if (this.powerEffect.hasAdditionalRecipients && this.powerEffect.targets.length > 1) {
data.recipients.cost = this.powerEffect.additionalRecipientCost; data.recipients.cost = this.powerEffect.additionalRecipientCost;
data.recipients.count = this.powerEffect.targets.length - 1; data.recipients.count = this.powerEffect.additionalRecipientCount;
data.recipients.total = data.recipients.cost * data.recipients.count; data.recipients.total = data.recipients.cost * data.recipients.count;
data.recipients.epic = this.powerEffect.additionalRecipientsIsEpic; data.recipients.epic = this.powerEffect.additionalRecipientsIsEpic;
} }
@ -179,11 +179,11 @@ export class PowerEffect {
return true; return true;
} }
get hasAdditionalRecipients() { get isDamaging() {
return false; return false;
} }
get isDamaging() { get hasAdditionalRecipients() {
return false; return false;
} }
@ -191,6 +191,13 @@ export class PowerEffect {
return false; return false;
} }
get additionalRecipientCount() {
if (!this.hasAdditionalRecipients) {
return 0;
}
return Math.max(0, this.targets.length - 1);
}
get additionalRecipientCost() { get additionalRecipientCost() {
return 0; return 0;
} }
@ -587,9 +594,7 @@ export class PowerEffect {
} }
} }
} }
if (this.targets.length > 1 && this.hasAdditionalRecipients) { total += this.additionalRecipientCost * this.additionalRecipientCount;
total += (this.targets.length - 1) * this.additionalRecipientCost;
}
return total; return total;
} }

View File

@ -26,6 +26,10 @@ export class EnvironmentalProtectionEffect extends PowerEffect {
return true; return true;
} }
get basePowerPoints() {
return 2;
}
get modifiers() { get modifiers() {
return [ return [
...super.modifiers, ...super.modifiers,

View File

@ -0,0 +1,81 @@
import { PowerEffect } from './basePowers.js';
export class MindLinkEffect extends PowerEffect {
get name() {
return 'Mind Link';
}
get duration() {
return 50;
}
get icon() {
return 'icons/skills/social/diplomacy-unity-alliance.webp';
}
get hasAdditionalRecipients() {
return true;
}
get additionalRecipientCost() {
return 1;
}
get isTargeted() {
return true;
}
get basePowerPoints() {
return 1;
}
get modifiers() {
return [
...super.modifiers,
{
name: 'Broadcast',
id: 'broadcast',
value: 2,
type: 'checkbox',
default: false,
epic: true,
effect: false,
},
{
name: 'Long Distance Link',
id: 'longlink',
value: 3,
type: 'checkbox',
default: false,
epic: true,
effect: false,
},
];
}
get additionalRecipientCount() {
return Math.max(0, this.targets.length - 2);
}
get description() {
let text = super.description;
if (this.data.broadcast) {
text += `<p>The caster can broadcast a short message to everyone within
Smarts ${this.data.raise ? 8 : 4}.</p>`;
} else {
text += `<p>Create a telepathic link that functions like speach between
two minds.
`;
if (this.data.longlink) {
text += `The ends of the link may be anywhere on the same plane. `;
} else {
text += `Once activated, Range between linked minds is
${this.data.raise ? 'five miles' : 'one mile'}. `;
}
text += `</p><p>
If a linked character suffers a Wound, all others in the link must make
a Smarts roll or be Shaken (this can't cause a Wound).</p>`;
}
return text;
}
}

View File

@ -36,6 +36,7 @@ import { IntangibilityEffect } from './intangibility.js';
import { InvisibliltyEffect } from './invisibility.js'; import { InvisibliltyEffect } from './invisibility.js';
import { LightDarknessEffect } from './lightdarkness.js'; import { LightDarknessEffect } from './lightdarkness.js';
import { LocateEffect } from './locate.js'; import { LocateEffect } from './locate.js';
import { MindLinkEffect } from './mindLink.js';
const PowerClasses = { const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect, 'arcane-protection': ArcaneProtectionEffect,
@ -85,6 +86,7 @@ const PowerClasses = {
light: LightDarknessEffect, light: LightDarknessEffect,
locate: LocateEffect, locate: LocateEffect,
'lower-trait': BoostLowerTraitEffect, 'lower-trait': BoostLowerTraitEffect,
'mind-link': MindLinkEffect,
shrink: GrowthShrinkEffect, shrink: GrowthShrinkEffect,
}; };