From 6b2a0011cb6ca24a027ab84b2b559f37004844ca Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Sat, 2 Oct 2021 23:53:18 +0700 Subject: [PATCH] Update wish tally standard banner count --- src/functions/wishTally.js | 23 ----------------------- src/routes/wish/tally/_itemNew.svelte | 17 ++++++----------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/functions/wishTally.js b/src/functions/wishTally.js index 06e63f71..79f4fe25 100644 --- a/src/functions/wishTally.js +++ b/src/functions/wishTally.js @@ -39,29 +39,6 @@ export async function submitWishTally() { const pityCount = [...banner[i].pityCount].map((e) => e || 0); if (pityCount.length > 90) continue; - // skip first 5 star and 4 star on standard banner - if (id === 'standard') { - if (banner[i].legendary.length > 0) { - banner[i].legendary = banner[i].legendary.slice(1); - } - - if (banner[i].rare.character.length > 0) { - const removedPullCharacter = banner[i].rare.character[0]; - if (removedPullCharacter) { - banner[i].rarePity[removedPullCharacter.pity - 1] -= 1; - } - banner[i].rare.character = banner[i].rare.character.slice(1); - } - - if (banner[i].rare.weapon.length > 0) { - const removedPullWeapon = banner[i].rare.weapon[0]; - if (removedPullWeapon) { - banner[i].rarePity[removedPullWeapon.pity - 1] -= 1; - } - banner[i].rare.weapon = banner[i].rare.weapon.slice(1); - } - } - const rarePity = banner[i].rarePity; const legendaryCount = banner[i].legendary.length; const rareCount = banner[i].rare.character.length + banner[i].rare.weapon.length; diff --git a/src/routes/wish/tally/_itemNew.svelte b/src/routes/wish/tally/_itemNew.svelte index af0a9e3b..da9316b8 100644 --- a/src/routes/wish/tally/_itemNew.svelte +++ b/src/routes/wish/tally/_itemNew.svelte @@ -106,11 +106,6 @@ max: 0, }; - const rareInclude = { - 300011: ['rosaria'], - 300012: ['yanfei', 'noelle', 'diona'], - 300013: ['xingqiu', 'beidou', 'xinyan'], - }; let promotedRarePercentage = 0; let legendaryList = []; @@ -143,10 +138,7 @@ featuredValues[i] = { total: item.count, guaranteed: item.guaranteed, - percentage: - (item.count / - (type === 'character' && id !== 200001 && i === 1 ? data.total.rare : data.total.legendary)) * - 100, + percentage: (item.count / (type === 'character' && i === 1 ? data.total.rare : data.total.legendary)) * 100, }; } } @@ -157,8 +149,11 @@ for (let i = 0; i < data.list.length; i++) { const feat = data.list[i]; - const index = feat.type === 'character' ? 0 : 1; - values[index] += feat.count; + if (feat.type === 'character' && characters[feat.name].rarity === 5) { + values[0] += feat.count; + } else if (feat.type === 'weapon' && weaponList[feat.name].rarity === 5) { + values[1] += feat.count; + } } featuredValues = [