add damage field

This commit is contained in:
Mike Bloy 2024-05-06 17:08:57 -05:00
parent 69bea4e77d
commit 312f2a88fc

View File

@ -633,6 +633,7 @@ class CurseEffect extends PowerEffect {
get duration () { return 500*24*60*6 } get duration () { return 500*24*60*6 }
get isTargeted () { return true } get isTargeted () { return true }
get oneTarget () { return true } get oneTarget () { return true }
get isRaisable () { return false }
get basePowerPoints () { return 5 } get basePowerPoints () { return 5 }
get modifiers () { get modifiers () {
const mods = super.modifiers const mods = super.modifiers
@ -662,6 +663,59 @@ class CurseEffect extends PowerEffect {
} }
} }
class DamageFieldEffect extends PowerEffect {
get name () { return 'Damage Field' }
get icon () { return 'icons/magic/defensive/shield-barrier-blades-teal.webp' }
get duration () { return 5 }
get basePowerPoints () { return 4 }
get isTargeted () { return true }
get oneTarget () { return true }
get isRaisable () { return false }
get modifiers () {
const mods = super.modifiers
mods.push({ name: 'Area of Effect', value: 2, id: 'aoe', epic: false, effect: false })
mods.push({ name: 'Damage', value: 2, id: 'damage', epic: false, effect: false })
mods.push({ name: 'Greater Damage Field', value: 4, id: 'greater', epic: true, effect: false })
mods.push({ name: 'Mobile', value: 2, id: 'mobile', epic: false, effect: false })
return mods
}
get description () {
let desc = super.description
let area = 'all adjacent creatures'
let damage = '2d4'
if (this.data.mods.has('greater')) {
damage = '3d6 (heavy weapon)'
} else if (this.data.mods.has('damage')) {
damage = '2d6'
}
if (this.data.mods.has('aoe')) {
area = 'all creatures within a MBT'
}
desc += `<p>At the end of the recipient's turn, ${area}
automatically take ${damage} damage.`
if (this.data.mods.has('mobile')) {
desc += `The caster may detach the damage field from the recipient and
move it up to his Smarts die type each round, as a limited free action.`
}
desc += '</p>'
return desc
}
getPrimaryEffectChanges () {
const base = 'flags.swade.auras.damagefield'
const priority = 0
const mode = foundry.CONST.ACTIVE_EFFECT_MODES.OVERRIDE
const changes = [
{ key: `${base}.enabled`, value: true, priority, mode },
{ key: `${base}.walls`, value: true, priority, mode },
{ key: `${base}.color`, value: '#ffcc00', priority, mode },
{ key: `${base}.alpha`, value: 0.1, priority, mode },
{ key: `${base}.radius`, value: (this.data.mods.has('aoe') ? 1.5 : 0.5), priority, mode },
{ key: `${base}.visibleTo`, value: [-1, 0, 1], priority, mode },
]
return changes
}
}
const PowerClasses = { const PowerClasses = {
"arcane-protection": ArcaneProtectionEffect, "arcane-protection": ArcaneProtectionEffect,
banish: BanishEffect, banish: BanishEffect,
@ -676,6 +730,7 @@ const PowerClasses = {
burst: BurstEffect, burst: BurstEffect,
confusion: ConfusionEffect, confusion: ConfusionEffect,
curse: CurseEffect, curse: CurseEffect,
"damage-field": DamageFieldEffect,
"lower-trait": BoostLowerTraitEffect, "lower-trait": BoostLowerTraitEffect,
} }