add environmental protection

This commit is contained in:
Mike Bloy 2024-05-19 20:37:47 -05:00
parent 909457d1dd
commit b6a42818c8
3 changed files with 83 additions and 1 deletions

View File

@ -6,7 +6,7 @@ export class ElementalManipulationEffect extends PowerEffect {
}
get icon() {
return 'icons/magic/earth/projectiles-stone-salvo-gray.webp';
return 'icons/magic/symbols/elements-air-earth-fire-water.webp';
}
get duration() {

View File

@ -0,0 +1,80 @@
import { moduleName } from '../globals.js';
import { PowerEffect } from './basePowers.js';
export class EnvironmentalProtectionEffect extends PowerEffect {
get name() {
return 'Environmental Protection';
}
get duration() {
return 600 * (this.data?.raise ? 8 : 1);
}
get icon() {
return 'icons/magic/defensive/barrier-shield-dome-pink.webp';
}
get hasAdditionalRecipients() {
return true;
}
get additionalRecipientCost() {
return 1;
}
get isTargeted() {
return true;
}
get modifiers() {
return [
...super.modifiers,
{
name: 'Environmental Resistance',
id: 'resist',
value: 1,
type: 'checkbox',
default: false,
epic: false,
effect: true,
icon: 'icons/magic/defensive/barrier-shield-dome-blue-purple.webp',
changes: [
{
key: `flags.${moduleName}.environmentalResistance`,
value: true,
priority: 0,
mode: foundry.CONST.ACTIVE_EFFECT_MODES.OVERRIDE,
},
],
},
{
name: 'Planar Adaptation',
id: 'planar',
value: 2,
type: 'checkbox',
default: false,
epic: false,
effect: false,
},
];
}
get description() {
let text = super.description;
text += `<p>Breathe, speak, and move at normal pace in an otherwise fatal
environment.
`;
if (this.data.resist) {
text += `Gain resistances to one energy source, reducing damage by
${this.data.raise ? 6 : 4}.
`;
}
if (this.data.planar) {
text += `This also protects against the extreme conditions that on other
planes of existance.
`;
}
text += '</p>';
return text;
}
}

View File

@ -24,6 +24,7 @@ import { DrainPowerPointsEffect } from './drainPowerPoints.js';
import { ElementalManipulationEffect } from './elementalManipulation.js';
import { EmpathyEffect } from './empathy.js';
import { EntangleEffect } from './entangle.js';
import { EnvironmentalProtectionEffect } from './environmentalProtection.js';
const PowerClasses = {
'arcane-protection': ArcaneProtectionEffect,
@ -55,6 +56,7 @@ const PowerClasses = {
'elemental-manipulation': ElementalManipulationEffect,
empathy: EmpathyEffect,
entangle: EntangleEffect,
'environmental-protection': EnvironmentalProtectionEffect,
'lower-trait': BoostLowerTraitEffect,
};