Skip to content

Commit

Permalink
fix to optinalRuleExceedsByFive
Browse files Browse the repository at this point in the history
  • Loading branch information
Havoclivekiller committed Dec 17, 2024
1 parent 6d7b8ae commit 55605c3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/module/chat/roll-messages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {buildAttackEffectsMessage, buildAttributeEffectsMessage, buildTalentEffectsMessage} from './effect-messages'
import { buildActorInfo, formatDice, getChatBaseData } from './base-messages'
import { optinalRuleExceedsByFive } from './settings.js'
import {buildActorInfo, formatDice, getChatBaseData} from './base-messages'

function changeBobDieColour (attackRoll)
{
Expand Down Expand Up @@ -55,7 +54,7 @@ export function postAttackToChat(attacker, defender, item, attackRoll, attackAtt
? defender?.system.characteristics.defense
: defender?.getAttribute(defenseAttribute)?.value || ''

const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (optinalRuleExceedsByFive ? 5 : 4) : true)
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (game.settings.get('demonlord', 'optinalRuleExceedsByFive') ? 5 : 4) : true)
const didHit = voidRoll ? false : attackRoll?.total >= targetNumber

let diceTotalGM = attackRoll?.total ?? ''
Expand Down Expand Up @@ -224,7 +223,7 @@ export function postTalentToChat(actor, talent, attackRoll, target, inputBoons)
}

const targetNumber = talentData?.action?.attack ? actor.getTargetNumber(talent) : ''
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (optinalRuleExceedsByFive ? 5 : 4) : true)
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (game.settings.get('demonlord', 'optinalRuleExceedsByFive') ? 5 : 4) : true)

let resultText =
!voidRoll && attackRoll != null && targetNumber !== undefined && attackRoll.total >= parseInt(targetNumber)
Expand Down Expand Up @@ -340,7 +339,7 @@ export async function postSpellToChat(actor, spell, attackRoll, target, inputBoo
if (uses >= 0 && usesMax > 0) usesText = game.i18n.localize('DL.SpellCastingsUses') + ': ' + uses + ' / ' + usesMax

const targetNumber = actor.getTargetNumber(spell)
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (optinalRuleExceedsByFive ? 5 : 4) : true)
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (game.settings.get('demonlord', 'optinalRuleExceedsByFive') ? 5 : 4) : true)

let resultText =
!voidRoll && targetNumber && attackRoll?.total >= parseInt(targetNumber)
Expand Down Expand Up @@ -512,7 +511,7 @@ export const postItemToChat = (actor, item, attackRoll, target, inputBoons) => {
}*/

const targetNumber = itemData?.action?.attack ? actor.getTargetNumber(item) : ''
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (optinalRuleExceedsByFive ? 5 : 4) : true)
const plus20 = attackRoll?.total >= 20 && (targetNumber ? attackRoll?.total > targetNumber + (game.settings.get('demonlord', 'optinalRuleExceedsByFive') ? 5 : 4) : true)

let resultText =
!voidRoll && attackRoll != null && targetNumber !== undefined && attackRoll.total >= parseInt(targetNumber)
Expand Down

0 comments on commit 55605c3

Please sign in to comment.