sekai-calculator 0.9.1 → 0.9.2
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 +9 -6
- package/dist/index.mjs +9 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -276,14 +276,16 @@ class CardPowerCalculator {
|
|
|
276
276
|
const allMatch = (areaItem.targetUnit !== 'any' && sameUnit) ||
|
|
277
277
|
(areaItem.targetCardAttr !== 'any' && sameAttr);
|
|
278
278
|
areaItemBonus[0] = Math.fround(areaItemBonus[0] +
|
|
279
|
-
Math.fround(allMatch ? areaItem.power1AllMatchBonusRate : areaItem.power1BonusRate)
|
|
279
|
+
Math.fround(Math.fround(allMatch ? areaItem.power1AllMatchBonusRate : areaItem.power1BonusRate) *
|
|
280
|
+
Math.fround(0.01) * basePower[0]));
|
|
280
281
|
areaItemBonus[1] = Math.fround(areaItemBonus[1] +
|
|
281
|
-
Math.fround(allMatch ? areaItem.power2AllMatchBonusRate : areaItem.power2BonusRate)
|
|
282
|
+
Math.fround(Math.fround(allMatch ? areaItem.power2AllMatchBonusRate : areaItem.power2BonusRate) *
|
|
283
|
+
Math.fround(0.01) * basePower[1]));
|
|
282
284
|
areaItemBonus[2] = Math.fround(areaItemBonus[2] +
|
|
283
|
-
Math.fround(allMatch ? areaItem.power3AllMatchBonusRate : areaItem.power3BonusRate)
|
|
285
|
+
Math.fround(Math.fround(allMatch ? areaItem.power3AllMatchBonusRate : areaItem.power3BonusRate) *
|
|
286
|
+
Math.fround(0.01) * basePower[2]));
|
|
284
287
|
}
|
|
285
|
-
return
|
|
286
|
-
.reduce((v, it, i) => v + Math.floor(Math.fround(it * Math.fround(areaItemBonus[i] * Math.fround(0.01)))), 0);
|
|
288
|
+
return areaItemBonus.reduce((v, it) => v + Math.floor(it), 0);
|
|
287
289
|
}
|
|
288
290
|
async getCharacterBonusPower(basePower, characterId) {
|
|
289
291
|
const characterRanks = await this.dataProvider.getMasterData('characterRanks');
|
|
@@ -297,7 +299,8 @@ class CardPowerCalculator {
|
|
|
297
299
|
Math.fround(characterRank.power3BonusRate)
|
|
298
300
|
];
|
|
299
301
|
return rates
|
|
300
|
-
.reduce((v, it, i) => v +
|
|
302
|
+
.reduce((v, it, i) => v +
|
|
303
|
+
Math.floor(Math.fround(Math.fround(it * Math.fround(0.01)) * basePower[i])), 0);
|
|
301
304
|
}
|
|
302
305
|
}
|
|
303
306
|
|
package/dist/index.mjs
CHANGED
|
@@ -274,14 +274,16 @@ class CardPowerCalculator {
|
|
|
274
274
|
const allMatch = (areaItem.targetUnit !== 'any' && sameUnit) ||
|
|
275
275
|
(areaItem.targetCardAttr !== 'any' && sameAttr);
|
|
276
276
|
areaItemBonus[0] = Math.fround(areaItemBonus[0] +
|
|
277
|
-
Math.fround(allMatch ? areaItem.power1AllMatchBonusRate : areaItem.power1BonusRate)
|
|
277
|
+
Math.fround(Math.fround(allMatch ? areaItem.power1AllMatchBonusRate : areaItem.power1BonusRate) *
|
|
278
|
+
Math.fround(0.01) * basePower[0]));
|
|
278
279
|
areaItemBonus[1] = Math.fround(areaItemBonus[1] +
|
|
279
|
-
Math.fround(allMatch ? areaItem.power2AllMatchBonusRate : areaItem.power2BonusRate)
|
|
280
|
+
Math.fround(Math.fround(allMatch ? areaItem.power2AllMatchBonusRate : areaItem.power2BonusRate) *
|
|
281
|
+
Math.fround(0.01) * basePower[1]));
|
|
280
282
|
areaItemBonus[2] = Math.fround(areaItemBonus[2] +
|
|
281
|
-
Math.fround(allMatch ? areaItem.power3AllMatchBonusRate : areaItem.power3BonusRate)
|
|
283
|
+
Math.fround(Math.fround(allMatch ? areaItem.power3AllMatchBonusRate : areaItem.power3BonusRate) *
|
|
284
|
+
Math.fround(0.01) * basePower[2]));
|
|
282
285
|
}
|
|
283
|
-
return
|
|
284
|
-
.reduce((v, it, i) => v + Math.floor(Math.fround(it * Math.fround(areaItemBonus[i] * Math.fround(0.01)))), 0);
|
|
286
|
+
return areaItemBonus.reduce((v, it) => v + Math.floor(it), 0);
|
|
285
287
|
}
|
|
286
288
|
async getCharacterBonusPower(basePower, characterId) {
|
|
287
289
|
const characterRanks = await this.dataProvider.getMasterData('characterRanks');
|
|
@@ -295,7 +297,8 @@ class CardPowerCalculator {
|
|
|
295
297
|
Math.fround(characterRank.power3BonusRate)
|
|
296
298
|
];
|
|
297
299
|
return rates
|
|
298
|
-
.reduce((v, it, i) => v +
|
|
300
|
+
.reduce((v, it, i) => v +
|
|
301
|
+
Math.floor(Math.fround(Math.fround(it * Math.fround(0.01)) * basePower[i])), 0);
|
|
299
302
|
}
|
|
300
303
|
}
|
|
301
304
|
|