This commit is contained in:
Mike Bloy 2024-05-19 00:33:37 -05:00
parent caee516d48
commit 2dda9d76a4
3 changed files with 120 additions and 1 deletions

View File

@ -422,6 +422,18 @@ export class PowerEffect {
return changes; return changes;
} }
getMaintainEffectChanges() {
const changes = [
{
key: 'flags.swade-mb-helpers.powerMaintained',
value: 1,
priority: 0,
mode: foundry.CONST.ACTIVE_EFFECT_MODES.OVERRIDE,
},
];
return changes;
}
get description() { get description() {
return ''; return '';
} }
@ -473,7 +485,7 @@ export class PowerEffect {
if (!this.usePrimaryEffect) { if (!this.usePrimaryEffect) {
icon = this.icon; icon = this.icon;
} }
const doc = this.createEffectDocument(icon, `Maintaining ${this.effectName}`, []); const doc = this.createEffectDocument(icon, `Maintaining ${this.effectName}`, this.getMaintainEffectChanges());
doc.duration.rounds = this.duration; doc.duration.rounds = this.duration;
if (moduleHelpers.useVAE) { if (moduleHelpers.useVAE) {
doc.flags['visual-active-effects'] = { data: { content: this.description } }; doc.flags['visual-active-effects'] = { data: { content: this.description } };

View File

@ -0,0 +1,105 @@
import { PowerEffect } from './basePowers.js';
export class EmpathyEffect extends PowerEffect {
get name() {
return 'Empathy';
}
get duration() {
return 5 * (this?.data?.duration ?? false ? 10 : 1);
}
get icon() {
return 'icons/skills/social/diplomacy-handshake-yellow.webp';
}
get hasAdditionalRecipients() {
return true;
}
get additionalRecipientCost() {
return 1;
}
get basePowerPoints() {
return 1;
}
get isTargeted() {
return true;
}
get modifiers() {
return [
...super.modifiers,
{
name: 'Charm',
type: 'checkbox',
id: 'charm',
value: 2,
epic: false,
effect: false,
},
{
name: 'Duration',
type: 'checkbox',
id: 'duration',
value: 1,
epic: false,
effect: false,
},
{
name: 'Truth',
type: 'checkbox',
id: 'truth',
value: 2,
epic: true,
effect: false,
},
];
}
get effectName() {
const extra = [];
if (this.data.charm) {
extra.push('Charm');
}
if (this.data.truth) {
extra.push('Truth');
}
const extraText = extra.length ? ` (${extra.join(', ')})` : '';
return this.name + extraText;
}
getMaintainEffectChanges() {
const mode = foundry.CONST.ACTIVE_EFFECT_MODES.ADD;
const value = this.data.raise ? 2 : 1;
return ['Intimidation', 'Persuasion', 'Performance', 'Taunt', 'Riding'].map(function (skill) {
return {
key: `@Skill{${skill}}[system.die.modifier]`,
priority: 0,
mode,
value,
};
});
}
get description() {
let text = super.description;
text += `
<p>Opposed by Spirit. If the target fails, caster gets
+${this.data.raise ? 2 : 1} to Intimidation, Persuasion, Performance,
Taunt or Riding (if target is an animal) rolls vs the target, except for
rolls to activate powers.</p>`;
if (this.data.charm) {
text += `<p>an Uncooperative target is made
${this.data.raise ? 'Friendly' : 'Cooperative'}.
The spell ends instantly if the caster's group attacks the victim's group.</p>`;
}
if (this.data.truth) {
text += '<p>The caster knows if the targets believe they are telling the truth.</p>';
}
return text;
}
}

View File

@ -22,6 +22,7 @@ import { DispelEffect } from './dispel.js';
import { DivinationEffect } from './divination.js'; import { DivinationEffect } from './divination.js';
import { DrainPowerPointsEffect } from './drainPowerPoints.js'; import { DrainPowerPointsEffect } from './drainPowerPoints.js';
import { ElementalManipulationEffect } from './elementalManipulation.js'; import { ElementalManipulationEffect } from './elementalManipulation.js';
import { EmpathyEffect } from './empathy.js';
const PowerClasses = { const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect, 'arcane-protection': ArcaneProtectionEffect,
@ -51,6 +52,7 @@ const PowerClasses = {
divination: DivinationEffect, divination: DivinationEffect,
'drain-power-points': DrainPowerPointsEffect, 'drain-power-points': DrainPowerPointsEffect,
'elemental-manipulation': ElementalManipulationEffect, 'elemental-manipulation': ElementalManipulationEffect,
empathy: EmpathyEffect,
'lower-trait': BoostLowerTraitEffect, 'lower-trait': BoostLowerTraitEffect,
}; };