Skip to content

Commit e3d9806

Browse files
committed
Add new abyss leylines, fix Shenhe typo
1 parent 74dd4a7 commit e3d9806

File tree

6 files changed

+106
-25
lines changed

6 files changed

+106
-25
lines changed

src/commands/misc/abyss.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AutocompleteInteraction, CommandInteraction, Message, MessageEmbed } fr
22

33
import Command from "../../utils/Command"
44
import client from "../../main"
5-
import { Colors, findFuzzyBestCandidates, sendMessage, simplePaginator } from "../../utils/Utils"
5+
import { Colors, findFuzzyBestCandidates, getDate, sendMessage, simplePaginator } from "../../utils/Utils"
66
import { AbyssSchedule, CommandSource, SendMessage } from "../../utils/Types"
77
import config from "../../data/config.json"
88

@@ -26,7 +26,7 @@ Old abyss floors/buffs can be accessed by giving the cycle (like \`${config.pref
2626
options: [{
2727
name: "floor",
2828
description: "Directly skip to a certain floor",
29-
type: "NUMBER",
29+
type: "INTEGER",
3030
required: false
3131
}, {
3232
name: "cycle",
@@ -49,7 +49,7 @@ Old abyss floors/buffs can be accessed by giving the cycle (like \`${config.pref
4949

5050
async runInteraction(source: CommandInteraction): Promise<SendMessage | undefined> {
5151
const { options } = source
52-
return this.run(source, options.getNumber("floor") ?? -1, options.getString("cycle"))
52+
return this.run(source, options.getInteger("floor") ?? -1, options.getString("cycle"))
5353

5454
}
5555
async runMessage(source: Message, args: string[]): Promise<SendMessage | undefined> {
@@ -72,7 +72,10 @@ Old abyss floors/buffs can be accessed by giving the cycle (like \`${config.pref
7272
async run(source: CommandSource, floor: number, abyssSchedule?: string | null): Promise<SendMessage | undefined> {
7373
const { data } = client
7474
const schedule = data.getAbyssSchedules()
75-
let abyss = schedule[schedule.length - 1]
75+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
76+
let abyss = schedule.filter(schedule =>
77+
Date.now() >= getDate(schedule.start).getTime()
78+
).pop()!
7679

7780
if (abyssSchedule) {
7881
const matchedDate = abyssSchedule.match(/^(\d\d\d\d)-(\d\d?)-(\d)$/)
@@ -84,9 +87,10 @@ Old abyss floors/buffs can be accessed by giving the cycle (like \`${config.pref
8487
if (!abyss)
8588
return sendMessage(source, `Couldn't find abyss \`${line}\``)
8689
}
87-
if (floor > 0 && floor <= abyss.regularFloors.length) {
90+
if (!abyss)
91+
return sendMessage(source, "Couldn't find last abyss")
92+
if (floor > 0 && floor <= abyss.regularFloors.length)
8893
return sendMessage(source, this.getSpiralFloor(abyss.regularFloors[floor - 1], floor))
89-
}
9094

9195
const defaultPage = floor > 0 ? floor - abyss.regularFloors.length : 0
9296

