From e07815a60596645cd39a24826c30c09951d822d9 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Fri, 30 Apr 2021 11:10:36 +0800 Subject: [PATCH] Update wish tally percentage system --- src/routes/wish/tally/_itemNew.svelte | 638 ++++++++++++++++++++++++++ src/routes/wish/tally/index.svelte | 5 +- 2 files changed, 641 insertions(+), 2 deletions(-) create mode 100644 src/routes/wish/tally/_itemNew.svelte diff --git a/src/routes/wish/tally/_itemNew.svelte b/src/routes/wish/tally/_itemNew.svelte new file mode 100644 index 00000000..1076b821 --- /dev/null +++ b/src/routes/wish/tally/_itemNew.svelte @@ -0,0 +1,638 @@ + + +
+
+ {banner.name} +
+ {#if loading} + + {:else if !error} +
+
+ {#if id === 200002} + + + + + + + + + +
+ {featuredValues[0].total} + +

+ {$t('wish.tally.character')} + {$t('wish.tally.summoned')} +

+

+ {numberFormat.format(featuredValues[0].percentage)}% {$t('wish.tally.fromFiveStar')} +

+
+ {featuredValues[1].total} + +

+ {$t('wish.tally.weapon')} + {$t('wish.tally.summoned')} +

+

+ {numberFormat.format(featuredValues[1].percentage)}% {$t('wish.tally.fromFiveStar')} +

+
+ {:else} + + {#each featured as feat, i} + + + + + {/each} +
+ {featuredValues[i].total} + +

+ {type === 'character' ? characters[feat].name : weaponList[feat].name} + {$t('wish.tally.summoned')} +

+

+ {#if id >= 300011 && id < 400000 && i === 0} + {numberFormat.format( + ((featuredValues[i].total - featuredValues[i].guaranteed) / + (data.total.legendary - featuredValues[i].guaranteed)) * + 100, + )}% + {$t('wish.tally.wonFiftyFifty')} + {:else if id > 300011 && id < 400000 && i === 1} + {numberFormat.format(promotedRarePercentage)}% + {$t('wish.tally.fromFourStarFeatured')} + {:else} + {numberFormat.format(featuredValues[i].percentage)}% {$t( + type === 'character' && i === 1 ? 'wish.tally.fromFourStar' : 'wish.tally.fromFiveStar', + )} + {/if} +

+
+ {/if} +
+ +
+
+
+

+ {numberFormat.format(legendary.percentage)}% +

+
+

+ + + + + +

+

Total {numberFormat.format(legendary.total)}

+
+
+
+

+ {numberFormatSecondary.format(rare.percentage)}% +

+
+

+ + + + +

+

Total {numberFormat.format(rare.total)}

+
+
+
+ {#if openLegendaryList} +
+ + + + + + {#each legendaryList as item} + + + + + {/each} +
{$t('wish.tally.name')}{$t('wish.tally.total')}
+ {item.type === 'character' ? characters[item.name].name : weaponList[item.name].name} + {item.count}
+

+ {$t('wish.tally.update')} + {updateTime} +

+
+ {/if} + {/if} +
+ {#if !loading && !error} +
+ + + + + + + {#each legendaryStep as label, i} + + + + + + {/each} +
5★ {$t('wish.tally.pity')}{$t('wish.tally.total')}Chance%
+ {#if Array.isArray(label)} + {label[0]} - {label[1]} + {:else} + {label} + {/if} + + {numberFormat.format(legendaryPity[i].total)} + + {numberFormat.format(legendaryPity[i].percentage * 100)} +
+
+
+ + + + + + + {#each rarePity as pity, i} + + + + + + {/each} +
4★ {$t('wish.tally.pity')}{$t('wish.tally.total')}%
+ {i + 1} + + {numberFormat.format(pity.total)} + + {numberFormat.format(pity.percentage * 100)} +
+
+ +
+ +
+
+
+ {$t('wish.tally.wishTotal')} {numberFormat.format(data.total.all)} +
+
+ {$t('wish.tally.worth')} primogem + {numberFormat.format(data.total.all * 160)} +
+
+
+
+ {$t('wish.tally.median')} + {numberFormat.format(data.median.legendary)} +
+
+ {$t('wish.tally.user')} {numberFormat.format(data.total.users)} +
+
+
+
+ {/if} + {#if error} +
{$t('wish.tally.error')}
+ {/if} +
+ + diff --git a/src/routes/wish/tally/index.svelte b/src/routes/wish/tally/index.svelte index f6472e9e..66d911c5 100644 --- a/src/routes/wish/tally/index.svelte +++ b/src/routes/wish/tally/index.svelte @@ -3,6 +3,7 @@ import Button from '../../../components/Button.svelte'; import { banners } from '../../../data/banners'; import Item from './_item.svelte'; + import ItemNew from './_itemNew.svelte'; let showOld = [false, false]; @@ -30,8 +31,8 @@

- - + +