From dd4735d50a310fb193f8370a7bcb1ccd6203fd7d Mon Sep 17 00:00:00 2001
From: Mike Bloy
Hostile powers are at ${this._penaltyAmount} - targeting or damaging this character.
` + get description () { + let text = super.description + text += `Hostile powers are at ${this._penaltyAmount} when + targeting or damaging the affected character.
` return text } get effectName () { @@ -42,6 +42,8 @@ class BanishEffect extends PowerEffect { get basePowerPoints () { return 3 } get usePrimaryEffect () { return false } get isTargeted () { return true } + get isRaisable () { return false } + get hasAoe () { return true } get menuInputs () { const inputs = super.menuInputs inputs.push @@ -59,8 +61,15 @@ class BanishEffect extends PowerEffect { total += this.data.aoe return total } + get description () { + return super.description + ` +An opposed roll of the caster's skill vs the target's Spirit. + Success: Shaken, each Raise: 1 Wound + Incapacitation results in banishment to home plane.
+ ` + } get chatMessageEffects () { - const list = [] + const list = super.chatMessageEffects switch (this.data.aoe) { case 0: break case 1: @@ -73,9 +82,6 @@ class BanishEffect extends PowerEffect { list.push('LBT') break } - list.push("Opposed Roll: caster's arcane skill vs target's Spirit.") - list.push("Success: Shaken, Each Raise: 1 Wound") - list.push("If target incapacitated by this, banishment to home plane") return list } async parseValues () { @@ -96,7 +102,6 @@ class BarrierEffect extends PowerEffect { const mods = super.modifiers mods.push({ name: 'Damage', id: 'damage', value: 1, epic: false, effect: false }) mods.push({ name: 'Damage (immaterial trapping)', id: 'damage', value: 0, epic: false, effect: false }) - mods.push({ name: 'Deadly', id: 'deadly', value: 2, epic: true, effect: false }) mods.push({ name: 'Hardened', id: 'hardened', value: 1, epic: false, effect: false }) mods.push({ name: 'Shaped', id: 'shaped', value: 1, epic: false, effect: false }) @@ -115,48 +120,28 @@ class BarrierEffect extends PowerEffect { get _hardness () { return (this.data.raise ? 12 : 10) + (this.data.mods.has('hardened') ? 2 : 0) } - getPrimaryEffectDescription () { - let text = super.getPrimaryEffectDescription() - text += `A barrier ${this._height} tall and ${this._length} long, of hardness ${this._hardness}.` + get description () { + let text = super.description + text += `
A barrier ${this._height} tall and ${this._length} long, of hardness ${this._hardness}. ` if (this.data.mods.has('deadly')) { - text += 'It does 2d6 damage to anyone who contacts it.' + text += 'It does 2d6 damage to anyone who contacts it. ' } else if (this.data.mods.has('damage')) { - text += 'It does 2d4 damage to anyone who contacts it.' + text += 'It does 2d4 damage to anyone who contacts it. ' } if (this.data.mods.has('shaped')) { - text += 'It was shaped into a circle, square, or rectangle.' + text += 'It was shaped into a circle, square, or rectangle. ' } text += '
' return text } - get chatMessageEffects () { - const list = [] - list.push( - `The Barrier is ${this._height} tall and ${this._length} long, of hardness ${this._hardness}.` - ) - if (this.data.mods.has('deadly')) { - list.push('Deadly: 2d6 to anyone who contacts') - } else if (this.data.mods.has('damage')) { - list.push('Damage: 2d4 to anyone who contacts') - } - if (this.data.mods.has('shaped')) { - list.push('Shaped (circle, square, or rectangle)') - } - if (this.data.mods.has('size')) { - list.push('Size - length and height doubled') - } - return list - } } class BeastFriendEffect extends PowerEffect { get name () { return 'Beast Friend' } get duration () { return (this.data.mods.has('duration') ? 30 : 10) * 6 * 60 } get icon () { return 'icons/magic/nature/wolf-paw-glow-large-green.webp' } - get isTargeted () { return false } - get isDamaging () { return true } - get basePowerPoints () { return 2 } - get usePrimaryEffect () { return false } + get isTargeted () { return true } + get usePrimaryEffect () { return true } get modifiers () { const mods = super.modifiers mods.push( @@ -166,28 +151,33 @@ class BeastFriendEffect extends PowerEffect { ) return mods } - getPrimaryEffectDescription () { - let text = super.getPrimaryEffectDescription() + get menuInputs () { + const inputs = super.menuInputs + const pp = Math.max( + this.targets. + map(t => Math.max(t.actor.system.stats.size, 1)). + reduce((a,b) => a+b, 0), + 1) + inputs.push({ type: 'number', label: 'Base power points', options: pp}) + return inputs + } + async parseValues () { + await super.parseValues() + this.data.basePP = this.data.values.shift() + } + get basePowerPoints () { return this?.data?.basePP || 2 } + get description () { + let text = super.description if (this.data.raise) { text += 'Creatures will overcome instincts to follow orders.' } else { text += '
Creatures obey simple commands, subject to their insticts.' } - if (this.data.mods('bestiarium')) { + if (this.data.mods.has('bestiarium')) { text += ' The caster may even effect magical beasts.' } return text } - get chatMessageEffects () { - const list = [] - if (this.data.mods.has('bestiarium')) { - list.push('Bestiarium, affect magical beasts with animal intelligence') - } - if (this.data.mods.has('mindrider')) { - list.push('Mind rider. Can communicate and sense through any befrended beasts') - } - return list - } } class BlastEffect extends PowerEffect { @@ -225,21 +215,14 @@ class BlastEffect extends PowerEffect { await super.parseValues() this.data.aoe = this.data.values.shift() } - get chatMessageEffects () { - const list = [] - switch (this.data.aoe) { - case 's': list.push('SBT'); break; - case 'm': list.push('MBT'); break; - case 'l': list.push('LBT'); break; - } - if (this.data.mods.has('greater')) { - list.push('Greater Blast: 4d6 damage') - } else if (this.data.mods.has('damage')) { - list.push('Damaging: 3d6 damage') - } else { - list.push('2d6 damage') - } - return list + get description () { + const dmgDie = ( + this.data.mods.has('greater') ? 4 : + (this.data.mods.has('damage') ? 3 : 2)) + (this.data.raise ? 1 : 0) + const size = ( + this.data.aoe === 'l' ? 'LBT' : (this.data.aoe === 's' ? 'SBT' : 'MBT')) + return super.description + ` +
The blast covers a ${size} and does ${dmgDie}d6 damage
` } } @@ -255,8 +238,8 @@ class BlindEffect extends PowerEffect { priority: 0, mode: foundry.CONST.ACTIVE_EFFECT_MODES.ADD } ] return changes } - getPrimaryEffectDescription() { - return super.getPrimaryEffectDescription() + + get description () { + return super.description + `${this.data.raise ? -4 : -2} penalty to all actions involving sight.
Shake off attempts at end of turns with a Vigor ${this.data.mods.has('strong') ? '-2 ' : ''}roll as a free action. @@ -272,6 +255,8 @@ class BlindEffect extends PowerEffect { priority: 0, mode: foundry.CONST.ACTIVE_EFFECT_MODES.ADD } ]) doc.duration.seconds = 594 + doc.description = this.description + + "
This is the raise effect which can be shaken off separately.
" doc.flags[moduleName].maintId = maintId docs.push(doc) } @@ -314,13 +299,52 @@ class BlindEffect extends PowerEffect { case 2: list.push('MBT'); break case 3: list.push('LBT'); break } - if (this.data.mods.has('strong')) { - list.push('Strong') - } return list } } +class BoltEffect extends PowerEffect { + get name () { return 'Bolt' } + get icon () { return 'icons/magic/fire/explosion-fireball-large-red-orange.webp' } + get duration () { return 0 } + get isTargeted () { return true } + get isDamaging () { return true } + get basePowerPoints () { return 3 } + get modifiers () { + const mods = super.modifiers + mods.push( + { name: 'Damage', value: 2, id: 'damage', epic: false, effect: false }, + { name: 'Disintegrate', value: 1, id: 'disintigrate', epic: true, effect: false }, + { name: 'Greater Blast', value: 1, id: 'greater', epic: true, effect: false }, + { name: 'Rate of Fire', value: 2, id: 'rof', epic: true, effect: false }, + ) + return mods + } + get powerPoints () { + let total = super.powerPoints + total += (this.data.aoe === 'l' ? 1 : 0) + return total + } + get description () { + const dmgDie = ( + this.data.mods.has('greater') ? 4 : + (this.data.mods.has('damage') ? 3 : 2)) + (this.data.raise ? 1 : 0) + let desc = super.description + '' + if (this.data.mods.has('rof')) { + desc += `Up to two bolts (RoF 2) do ${dmgDie}d6 damage each.` + } else { + desc += `The bolt does ${dmgDie}d6 damage.` + } + if (this.data.mods.has('disintegrate')) { + desc += 'The bolt is disintegrating. If being used to break' + + ' something, the damage dice can Ace. A creature Incapacitated by a ' + + 'disintegrating bolt must make a Vigor roll or its body turns to dust' + } + desc += '
' + return desc + } +} + class BurrowEffect extends PowerEffect { get name () { return 'Burrow' } get duration () { return 5 } @@ -344,21 +368,14 @@ class BurrowEffect extends PowerEffect { return `${this.name} ${this.data.mods.has('power') ? '[Power] ' : ''}` + `(${this.data.raise ? 'full' : 'half'} pace)` } - getPrimaryEffectDescription() { - let text = super.getPrimaryEffectDescription() + + get description() { + let text = super.description + `Meld into the ground. Move at ${this.data.raise ? 'full' : 'half'} pace. May not run.
` if (this.data.mods.has('power')) { text += `Can burrow through solid stone, concrete, etc
` } return text } - get chatMessageEffects () { - const list = super.chatMessageEffects - if (this.data.mods.has('Power')) { - list.push('Power: Burrow through solid stone, concrete') - } - return list - } } const PowerClasses = { @@ -368,6 +385,7 @@ const PowerClasses = { "beast-friend": BeastFriendEffect, blast: BlastEffect, blind: BlindEffect, + bolt: BoltEffect, burrow: BurrowEffect, }