add sloth/speed
This commit is contained in:
@@ -790,6 +790,60 @@ class SmiteEffect extends TargetedPowerEffect {
|
||||
}
|
||||
}
|
||||
|
||||
class SlothSpeedEffect extends TargetedPowerEffect {
|
||||
get name () {
|
||||
return 'Sloth/Speed'
|
||||
}
|
||||
|
||||
get baseDurationRounds () {
|
||||
if (this.inputs?.[this.inputIndex + 1] === true) {
|
||||
return 1
|
||||
}
|
||||
return 5
|
||||
}
|
||||
|
||||
async prepMenu () {
|
||||
this.menuData.inputs = this.menuData.inputs.concat(
|
||||
{ type: 'info', label: 'Sloth or Speed?' },
|
||||
{ type: 'radio', label: 'Sloth', options: ['isSloth', true] },
|
||||
{ type: 'radio', label: 'Speed', options: ['isSloth', false] },
|
||||
{ type: 'checkbox', label: 'Dash (+2, speed only)', options: false },
|
||||
{ type: 'checkbox', label: 'Quickness (+2, speed only)', options: false },
|
||||
{ type: 'checkbox', label: 'Strong (+1, sloth only)', options: false }
|
||||
)
|
||||
}
|
||||
|
||||
async prepResult () {
|
||||
const raise = (this.buttons === 'raise')
|
||||
const isSloth = this.inputs[this.inputIndex + 1] === true
|
||||
const icon = (isSloth
|
||||
? 'icons/magic/control/debuff-chains-shackles-movement-blue.webp'
|
||||
: 'icons/skills/movement/feet-winged-sandals-tan.webp'
|
||||
)
|
||||
const dash = !isSloth && !!this.inputs[this.inputIndex + 3]
|
||||
const quickness = !isSloth && !!this.inputs[this.inputIndex + 4]
|
||||
const strong = isSloth && !!this.inputs[this.inputIndex + 4]
|
||||
const nameMods = []
|
||||
if (raise) { nameMods.push('Major') }
|
||||
if (dash) { nameMods.push('Dash') }
|
||||
if (quickness) { nameMods.push('Quickness') }
|
||||
if (strong) { nameMods.push('Strong') }
|
||||
const nameModifier = (
|
||||
`${nameMods.length > 0 ? ' (' : ''}` +
|
||||
`${nameMods.join(', ')}${nameMods.length > 0 ? ')' : ''}`)
|
||||
const name = `${isSloth ? 'Sloth' : 'Speed'}${nameModifier}`
|
||||
const effect = shim.createEffectDocument(
|
||||
icon, name, this.durationRounds, [
|
||||
{
|
||||
key: 'system.stats.speed.value',
|
||||
mode: CONST.FOUNDRY.ACTIVE_EFFECT_MODES.MULTIPLY,
|
||||
value: (isSloth ? 0.5 : 2),
|
||||
priority: 0
|
||||
}])
|
||||
this.effectDocs.push(effect)
|
||||
}
|
||||
}
|
||||
|
||||
class SummonEffect extends PowerEffect {
|
||||
ICON = 'icons/magic/symbols/runes-triangle-blue.webp'
|
||||
|
||||
@@ -1201,7 +1255,10 @@ const PowerClasses = {
|
||||
'lower trait': BoostLowerTraitEffect,
|
||||
protection: ProtectionEffect,
|
||||
'shape change': ShapeChangeEffect,
|
||||
sloth: SlothSpeedEffect,
|
||||
'sloth/speed': SlothSpeedEffect,
|
||||
smite: SmiteEffect,
|
||||
speed: SlothSpeedEffect,
|
||||
'summon ally': SummonAllyEffect,
|
||||
'summon animal': SummonAnimalEffect,
|
||||
'summon monster': SummonMonsterEffect,
|
||||
|
||||
Reference in New Issue
Block a user