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) {
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.epic = this.powerEffect.additionalRecipientsIsEpic;
}
@ -179,11 +179,11 @@ export class PowerEffect {
return true;
}
get hasAdditionalRecipients() {
get isDamaging() {
return false;
}
get isDamaging() {
get hasAdditionalRecipients() {
return false;
}
@ -191,6 +191,13 @@ export class PowerEffect {
return false;
}
get additionalRecipientCount() {
if (!this.hasAdditionalRecipients) {
return 0;
}
return Math.max(0, this.targets.length - 1);
}
get additionalRecipientCost() {
return 0;
}
@ -587,9 +594,7 @@ export class PowerEffect {
}
}
}
if (this.targets.length > 1 && this.hasAdditionalRecipients) {
total += (this.targets.length - 1) * this.additionalRecipientCost;
}
total += this.additionalRecipientCost * this.additionalRecipientCount;
return total;
}

View File

@ -26,6 +26,10 @@ export class EnvironmentalProtectionEffect extends PowerEffect {
return true;
}
get basePowerPoints() {
return 2;
}
get modifiers() {
return [
...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 { LightDarknessEffect } from './lightdarkness.js';
import { LocateEffect } from './locate.js';
import { MindLinkEffect } from './mindLink.js';
const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect,
@ -85,6 +86,7 @@ const PowerClasses = {
light: LightDarknessEffect,
locate: LocateEffect,
'lower-trait': BoostLowerTraitEffect,
'mind-link': MindLinkEffect,
shrink: GrowthShrinkEffect,
};