Adjust Mod Calculation (#30)
Changes: + Adjust mod calculation + remov max 0 from subtract and addition + check in skills for subtract mod
This commit is contained in:
@@ -124,27 +124,27 @@ export default class M5ModAggregate {
|
||||
if (mods.length !== 0) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||
ret.value = Math.max(0, ret.value + bonus);
|
||||
ret.value = ret.value + bonus;
|
||||
}
|
||||
|
||||
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.SUBTRACT);
|
||||
if (mods.length !== 0) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||
ret.value = Math.max(0, ret.value - bonus);
|
||||
ret.value = ret.value - bonus;
|
||||
}
|
||||
|
||||
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.MULTIPLY);
|
||||
if (mods.length !== 0) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a * b, 1);
|
||||
ret.value = Math.max(0, ret.value * bonus);
|
||||
}
|
||||
|
||||
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.DIVISION);
|
||||
if (mods.length !== 0) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a * b, 1);
|
||||
ret.value = Math.max(0, Math.floor(ret.value / bonus));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user