Skip to content

Commit 0bb0d02

Browse files
committed
修改默认版本到 160
1 parent 62061fb commit 0bb0d02

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

packages/types/src/Chart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DifficultyEnum, NoteCounts, Regions, Sheet, TypeEnum, VersionEnum } from '@gekichumai/dxdata';
22
import _ from 'lodash';
3-
import { DX_VERSIONS, LEVEL_EMOJI, LEVEL_EN, LEVELS } from './consts';
3+
import { DEFAULT_VERSION, DX_VERSIONS, LEVEL_EMOJI, LEVEL_EN, LEVELS } from './consts';
44
import { ALL_MUSIC } from '@clansty/maibot-data';
55
import { MaiVersion } from './types';
66

@@ -21,7 +21,7 @@ export default class Chart implements Sheet {
2121
public constructor(data: Sheet,
2222
dataFromAllMusic?: typeof ALL_MUSIC[number],
2323
internalId?: number,
24-
public readonly ver: MaiVersion = 155
24+
public readonly ver: MaiVersion = DEFAULT_VERSION
2525
) {
2626
const dataCopy = { ...data };
2727
delete dataCopy.level;

packages/types/src/Song.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CategoryEnum, DifficultyEnum, dxdata, Regions, Song as DataSong, TypeEn
22
import Chart from './Chart';
33
import _ from 'lodash';
44
import { ALL_MUSIC, ALL_MUSIC_140, ALL_MUSIC_145, ALL_MUSIC_150, ALL_MUSIC_155, JACKET_EXIST_IDS } from '@clansty/maibot-data';
5-
import { LEVEL, LEVEL_EN } from './consts';
5+
import { DEFAULT_VERSION, LEVEL, LEVEL_EN } from './consts';
66
import { MaiVersion } from './types';
77
import { ASSET_TYPE, getAssetUrl } from '@clansty/maibot-utils/src/getAssetUrl';
88

@@ -25,7 +25,7 @@ export default class Song implements DataSong {
2525
public readonly dx?: boolean,
2626
// 指 DXRating 中没有的歌
2727
public readonly unlisted = false,
28-
public readonly ver: MaiVersion = 155
28+
public readonly ver: MaiVersion = DEFAULT_VERSION
2929
) {
3030
Object.assign(this, data);
3131

@@ -146,7 +146,7 @@ export default class Song implements DataSong {
146146
return message;
147147
}
148148

149-
public static fromId(id: number, ver: MaiVersion = 155) {
149+
public static fromId(id: number, ver: MaiVersion = DEFAULT_VERSION) {
150150
let allMusic: typeof ALL_MUSIC;
151151
if (ver === 160) {
152152
allMusic = ALL_MUSIC;
@@ -215,7 +215,7 @@ export default class Song implements DataSong {
215215
}, dx, true, ver);
216216
}
217217

218-
public static search(kw: string, ver: MaiVersion = 155) {
218+
public static search(kw: string, ver: MaiVersion = DEFAULT_VERSION) {
219219
const results = [] as Song[];
220220
if (Number(kw)) {
221221
const song = this.fromId(Number(kw), ver);
@@ -239,7 +239,7 @@ export default class Song implements DataSong {
239239
return _.uniqBy(results, (it) => `${it.id}_${it.title}`);
240240
}
241241

242-
public static getByCondition(condition: (song: Song) => boolean, ver: MaiVersion = 155, officialOnly = true): Song[] {
242+
public static getByCondition(condition: (song: Song) => boolean, ver: MaiVersion = DEFAULT_VERSION, officialOnly = true): Song[] {
243243
let tmp = Song.getAllSongs(ver);
244244
if (officialOnly) {
245245
tmp = tmp.filter(song => song.id < 2000);
@@ -249,7 +249,7 @@ export default class Song implements DataSong {
249249
}
250250

251251
public static allIds = _.uniq(Object.keys(ALL_MUSIC).map(Number).map(it => it % 1e4));
252-
public static getAllSongs = (ver: MaiVersion = 155) => Song.allIds.filter(it => it < 2000).map(id => Song.fromId(id, ver)).filter(it => it);
252+
public static getAllSongs = (ver: MaiVersion = DEFAULT_VERSION) => Song.allIds.filter(it => it < 2000).map(id => Song.fromId(id, ver)).filter(it => it);
253253

254254
public getChart(difficulty: DifficultyEnum | number | typeof LEVEL[number], dx = this.dx) {
255255
if (LEVEL.includes(difficulty as any)) {

packages/types/src/consts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DifficultyEnum, VersionEnum } from '@gekichumai/dxdata';
22
import { GameVariantPlateMusicList } from './types';
33
import { ASSET_TYPE, getAssetUrl } from '@clansty/maibot-utils/src/getAssetUrl';
44

5+
export const DEFAULT_VERSION = 160;
56
export const LEVEL = ['绿', '黄', '红', '紫', '白'] as const;
67
export const CHU_LEVEL = ['绿', '黄', '红', '紫', '黑'] as const;
78
export const LEVEL_COLOR = ['rgb(34, 187, 91)', 'rgb(251, 156, 45)', 'rgb(246, 72, 97)', 'rgb(158, 69, 226)',
@@ -1474,4 +1475,4 @@ export const PLATE_MUSIC_LIST_155: GameVariantPlateMusicList = {
14741475
'全曲': [],
14751476
'霸者': []
14761477
}
1477-
PLATE_MUSIC_LIST_155['霸者'] = PLATE_MUSIC_LIST_155['舞'];
1478+
PLATE_MUSIC_LIST_155['霸者'] = PLATE_MUSIC_LIST_155['舞'];

0 commit comments

Comments
 (0)