develop #34

Merged
mike merged 14 commits from develop into main 2023-09-26 03:39:21 +00:00
Showing only changes of commit 5da433a273 - Show all commits

View File

@ -658,20 +658,15 @@ class SmiteEffect extends TargetedPowerEffect {
const raise = (this.buttons === 'raise') const raise = (this.buttons === 'raise')
const greater = !!this.inputs[this.inputIndex] const greater = !!this.inputs[this.inputIndex]
const changeValue = (greater ? (raise ? '+6' : '+4') : (raise ? '+4' : '+2')) const changeValue = (greater ? (raise ? '+6' : '+4') : (raise ? '+4' : '+2'))
const changeKey = 'system.stats.globalMods.damage'
for (const token of this.targets) { for (const token of this.targets) {
const weaponName = this.inputs[this.tokenWeapons[token.id]] const weaponName = this.inputs[this.tokenWeapons[token.id]]
const weaponId = token.actor.items.getName(weaponName)?.id const effectName = `Smite (${weaponName})`
const changeKey = `@Weapon{${weaponName}}[system.actions.dmgMod]`
if (!weaponId) {
continue
}
const effectName = `${this.buttons === 'raise' ? 'major' : 'minor'} Smite${greater ? ' (greater)' : ''} (${weaponName})`
const changes = [ const changes = [
{ key: changeKey, mode, value: changeValue, priority: 0 } { key: changeKey, mode, value: changeValue, priority: 0 }
] ]
this.baseEffect.changes = changes this.baseEffect.changes = changes
this.baseEffect.name = effectName this.baseEffect.name = effectName
console.log(token, weaponName, weaponId, effectName, changeKey)
await shim.applyActiveEffects(token, [this.baseEffect].concat(this.effectDocs)) await shim.applyActiveEffects(token, [this.baseEffect].concat(this.effectDocs))
} }
} }