add alarm to sound/silence

This commit is contained in:
Mike Bloy 2024-06-09 14:27:27 -05:00
parent 613552af4e
commit d520f8e137

View File

@ -16,7 +16,7 @@ export class SoundSilenceEffect extends PowerEffect {
}
get duration() {
return this?.data?.direction === 'Sound' ? 0 : 5;
return this?.data?.direction === 'Sound' ? (this.data.alarm === 'none' ? 0 : 6000) : 5;
}
get isTargeted() {
@ -71,10 +71,23 @@ export class SoundSilenceEffect extends PowerEffect {
value: 0,
epic: false,
});
mods.push({
name: 'Alarm (Sound only)',
type: 'select',
id: 'alarm',
epic: false,
default: 'none',
choices: { none: 'No alarm', object: 'On Object', area: '10 yard area' },
effects: { none: null, object: null, area: null },
values: { none: 0, object: 1, area: 2 },
});
return mods;
}
get effectName() {
if (this.data.direction === 'Sound' && this.data.alarm !== 'none') {
return 'Alarm';
}
let name = `${this.data.raise ? 'major' : 'minor'} ${this.data.direction}`;
return name;
}
@ -84,6 +97,14 @@ export class SoundSilenceEffect extends PowerEffect {
if (this.data.direction === 'Sound') {
desc += `<p>Mimic any known sound from a point within ranage. If used as
a test, resist with Smarts${this.data.greater ? ' -2' : ''}.</p>`;
if (this.data.alarm !== 'none') {
desc += `<p>A subtle ward is created on
${this.data.alarm === 'object' ? 'an object' : 'an area 10 yards in diameter'}
which will sound an alarm (to the caster only or audibly, caster's choice)
if the ward is disturbed. This lasts 10 hours. The caster may choose to
set a password that, if spoken, will allow the ward to be disturbed by
the speaking entity.</p>`;
}
} else if (this.data.targeted) {
desc += `<p>Silence an individual, causing
${this.data.raise ? 'complete silence' : '-4 to auditory Notice rolls'}