mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-06 05:30:28 -04:00
Case insensitive fix for library as well.
This commit is contained in:
parent
0f2b892393
commit
125001bec3
1 changed files with 3 additions and 3 deletions
|
@ -214,7 +214,7 @@ function getAddition(rolltext) {
|
|||
}
|
||||
|
||||
function formatRoll(text) {
|
||||
var matches = text.match(/(?<=.*)\d*d\d+(?=.*)(\s*(\+|-)\s*\d+)?/)
|
||||
var matches = text.match(/(?<=.*)\d*d\d+(?=.*)(\s*(\+|-)\s*\d+)?/gi)
|
||||
if (matches != null) {
|
||||
return matches[0].replaceAll(/\s*\+\s*/g, "+").replaceAll(/\s*-\s*/g, "-")
|
||||
}
|
||||
|
@ -864,8 +864,8 @@ function createEncounter(listName) {
|
|||
enemy.initiative = Math.floor(enemy.initiative * multiplier)
|
||||
enemy.ac = Math.floor(enemy.ac * multiplier)
|
||||
|
||||
damagePrefix = enemy.damage.match(/^\d*d\d*/g)[0]
|
||||
damageSuffix = enemy.damage.match(/(?<=^\d*d\d*).*$/g)
|
||||
damagePrefix = enemy.damage.match(/^\d*d\d*/gi)[0]
|
||||
damageSuffix = enemy.damage.match(/(?<=^\d*d\d*).*$/gi)
|
||||
damageSuffix = damageSuffix != null ? parseInt(damageSuffix[0]) : 0
|
||||
damageSuffix += Math.floor(3 * (multiplier - 1))
|
||||
enemy.damage = damagePrefix + damageSuffix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue