[chunithm] Support LUMINOUS PLUS + revive SUN Omnimix table for MYT (#1197)

* [chunithm] Support LUMINOUS PLUS + revive SUN Omnimix table for MYT

* fix tests

* correct alias
This commit is contained in:
beerpsi
2024-10-20 14:54:25 +01:00
committed by GitHub
parent c9baf824d9
commit cfa3f94eb5
8 changed files with 28369 additions and 6393 deletions
@@ -0,0 +1,112 @@
const { Command } = require("commander");
const { GetGamePTConfig } = require("tachi-common");
const { CreateFolderID, MutateCollection } = require("../../util");
const LEVELS = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"7+",
"8",
"8+",
"9",
"9+",
"10",
"10+",
"11",
"11+",
"12",
"12+",
"13",
"13+",
"14",
"14+",
"15",
];
const DIFFICULTIES = ["BASIC", "ADVANCED", "EXPERT", "MASTER", "ULTIMA"];
const command = new Command().requiredOption("-v, --version <version>").parse(process.argv);
const options = command.opts();
const version = options.version;
const tachiVersions = GetGamePTConfig("chunithm", "Single").versions;
const versionName = tachiVersions[version];
if (!versionName) {
throw new Error(
`Invalid version of ${version}. Please update game config before adding tables and folders.`
);
}
const newFolders = [];
const levelFolderIDs = [];
const difficultyFolderIDs = [];
for (const level of LEVELS) {
const data = { level, versions: version };
const folderID = CreateFolderID(data, "chunithm", "Single");
levelFolderIDs.push(folderID);
newFolders.push({
data,
folderID,
game: "chunithm",
inactive: false,
playtype: "Single",
searchTerms: [],
title: `Level ${level} (${versionName})`,
type: "charts",
});
}
for (const difficulty of DIFFICULTIES) {
const data = { difficulty, versions: version };
const folderID = CreateFolderID(data, "chunithm", "Single");
difficultyFolderIDs.push(folderID);
newFolders.push({
data,
folderID,
game: "chunithm",
inactive: false,
playtype: "Single",
searchTerms: [],
title: `${difficulty} (${versionName})`,
type: "charts",
});
}
MutateCollection("tables.json", (ts) => {
ts.push(
{
default: false,
description: `Levels for CHUNITHM in ${versionName}.`,
folders: levelFolderIDs,
game: "chunithm",
inactive: false,
playtype: "Single",
tableID: `chunithm-Single-${version}-levels`,
title: `CHUNITHM (${versionName})`,
},
{
default: false,
description: `Difficulties for CHUNITHM in ${versionName}.`,
folders: difficultyFolderIDs,
game: "chunithm",
inactive: false,
playtype: "Single",
tableID: `chunithm-Single-${version}-difficulties`,
title: `CHUNITHM (${versionName}) (Difficulties)`,
}
);
return ts;
});
MutateCollection("folders.json", (fs) => [...fs, ...newFolders]);
@@ -27,11 +27,12 @@ const VERSIONS = [
"sun",
"sunplus",
"luminous",
"luminousplus",
];
interface IDWithDisplayName {
id: number;
str: string;
str: string | number; // "39" -> 39, fast-xml-parser things
data: string;
}
@@ -207,7 +208,7 @@ for (const optionsDir of options.input) {
// New song?
if (tachiSongID === undefined) {
const existingTitle = songTitleMap.get(musicData.name.str);
const existingTitle = songTitleMap.get(musicData.name.str.toString());
if (existingTitle) {
logger.warn(
@@ -233,19 +234,20 @@ for (const optionsDir of options.input) {
}
const songDoc: SongDocument<"chunithm"> = {
title: musicData.name.str,
title: musicData.name.str.toString(),
altTitles: [],
searchTerms: [],
artist: musicData.artistName.str,
artist: musicData.artistName.str.toString(),
id: tachiSongID,
data: {
displayVersion,
genre: musicData.genreNames.list.StringID.str,
genre: musicData.genreNames.list.StringID.str.toString(),
},
};
newSongs.push(songDoc);
inGameIDToSongIDMap.set(inGameID, tachiSongID);
songMap.set(tachiSongID, songDoc);
logger.info(`Added new song ${songDoc.artist} - ${songDoc.title}.`);
} else if (!songMap.has(tachiSongID)) {
@@ -0,0 +1,12 @@
const { GetGamePTConfig } = require("tachi-common");
const { MutateCollection } = require("../../util");
const versions = Object.keys(GetGamePTConfig("chunithm", "Single").versions);
MutateCollection("charts-chunithm.json", (charts) => {
for (const chart of charts) {
chart.versions.sort((a, b) => versions.indexOf(a) - versions.indexOf(b));
}
return charts;
});