Update banners

This commit is contained in:
Made Baruna 2021-06-09 03:27:55 +07:00
parent 5054f9d87f
commit 3f3110f948
No known key found for this signature in database
GPG key ID: 5AA5DA16AA5DCEAD
6 changed files with 52 additions and 15 deletions

View file

@ -112,8 +112,9 @@ export const banners = {
start: '2021-03-17 06:00:00',
end: '2021-04-06 16:00:00',
color: '#35C297',
timezoneDependent: true,
featured: ['venti'],
featuredRare: ['sucrose', 'razor', 'noelle'],
timezoneDependent: true,
},
{
name: 'Farewell of Snezhnaya',
@ -123,6 +124,7 @@ export const banners = {
end: '2021-04-27 15:00:00',
color: '#50A3C0',
featured: ['tartaglia'],
featuredRare: ['rosaria', 'fischl', 'barbara'],
},
{
name: 'Gentry of Hermitage',
@ -142,8 +144,19 @@ export const banners = {
start: '2021-05-18 18:00:00',
end: '2021-06-08 15:00:00',
color: '#A6D6E0',
featuredRare: ['xingqiu', 'beidou', 'xinyan'],
featured: ['eula'],
featuredRare: ['xingqiu', 'beidou', 'xinyan'],
},
{
name: 'Sparkling Steps',
image: 2,
shortName: 'Klee',
start: '2021-06-09 06:00:00',
end: '2021-06-29 17:59:59',
color: '#CA360E',
featured: ['klee'],
featuredRare: ['fischl', 'sucrose', 'barbara'],
timezoneDependent: true,
},
],
weapons: [
@ -232,6 +245,7 @@ export const banners = {
color: '#f54e42',
timezoneDependent: true,
featured: ['elegy_for_the_end', 'skyward_blade'],
featuredRare: ['the_alley_flash', 'wine_and_song', 'favonius_greatsword', 'favonius_warbow', 'dragons_bane'],
},
{
name: 'Epitome Invocation',
@ -241,6 +255,7 @@ export const banners = {
shortName: 'Skyward',
color: '#f5c242',
featured: ['skyward_harp', 'lost_prayer_to_the_sacred_winds'],
featuredRare: ['alley_hunter', 'favonius_codex', 'favonius_lance', 'sacrificial_greatsword', 'favonius_sword'],
},
{
name: 'Epitome Invocation',
@ -248,9 +263,10 @@ export const banners = {
start: '2021-04-28 06:00:00',
end: '2021-05-18 17:59:59',
shortName: 'Summit',
color: '#f54e42',
color: '#f5ef42',
timezoneDependent: true,
featured: ['summit_shaper', 'memory_of_dust'],
featuredRare: ['lithic_blade', 'lithic_spear', 'sacrificial_bow', 'eye_of_perception', 'the_flute'],
},
{
name: 'Epitome Invocation',
@ -258,8 +274,20 @@ export const banners = {
start: '2021-05-18 18:00:00',
end: '2021-06-08 15:00:00',
shortName: 'Pines',
color: '#f5c242',
color: '#7ef542',
featured: ['song_of_broken_pines', 'aquila_favonia'],
featuredRare: ['rust', 'sacrificial_fragments', 'dragons_bane', 'rainslasher', 'sacrificial_sword'],
},
{
name: 'Epitome Invocation',
image: 13,
start: '2021-06-09 06:00:00',
end: '2021-06-29 17:59:59',
shortName: 'Lost Prayer',
color: '#42ecf5',
featured: ['lost_prayer_to_the_sacred_winds', 'skyward_pride'],
featuredRare: ['mitternachts_waltz', 'lions_roar', 'the_bell', 'favonius_lance', 'the_widsith'],
timezoneDependent: true,
},
],
};

View file

@ -1,5 +1,5 @@
import dayjs from 'dayjs';
import { t as $t } from 'svelte-i18n'
import { t as $t } from 'svelte-i18n';
import { getAccountPrefix } from '../stores/account';
import { getTimeOffset } from '../stores/server';
@ -10,7 +10,7 @@ import { characters } from '../data/characters';
import { pushToast } from '../stores/toast';
let t;
$t.subscribe(f => t = f)
$t.subscribe((f) => (t = f));
const bannerTypes = {
'character-event': 'characters',
@ -78,6 +78,8 @@ export async function process(id) {
character: [],
weapon: [],
},
featured: e.featured,
featuredRare: e.featuredRare,
};
});
@ -94,6 +96,7 @@ export async function process(id) {
let grouped = false;
let striped = false;
let rateUp = false;
let rateUpRare = false;
let startBanner = false;
let currentBannerIndex = -1;
let hasManualInput = false;
@ -145,7 +148,7 @@ export async function process(id) {
currentPity: ++pity,
};
if (item.rarity === 5) {
if (item.rarity === 5) {
if (currentBanner.featured) {
newPull.guaranteed = rateUp;
rateUp = !currentBanner.featured.includes(newPull.id);
@ -155,6 +158,11 @@ export async function process(id) {
allLegendary.push(newPull);
pity = 0;
} else if (item.rarity === 4) {
if (currentBanner.featuredRare) {
newPull.guaranteed = rateUpRare;
rateUpRare = !currentBanner.featuredRare.includes(newPull.id);
}
allRare.push(newPull);
selectedBanners[currentBannerIndex].rarePity[newPull.pity - 1]++;
if (pull.type === 'character') {

View file

@ -2,11 +2,6 @@ import dayjs from 'dayjs';
import { process } from './wish';
const bannerCategories = ['beginners', 'standard', 'character-event', 'weapon-event'];
const rareInclude = {
300011: ['rosaria'],
300012: ['yanfei', 'noelle', 'diona'],
300013: ['xingqiu', 'beidou', 'xinyan'],
};
async function sendWish(data) {
try {
@ -58,11 +53,15 @@ export async function submitWishTally() {
]);
// specific 4star include
if (rareInclude[prefixId + i + 1]) {
if (banner[i].rare && banner[i].featuredRare) {
const includedRarePulls = banner[i].rare.character
.filter((e) => rareInclude[prefixId + i + 1].includes(e.id))
.map((e) => [dayjs(e.time).unix().toString(), e.id, e.type, e.pity, e.group === 'group', true, 4]);
.filter((e) => banner[i].featuredRare.includes(e.id))
.map((e) => [dayjs(e.time).unix().toString(), e.id, e.type, e.pity, e.group === 'group', e.guaranteed, 4]);
const includedRareWeaponPulls = banner[i].rare.weapon
.filter((e) => banner[i].featuredRare.includes(e.id))
.map((e) => [dayjs(e.time).unix().toString(), e.id, e.type, e.pity, e.group === 'group', e.guaranteed, 4]);
legendaryPulls.push(...includedRarePulls);
legendaryPulls.push(...includedRareWeaponPulls);
}
// console.log(pityCount);

View file

@ -107,12 +107,14 @@
time: e[1],
type: e[0],
pity: 0,
manualInput: true,
}));
const end = append.map((e) => ({
id: e[2],
time: e[1],
type: e[0],
pity: 0,
manualInput: true,
}));
const combined = [...beginning, ...data, ...end];

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB