diff --git a/src/components/WishImportModal.svelte b/src/components/WishImportModal.svelte index 4eeba8f7..c921676f 100644 --- a/src/components/WishImportModal.svelte +++ b/src/components/WishImportModal.svelte @@ -73,11 +73,6 @@ let currentBanner = ''; let currentPage = 1; - let lastPull = { - id: '0', - time: '', - }; - function cancel() { fetchController.abort(); cancelled = true; @@ -229,11 +224,6 @@ const name = row.name; const type = row.item_type.replace(/ /g, ''); - if (row.id > lastPull.id) { - lastPull.id = row.id; - lastPull.time = row.time; - } - if (time.unix() <= newestPullTime) { return; } @@ -409,7 +399,7 @@ pushToast($t('wish.import.success')); if (wishTallyChecked) { - submitWishTally(lastPull); + submitWishTally(); } const prefix = getAccountPrefix(); diff --git a/src/functions/wish.js b/src/functions/wish.js index 6be1fb5e..04ace3f2 100644 --- a/src/functions/wish.js +++ b/src/functions/wish.js @@ -72,6 +72,7 @@ export function process(id) { image, total: 0, legendary: [], + pityCount: [], rarePity: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], rare: { character: [], @@ -97,6 +98,7 @@ export function process(id) { let currentBannerIndex = -1; let hasManualInput = false; + let pity = 0; for (let i = 0; i < pullData.length; i++) { const pull = pullData[i]; const next = pullData[i + 1] || { time: dayjs().year(2000).unix() }; @@ -128,6 +130,9 @@ export function process(id) { selectedBanners[currentBannerIndex].total++; + const currentPity = selectedBanners[currentBannerIndex].pityCount[pity]; + selectedBanners[currentBannerIndex].pityCount[pity] = (currentPity || 0) + 1; + const newPull = { ...pull, formattedTime: formatTime(pull.time), @@ -136,6 +141,7 @@ export function process(id) { banner: currentBanner, start: startBanner, at: selectedBanners[currentBannerIndex].total, + currentPity: ++pity, }; if (item.rarity === 5) { @@ -146,6 +152,7 @@ export function process(id) { selectedBanners[currentBannerIndex].legendary.push(newPull); allLegendary.push(newPull); + pity = 0; } else if (item.rarity === 4) { allRare.push(newPull); selectedBanners[currentBannerIndex].rarePity[newPull.pity - 1]++; diff --git a/src/functions/wishTally.js b/src/functions/wishTally.js index eb1ca07c..4d97431e 100644 --- a/src/functions/wishTally.js +++ b/src/functions/wishTally.js @@ -1,6 +1,10 @@ import { process } from './wish'; const bannerCategories = ['beginners', 'standard', 'character-event', 'weapon-event']; +const rareInclude = { + 300011: ['rosaria'], + 300012: ['yanfei', 'noelle', 'diona'], +}; async function sendWish(data) { try { @@ -14,14 +18,14 @@ async function sendWish(data) { } } -export async function submitWishTally(lastPull) { +export async function submitWishTally() { let prefixId = 0; for (const id of bannerCategories) { prefixId += 100000; const data = process(id); if (data === null) continue; - if (data.hasManualInput) continue; + // if (data.hasManualInput) continue; console.log('processing wish tally', id); @@ -33,6 +37,7 @@ export async function submitWishTally(lastPull) { const total = banner[i].total; if (total === 0) continue; + const pityCount = [...banner[i].pityCount].map((e) => e || 0); const rarePity = banner[i].rarePity; const legendaryCount = banner[i].legendary.length; const rareCount = banner[i].rare.character.length + banner[i].rare.weapon.length; @@ -46,15 +51,17 @@ export async function submitWishTally(lastPull) { 5, ]); - // rosaria only - const rosariaPulls = banner[i].rare.character - .filter((e) => e.id === 'rosaria') - .map((e) => [e.time.toString(), e.id, e.type, e.pity, e.group === 'group', true, 4]); - legendaryPulls.push(...rosariaPulls); + // specific 4star include + if (rareInclude[prefixId + i + 1]) { + const includedRarePulls = banner[i].rare.character + .filter((e) => rareInclude[prefixId + i + 1].includes(e.id)) + .map((e) => [e.time.toString(), e.id, e.type, e.pity, e.group === 'group', true, 4]); + legendaryPulls.push(...includedRarePulls); + } - console.log(legendaryPulls); - console.log(rarePity); - console.log(legendaryCount, rareCount, total); + // console.log(legendaryPulls); + // console.log(rarePity); + // console.log(legendaryCount, rareCount, total); await sendWish({ firstPulls: firstFivePulls, @@ -64,7 +71,7 @@ export async function submitWishTally(lastPull) { total, legendary: legendaryCount, rare: rareCount, - lastPull, + pityCount, }); } } diff --git a/src/locales/en.json b/src/locales/en.json index a3280645..72ae05a1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -18,8 +18,8 @@ "message": "Your best Genshin Impact companion! Help you plan what to farm with ascension calculator, also track your progress with todo and wish counter.", "banner": { "featured": [ - "Rosaria", - "Tartaglia" + "Zhongli", + "Yanfei" ], "summoned": "Summoned", "percentage": "from all {rarity}", diff --git a/src/locales/id.json b/src/locales/id.json index 1f48a882..f27671f8 100644 --- a/src/locales/id.json +++ b/src/locales/id.json @@ -17,10 +17,6 @@ "welcome": "Selamat Datang di Paimon.moe! 👋", "message": "Your best Genshin Impact companion! Membantu kamu merencanakan apa yang harus di farm dengan kalkulator ascension, juga catat progress mu dengan todo dan wish counter.", "banner": { - "featured": [ - "Rosaria", - "Tartaglia" - ], "summoned": "Pulang", "percentage": "dari semua {rarity}", "avg": "Pity rata-rata", diff --git a/src/locales/ko.json b/src/locales/ko.json index bb4d4f8e..7b0fb8c2 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -17,10 +17,6 @@ "welcome": "Paimon.moe에 어서오세요! 👋", "message": "최고의 원신 동반자! 돌파 계산기로 파밍 계획을 도와주고, 할 일 목록과 기원 통계를 통해 진척도를 확인해줍니다.", "banner": { - "featured": [ - "로자리아", - "타르탈리아" - ], "summoned": "획득", "percentage": "(모든 {rarity} 중)", "avg": "평균 천장", diff --git a/src/locales/ru.json b/src/locales/ru.json index 08fd3a8e..93984f34 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -14,10 +14,6 @@ "welcome": "Добро пожаловать на Paimon.moe! 👋", "message": "Твой лучший компаньон в Genshin Impact! Поможет тебе распланировать что фармить в калькуляторе возвышения, а также отслеживать свой прогресс с помощью счетчика молитв и cписка дел", "banner": { - "featured": [ - "Rosaria", - "Tartaglia" - ], "summoned": "Призывов", "percentage": "из всех {rarity}", "avg": "Среднее число молитв", diff --git a/src/routes/_index/banner.svelte b/src/routes/_index/banner.svelte index 3a91ab0b..7a7f4d48 100644 --- a/src/routes/_index/banner.svelte +++ b/src/routes/_index/banner.svelte @@ -13,21 +13,21 @@ const dispatch = createEventDispatcher(); const featured = { - rosaria: { - rarity: 'rare', - count: 0, - average: '...', - percentage: '...', - }, - tartaglia: { + zhongli: { rarity: 'legendary', count: 0, average: '...', percentage: '...', }, + yanfei: { + rarity: 'rare', + count: 0, + average: '...', + percentage: '...', + }, }; - const bannerId = 300011; - const image = 'childerosaria.png'; + const bannerId = 300012; + const image = 'zhongliyanfei.png'; let loading = true; let user = ''; diff --git a/src/routes/settings/index.svelte b/src/routes/settings/index.svelte index 4068b364..37a1bfaf 100644 --- a/src/routes/settings/index.svelte +++ b/src/routes/settings/index.svelte @@ -247,7 +247,7 @@
-

{$t('settings.version')} 1.4

+

{$t('settings.version')} 1.5

{$t('settings.multiple')}

diff --git a/src/routes/wish/tally/index.svelte b/src/routes/wish/tally/index.svelte index 0e2c190c..f6472e9e 100644 --- a/src/routes/wish/tally/index.svelte +++ b/src/routes/wish/tally/index.svelte @@ -1,13 +1,13 @@ @@ -30,6 +30,8 @@ import Button from '../../../components/Button.svelte';

+ + - - - - {#if showOld} - - + + {#if showOld[0]} + + {:else} - + +
+ {/if} + {#if showOld[1]} + + + {:else} + +
{/if}
diff --git a/static/images/home/zhongliyanfei.png b/static/images/home/zhongliyanfei.png new file mode 100644 index 00000000..3ec76bb7 Binary files /dev/null and b/static/images/home/zhongliyanfei.png differ