From ac70a99b99ab1b68256ebe5488b17c355f6ccc3c Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sun, 2 Jun 2024 22:28:27 -0500 Subject: [PATCH] add speak language --- src/module/powers/powers.js | 2 + src/module/powers/soundSilence.js | 35 ++++++++-------- src/module/powers/speakLanguage.js | 66 ++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 src/module/powers/speakLanguage.js diff --git a/src/module/powers/powers.js b/src/module/powers/powers.js index 59de106..60b8ae9 100644 --- a/src/module/powers/powers.js +++ b/src/module/powers/powers.js @@ -54,6 +54,7 @@ import { SlothSpeedEffect } from './slothSpeed.js'; import { SlumberEffect } from './slumber.js'; import { SmiteEffect } from './smite.js'; import { SoundSilenceEffect } from './soundSilence.js'; +import { SpeakLanguageEffect } from './speakLanguage.js'; const PowerClasses = { 'arcane-protection': ArcaneProtectionEffect, @@ -128,6 +129,7 @@ const PowerClasses = { soundsilence: SoundSilenceEffect, 'sound-silence': SoundSilenceEffect, sound: SoundSilenceEffect, + 'speak-language': SpeakLanguageEffect, }; /* ---------------------------------------------------------------- */ diff --git a/src/module/powers/soundSilence.js b/src/module/powers/soundSilence.js index b7f116e..e98c7ae 100644 --- a/src/module/powers/soundSilence.js +++ b/src/module/powers/soundSilence.js @@ -81,25 +81,22 @@ export class SoundSilenceEffect extends PowerEffect { get description() { let desc = super.description; + if (this.data.direction === 'Sound') { + desc += `

Mimic any known sound from a point within ranage. If used as + a test, resist with Smarts${this.data.greater ? ' -2' : ''}.

`; + } else if (this.data.targeted) { + desc += `

Silence an individual, causing + ${this.data.raise ? 'complete silence' : '-4 to auditory Notice rolls'} + for that individual. Resisted with Spirit, -2 if a raise and -2 if Greater.

`; + } else { + desc += `

Silence a Large Blast Template, causing + ${this.data.raise ? 'complete silence' : '-4 t auditory Notice rolls'} + within the area.

`; + } + if (!this.data.targete && this.data.mobile) { + desc += `

The caster can move the area up to his arcane skill die + type each round.

`; + } 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; - } } diff --git a/src/module/powers/speakLanguage.js b/src/module/powers/speakLanguage.js new file mode 100644 index 0000000..76d0649 --- /dev/null +++ b/src/module/powers/speakLanguage.js @@ -0,0 +1,66 @@ +import { PowerEffect } from './basePowers.js'; + +export class SpeakLanguageEffect extends PowerEffect { + get name() { + return 'Speak Language'; + } + + get duration() { + return 100; + } + + get icon() { + return 'icons/magic/sonic/scream-wail-shout-teal.webp'; + } + + get hasAdditionalRecipients() { + return true; + } + + get additionalRecipientCost() { + return 1; + } + + get basePowerPoints() { + return 1; + } + + get isTargeted() { + return true; + } + + get modifiers() { + const mods = super.modifiers; + mods.push({ + name: 'Greater Speak Language', + type: 'checkbox', + id: 'greater', + value: 2, + epic: true, + effect: false, + }); + mods.push({ + name: 'Mass Understanding', + type: 'checkbox', + id: 'mass', + value: 5, + epic: true, + effect: false, + }); + return mods; + } + + get effectName() { + return `${this.data.raise ? 'major' : 'minor'} ${this.name}${this.data.mass ? ' [Mass Understanding]' : this.data.greater ? ' [Greater]' : ''}`; + } + + get description() { + let text = super.description; + if (this.data.mass) { + text += `

All creatures within Smarts ×2 of the recipient can understand one another.

`; + } else { + text += `

Speak, read, and write ${this.data.greater ? 'all sapient languages' : 'a sapient language other than your own'}. ${this.data.raise ? 'Understand and use dialect and slang as well.' : ''}

`; + } + return text; + } +}