Skip to content

Commit

Permalink
Finish inputBoons as int
Browse files Browse the repository at this point in the history
  • Loading branch information
juanferrer committed Nov 8, 2023
1 parent 3bc4836 commit 818e0bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export class DemonlordActor extends Actor {
const attackRoll = new Roll(this.rollFormula(modifiers, boons, boonsReroll), {})
await attackRoll.evaluate()

postAttackToChat(attacker, defender, item, attackRoll, attackAttribute, defenseAttribute, inputBoons)
postAttackToChat(attacker, defender, item, attackRoll, attackAttribute, defenseAttribute, parseInt(inputBoons) || 0)

const hitTargets = defendersTokens.filter(d => {
const targetNumber =
Expand Down Expand Up @@ -413,12 +413,12 @@ export class DemonlordActor extends Actor {
async rollAttribute(attribute, inputBoons, inputModifier) {
attribute = attribute.label.toLowerCase()
const modifiers = [parseInt(inputModifier), this.getAttribute(attribute)?.modifier || 0]
const boons = parseInt(inputBoons) + (this.system.bonuses.challenge.boons[attribute] || 0) + (this.system.bonuses.challenge.boons.all || 0)
const boons = (parseInt(inputBoons) || 0) + (this.system.bonuses.challenge.boons[attribute] || 0) + (this.system.bonuses.challenge.boons.all || 0)
const boonsReroll = parseInt(this.system.bonuses.rerollBoon1Dice)

const challengeRoll = new Roll(this.rollFormula(modifiers, boons, boonsReroll), {})
await challengeRoll.evaluate()
postAttributeToChat(this, attribute, challengeRoll, inputBoons)
postAttributeToChat(this, attribute, challengeRoll, parseInt(inputBoons) || 0)
}

rollChallenge(attribute) {
Expand Down Expand Up @@ -488,7 +488,7 @@ export class DemonlordActor extends Actor {
itemId: talent.id,
})

postTalentToChat(this, talent, attackRoll, target?.actor, inputBoons)
postTalentToChat(this, talent, attackRoll, target?.actor, parseInt(inputBoons) || 0)
}

/* -------------------------------------------- */
Expand Down Expand Up @@ -558,7 +558,7 @@ export class DemonlordActor extends Actor {
itemId: spell.id,
})

postSpellToChat(this, spell, attackRoll, target?.actor, inputBoons)
postSpellToChat(this, spell, attackRoll, target?.actor, parseInt(inputBoons) || 0)
}

/* -------------------------------------------- */
Expand Down Expand Up @@ -601,7 +601,7 @@ export class DemonlordActor extends Actor {
let modifiers = [parseInt(inputModifier), (this.getAttribute(attackAttribute)?.modifier || 0)]

let boons =
parseInt(inputBoons) +
(parseInt(inputBoons) || 0) +
(this.system.bonuses.attack[attackAttribute] || 0) +
(this.system.bonuses.attack.boons.all || 0) +
parseInt(itemData.action?.boonsbanes || 0)
Expand All @@ -612,7 +612,7 @@ export class DemonlordActor extends Actor {
await attackRoll.evaluate()
}

postItemToChat(this, item, attackRoll, target?.actor, inputBoons)
postItemToChat(this, item, attackRoll, target?.actor, parseInt(inputBoons) || 0)
}

/* -------------------------------------------- */
Expand Down

0 comments on commit 818e0bb

Please sign in to comment.