@@ -124,13 +128,15 @@ Old abyss floors/buffs can be accessed by giving the cycle (like \`${config.pref
124128
.setTitle(`Floor ${num}`)
125129
.setDescription(floor.leyline)
126130

127-
const lastChamber = floor.chambers[floor.chambers.length - 1]
128-
for (const chamber of floor.chambers) {
129-
embed.addField(`Chamber ${chamber.chamber}: Conditions`, chamber.conds)
131+
if (floor.chambers) {
132+
const lastChamber = floor.chambers[floor.chambers.length - 1]
133+
for (const chamber of floor.chambers) {
134+
embed.addField(`Chamber ${chamber.chamber}: Conditions`, chamber.conds)
130135

131-
for (const [ind, monsters] of Object.entries(chamber.monsters)) {
132-
const status = `${+ind+1}/${chamber.monsters.length}`
133-
embed.addField(`${names[status] ?? status}: (Lv. ${chamber.level})`, `${monsters.join("\n")}${chamber == lastChamber ? "" : "\n\u200B"}`, true)
136+
for (const [ind, monsters] of Object.entries(chamber.monsters)) {
137+
const status = `${+ind+1}/${chamber.monsters.length}`
138+
embed.addField(`${names[status] ?? status}: (Lv. ${chamber.level})`, `${monsters.join("\n")}${chamber == lastChamber ? "" : "\n\u200B"}`, true)
139+
}
134140
}
135141
}
136142

src/data/gamedata/abyss_floors.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,5 +1921,13 @@
19211921
]
19221922
}
19231923
]
1924+
},
1925+
"34": {
1926+
"teams": 2,
1927+
"leyline": "All party members' Normal Attack DMG increased by 50%."
1928+
},
1929+
"35": {
1930+
"teams": 2,
1931+
"leyline": "Certain opponents in this challenge possess the Honed Spirit effect, which grants them 10% Physical and All Elemental RES. When opponents with Honed Spirit take hits from attacks that are considered Normal Attack DMG, they will lose 3% Physical and All Elemental RES. A maximum of 30% of each may be lost this way. The RES lost this way will be reset every 20s."
19241932
}
19251933
}

src/data/gamedata/abyss_schedule.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,5 +702,71 @@
702702
32,
703703
33
704704
]
705+
},
706+
"32": {
707+
"start": "2022-01-16 04:00:00",
708+
"end": "2022-02-01 03:59:59",
709+
"buff": "Blade-Flourish Moon",
710+
"buffDesc": "When the active character's Normal, Charged, or Plunging Attacks hit opponents multiple times within 2s, that character's Normal, Charged, and Plunging Attack DMG is increased by 5% for 8s. Max 15 stacks. This effect can be triggered once every 0.1s and will be cleared if the character goes down or leaves the field.",
711+
"regularFloors": [
712+
1,
713+
2,
714+
3,
715+
4,
716+
5,
717+
6,
718+
7,
719+
8
720+
],
721+
"spiralAbyssFloors": [
722+
24,
723+
25,
724+
34,
725+
35
726+
]
727+
},
728+
"33": {
729+
"start": "2022-02-01 04:00:00",
730+
"end": "2022-02-16 03:59:59",
731+
"buff": "Blooming Moon",
732+
"buffDesc": "When the active character hits opponents with attacks that are considered Normal Attack DMG, there is a 50% chance of unleashing a shockwave at the hit opponent's position, dealing AoE True DMG. One shockwave can be released in this way every 0.3s.",
733+
"regularFloors": [
734+
1,
735+
2,
736+
3,
737+
4,
738+
5,
739+
6,
740+
7,
741+
8
742+
],
743+
"spiralAbyssFloors": [
744+
24,
745+
25,
746+
34,
747+
35
748+
]
749+
},
750+
"34": {
751+
"start": "2022-02-16 04:00:00",
752+
"end": "2022-03-01 03:59:59",
753+
"buff": "Awakening Moon",
754+
"buffDesc": "When the active character's Normal, Charged, or Plunging Attacks hit opponents multiple times within 2s, the character gains a stack of Emergence for 8s. This effect can be triggered once every 0.1s. Emergence will be cleared when the character goes down or leaves the field. When the character gains 15 Emergence stacks, the stacks will be cleared and a shockwave will be unleashed that deals True DMG to nearby opponents. After a shockwave is unleashed in this way, all party members will deal 25% increased DMG for 10s.",
755+
"regularFloors": [
756+
1,
757+
2,
758+
3,
759+
4,
760+
5,
761+
6,
762+
7,
763+
8
764+
],
765+
"spiralAbyssFloors": [
766+
24,
767+
25,
768+
34,
769+
35
770+
]
705771
}
706772
}

src/data/gamedata/characters.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18168,7 +18168,7 @@
1816818168
},
1816918169
"Shenhe": {
1817018170
"name": "Shenhe",
18171-
"desc": "An adepti disciple with a most unusual air about her. having spent much time cultivating in isolation in Liyue's mountains, she has become every bit as cool and distant as the adepti themselves.",
18171+
"desc": "An adepti disciple with a most unusual air about her. Having spent much time cultivating in isolation in Liyue's mountains, she has become every bit as cool and distant as the adepti themselves.",
1817218172
"star": 5,
1817318173
"weaponType": "Polearm",
1817418174
"icon": "https://i.imgur.com/ccLge5X.png",
@@ -18181,7 +18181,8 @@
1818118181
"birthDay": 10,
1818218182
"association": "Liyue",
1818318183
"title": "Lonesome Transcendence",
18184-
"detail": "An adepti disciple with a most unusual air about her. having spent much time cultivating in isolation in Liyue's mountains, she has become every bit as cool and distant as the adepti themselves.",
18184+
"detail": "An adepti disciple with a most unusual air about her. Having spent much time cultivating in isolation in Liyue's mountains, she has become every bit as cool and distant as the adepti themselves.",
18185+
"affiliation": "Liyue Harbor",
1818518186
"element": "Cryo",
1818618187
"constellation": "Crista Doloris",
1818718188
"cvChinese": "秦紫翼",
@@ -25175,6 +25176,8 @@
2517525176
"name": "Yun Jin",
2517625177
"desc": "A renowned Liyue opera singer who is skilled in both playwriting and singing. Her style is one-of-a-kind, exquisite and delicate, much like the person herself.",
2517725178
"icon": "https://i.imgur.com/BrcAmXj.png",
25179+
"star": 4,
25180+
"weaponType": "Polearm",
2517825181
"imgs": [
2517925182
"https://upload-os-bbs.hoyolab.com/upload/2021/11/22/1015537/d35ba124ac2d9af4772fa6e7925624bc_2825394445059469033.jpg",
2518025183
"https://upload-os-bbs.hoyolab.com/upload/2021/11/22/1015537/8fd08b431a58addf9d16451c8da93236_3542243023422706080.jpg"
@@ -25183,12 +25186,13 @@
2518325186
"association": "Liyue",
2518425187
"title": "Stage Lucida",
2518525188
"detail": "A renowned Liyue opera singer who is skilled in both playwriting and singing. Her style is one-of-a-kind, exquisite and delicate, much like the person herself.",
25189+
"affiliation": "Yun-Han Opera Troupe",
2518625190
"element": "Geo",
2518725191
"constellation": "Opera Grandis",
25188-
"cvChinese": "贺文潇 & 杨扬",
25192+
"cvChinese": "贺文潇&杨扬",
25193+
"cvJapanese": "小岩井ことり&杨扬",
2518925194
"cvEnglish": "Judy Alice Lee & 杨扬",
25190-
"cvJapanese": "小岩井ことり & 杨扬",
25191-
"cvKorean": "사문영 & 杨扬"
25195+
"cvKorean": "사문영&Yang Yang"
2519225196
},
2519325197
"skills": [
2519425198
{

src/utils/DataManager.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { exists, unlink, move, writeFile, existsSync, readFileSync } from "fs-ex
33
import { join } from "path"
44

55
import { Artifact, ArtifactType, MainStatInfo, Character, BotEmoji, Store, Weapon, Cost, AbyssSchedule, AbyssFloor, Event, PaimonShop, Guide, CharacterFull, CostTemplate } from "./Types"
6+
import { findFuzzy } from "./Utils"
67

78
import artifactsData from "../data/gamedata/artifacts.json"
89
import artifactsMainStats from "../data/gamedata/artifact_main_stats.json"
@@ -29,8 +30,6 @@ import emojiData from "../data/emojis.json"
2930
import eventData from "../data/events.json" // Not in gamedata since it also contains webevents
3031
import guideData from "../data/guides.json"
3132

32-
import { findFuzzy, getDate } from "./Utils"
33-
3433
const Logger = log4js.getLogger("DataManager")
3534
const existsP = async (path: string): Promise<boolean> => new Promise((resolve) => exists(path, resolve))
3635

@@ -137,9 +136,7 @@ export default class DataManager {
137136
}
138137

139138
getAbyssSchedules(): AbyssSchedule[] {
140-
return Object.values(this.abyssSchedule).filter(schedule =>
141-
Date.now() >= getDate(schedule.start).getTime()
142-
)
139+
return Object.values(this.abyssSchedule)
143140
}
144141

145142
getArtifactByName(name: string): Artifact | undefined {

src/utils/Types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ export enum WeaponCurveName {
497497
}
498498

499499
export interface AbyssFloor {
500-
teams: number
501-
leyline: string
502-
chambers: AbyssChamber[]
500+
teams: number
501+
leyline: string
502+
chambers?: AbyssChamber[]
503503
}
504504

505505
export interface AbyssChamber {

0 commit comments

Comments
 (0)