fixed issue with dmg calculation
This commit is contained in:
parent
a61c33f23e
commit
4bc062c464
@ -130,32 +130,32 @@ function changeSort(newSort) {
|
|||||||
|
|
||||||
function damage(weapon, infusion, upgraded, stats) {
|
function damage(weapon, infusion, upgraded, stats) {
|
||||||
let weaponInfusion = weapon.infusions[infusion.id];
|
let weaponInfusion = weapon.infusions[infusion.id];
|
||||||
let upgradeLevel = upgraded ? (weapon.unique ? 10 : 25) : 0;
|
let upgLevel = upgraded ? (weapon.unique ? 10 : 25) : 0;
|
||||||
|
|
||||||
let base = infusion.damage.map(
|
let baseDmg = infusion.damage.map(
|
||||||
(amount, ty) => weaponInfusion.damage[ty] * (amount + infusion.upgrade[ty] * upgradeLevel),
|
(dmg, ty) => weaponInfusion.damage[ty] * (dmg + infusion.upgrade[ty] * upgLevel * (weapon.unique ? 2.5 : 1.0)),
|
||||||
);
|
);
|
||||||
|
|
||||||
let scaling = stats.some((stat, i) => stat < weapon.requirements[i])
|
let scalingDmg = stats.some((stat, i) => stat < weapon.requirements[i])
|
||||||
? base.map(dmg => dmg * -0.4)
|
? baseDmg.map(dmg => dmg * -0.4)
|
||||||
: base.map((baseAmount, i) => {
|
: baseDmg.map((dmg, ty) => {
|
||||||
let statCorrection = corrections(
|
let statCorrection = corrections(
|
||||||
CORRECTIONS[weaponInfusion.corrections[i]],
|
CORRECTIONS[weaponInfusion.corrections[ty]],
|
||||||
stats,
|
stats,
|
||||||
weaponInfusion.masks[i],
|
weaponInfusion.masks[ty],
|
||||||
);
|
);
|
||||||
let statScaling = weaponInfusion.scaling.map(itemScaling => {
|
let statScaling = weaponInfusion.scaling.map(scaling => {
|
||||||
return (
|
return (
|
||||||
itemScaling * infusion.scaling[i] +
|
infusion.scaling[ty] *
|
||||||
itemScaling * infusion.scaling[i] * infusion.growth[i] * upgradeLevel
|
(scaling + scaling * infusion.growth[ty] * upgLevel * (weapon.unique ? 4.0 : 1.0))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
return statScaling
|
return statScaling
|
||||||
.map((scaling, statIndex) => (baseAmount * scaling * statCorrection[statIndex]) / 100.0)
|
.map((scaling, statIndex) => (dmg * scaling * statCorrection[statIndex]) / 100.0)
|
||||||
.reduce((sum, n) => sum + n);
|
.reduce((sum, n) => sum + n);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Math.floor(base.reduce((sum, n) => sum + n) + scaling.reduce((sum, n) => sum + n));
|
return Math.floor(baseDmg.reduce((sum, n) => sum + n) + scalingDmg.reduce((sum, n) => sum + n));
|
||||||
}
|
}
|
||||||
|
|
||||||
function corrections(calc, stats, masks) {
|
function corrections(calc, stats, masks) {
|
||||||
|
@ -161,6 +161,7 @@ a:hover {
|
|||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
}
|
}
|
||||||
a.current {
|
a.current {
|
||||||
|
color: var(--link-color);
|
||||||
text-decoration: underline wavy var(--link-color) 0.08rem;
|
text-decoration: underline wavy var(--link-color) 0.08rem;
|
||||||
text-underline-offset: 0.2rem;
|
text-underline-offset: 0.2rem;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user