Skip to content

Commit

Permalink
5.2 character & weapon
Browse files Browse the repository at this point in the history
  • Loading branch information
chadluo committed Nov 10, 2024
1 parent 1fbed1e commit 32c4934
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 52 deletions.
12 changes: 12 additions & 0 deletions src/models/characters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ export const characters = {
"Beryl Conch",
],
} as Character,
Chasca: {
id: "Chasca",
type: "character",
rarity: 5,
name: { en: "Chasca", "zh-CN": "恰斯卡" },
} as Character,
Chevreuse: {
id: "Chevreuse",
type: "character",
Expand Down Expand Up @@ -820,6 +826,12 @@ export const characters = {
"Glaze Lily",
],
} as Character,
Ororon: {
id: "Ororon",
type: "character",
rarity: 4,
name: { en: "Ororon", "zh-CN": "欧洛伦" },
} as Character,
Noelle: {
id: "Noelle",
type: "character",
Expand Down
28 changes: 28 additions & 0 deletions src/models/weapons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ export const weapons = {
"Transoceanic Pearl",
],
} as Weapon,
"Astral Vulture’s Crimson Plumage": {
id: "Astral Vulture’s Crimson Plumage",
type: "weapon",
rarity: 5,
category: "Bow",
name: { en: "Astral Vulture’s Crimson Plumage", "zh-CN": "星鹫赤羽" },
} as Weapon,
//
// Newline - bow 5
//
Expand Down Expand Up @@ -890,6 +897,13 @@ export const weapons = {
"White Iron Chunk",
],
} as Weapon,
"Flower-Wreathed Feathers": {
id: "Flower-Wreathed Feathers",
type: "weapon",
rarity: 4,
category: "Bow",
name: { en: "Flower-Wreathed Feathers", "zh-CN": "缀花之翎" },
} as Weapon,
//
// Newline - bow 4
//
Expand Down Expand Up @@ -1158,6 +1172,13 @@ export const weapons = {
"Juvenile Fang",
],
} as Weapon,
"Waveriding Whirl": {
id: "Waveriding Whirl",
type: "weapon",
rarity: 4,
category: "Catalyst",
name: { en: "Waveriding Whirl", "zh-CN": "乘浪的回旋" },
} as Weapon,
//
// Newline catalyst 4
//
Expand Down Expand Up @@ -2031,6 +2052,13 @@ export const weapons = {
"Sentry’s Wooden Whistle",
],
} as Weapon,
"Calamity of Eshu": {
id: "Calamity of Eshu",
type: "weapon",
rarity: 4,
category: "Sword",
name: { en: "Calamity of Eshu", "zh-CN": "厄水之祸" },
} as Weapon,
//
// Newline - sword 4
//
Expand Down
116 changes: 64 additions & 52 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
const versions: { version: string; start: number; items: string[] }[] = [
{
version: "4.8",
start: new Date(2024, 7 - 1, 16).getTime(),
items: ["Emilie", "Lumidouce Elegy"],
},
{
version: "5.0",
start: new Date(2024, 8 - 1, 28).getTime(),
items: [
"Mualani",
"Kinich",
"Kachina",
"Fang of the Mountain King",
"Surf’s Up",
"Flute of Ezpitzal",
"Earth Shaker",
"Footprint of the Rainbow",
"Ring of Yaxche",
"Chain Breaker",
"Ash-Graven Drinking Horn",
],
},
{
version: "5.1",
start: new Date("2024-10-09").getTime(),
items: [
"Xilonen",
"Peak Patrol Song",
"Sturdy Bone",
"Mountain-Bracing Bolt",
"Fruitful Hook",
],
},
];

export function findRecents() {
const now = new Date().getTime();
const currentIndex = versions.findLastIndex((version) => version.start < now);

if (currentIndex === -1) {
return { current: [], upcoming: [] };
}

return {
current: versions[currentIndex].items,
upcoming:
currentIndex > versions.length - 2
? []
: versions[currentIndex + 1].items,
};
}
const versions: { version: string; start: number; items: string[] }[] = [
{
version: "4.8",
start: new Date(2024, 7 - 1, 16).getTime(),
items: ["Emilie", "Lumidouce Elegy"],
},
{
version: "5.0",
start: new Date(2024, 8 - 1, 28).getTime(),
items: [
"Mualani",
"Kinich",
"Kachina",
"Fang of the Mountain King",
"Surf’s Up",
"Flute of Ezpitzal",
"Earth Shaker",
"Footprint of the Rainbow",
"Ring of Yaxche",
"Chain Breaker",
"Ash-Graven Drinking Horn",
],
},
{
version: "5.1",
start: new Date("2024-10-09").getTime(),
items: [
"Xilonen",
"Peak Patrol Song",
"Sturdy Bone",
"Mountain-Bracing Bolt",
"Fruitful Hook",
],
},
{
version: "5.2",
start: new Date("2024-11-20").getTime(),
items: [
"Chasca",
"Ororon",
"Astral Vulture’s Crimson Plumage",
"Flower-Wreathed Feathers",
"Waveriding Whirl",
"Calamity of Eshu",
],
},
];

export function findRecents() {
const now = new Date().getTime();
const currentIndex = versions.findLastIndex((version) => version.start < now);

if (currentIndex === -1) {
return { current: [], upcoming: [] };
}

return {
current: versions[currentIndex].items,
upcoming:
currentIndex > versions.length - 2
? []
: versions[currentIndex + 1].items,
};
}

0 comments on commit 32c4934

Please sign in to comment.