Minor fix for chronicles v1
This commit is contained in:
@@ -19,9 +19,9 @@ export class BoLRoll {
|
||||
static updateApplicableEffects(rollData) {
|
||||
let appEffects = []
|
||||
for (let effect of rollData.bolEffects) {
|
||||
if ( (effect.system.properties.identifier == "always") ||
|
||||
(effect.system.properties.identifier.includes(rollData.attribute.key)) ||
|
||||
(rollData.aptitude && effect.system.properties.identifier.includes(rollData.aptitude.key)) ){
|
||||
if ((effect.system.properties.identifier == "always") ||
|
||||
(effect.system.properties.identifier.includes(rollData.attribute.key)) ||
|
||||
(rollData.aptitude && effect.system.properties.identifier.includes(rollData.aptitude.key))) {
|
||||
appEffects.push(effect)
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export class BoLRoll {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static attributeCheck(actor, key="vigor", event=undefined, combatData=undefined) {
|
||||
static attributeCheck(actor, key = "vigor", event = undefined, combatData = undefined) {
|
||||
|
||||
let attribute = eval(`actor.system.attributes.${key}`)
|
||||
|
||||
@@ -89,7 +89,7 @@ export class BoLRoll {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static aptitudeCheck(actor, key="init", event=undefined, combatData=undefined) {
|
||||
static aptitudeCheck(actor, key = "init", event = undefined, combatData = undefined) {
|
||||
|
||||
let aptitude = eval(`actor.system.aptitudes.${key}`)
|
||||
let attrKey = this.getDefaultAttribute(key)
|
||||
@@ -482,10 +482,15 @@ export class BoLRoll {
|
||||
if (rollData.mode == "weapon") {
|
||||
rollData.weaponModifier = rollData.weapon.system.properties.attackModifiers ?? 0
|
||||
rollData.attackBonusDice = rollData.weapon.system.properties.attackBonusDice
|
||||
rollData.attackMalusDice = rollData.weapon.system.properties.attackMalusDice
|
||||
if (rollData.attackBonusDice) {
|
||||
rollData.adv = "1B"
|
||||
rollData.bDice = 1
|
||||
}
|
||||
if (rollData.attackMalusDice) {
|
||||
rollData.adv = "1M"
|
||||
rollData.mDice = 1
|
||||
}
|
||||
if (defender) { // If target is selected
|
||||
rollData.defence = defender.defenseValue
|
||||
rollData.armorMalus = defender.armorMalusValue
|
||||
@@ -534,6 +539,7 @@ export class BoLRoll {
|
||||
rollData.id = foundry.utils.randomID(16)
|
||||
rollData.weaponModifier = 0
|
||||
rollData.attackBonusDice = false
|
||||
rollData.attackMalusDice = false
|
||||
rollData.armorMalus = 0
|
||||
// Specific stuff
|
||||
this.preProcessWeapon(rollData, defender)
|
||||
@@ -634,7 +640,7 @@ export class BoLDefaultRoll {
|
||||
const diceTotal = activeDice.map(r => r.result).reduce((a, b) => a + b)
|
||||
this.rollData.roll = r
|
||||
this.rollData.isFumble = (diceTotal <= diceData.criticalFailureValue)
|
||||
if ( this.rollData.isFumble ) {
|
||||
if (this.rollData.isFumble) {
|
||||
this.rollData.isSuccess = false
|
||||
this.rollData.isCritical = false
|
||||
this.rollData.isRealCritical = false
|
||||
@@ -642,7 +648,7 @@ export class BoLDefaultRoll {
|
||||
this.rollData.isFailure = true
|
||||
} else {
|
||||
this.rollData.isCritical = (diceTotal >= diceData.criticalSuccessValue)
|
||||
if ( this.rollData.isCritical) {
|
||||
if (this.rollData.isCritical) {
|
||||
this.rollData.isSuccess = true
|
||||
} else {
|
||||
this.rollData.isSuccess = (r.total >= diceData.successValue)
|
||||
|
||||
Reference in New Issue
Block a user