Update wish tally

pull/1/head
Made Baruna 2021-04-06 11:00:25 +08:00
parent 6cfcea50c6
commit d41b6002a8
6 changed files with 114 additions and 16 deletions

View File

@ -28,6 +28,7 @@ export const banners = {
end: '2020-10-18 18:00:00',
color: '#55E4B0',
timezoneDependent: true,
featured: ['venti'],
},
{
name: 'Sparkling Steps',
@ -36,6 +37,7 @@ export const banners = {
start: '2020-10-20 18:00:00',
end: '2020-11-10 16:00:00',
color: '#CA360E',
featured: ['klee'],
},
{
name: 'Farewell of Snezhnaya',
@ -45,6 +47,7 @@ export const banners = {
end: '2020-12-01 16:00:00',
color: '#50A3C0',
timezoneDependent: true,
featured: ['tartaglia'],
},
{
name: 'Gentry of Hermitage',
@ -53,6 +56,7 @@ export const banners = {
start: '2020-12-01 18:00:00',
end: '2020-12-22 15:00:00',
color: '#D1A55C',
featured: ['zhongli'],
},
{
name: 'Secretum Secretorum',
@ -62,6 +66,7 @@ export const banners = {
end: '2021-01-12 16:00:00',
color: '#FCFE83',
timezoneDependent: true,
featured: ['albedo'],
},
{
name: 'Adrift in the Harbor',
@ -70,6 +75,7 @@ export const banners = {
start: '2021-01-12 18:00:00',
end: '2021-02-02 15:00:00',
color: '#6994DF',
featured: ['ganyu'],
},
{
name: 'Invitation to Mundane Life',
@ -79,6 +85,7 @@ export const banners = {
end: '2021-02-17 16:00:00',
color: '#2BE3F8',
timezoneDependent: true,
featured: ['xiao'],
},
{
name: 'Dance of Lanterns',
@ -87,6 +94,7 @@ export const banners = {
start: '2021-02-17 18:00:00',
end: '2021-03-02 16:00:00',
color: '#AB6CD7',
featured: ['keqing'],
},
{
name: 'Moment of Bloom',
@ -95,6 +103,7 @@ export const banners = {
start: '2021-03-02 18:00:00',
end: '2021-03-16 15:00:00',
color: '#BF5042',
featured: ['hu_tao'],
},
{
name: 'Ballad in Goblets',
@ -104,6 +113,7 @@ export const banners = {
end: '2021-04-06 16:00:00',
color: '#35C297',
timezoneDependent: true,
featured: ['venti'],
},
{
name: 'Farewell of Snezhnaya',
@ -112,6 +122,7 @@ export const banners = {
start: '2021-04-06 18:00:00',
end: '2021-04-27 15:00:00',
color: '#50A3C0',
featured: ['tartaglia'],
},
],
weapons: [
@ -123,6 +134,7 @@ export const banners = {
shortName: 'Amos',
color: '#f54e42',
timezoneDependent: true,
featured: ['aquila_favonia', 'amos_bow'],
},
{
name: 'Epitome Invocation',
@ -131,6 +143,7 @@ export const banners = {
end: '2020-11-10 16:00:00',
shortName: 'Lost Prayer',
color: '#f5c242',
featured: ['lost_prayer_to_the_sacred_winds', 'wolfs_gravestone'],
},
{
name: 'Epitome Invocation',
@ -140,6 +153,7 @@ export const banners = {
shortName: 'Skyward',
color: '#f5ef42',
timezoneDependent: true,
featured: ['skyward_harp', 'memory_of_dust'],
},
{
name: 'Epitome Invocation',
@ -148,6 +162,7 @@ export const banners = {
end: '2020-12-22 15:00:00',
shortName: 'Vortex',
color: '#7ef542',
featured: ['vortex_vanquisher', 'the_unforged'],
},
{
name: 'Epitome Invocation',
@ -157,6 +172,7 @@ export const banners = {
shortName: 'Summit',
color: '#42ecf5',
timezoneDependent: true,
featured: ['summit_shaper', 'skyward_atlas'],
},
{
name: 'Epitome Invocation',
@ -165,6 +181,7 @@ export const banners = {
end: '2021-02-02 15:00:00',
shortName: 'Amos',
color: '#424ef5',
featured: ['amos_bow', 'skyward_pride'],
},
{
name: 'Epitome Invocation',
@ -174,6 +191,7 @@ export const banners = {
shortName: 'Primordial',
color: '#b042f5',
timezoneDependent: true,
featured: ['primordial_jade_winged-spear', 'primordial_jade_cutter'],
},
{
name: 'Epitome Invocation',
@ -182,6 +200,7 @@ export const banners = {
end: '2021-03-16 15:00:00',
shortName: 'Homa',
color: '#f542c8',
featured: ['wolfs_gravestone', 'staff_of_homa'],
},
{
name: 'Epitome Invocation',
@ -191,6 +210,7 @@ export const banners = {
shortName: 'Elegy',
color: '#f54e42',
timezoneDependent: true,
featured: ['elegy_for_the_end', 'skyward_blade'],
},
{
name: 'Epitome Invocation',
@ -199,6 +219,7 @@ export const banners = {
end: '2021-04-27 15:00:00',
shortName: 'Skyward',
color: '#f5c242',
featured: ['skyward_harp', 'lost_prayer_to_the_sacred_winds'],
},
],
};

View File

@ -92,6 +92,7 @@ export function process(id) {
let currentBanner = null;
let grouped = false;
let striped = false;
let rateUp = false;
let startBanner = false;
let currentBannerIndex = -1;
let hasManualInput = false;
@ -137,7 +138,12 @@ export function process(id) {
at: selectedBanners[currentBannerIndex].total,
};
if (item.rarity === 5) {
if (item.rarity === 5) {
if (currentBanner.featured) {
newPull.guaranteed = rateUp;
rateUp = !currentBanner.featured.includes(newPull.id);
}
selectedBanners[currentBannerIndex].legendary.push(newPull);
allLegendary.push(newPull);
} else if (item.rarity === 4) {

View File

@ -29,7 +29,7 @@ export async function submitWishTally() {
const firstFivePulls = pulls.slice(0, 5).map((e) => [e.time.toString(), e.id, e.type, e.pity, e.group === 'group']);
for (let i = banner.length - 1; i >= Math.max(banner.length - 2, 0); i--) {
for (let i = banner.length - 1; i >= Math.max(banner.length - 3, 0); i--) {
const total = banner[i].total;
if (total === 0) continue;
@ -42,11 +42,20 @@ export async function submitWishTally() {
e.type,
e.pity,
e.group === 'group',
e.guaranteed,
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);
console.log(legendaryPulls);
console.log(rarePity);
console.log(legendaryCount, rareCount, total);
await sendWish({
firstPulls: firstFivePulls,
legendaryPulls,

View File

@ -241,7 +241,8 @@
"roll": "#Roll",
"totalThisBanner": "Total pull on this banner",
"worth": "Worth",
"loading": "Loading... (If this stuck, change your server on settings page)"
"loading": "Loading... (If this stuck, change your server on settings page)",
"guaranteed": "The next 5★ is guaranteed to be the promotional character or weapon"
},
"tally": {
"title": "Wish Tally",
@ -426,19 +427,35 @@
"collect": [
{
"title": "Visited url at paimon.moe, referer, browser, operating system, device type, visitor country",
"content": ["Paimon.moe use", "plausible.io", "(a privacy-friendly analytics) so we can see how many people use which feature, so we can prioritize what feature to implement or improve."]
"content": [
"Paimon.moe use",
"plausible.io",
"(a privacy-friendly analytics) so we can see how many people use which feature, so we can prioritize what feature to implement or improve."
]
},
{
"title": "Error message and exception from the website",
"content": ["Paimon.moe will send error and exception from the website to", "sentry.io", "so we can track what cause problem and fix it accordingly."]
"content": [
"Paimon.moe will send error and exception from the website to",
"sentry.io",
"so we can track what cause problem and fix it accordingly."
]
},
{
"title": "Wish Pity",
"content": ["Paimon.moe will save 4* pity count, 5* pity count, and 5* wish information (wish time, item name, pity count) if you check 'Submit pity for global wish tally' on Wish Auto Import or manually submit it on Help & Setting menu. Paimon.moe will aggregate the data and use it to calculate the average pity for each banner on paimon.moe users. You can check it here", "wish tally"]
"content": [
"Paimon.moe will save 4* pity count, 5* pity count, and 5* wish information (wish time, item name, pity count) if you check 'Submit pity for global wish tally' on Wish Auto Import or manually submit it on Help & Setting menu. Paimon.moe will aggregate the data and use it to calculate the average pity for each banner on paimon.moe users. You can check it here",
"wish tally"
]
}
],
"subtitleNotCollect": "What paimon.moe NOT collect",
"notCollect": ["Paimon.moe never save any password, uid, username, email, temporary keys, or feedback url. If you are interested, the project is open source and you can check the source code at", "paimon-moe-api Github", "and", "paimon-moe Github"]
"notCollect": [
"Paimon.moe never save any password, uid, username, email, temporary keys, or feedback url. If you are interested, the project is open source and you can check the source code at",
"paimon-moe-api Github",
"and",
"paimon-moe Github"
]
},
"sync": {
"message": "Your local data in this browser is conflicting with the ones stored in the Google Drive!",
@ -490,4 +507,4 @@
"hoyolab": "Hoyolab Daily Check-In Reminder",
"comingsoon": "Coming Soon!"
}
}
}

View File

@ -241,7 +241,8 @@
"roll": "#Roll",
"totalThisBanner": "Total pull di banner ini",
"worth": "Setara dengan",
"loading": "Loading... (Kalau tidak selesai-selesai, ganti server di halaman settings)"
"loading": "Loading... (Kalau tidak selesai-selesai, ganti server di halaman settings)",
"guaranteed": "5★ selanjutnya pasti karakter atau senjata promotional"
},
"tally": {
"title": "Perhitungan Pity Wish",

View File

@ -8,7 +8,7 @@
<script>
import { t } from 'svelte-i18n';
import { getContext, onMount, tick } from 'svelte';
import { mdiArrowLeft, mdiStar } from '@mdi/js';
import { mdiArrowLeft, mdiArrowUpCircle, mdiStar } from '@mdi/js';
import dayjs from 'dayjs';
import Chart from 'chart.js';
@ -54,6 +54,7 @@
let total = 0;
let legendary = 0;
let rare = 0;
let nextRateUp = false;
let allLegendary = [];
let allRare = [];
@ -132,6 +133,8 @@
let grouped = false;
let striped = false;
let startBanner = false;
let rateUp = false;
for (let i = 0; i < pullData.length; i++) {
const pull = pullData[i];
const next = pullData[i + 1] || { time: dayjs().year(2000).unix() };
@ -173,6 +176,11 @@
};
if (item.rarity === 5) {
if (currentBanner.featured) {
newPull.guaranteed = rateUp;
rateUp = !currentBanner.featured.includes(newPull.id);
}
selectedBanners[currentBannerIndex].legendary.push(newPull);
allLegendary.push(newPull);
} else if (item.rarity === 4) {
@ -207,7 +215,7 @@
currentPulls.push(newPull);
}
console.log(currentPulls.slice());
nextRateUp = rateUp;
pulls = currentPulls;
sorted = pulls.reverse();
@ -409,10 +417,10 @@
<div class="text-white pl-4 md:pl-8 mt-4">{$t('wish.detail.loading')}</div>
<div class="text-gray-400 pl-4 md:pl-8 mt-2">
{#if errorProcessingPull !== null}
Show this on Discord if still stuck:<br/>
Error when getting banner for<br/>
id: {errorProcessingPull.id}<br/>
time: {errorProcessingPull.time}<br/>
Show this on Discord if still stuck:<br />
Error when getting banner for<br />
id: {errorProcessingPull.id}<br />
time: {errorProcessingPull.time}<br />
server: {$server}
{/if}
</div>
@ -580,7 +588,15 @@
<p class="text-gray-400 font-body">Total</p>
<p class="text-gray-400 font-body text-xl font-bold">{total}</p>
<p class="text-gray-400 font-body mt-2 flex items-center">5<Icon size={0.7} path={mdiStar} /> Pity</p>
<p class="text-legendary-from font-body text-xl font-bold">{legendary}</p>
<p class="text-legendary-from font-body text-xl font-bold flex items-center">
{legendary}
{#if nextRateUp}
<span class="rate-tooltip" style="margin-bottom: 2px; margin-left: 2px;">
<Icon size={0.8} path={mdiArrowUpCircle} />
<span class="tooltip-content">{$t('wish.detail.guaranteed')}</span>
</span>
{/if}
</p>
<p class="text-gray-400 font-body mt-2 flex items-center">4<Icon size={0.7} path={mdiStar} /> Pity</p>
<p class="text-rare-from font-body text-xl font-bold">{rare}</p>
</div>
@ -684,6 +700,34 @@
}
}
.rate-tooltip {
@apply relative;
.tooltip-content {
bottom: 30px;
left: 0px;
width: 250px;
@apply absolute;
@apply hidden;
@apply bg-gray-400;
@apply text-background;
@apply rounded-xl;
@apply p-2;
@apply text-sm;
@screen md {
top: 0px;
bottom: auto;
left: 25px;
width: 320px;
}
}
&:hover .tooltip-content {
@apply block;
}
}
/* firefox bug */
@supports (-moz-appearance: none) {
.border-start {