add sound/silence
This commit is contained in:
parent
805f50c631
commit
b646524a97
@ -53,6 +53,7 @@ import { ShapeChangeEffect } from './shapeChange.js';
|
||||
import { SlothSpeedEffect } from './slothSpeed.js';
|
||||
import { SlumberEffect } from './slumber.js';
|
||||
import { SmiteEffect } from './smite.js';
|
||||
import { SoundSilenceEffect } from './soundSilence.js';
|
||||
|
||||
const PowerClasses = {
|
||||
'arcane-protection': ArcaneProtectionEffect,
|
||||
@ -117,12 +118,16 @@ const PowerClasses = {
|
||||
scrying: ScryingEffect,
|
||||
'shape-change': ShapeChangeEffect,
|
||||
shrink: GrowthShrinkEffect,
|
||||
silence: SoundSilenceEffect,
|
||||
slothspeed: SlothSpeedEffect,
|
||||
'sloth-speed': SlothSpeedEffect,
|
||||
sloth: SlothSpeedEffect,
|
||||
speed: SlothSpeedEffect,
|
||||
slumber: SlumberEffect,
|
||||
smite: SmiteEffect,
|
||||
soundsilence: SoundSilenceEffect,
|
||||
'sound-silence': SoundSilenceEffect,
|
||||
sound: SoundSilenceEffect,
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
105
src/module/powers/soundSilence.js
Normal file
105
src/module/powers/soundSilence.js
Normal file
@ -0,0 +1,105 @@
|
||||
import { PowerEffect } from './basePowers.js';
|
||||
|
||||
export class SoundSilenceEffect extends PowerEffect {
|
||||
get name() {
|
||||
return 'Sound/Silence';
|
||||
}
|
||||
|
||||
get hasAdditionalRecipients() {
|
||||
return false;
|
||||
}
|
||||
|
||||
get icon() {
|
||||
return (this?.data?.direction ?? 'Sound') === 'Sound'
|
||||
? 'icons/magic/sonic/bell-alarm-red-purple.webp'
|
||||
: 'icons/svg/silenced.svg';
|
||||
}
|
||||
|
||||
get duration() {
|
||||
return this?.data?.direction === 'Sound' ? 0 : 5;
|
||||
}
|
||||
|
||||
get isTargeted() {
|
||||
return this.data?.targeted && this?.data?.direction === 'Silence';
|
||||
}
|
||||
|
||||
get basePowerPoints() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
get hasAoe() {
|
||||
return true;
|
||||
}
|
||||
|
||||
get modifiers() {
|
||||
const mods = super.modifiers;
|
||||
mods.push({
|
||||
sortOrder: -2,
|
||||
name: 'Sound or Silence',
|
||||
id: 'direction',
|
||||
type: 'radio',
|
||||
default: 'Sound',
|
||||
epic: false,
|
||||
choices: { Sound: 'Sound', Silence: 'Silence' },
|
||||
effects: { Sound: null, Silence: null },
|
||||
values: { Sound: 0, Silence: 0 },
|
||||
});
|
||||
mods.push({
|
||||
name: 'Greater Sound/Silence',
|
||||
id: 'greater',
|
||||
default: false,
|
||||
type: 'checkbox',
|
||||
effect: false,
|
||||
value: 1,
|
||||
epic: true,
|
||||
});
|
||||
mods.push({
|
||||
name: 'Mobile',
|
||||
id: 'mobile',
|
||||
default: false,
|
||||
type: 'checkbox',
|
||||
effect: false,
|
||||
value: 1,
|
||||
epic: false,
|
||||
});
|
||||
mods.push({
|
||||
name: 'Targeted',
|
||||
id: 'targeted',
|
||||
default: false,
|
||||
type: 'checkbox',
|
||||
effect: false,
|
||||
value: 0,
|
||||
epic: false,
|
||||
});
|
||||
return mods;
|
||||
}
|
||||
|
||||
get effectName() {
|
||||
let name = `${this.data.raise ? 'major' : 'minor'} ${this.data.direction}`;
|
||||
return name;
|
||||
}
|
||||
|
||||
get description() {
|
||||
let desc = super.description;
|
||||
return desc;
|
||||
}
|
||||
|
||||
get primaryEffectButtons() {
|
||||
const buttons = super.primaryEffectButtons;
|
||||
if (this.data.direction === 'Silence' && this.data.targeted) {
|
||||
const mods = [];
|
||||
if (this.data.greater) {
|
||||
mods.push({ label: 'Greater Silence', value: -2 });
|
||||
}
|
||||
buttons.push({
|
||||
label: `Shake off (Smarts${this.data.greater ? ' -2' : ''})`,
|
||||
type: 'trait',
|
||||
rollType: 'attribute',
|
||||
rollDesc: 'Smarts',
|
||||
flavor: 'Success shakes off the effects of silence',
|
||||
mods,
|
||||
});
|
||||
}
|
||||
return buttons;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user