Skip to content

Commit

Permalink
fix(item): fixed the order of the damage formula and damage types
Browse files Browse the repository at this point in the history
  • Loading branch information
SouOWendel committed Jan 17, 2024
1 parent 8709c51 commit 1c32d8d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions module/documents/item.mjs
Expand Up @@ -310,22 +310,22 @@ export class OrdemItem extends Item {
// Push the bonus
prepareFormula.push(damage.bonus);

// Get all the other formulas
for (const parts of damage.parts) {
prepareFormula.push(`(${parts[0]})`);
damageTypes.push(game.i18n.localize('ordemparanormal.damageTypeAbv.' + parts[1]));
}

// Verify the attributes
for (const [i, attrParent] of Object.entries(this.parent.system.attributes)) {
if (i == damage.parts.map(d => d[1])[0]) prepareFormula.push(attrParent.value);
}

// Combine all formulas
const formulas = prepareFormula.join('+');

// Combine all damage types
// Get the main type damage
damageTypes.push(game.i18n.localize('ordemparanormal.damageTypeAbv.' + damage.type));

// Get all the other formulas
for (const parts of damage.parts) {
prepareFormula.push(`(${parts[0] || 0})`);
damageTypes.push((parts[1]) ? game.i18n.localize('ordemparanormal.damageTypeAbv.' + parts[1]) : 'Indefinido');
}

// Combine all formulas and types
const formulas = prepareFormula.join('+');
const types = damageTypes.join('+').replaceAll('+', ' + ');

const rollConfig = {
Expand Down

0 comments on commit 1c32d8d

Please sign in to comment.