Skip to content

Commit

Permalink
Rest of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 8, 2023
1 parent ecf0e25 commit 0c7602f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export function getDamageList(rolls) {
case 'none':
dmg_list = extractDamageInfoSimple(rolls);
break;
case 'split-by-type':
case 'by-damage-type':
dmg_list = extractDamageInfoCombined(rolls);
break;
case 'split-all':
case 'all':
dmg_list = extractDamageInfoAll(rolls);
break;
default:
Expand Down Expand Up @@ -143,21 +143,21 @@ export function extractDamageInfoSimple(rolls) {

export function extractTerm(term, flavor = '') {
let result = [];
switch (term.class) {
case 'PoolTerm':
switch (term.constructor.name) {
case 'InstancePool':
for (const roll of term.rolls) {
result = result.concat(extractTerm(roll, term.flavor || flavor));
}
break;
case '_DamageInstance2':
case 'DamageInstance':
for (const item of term.terms) {
result = result.concat(extractTerm(item, term.types || flavor));
}
break;
case 'Grouping':
result = result.concat(extractTerm(term.term, term.flavor || flavor));
break;
case '_ArithmeticExpression2':
case 'ArithmeticExpression':
switch (term.operator) {
case '+':
for (const op of term.operands) {
Expand Down Expand Up @@ -191,7 +191,7 @@ export function extractTerm(term, flavor = '') {
break;

default:
console.error({ msg: "Unrecognized Term when extracting parts", term })
console.error("Unrecognized Term when extracting parts", term )
result.push({ value: term.total, type: term.flavor || flavor })
break;
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ Hooks.on("init", () => {
hint: game.i18n.localize("pf2e-rpg-numbers.module-settings.damage-split.hint"),
scope: "world",
config: true,
default: "split-by-type",
default: "by-damage-type",
type: String,
choices: {
["none"]: game.i18n.localize("pf2e-rpg-numbers.module-settings.damage-split.choices.none"),
["split-by-type"]: game.i18n.localize("pf2e-rpg-numbers.module-settings.damage-split.split-by-type"),
["split-all"]: game.i18n.localize("pf2e-rpg-numbers.module-settings.damage-split.choices.split-all"),
["by-damage-type"]: game.i18n.localize("pf2e-rpg-numbers.module-settings.damage-split.choices.by-damage-type"),
["all"]: game.i18n.localize("pf2e-rpg-numbers.module-settings.damage-split.choices.all"),
},
});

Expand Down

0 comments on commit 0c7602f

Please sign in to comment.