提交配置表

This commit is contained in:
DESKTOP-5RP3AKU\Jisol 2024-01-07 03:24:10 +08:00
parent e85bd85cde
commit 2a02dc2914
11 changed files with 20751 additions and 2085 deletions

View File

@ -1,24 +0,0 @@
@echo off & setlocal enabledelayedexpansion
@REM 需要被替换的字符串,注意字符串前后不加“”,支持空格
set var1={ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele of _ele) { let _e; _e = new TbGEntity.TAttributeValue(_ele); _e.push(_e);}}; this.baseAttributes.push(_e);}}
@REM 替换成什么内容,此处是批处理当前路径
set var2={ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele of _ele) { let _e; _e = new TbGEntity.TAttributeValue(_ele); _e.push(_e);}}; this.baseAttributes.push(_e);}}
for /r %%i in (JisolGameCocos\assets\script\config\data\schema.ts) do (
echo %%i
@REM 读取a.txt所有内容
for /f "eol=* tokens=*" %%j in (%%i) do (
@REM 设置变量a为每行内容
set a=%%j
@REM 如果该行有var1则将其改为var2
set "a=!a:%var1%=%var2%!"
echo !a!
@REM 把修改后的全部行存入$
echo !a!>>$
)
@REM 用$的内容替换原来a.txt内容
move $ %%i
)
pause

View File

@ -12,4 +12,6 @@ dotnet %LUBAN_DLL% ^
-x outputCodeDir=%P_PATH%\assets\script\config\data ^
-x outputDataDir=%P_PATH%\assets\resources\config\json
pause
pause
npm run main

File diff suppressed because it is too large Load Diff

View File

@ -716,10 +716,16 @@ export class TbGRoleEquip {
this.quality = _json_.quality
if (_json_.icon === undefined) { throw new Error() }
this.icon = _json_.icon
if (_json_.levelFactors === undefined) { throw new Error() }
{ this.levelFactors = []; for(let _ele of _json_.levelFactors) { let _e; _e = _ele; this.levelFactors.push(_e);}}
if (_json_.levelBaseAttributesFactors === undefined) { throw new Error() }
{ this.levelBaseAttributesFactors = []; for(let _ele of _json_.levelBaseAttributesFactors) { let _e; _e = _ele; this.levelBaseAttributesFactors.push(_e);}}
if (_json_.baseAttributes === undefined) { throw new Error() }
{ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele of _ele) { let _e; _e = new TbGEntity.TAttributeValue(_ele); _e.push(_e);}}; this.baseAttributes.push(_e);}}
{ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele1 of _ele) { let _e1; _e1 = new TbGEntity.TAttributeValue(_ele1); _e.push(_e1);}}; this.baseAttributes.push(_e);}}
if (_json_.levelHighAttributesFactors === undefined) { throw new Error() }
{ this.levelHighAttributesFactors = []; for(let _ele of _json_.levelHighAttributesFactors) { let _e; _e = _ele; this.levelHighAttributesFactors.push(_e);}}
if (_json_.highAttributes === undefined) { throw new Error() }
{ this.highAttributes = []; for(let _ele of _json_.highAttributes) { let _e; { _e = []; for(let _ele1 of _ele) { let _e1; _e1 = new TbGEntity.TAttributeValue(_ele1); _e.push(_e1);}}; this.highAttributes.push(_e);}}
if (_json_.highAttributeSize === undefined) { throw new Error() }
{ this.highAttributeSize = []; for(let _ele of _json_.highAttributeSize) { let _e; _e = _ele; this.highAttributeSize.push(_e);}}
}
/**
@ -743,13 +749,25 @@ export class TbGRoleEquip {
*/
readonly icon: string
/**
* ( * ( * ))
* ( * ( * ))
*/
readonly levelFactors: number[]
readonly levelBaseAttributesFactors: number[]
/**
* (value - value )
*/
readonly baseAttributes: TbGEntity.TAttributeValue[][]
/**
* ( * ( * ))
*/
readonly levelHighAttributesFactors: number[]
/**
* (value - value )
*/
readonly highAttributes: TbGEntity.TAttributeValue[][]
/**
*
*/
readonly highAttributeSize: number[]
resolve(tables:Tables)
{

View File

@ -54,7 +54,7 @@ public final class TbGRoleEquip extends AbstractBean {
*/
public final int[] levelFactors;
/**
* 基础属性
* 基础属性(value - value 区间)
*/
public final cfg.TbGEntity.TAttributeValue[][] baseAttributes;

View File

@ -9,26 +9,6 @@
1
],
"baseAttributes": [
[
{
"id": 110001,
"value": 1
},
{
"id": 110001,
"value": 5
}
],
[
{
"id": 110001,
"value": 1
},
{
"id": 110001,
"value": 5
}
],
[
{
"id": 110001,
@ -61,16 +41,6 @@
"value": 5
}
],
[
{
"id": 110001,
"value": 1
},
{
"id": 110001,
"value": 5
}
],
[
{
"id": 110001,

30
index.js Normal file
View File

@ -0,0 +1,30 @@
const fs = require('fs');
fs.readFile('JisolGameCocos/assets/script/config/data/schema.ts', 'utf-8', (err, data) => {
if (err) throw err;
// let replaced = data.replace(
// `{ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele of _ele) { let _e; _e = new TbGEntity.TAttributeValue(_ele); _e.push(_e);}}; this.baseAttributes.push(_e);}}`,
// '{ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele1 of _ele) { let _e1; _e1 = new TbGEntity.TAttributeValue(_ele1); _e.push(_e1);}}; this.baseAttributes.push(_e);}}'
// );
// let replaced = data.replace(
// new RegExp(`{ let _e; { _e = []; for(let _ele of _ele) { let _e; _e = `, 'g'),
// '{ let _e; { _e = []; for(let _ele1 of _ele) { let _e1; _e1 = '
// );
// replaced = replaced.replace(
// new RegExp(`(_ele); _e.push(_e);}};`,'g'),
// '(_ele1); _e.push(_e1);}};'
// );
let replaced = data.replaceAll(
`for(let _ele of _ele) { let _e; _e = `,
'for(let _ele1 of _ele) { let _e1; _e1 = '
);
replaced = replaced.replaceAll(
`(_ele); _e.push(_e);}};`,
'(_ele1); _e.push(_e1);}};'
);
console.log(replaced)
fs.writeFile('JisolGameCocos/assets/script/config/data/schema.ts', replaced, 'utf-8', err => {
if (err) throw err;
console.log('done');
});
});

12
package.json Normal file
View File

@ -0,0 +1,12 @@
{
"name": "jisolgame",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"main": "node index.js"
},
"author": "",
"license": "ISC"
}

1179
schema.ts

File diff suppressed because it is too large Load Diff