mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-25 19:04:43 +00:00
提交配置表
This commit is contained in:
parent
e85bd85cde
commit
2a02dc2914
@ -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
|
|
@ -12,4 +12,6 @@ dotnet %LUBAN_DLL% ^
|
|||||||
-x outputCodeDir=%P_PATH%\assets\script\config\data ^
|
-x outputCodeDir=%P_PATH%\assets\script\config\data ^
|
||||||
-x outputDataDir=%P_PATH%\assets\resources\config\json
|
-x outputDataDir=%P_PATH%\assets\resources\config\json
|
||||||
|
|
||||||
pause
|
pause
|
||||||
|
|
||||||
|
npm run main
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -716,10 +716,16 @@ export class TbGRoleEquip {
|
|||||||
this.quality = _json_.quality
|
this.quality = _json_.quality
|
||||||
if (_json_.icon === undefined) { throw new Error() }
|
if (_json_.icon === undefined) { throw new Error() }
|
||||||
this.icon = _json_.icon
|
this.icon = _json_.icon
|
||||||
if (_json_.levelFactors === undefined) { throw new Error() }
|
if (_json_.levelBaseAttributesFactors === undefined) { throw new Error() }
|
||||||
{ this.levelFactors = []; for(let _ele of _json_.levelFactors) { let _e; _e = _ele; this.levelFactors.push(_e);}}
|
{ this.levelBaseAttributesFactors = []; for(let _ele of _json_.levelBaseAttributesFactors) { let _e; _e = _ele; this.levelBaseAttributesFactors.push(_e);}}
|
||||||
if (_json_.baseAttributes === undefined) { throw new Error() }
|
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 icon: string
|
||||||
/**
|
/**
|
||||||
* 等级系数 (属性 * (等级 * 系数))
|
* 基础等级属性系数 (属性 * (等级 * 系数))
|
||||||
*/
|
*/
|
||||||
readonly levelFactors: number[]
|
readonly levelBaseAttributesFactors: number[]
|
||||||
/**
|
/**
|
||||||
* 基础属性(value - value 区间)
|
* 基础属性(value - value 区间)
|
||||||
*/
|
*/
|
||||||
readonly baseAttributes: TbGEntity.TAttributeValue[][]
|
readonly baseAttributes: TbGEntity.TAttributeValue[][]
|
||||||
|
/**
|
||||||
|
* 高级等级属性系数 (属性 * (等级 * 系数))
|
||||||
|
*/
|
||||||
|
readonly levelHighAttributesFactors: number[]
|
||||||
|
/**
|
||||||
|
* 高级属性(value - value 区间)
|
||||||
|
*/
|
||||||
|
readonly highAttributes: TbGEntity.TAttributeValue[][]
|
||||||
|
/**
|
||||||
|
* 高级词条随机数量
|
||||||
|
*/
|
||||||
|
readonly highAttributeSize: number[]
|
||||||
|
|
||||||
resolve(tables:Tables)
|
resolve(tables:Tables)
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,7 @@ public final class TbGRoleEquip extends AbstractBean {
|
|||||||
*/
|
*/
|
||||||
public final int[] levelFactors;
|
public final int[] levelFactors;
|
||||||
/**
|
/**
|
||||||
* 基础属性
|
* 基础属性(value - value 区间)
|
||||||
*/
|
*/
|
||||||
public final cfg.TbGEntity.TAttributeValue[][] baseAttributes;
|
public final cfg.TbGEntity.TAttributeValue[][] baseAttributes;
|
||||||
|
|
||||||
|
@ -9,26 +9,6 @@
|
|||||||
1
|
1
|
||||||
],
|
],
|
||||||
"baseAttributes": [
|
"baseAttributes": [
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": 110001,
|
|
||||||
"value": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 110001,
|
|
||||||
"value": 5
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": 110001,
|
|
||||||
"value": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 110001,
|
|
||||||
"value": 5
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 110001,
|
"id": 110001,
|
||||||
@ -61,16 +41,6 @@
|
|||||||
"value": 5
|
"value": 5
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": 110001,
|
|
||||||
"value": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 110001,
|
|
||||||
"value": 5
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 110001,
|
"id": 110001,
|
||||||
|
30
index.js
Normal file
30
index.js
Normal 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
12
package.json
Normal 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"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user