Skip to content

Commit

Permalink
Update banner
Browse files Browse the repository at this point in the history
  • Loading branch information
MadeBaruna committed May 14, 2024
1 parent 28306b2 commit fc1172c
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
20 changes: 20 additions & 0 deletions src/data/banners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,16 @@ export const banners: { [key: number]: Banner } = {
featuredRare: ['freminet', 'lynette', 'xiangling'],
timezoneDependent: true,
},
300065: {
name: 'From Ashes Reborn',
image: 3,
shortName: 'Wanderer',
start: '2024-05-14 18:00:00',
end: '2024-06-04 14:59:00',
color: '#31cae1',
featured: ['wanderer', 'baizhu'],
featuredRare: ['layla', 'faruzan', 'beidou'],
},

400001: {
name: 'Epitome Invocation',
Expand Down Expand Up @@ -1458,6 +1468,16 @@ export const banners: { [key: number]: Banner } = {
],
timezoneDependent: true,
},
400064: {
name: 'Epitome Invocation',
image: 64,
shortName: 'Tulaytullah',
start: '2024-05-14 18:00:00',
end: '2024-06-04 14:59:00',
color: '#eae5e1',
featured: ['tulaytullahs_remembrance', 'jadefalls_splendor'],
featuredRare: ['prospectors_drill', 'range_gauge', 'favonius_sword', 'rainslasher', 'sacrificial_fragments'],
},

500001: {
name: 'Ode to the Dawn Breeze',
Expand Down
43 changes: 43 additions & 0 deletions src/migrations/1715699010371-UpdateBanner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { Banner } from "../entities/banner";

const banners = {
characters: {
name: "From Ashes Reborn",
start: "2024-05-14 18:00:00",
end: "2024-06-04 14:59:00",
id: 300065,
},
weapons: {
name: "Epitome Invocation",
start: "2024-05-14 18:00:00",
end: "2024-06-04 14:59:00",
id: 400064,
},
};

export class UpdateBanner1715699010371 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const newCharacterBanner = banners.characters;
const characterBanner = new Banner();
characterBanner.id = newCharacterBanner.id;
characterBanner.type = "characters";
characterBanner.name = newCharacterBanner.name;
characterBanner.start = `${newCharacterBanner.start}+8`;
characterBanner.end = `${newCharacterBanner.end}+8`;

const newWeaponBanner = banners.weapons;
const weaponBanner = new Banner();
weaponBanner.id = newWeaponBanner.id;
weaponBanner.type = "weapons";
weaponBanner.name = newWeaponBanner.name;
weaponBanner.start = `${newWeaponBanner.start}+8`;
weaponBanner.end = `${newWeaponBanner.end}+8`;

await queryRunner.manager.save([characterBanner, weaponBanner]);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.manager.delete(Banner, [300065, 400064]);
}
}
4 changes: 2 additions & 2 deletions src/queue/tally.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ async function calculateWishTally(job: Job<number>): Promise<void> {
calculated[id] = result;
}

const LATEST_CHARACTER_BANNER = 300064;
const LATEST_WEAPON_BANNER = 400063;
const LATEST_CHARACTER_BANNER = 300065;
const LATEST_WEAPON_BANNER = 400064;
const LATEST_CHRONICLED_BANNER = 500001;
const TOTAL_BANNER = LATEST_CHARACTER_BANNER - 300009;

Expand Down
4 changes: 2 additions & 2 deletions src/routes/wish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { WishSummaryRequest } from '../types/wishSummaryRequest';
import { WishSummaryLuckRequest } from '../types/wishSummaryLuckRequest';
import { wishSummary, wishSummaryLuck4, wishSummaryLuck5, wishSummaryWinRateOff4, wishSummaryWinRateOff5 } from '../stores/wishSummary';

const LATEST_CHARACTER_BANNER = 300064;
const LATEST_WEAPON_BANNER = 400063;
const LATEST_CHARACTER_BANNER = 300065;
const LATEST_WEAPON_BANNER = 400064;

export default async function (server: FastifyInstance): Promise<void> {
server.get(
Expand Down

0 comments on commit fc1172c

Please sign in to comment.