From a61fa8ac10900d2d407ff1794d40c57a50da55fc Mon Sep 17 00:00:00 2001
From: Made Baruna
Date: Mon, 12 Apr 2021 00:27:18 +0800
Subject: [PATCH] Change percentage to 50:50 on wish tally
---
src/locales/en.json | 1 +
src/locales/id.json | 1 +
src/routes/wish/tally/_item.svelte | 16 +++++++++++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/locales/en.json b/src/locales/en.json
index 3aad61d2..14d25b39 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -257,6 +257,7 @@
"subtitle": "Global average pity from paimon.moe users submission",
"update": "Updated",
"summoned": "Summoned",
+ "wonFiftyFifty": "won 50:50",
"fromFiveStar": "from all 5★",
"fromFourStar": "from all 4★",
"show": "Show",
diff --git a/src/locales/id.json b/src/locales/id.json
index 089cb6d5..789a71f3 100644
--- a/src/locales/id.json
+++ b/src/locales/id.json
@@ -257,6 +257,7 @@
"subtitle": "Rata-rata pity dari kiriman pengguna paimon.moe",
"update": "Diupdate",
"summoned": "Pulang",
+ "wonFiftyFifty": "menang 50:50",
"fromFiveStar": "dari semua 5★",
"fromFourStar": "dari semua 4★",
"show": "Tampilkan",
diff --git a/src/routes/wish/tally/_item.svelte b/src/routes/wish/tally/_item.svelte
index a6de49dc..7d8f7269 100644
--- a/src/routes/wish/tally/_item.svelte
+++ b/src/routes/wish/tally/_item.svelte
@@ -134,6 +134,7 @@
if (item) {
featuredValues[i] = {
total: item.count,
+ guaranteed: item.guaranteed,
percentage:
(item.count /
(type === 'character' && id !== 200001 && i === 1 ? data.total.rare : data.total.legendary)) *
@@ -309,9 +310,18 @@
{$t('wish.tally.summoned')}
- {numberFormat.format(featuredValues[i].percentage)}% {$t(
- type === 'character' && i === 1 ? 'wish.tally.fromFourStar' : 'wish.tally.fromFiveStar',
- )}
+ {#if id === 300011 && i === 0}
+ {numberFormat.format(
+ ((featuredValues[i].total - featuredValues[i].guaranteed) /
+ (data.total.legendary - featuredValues[i].guaranteed)) *
+ 100,
+ )}%
+ {$t('wish.tally.wonFiftyFifty')}
+ {:else}
+ {numberFormat.format(featuredValues[i].percentage)}% {$t(
+ type === 'character' && i === 1 ? 'wish.tally.fromFourStar' : 'wish.tally.fromFiveStar',
+ )}
+ {/if}