diff --git a/src/main/ipc/WarpTracker/parseWarps.ts b/src/main/ipc/WarpTracker/parseWarps.ts index b5062b9..c427906 100644 --- a/src/main/ipc/WarpTracker/parseWarps.ts +++ b/src/main/ipc/WarpTracker/parseWarps.ts @@ -3,6 +3,8 @@ import type { Warp } from '@/main/db/models/Warp' export type BannerWarp = Warp & { pity: number + isLimited?: boolean + isGuaranteed?: boolean } export type BannerHistory = { @@ -18,11 +20,12 @@ export type BannerHistory = { export function parseWarps(warps: Array): BannerHistory { let star5Pity = 0 let star4Pity = 0 - let nextIs5050 = true + let next5StarIs5050 = true + let next5StarIsGuaranteed = false const bannerWarps = new Array() for (const warp of warps.toReversed()) { - const bannerWarp = { ...warp, pity: 0 } + const bannerWarp: BannerWarp = { ...warp, pity: 0 } bannerWarps.push(bannerWarp) star5Pity++ @@ -30,9 +33,15 @@ export function parseWarps(warps: Array): BannerHistory { // Assume 4-star and 5-star have separate pity counters if (warp.rarity === 5) { + const isLimited = isLimitedBanner5Star(warp.itemId) + bannerWarp.pity = star5Pity + bannerWarp.isLimited = isLimited + bannerWarp.isGuaranteed = next5StarIsGuaranteed + star5Pity = 0 - nextIs5050 = isLimitedBanner5Star(warp.itemId) + next5StarIs5050 = isLimitedBanner5Star(warp.itemId) + next5StarIsGuaranteed = !next5StarIs5050 } if (warp.rarity === 4) { bannerWarp.pity = star4Pity @@ -46,7 +55,7 @@ export function parseWarps(warps: Array): BannerHistory { return { star5Pity, star4Pity, - nextIs5050, + nextIs5050: next5StarIs5050, warps: bannerWarps, } } diff --git a/src/renderer/client/pages/Banner/BannerPageStats.vue b/src/renderer/client/pages/Banner/BannerPageStats.vue index 55947e8..9b01f74 100644 --- a/src/renderer/client/pages/Banner/BannerPageStats.vue +++ b/src/renderer/client/pages/Banner/BannerPageStats.vue @@ -1,5 +1,5 @@ @@ -41,11 +41,11 @@ const midpointWinRateStr = computed(() => { diff --git a/src/renderer/client/pages/Banner/WarpListItem.vue b/src/renderer/client/pages/Banner/WarpListItem.vue index 5ebc8c0..d6111f2 100644 --- a/src/renderer/client/pages/Banner/WarpListItem.vue +++ b/src/renderer/client/pages/Banner/WarpListItem.vue @@ -42,6 +42,12 @@ const pityColor = computed(() => getPityCssColor(props.bannerWarp)) > {{ bannerWarp.pity }} + +