mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
生成野怪逻辑
This commit is contained in:
@@ -276,6 +276,39 @@ export class TbGMap {
|
||||
}
|
||||
|
||||
|
||||
export namespace TB {
|
||||
export class TbGOnHookGlobal {
|
||||
|
||||
constructor(_json_: any) {
|
||||
if (_json_.id === undefined) { throw new Error() }
|
||||
this.id = _json_.id
|
||||
if (_json_.args === undefined) { throw new Error() }
|
||||
this.args = _json_.args
|
||||
if (_json_.tig === undefined) { throw new Error() }
|
||||
this.tig = _json_.tig
|
||||
}
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
readonly id: number
|
||||
/**
|
||||
* 全局表参数
|
||||
*/
|
||||
readonly args: string
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
readonly tig: string
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export class TbGGlobal{
|
||||
@@ -470,6 +503,38 @@ export class TbGMap{
|
||||
|
||||
|
||||
|
||||
export class TbGOnHookGlobal{
|
||||
private _dataMap: Map<number, TB.TbGOnHookGlobal>
|
||||
private _dataList: TB.TbGOnHookGlobal[]
|
||||
constructor(_json_: any) {
|
||||
this._dataMap = new Map<number, TB.TbGOnHookGlobal>()
|
||||
this._dataList = []
|
||||
for(var _json2_ of _json_) {
|
||||
let _v: TB.TbGOnHookGlobal
|
||||
_v = new TB.TbGOnHookGlobal(_json2_)
|
||||
this._dataList.push(_v)
|
||||
this._dataMap.set(_v.id, _v)
|
||||
}
|
||||
}
|
||||
|
||||
getDataMap(): Map<number, TB.TbGOnHookGlobal> { return this._dataMap; }
|
||||
getDataList(): TB.TbGOnHookGlobal[] { return this._dataList; }
|
||||
|
||||
get(key: number): TB.TbGOnHookGlobal | undefined { return this._dataMap.get(key); }
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
for(let data of this._dataList)
|
||||
{
|
||||
data.resolve(tables)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
type JsonLoader = (file: string) => any
|
||||
|
||||
export class Tables {
|
||||
@@ -485,6 +550,8 @@ export class Tables {
|
||||
get TbGRoleSkill(): TbGRoleSkill { return this._TbGRoleSkill;}
|
||||
private _TbGMap: TbGMap
|
||||
get TbGMap(): TbGMap { return this._TbGMap;}
|
||||
private _TbGOnHookGlobal: TbGOnHookGlobal
|
||||
get TbGOnHookGlobal(): TbGOnHookGlobal { return this._TbGOnHookGlobal;}
|
||||
|
||||
constructor(loader: JsonLoader) {
|
||||
this._TbGGlobal = new TbGGlobal(loader('tbgglobal'))
|
||||
@@ -493,6 +560,7 @@ export class Tables {
|
||||
this._TbGRoleBattleRes = new TbGRoleBattleRes(loader('tbgrolebattleres'))
|
||||
this._TbGRoleSkill = new TbGRoleSkill(loader('tbgroleskill'))
|
||||
this._TbGMap = new TbGMap(loader('tbgmap'))
|
||||
this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal'))
|
||||
|
||||
this._TbGGlobal.resolve(this)
|
||||
this._TbGRole.resolve(this)
|
||||
@@ -500,5 +568,6 @@ export class Tables {
|
||||
this._TbGRoleBattleRes.resolve(this)
|
||||
this._TbGRoleSkill.resolve(this)
|
||||
this._TbGMap.resolve(this)
|
||||
this._TbGOnHookGlobal.resolve(this)
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"id": 80001,
|
||||
"args": "100",
|
||||
"tig": "预先生成的野外宠物数量"
|
||||
}
|
||||
]
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "2.0.1",
|
||||
"importer": "json",
|
||||
"imported": true,
|
||||
"uuid": "0ccb44c9-b7bc-4fc6-b7d2-8a4335f806a5",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user