sekai-calculator 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -13
- package/dist/index.mjs +13 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -275,15 +275,15 @@ class CardPowerCalculator {
|
|
|
275
275
|
for (const areaItem of usedAreaItems) {
|
|
276
276
|
const allMatch = (areaItem.targetUnit !== 'any' && sameUnit) ||
|
|
277
277
|
(areaItem.targetCardAttr !== 'any' && sameAttr);
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
278
|
+
const rates = [
|
|
279
|
+
allMatch ? areaItem.power1AllMatchBonusRate : areaItem.power1BonusRate,
|
|
280
|
+
allMatch ? areaItem.power2AllMatchBonusRate : areaItem.power2BonusRate,
|
|
281
|
+
allMatch ? areaItem.power3AllMatchBonusRate : areaItem.power3BonusRate
|
|
282
|
+
];
|
|
283
|
+
rates.forEach((rate, i) => {
|
|
284
|
+
areaItemBonus[i] = Math.fround(areaItemBonus[i] +
|
|
285
|
+
Math.fround(Math.fround(Math.fround(rate) * Math.fround(0.01)) * basePower[i]));
|
|
286
|
+
});
|
|
287
287
|
}
|
|
288
288
|
return areaItemBonus.reduce((v, it) => v + Math.floor(it), 0);
|
|
289
289
|
}
|
|
@@ -294,13 +294,13 @@ class CardPowerCalculator {
|
|
|
294
294
|
const characterRank = findOrThrow(characterRanks, it => it.characterId === userCharacter.characterId &&
|
|
295
295
|
it.characterRank === userCharacter.characterRank);
|
|
296
296
|
const rates = [
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
characterRank.power1BonusRate,
|
|
298
|
+
characterRank.power2BonusRate,
|
|
299
|
+
characterRank.power3BonusRate
|
|
300
300
|
];
|
|
301
301
|
return rates
|
|
302
302
|
.reduce((v, it, i) => v +
|
|
303
|
-
Math.floor(Math.fround(Math.fround(it * Math.fround(0.01)) * basePower[i])), 0);
|
|
303
|
+
Math.floor(Math.fround(Math.fround(Math.fround(it) * Math.fround(0.01)) * basePower[i])), 0);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
package/dist/index.mjs
CHANGED
|
@@ -273,15 +273,15 @@ class CardPowerCalculator {
|
|
|
273
273
|
for (const areaItem of usedAreaItems) {
|
|
274
274
|
const allMatch = (areaItem.targetUnit !== 'any' && sameUnit) ||
|
|
275
275
|
(areaItem.targetCardAttr !== 'any' && sameAttr);
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
276
|
+
const rates = [
|
|
277
|
+
allMatch ? areaItem.power1AllMatchBonusRate : areaItem.power1BonusRate,
|
|
278
|
+
allMatch ? areaItem.power2AllMatchBonusRate : areaItem.power2BonusRate,
|
|
279
|
+
allMatch ? areaItem.power3AllMatchBonusRate : areaItem.power3BonusRate
|
|
280
|
+
];
|
|
281
|
+
rates.forEach((rate, i) => {
|
|
282
|
+
areaItemBonus[i] = Math.fround(areaItemBonus[i] +
|
|
283
|
+
Math.fround(Math.fround(Math.fround(rate) * Math.fround(0.01)) * basePower[i]));
|
|
284
|
+
});
|
|
285
285
|
}
|
|
286
286
|
return areaItemBonus.reduce((v, it) => v + Math.floor(it), 0);
|
|
287
287
|
}
|
|
@@ -292,13 +292,13 @@ class CardPowerCalculator {
|
|
|
292
292
|
const characterRank = findOrThrow(characterRanks, it => it.characterId === userCharacter.characterId &&
|
|
293
293
|
it.characterRank === userCharacter.characterRank);
|
|
294
294
|
const rates = [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
characterRank.power1BonusRate,
|
|
296
|
+
characterRank.power2BonusRate,
|
|
297
|
+
characterRank.power3BonusRate
|
|
298
298
|
];
|
|
299
299
|
return rates
|
|
300
300
|
.reduce((v, it, i) => v +
|
|
301
|
-
Math.floor(Math.fround(Math.fround(it * Math.fround(0.01)) * basePower[i])), 0);
|
|
301
|
+
Math.floor(Math.fround(Math.fround(Math.fround(it) * Math.fround(0.01)) * basePower[i])), 0);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|