diff --git a/src/functions/wish.js b/src/functions/wish.js index d9514a1c..f8e81ad3 100644 --- a/src/functions/wish.js +++ b/src/functions/wish.js @@ -224,8 +224,6 @@ export async function process(id) { } } - if (newPull.id === 'raiden_shogun') console.log(newPull); - if (newPull.rarity > 3) { if (selectedBanners[currentBannerIndex].constellation[newPull.id] === undefined) { selectedBanners[currentBannerIndex].constellation[newPull.id] = 0; @@ -265,7 +263,8 @@ export async function process(id) { currentPulls.push(newPull); } - console.log(constellation); + rateOffLegendary.maxStreak = Math.max(rateOffLegendary.maxStreak, rateOffLegendary.currentStreak); + rateOffRare.maxStreak = Math.max(rateOffRare.maxStreak, rateOffRare.currentStreak); return { pulls: currentPulls, diff --git a/src/routes/settings/_importExportModal.svelte b/src/routes/settings/_importExportModal.svelte index 84b930b6..512b0491 100644 --- a/src/routes/settings/_importExportModal.svelte +++ b/src/routes/settings/_importExportModal.svelte @@ -33,6 +33,7 @@ reader.onload = async () => { try { const data = JSON.parse(reader.result); + await localforage.clear(); for (const key in data) { await updateSave(key, data[key], true); } diff --git a/src/routes/wish/_rank.svelte b/src/routes/wish/_rank.svelte index a7342c0c..4ac40f09 100644 --- a/src/routes/wish/_rank.svelte +++ b/src/routes/wish/_rank.svelte @@ -34,6 +34,8 @@ median = '...'; wishCount = wishTotal[current]; + if (wishCount === 0) return; + try { const url = new URL(`${__paimon.env.API_HOST}/wish/summary`); const query = new URLSearchParams({ banner: current }); @@ -81,6 +83,8 @@ percentageLuck[rarity] = 0; medianLuck[rarity] = '...'; + if (percentages[current] === undefined) return; + try { const url = new URL(`${__paimon.env.API_HOST}/wish/summary/luck`); const query = new URLSearchParams({ banner: current, rarity }); diff --git a/src/routes/wish/_summary.svelte b/src/routes/wish/_summary.svelte index 8a5e1393..a63d867e 100644 --- a/src/routes/wish/_summary.svelte +++ b/src/routes/wish/_summary.svelte @@ -25,6 +25,7 @@ let loading = true; let wishCount = 0; + let box = [0, 1, 2, 3]; const avg = {}; const percentages = {}; @@ -171,7 +172,7 @@ legendaryPity += pull.pity; currentMonthlyData[time].legendary++; - legendaryPulls.push({ name: itemName, pity: pull.pity }); + legendaryPulls.push({ name: itemName, pity: pull.pity, rate: pull.rate }); } else if (rarity === 4) { rare++; rarePity += pull.pity; @@ -211,6 +212,23 @@ }, }; + if (counterData.rateoff !== undefined) { + if (avg[type.id].rare.total > 0) { + avg[type.id].rare.rateOff = { + total: counterData.rateoff.rare.win, + percentage: counterData.rateoff.rare.win / (counterData.rateoff.rare.win + counterData.rateoff.rare.lose), + }; + } + if (avg[type.id].legendary.total > 0) { + avg[type.id].legendary.rateOff = { + total: counterData.rateoff.legendary.win, + percentage: + counterData.rateoff.legendary.win / + (counterData.rateoff.legendary.win + counterData.rateoff.legendary.lose), + }; + } + } + percentages[type.id] = { legendary: avg[type.id].legendary.percentage, rare: avg[type.id].rare.percentage, @@ -221,6 +239,14 @@ wishCount = totalWish; monthlyData = currentMonthlyData; + if ( + avg['weapon-event'] !== undefined && + avg['standard'] !== undefined && + avg['weapon-event'].legendary.total > avg['standard'].legendary.total + ) { + box = [0, 2, 1, 3]; + } + if (updateCollectedCharacters && totalWish > 0) { console.log('updating collectables'); await updateSave(`${prefix}characters`, collectedCharacters); @@ -236,21 +262,21 @@ {#if !loading}