add dispel and divination

This commit is contained in:
Mike Bloy 2024-05-18 14:13:12 -05:00
parent b6c16ed0f5
commit db471b0cb9
3 changed files with 207 additions and 0 deletions

133
src/module/powers/dispel.js Normal file
View File

@ -0,0 +1,133 @@
import { PowerEffect } from './basePowers.js';
export class DispelEffect extends PowerEffect {
get name() {
return 'Dispel';
}
get icon() {
return 'icons/magic/symbols/triangle-glowing-green.webp';
}
get duration() {
return this?.data?.antiMagic ? 5 : 0;
}
get usePrimaryEffect() {
return !!this?.data?.antiMagic;
}
get basePowerPoints() {
return 1;
}
get isTargeted() {
return true;
}
get hasAoe() {
return true;
}
get modifiers() {
return [
...super.modifiers,
{
name: 'Anti-Magic Field',
type: 'checkbox',
value: 8,
id: 'antiMagic',
epic: true,
effect: false,
},
{
type: 'select',
default: 'none',
name: 'Area of Effect',
id: 'aoe',
epic: false,
choices: {
none: 'None',
sbt: 'Small Blast Template',
mbt: 'Medium Blast Template',
lbt: 'Large Blast Template',
},
effects: { none: null, sbt: null, mbt: null, lbt: null },
values: { none: 0, sbt: 1, mbt: 2, lbt: 3 },
},
{
name: 'Disenchant',
type: 'checkbox',
value: 1,
id: 'disenchant',
epic: true,
effect: false,
},
{
name: 'Multiple Powers',
type: 'checkbox',
value: 8,
id: 'multiple',
epic: false,
effect: false,
},
{
name: 'Remove Curse',
type: 'checkbox',
value: 2,
id: 'removeCurse',
epic: true,
effect: false,
},
];
}
get effectName() {
return this.data.antiMagic ? 'Anti-Magic Field' : super.effectName;
}
getPrimaryEffectChanges() {
if (this.data.antiMagic) {
const base = 'flags.swade.auras.antiMagicField';
const priority = 0;
const mode = foundry.CONST.ACTIVE_EFFECT_MODES.OVERRIDE;
return [
{ key: `${base}.enabled`, value: true, priority, mode },
{ key: `${base}.walls`, value: true, priority, mode },
{ key: `${base}.color`, value: '#ff00cc', priority, mode },
{ key: `${base}.alpha`, value: 0.1, priority, mode },
{ key: `${base}.radius`, value: 1.5, priority, mode },
{ key: `${base}.visibleTo`, value: [-1, 0, 1], priority, mode },
];
}
return super.getPrimaryEffectChanges();
}
get description() {
let text = super.description;
if (this.data.antiMagic) {
text += `<p>Magic items, effects, and powers within the anti magic field
have no effect. Summoned creatures must make a Spirit roll each round or
or take a wound.</p>`;
return text;
}
const multi = this.data.multiple || this.data.aoe;
const affected = `${multi ? 'all' : 'a single'}
${this.data.disenchant ? 'magic item' : 'power'}${multi ? 's' : ''}
${this.data.aoe === 'none' ? 'cast by or on the recipient' : 'within a ' + this.data.aoe.toUpperCase()}`;
text += `<p>Attempt to dispel ${affected}. `;
if (this.data.disenchant) {
text += `The item(s) magical abilities are negated for ${this.data.raise ? 'two rounds' : 'one round'}`;
} else {
text += `Each target must make an opposed arcane skill (spirit for Mystic Powers)
roll or have the power(s) end immediately.`;
}
if (this.data.removeCurse) {
text += `The normal -2 penalty to remove a curse is ignored.`;
} else {
text += `If the effect is a Curse, there is a -2 penalty to the dispeller's roll`;
}
text += '</p>';
return text;
}
}

View File

@ -0,0 +1,70 @@
import { PowerEffect } from './basePowers.js';
export class DivinationEffect extends PowerEffect {
get name() {
return 'Divination';
}
get icon() {
return 'icons/magic/perception/orb-crystal-ball-scrying.webp';
}
get duration() {
return 0;
}
get isTargeted() {
return false;
}
get isRaisable() {
return true;
}
get basePowerPoints() {
return 5;
}
get modifiers() {
return [
{
name: 'Power (sacred ground only)',
type: 'checkbox',
value: 5,
id: 'power',
epic: true,
effect: false,
},
{
name: 'Sacred Ground',
type: 'checkbox',
value: 0,
id: 'sacred',
epic: false,
effect: false,
},
];
}
get description() {
let desc = super.description;
desc += `<p>A brief conversation with a summoned spirit or entity. `;
if (this.data.sacred) {
desc += `There is a +2 to the roll due to being on sacred ground for the
summoned entity. `;
}
if (this.data.raise) {
desc += `The entity will be generally helpful and more direct than usual
in answering questions.i `;
} else {
desc += `The entity will answer questions to the best of its ability, but
usually in a vague or symbolic manner.i `;
}
if (this.data.sacred && this.data.power) {
desc += `The entity will also offer unsolicted advice or information,
according to its nature.`;
}
desc += '</p>';
return desc;
}
}

View File

@ -17,6 +17,8 @@ import { DarksightEffect } from './darksight.js';
import { DeflectionEffect } from './deflection.js'; import { DeflectionEffect } from './deflection.js';
import { DetectConcealArcanaEffect } from './detectConcealArcana.js'; import { DetectConcealArcanaEffect } from './detectConcealArcana.js';
import { DisguiseEffect } from './disguise.js'; import { DisguiseEffect } from './disguise.js';
import { DispelEffect } from './dispel.js';
import { DivinationEffect } from './divination.js';
const PowerClasses = { const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect, 'arcane-protection': ArcaneProtectionEffect,
@ -41,6 +43,8 @@ const PowerClasses = {
'detect-conceal-arcana': DetectConcealArcanaEffect, 'detect-conceal-arcana': DetectConcealArcanaEffect,
'detectconceal-arcana': DetectConcealArcanaEffect, 'detectconceal-arcana': DetectConcealArcanaEffect,
disguise: DisguiseEffect, disguise: DisguiseEffect,
dispel: DispelEffect,
divination: DivinationEffect,
'lower-trait': BoostLowerTraitEffect, 'lower-trait': BoostLowerTraitEffect,
}; };