Files
chuanqi-client-config/batchSetting.js
aixianling b521e2e735 feat(batchSetting): 更新戒指配置模板
- 调整了 values 数组中的登记值和元宝花费
- 修改了 interval 数组中的间隔值
- 更新了 num 变量的值
- 重构了模板字符串,增加了新的属性和成本项
2024-12-26 14:18:06 +08:00

68 lines
1.8 KiB
JavaScript

const fs = require('fs')
const key = "SpecialRing.config"
const values = [71, 100, 500] // 登记,伤害加倍,元宝花费
const interval = [1, 50, 50]
const num = 130
const start = () => {
const template = `"S1": {
"attr": [
{
"value": S2,
"type": 75
},
{
"value": 585,
"type": 76
},
{
"value": 1115,
"type": 77
},
{
"value": 70,
"type": 21
},
{
"value": 70,
"type": 23
},
{
"value": 70,
"type": 25
},
{
"value": 70,
"type": 27
},
{
"value": 3400,
"type": 79
}
],
"lv": S1,
"cost": [
{
"id": 1022,
"type": 0,
"count": 1600
},
{
"id":4,
"type": 4,
"count": S3
}
],
"pos": 5
}`
const getStr = (index) => {
let str = template
values.forEach((v, i) => {
const reg = new RegExp(`S${i + 1}`, 'g')
str = str.replace(reg, v + index * interval[i])
})
return str
}
const content = Array(num).fill(1).map((e, i) => `${getStr(i)}`).join(',')
fs.writeFileSync(`./dist/${key}.txt`, content)
}
start()