Add customizable rolls to items
This commit is contained in:
@@ -65,7 +65,7 @@ export class M5Item extends Item {
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true })
|
||||
if (actorCalc) {
|
||||
calc.ew += actorCalc.stats.attackBonus
|
||||
calc.ew += actorCalc.stats.attackBonus.value
|
||||
calc.combatSkills = actorCalc.skills.combat
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ export class M5Item extends Item {
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true })
|
||||
if (actorCalc) {
|
||||
calc.ew += actorCalc.stats.spellCasting
|
||||
calc.ew += actorCalc.stats.spellCasting.value
|
||||
}
|
||||
}
|
||||
} else if (context.type === "item") {
|
||||
@@ -204,15 +204,17 @@ export class M5Item extends Item {
|
||||
const rollData = this.getRollData()
|
||||
formulaNames.forEach(formulaName => {
|
||||
const formula = item.data.rolls.formulas[formulaName]
|
||||
rollData.rolls[formulaName] = {
|
||||
formula: formula.formula,
|
||||
label: formula.label,
|
||||
type: formula.type,
|
||||
result: "",
|
||||
total: 0,
|
||||
totalStr: "",
|
||||
dice: {}
|
||||
} as M5RollResult
|
||||
if (formula) {
|
||||
rollData.rolls[formulaName] = {
|
||||
formula: formula.formula,
|
||||
label: formula.label,
|
||||
enabled: formula.enabled,
|
||||
result: "",
|
||||
total: 0,
|
||||
totalStr: "",
|
||||
dice: {}
|
||||
} as M5RollResult
|
||||
}
|
||||
})
|
||||
|
||||
const roll = new M5Roll(rollData, this.actor, item.name)
|
||||
|
||||
Reference in New Issue
Block a user