diff --git a/craft.js b/craft.js index 6ff3331..28455bb 100644 --- a/craft.js +++ b/craft.js @@ -211,18 +211,19 @@ class Craft{ powders.push(ingred.get("pid")); } } - for (const p of powders) { - /* Powders as ingredients in crafted weapons are different than powders applied to non-crafted weapons. Thanks to nbcss for showing me the math. - */ - let powder = powderStats[p]; //use min, max, and convert - let element = Math.floor((p+0.01)/6); //[0,4], the +0.01 attempts to prevent division error - let diffLow = Math.floor(nDamBaseLow * powder.convert/100); - nDamBaseLow -= diffLow; - elemDamBaseLow[element] += diffLow + Math.floor( (powder.min + powder.max) / 2 ); - let diffHigh = Math.floor(nDamBaseHigh * powder.convert/100); - nDamBaseHigh -= diffHigh; - elemDamBaseHigh[element] += diffHigh + Math.floor( (powder.min + powder.max) / 2 ); - } + // for (const p of powders) { + // /* Powders as ingredients in crafted weapons are different than powders applied to non-crafted weapons. Thanks to nbcss for showing me the math. + // */ + // let powder = powderStats[p]; //use min, max, and convert + // let element = Math.floor((p+0.01)/6); //[0,4], the +0.01 attempts to prevent division error + // let diffLow = Math.floor(nDamBaseLow * powder.convert/100); + // nDamBaseLow -= diffLow; + // elemDamBaseLow[element] += diffLow + Math.floor( (powder.min + powder.max) / 2 ); + // let diffHigh = Math.floor(nDamBaseHigh * powder.convert/100); + // nDamBaseHigh -= diffHigh; + // elemDamBaseHigh[element] += diffHigh + Math.floor( (powder.min + powder.max) / 2 ); + // } + statMap.set("ingredPowders", powders); /* I create a separate variable for each low damage range because we need one damage range to calculate damage with, and it's custom to use the maximum range of the range range. */ diff --git a/damage_calc.js b/damage_calc.js index de75d93..c701529 100644 --- a/damage_calc.js +++ b/damage_calc.js @@ -42,7 +42,7 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier, //1st round - apply each as ingred, 2nd round - apply as normal if (weapon.get("tier") === "Crafted") { let damageBases = buildStats.get("damageBases").slice(); - for (const p of powders) { + for (const p of powders.concat(weapon.get("ingredPowders"))) { let powder = powderStats[p]; //use min, max, and convert let element = Math.floor((p+0.01)/6); //[0,4], the +0.01 attempts to prevent division error let diff = Math.floor(damageBases[0] * powder.convert/100);