Browse Source

将改动并入怪物数据

master
枫谷剑仙 1 year ago
parent
commit
9ffbb1de46
2 changed files with 31 additions and 1 deletions
  1. +30
    -0
      monsters-info/custom/chs重新排序和格式整理.mjs
  2. +1
    -1
      monsters-info/mon_ja.json

+ 30
- 0
monsters-info/custom/chs重新排序和格式整理.mjs View File

@@ -0,0 +1,30 @@
import { readFileSync, writeFile, readFile } from 'fs';
import { chdir, cwd } from 'node:process';
import { dirname as pathDirname, join as pathJoin } from 'path';
import {fileURLToPath} from 'url';
const __filename = fileURLToPath(import.meta.url); //当前文件路径
const __dirname = pathDirname(__filename); //当前文件目录
chdir(__dirname);
const ljson = readFileSync("./chs.json", 'utf-8'); //使用同步读取
const ccard = JSON.parse(ljson);//将字符串转换为json对象
ccard.forEach(c => {
const tags = new Set(c.tags);
if(c.name.includes("希石")){
tags.add("希石");
}
c.tags = [...tags];
});
//按ID排序
ccard.sort((a,b)=>a.id-b.id);
//写入Cards
writeFile(`./chs.json`, JSON.stringify(ccard, null, '\t'), function (err) {
if (err) {
console.error(err);
}
});

+ 1
- 1
monsters-info/mon_ja.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save