mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
重构战斗资源加载 , 新添加宠物
This commit is contained in:
@@ -70,9 +70,9 @@ export class TbGRole {
|
||||
*/
|
||||
readonly roleName: string
|
||||
/**
|
||||
* 描述
|
||||
* 角色Spine资源Id
|
||||
*/
|
||||
readonly spine: string
|
||||
readonly spine: number
|
||||
/**
|
||||
* 角色技能Id列表
|
||||
*/
|
||||
@@ -123,45 +123,6 @@ export class TbGRoleAttack {
|
||||
}
|
||||
|
||||
|
||||
export namespace TB {
|
||||
export class TbGRoleBattleRes {
|
||||
|
||||
constructor(_json_: any) {
|
||||
if (_json_.id === undefined) { throw new Error() }
|
||||
this.id = _json_.id
|
||||
if (_json_.resName === undefined) { throw new Error() }
|
||||
this.resName = _json_.resName
|
||||
if (_json_.resType === undefined) { throw new Error() }
|
||||
this.resType = _json_.resType
|
||||
if (_json_.resSrc === undefined) { throw new Error() }
|
||||
this.resSrc = _json_.resSrc
|
||||
}
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
readonly id: number
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
readonly resName: string
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
readonly resType: string
|
||||
/**
|
||||
* 资源地址
|
||||
*/
|
||||
readonly resSrc: string
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export namespace TB {
|
||||
export class TbGRoleSkill {
|
||||
|
||||
@@ -242,15 +203,15 @@ export class TbGMap {
|
||||
/**
|
||||
* 地图1(前)
|
||||
*/
|
||||
readonly map1: string
|
||||
readonly map1: number
|
||||
/**
|
||||
* 地图2(后)
|
||||
*/
|
||||
readonly map2: string
|
||||
readonly map2: number
|
||||
/**
|
||||
* 地图3(天空)
|
||||
*/
|
||||
readonly map3: string
|
||||
readonly map3: number
|
||||
/**
|
||||
* 地图1(前) 偏移量Y
|
||||
*/
|
||||
@@ -696,6 +657,8 @@ export class TbBattleResource {
|
||||
constructor(_json_: any) {
|
||||
if (_json_.id === undefined) { throw new Error() }
|
||||
this.id = _json_.id
|
||||
if (_json_.name === undefined) { throw new Error() }
|
||||
this.name = _json_.name
|
||||
if (_json_.path === undefined) { throw new Error() }
|
||||
this.path = _json_.path
|
||||
if (_json_.type === undefined) { throw new Error() }
|
||||
@@ -706,12 +669,16 @@ export class TbBattleResource {
|
||||
* id
|
||||
*/
|
||||
readonly id: number
|
||||
/**
|
||||
* 资源介绍
|
||||
*/
|
||||
readonly name: string
|
||||
/**
|
||||
* 资源路径
|
||||
*/
|
||||
readonly path: string
|
||||
/**
|
||||
* 资源类型(0.Spine)
|
||||
* 资源类型(0.Spine,1.Sprite)
|
||||
*/
|
||||
readonly type: number
|
||||
|
||||
@@ -821,38 +788,6 @@ export class TbGRoleAttack{
|
||||
|
||||
|
||||
|
||||
export class TbGRoleBattleRes{
|
||||
private _dataMap: Map<number, TB.TbGRoleBattleRes>
|
||||
private _dataList: TB.TbGRoleBattleRes[]
|
||||
constructor(_json_: any) {
|
||||
this._dataMap = new Map<number, TB.TbGRoleBattleRes>()
|
||||
this._dataList = []
|
||||
for(var _json2_ of _json_) {
|
||||
let _v: TB.TbGRoleBattleRes
|
||||
_v = new TB.TbGRoleBattleRes(_json2_)
|
||||
this._dataList.push(_v)
|
||||
this._dataMap.set(_v.id, _v)
|
||||
}
|
||||
}
|
||||
|
||||
getDataMap(): Map<number, TB.TbGRoleBattleRes> { return this._dataMap; }
|
||||
getDataList(): TB.TbGRoleBattleRes[] { return this._dataList; }
|
||||
|
||||
get(key: number): TB.TbGRoleBattleRes | undefined { return this._dataMap.get(key); }
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
for(let data of this._dataList)
|
||||
{
|
||||
data.resolve(tables)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export class TbGRoleSkill{
|
||||
private _dataMap: Map<number, TB.TbGRoleSkill>
|
||||
private _dataList: TB.TbGRoleSkill[]
|
||||
@@ -1278,8 +1213,6 @@ export class Tables {
|
||||
get TbGRole(): TbGRole { return this._TbGRole;}
|
||||
private _TbGRoleAttack: TbGRoleAttack
|
||||
get TbGRoleAttack(): TbGRoleAttack { return this._TbGRoleAttack;}
|
||||
private _TbGRoleBattleRes: TbGRoleBattleRes
|
||||
get TbGRoleBattleRes(): TbGRoleBattleRes { return this._TbGRoleBattleRes;}
|
||||
private _TbGRoleSkill: TbGRoleSkill
|
||||
get TbGRoleSkill(): TbGRoleSkill { return this._TbGRoleSkill;}
|
||||
private _TbGMap: TbGMap
|
||||
@@ -1311,7 +1244,6 @@ export class Tables {
|
||||
this._TbGGlobal = new TbGGlobal(loader('tbgglobal'))
|
||||
this._TbGRole = new TbGRole(loader('tbgrole'))
|
||||
this._TbGRoleAttack = new TbGRoleAttack(loader('tbgroleattack'))
|
||||
this._TbGRoleBattleRes = new TbGRoleBattleRes(loader('tbgrolebattleres'))
|
||||
this._TbGRoleSkill = new TbGRoleSkill(loader('tbgroleskill'))
|
||||
this._TbGMap = new TbGMap(loader('tbgmap'))
|
||||
this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal'))
|
||||
@@ -1329,7 +1261,6 @@ export class Tables {
|
||||
this._TbGGlobal.resolve(this)
|
||||
this._TbGRole.resolve(this)
|
||||
this._TbGRoleAttack.resolve(this)
|
||||
this._TbGRoleBattleRes.resolve(this)
|
||||
this._TbGRoleSkill.resolve(this)
|
||||
this._TbGMap.resolve(this)
|
||||
this._TbGOnHookGlobal.resolve(this)
|
||||
|
@@ -1 +1,98 @@
|
||||
[]
|
||||
[
|
||||
{
|
||||
"id": 130001,
|
||||
"name": "宠物:小石头",
|
||||
"path": "spine/召唤与合成819个Spine/小石头/guaiA1a/spine/guaiA1a",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 130002,
|
||||
"name": "宠物:坚强小石",
|
||||
"path": "spine/召唤与合成819个Spine/坚强小石/guaiA1a_1/spine/guaiA1a",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 130003,
|
||||
"name": "宠物:疯狂松鼠",
|
||||
"path": "spine/召唤与合成819个Spine/疯狂松鼠/guaiA4e_2/spine/guaiA4e",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 130004,
|
||||
"name": "宠物:妙蛙种子",
|
||||
"path": "spine/神奇宝贝/001妙蛙种子/spine/001妙蛙种子",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 130005,
|
||||
"name": "宠物:雷吉艾斯",
|
||||
"path": "spine/神奇宝贝/378雷吉艾斯/spine/378雷吉艾斯",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 140001,
|
||||
"name": "爆炸",
|
||||
"path": "effect/爆炸效果/shouji_01/spine/shouji_01",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 140002,
|
||||
"name": "炸弹",
|
||||
"path": "bullets/疯狂松鼠/attack/spriteFrame",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": 140003,
|
||||
"name": "疯狂松鼠的技能开始 松鼠向天上丢出炸弹",
|
||||
"path": "spine/召唤与合成819个Spine/疯狂松鼠/guaiA4es_2/spine/guaiA4es",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 140004,
|
||||
"name": "火球",
|
||||
"path": "effect/子弹效果/base_fly_fire/spine/buff_fire",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 140005,
|
||||
"name": "火球爆炸",
|
||||
"path": "effect/爆炸效果/zhouyu_skill2_2/spine/zhouyu_skill2_2",
|
||||
"type": 0
|
||||
},
|
||||
{
|
||||
"id": 150001,
|
||||
"name": "天空城:地图1(前)",
|
||||
"path": "map/MAP6/MAP6_1/spriteFrame",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": 150002,
|
||||
"name": "天空城:地图2(后)",
|
||||
"path": "map/MAP6/MAP6_2/spriteFrame",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": 150003,
|
||||
"name": "天空城:地图3(天空)",
|
||||
"path": "map/MAP6/MAP6_3/spriteFrame",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": 150004,
|
||||
"name": "魔法镇:地图1(前)",
|
||||
"path": "map/MAP4/MAP4_1/spriteFrame",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": 150005,
|
||||
"name": "魔法镇:地图2(后)",
|
||||
"path": "map/MAP4/MAP4_2/spriteFrame",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": 150006,
|
||||
"name": "魔法镇:地图3(天空)",
|
||||
"path": "map/MAP4/MAP4_3/spriteFrame",
|
||||
"type": 1
|
||||
}
|
||||
]
|
@@ -2,7 +2,7 @@
|
||||
"ver": "2.0.1",
|
||||
"importer": "json",
|
||||
"imported": true,
|
||||
"uuid": "95a40bf9-994f-4f8c-bd5e-f8bc347becf3",
|
||||
"uuid": "65f65595-306d-4900-b587-13aabe848686",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
@@ -2,9 +2,9 @@
|
||||
{
|
||||
"id": 60001,
|
||||
"mapName": "天空城",
|
||||
"map1": "map/MAP6/MAP6_1/spriteFrame",
|
||||
"map2": "map/MAP6/MAP6_2/spriteFrame",
|
||||
"map3": "map/MAP6/MAP6_3/spriteFrame",
|
||||
"map1": 150001,
|
||||
"map2": 150002,
|
||||
"map3": 150003,
|
||||
"map1OffsetY": 80,
|
||||
"map2OffsetY": 520,
|
||||
"map3OffsetY": 520,
|
||||
@@ -13,9 +13,9 @@
|
||||
{
|
||||
"id": 60002,
|
||||
"mapName": "魔法镇",
|
||||
"map1": "map/MAP4/MAP4_1/spriteFrame",
|
||||
"map2": "map/MAP4/MAP4_2/spriteFrame",
|
||||
"map3": "map/MAP4/MAP4_3/spriteFrame",
|
||||
"map1": 150004,
|
||||
"map2": 150005,
|
||||
"map3": 150006,
|
||||
"map1OffsetY": 80,
|
||||
"map2OffsetY": 520,
|
||||
"map3OffsetY": 520,
|
||||
|
@@ -18,7 +18,8 @@
|
||||
"mapImage": "ui/map/魔法镇_图片/spriteFrame",
|
||||
"mapId": 60002,
|
||||
"petIds": [
|
||||
10004
|
||||
10004,
|
||||
10005
|
||||
],
|
||||
"sign": "",
|
||||
"introduce": "魔法阵 这里有魔法精灵~"
|
||||
|
@@ -2,21 +2,21 @@
|
||||
{
|
||||
"id": 10001,
|
||||
"roleName": "小石头",
|
||||
"spine": "spine/召唤与合成819个Spine/小石头/guaiA1a/spine/guaiA1a",
|
||||
"spine": 130001,
|
||||
"roleSkillIds": [],
|
||||
"roleAttackRange": 100
|
||||
},
|
||||
{
|
||||
"id": 10002,
|
||||
"roleName": "坚强小石",
|
||||
"spine": "spine/召唤与合成819个Spine/坚强小石/guaiA1a_1/spine/guaiA1a",
|
||||
"spine": 130002,
|
||||
"roleSkillIds": [],
|
||||
"roleAttackRange": 100
|
||||
},
|
||||
{
|
||||
"id": 10003,
|
||||
"roleName": "疯狂松鼠",
|
||||
"spine": "spine/召唤与合成819个Spine/疯狂松鼠/guaiA4e_2/spine/guaiA4e",
|
||||
"spine": 130003,
|
||||
"roleSkillIds": [
|
||||
40001
|
||||
],
|
||||
@@ -25,10 +25,17 @@
|
||||
{
|
||||
"id": 10004,
|
||||
"roleName": "妙蛙种子",
|
||||
"spine": "spine/神奇宝贝/001妙蛙种子/spine/001妙蛙种子",
|
||||
"spine": 130004,
|
||||
"roleSkillIds": [
|
||||
40002
|
||||
],
|
||||
"roleAttackRange": 350
|
||||
},
|
||||
{
|
||||
"id": 10005,
|
||||
"roleName": "雷吉艾斯",
|
||||
"spine": 130005,
|
||||
"roleSkillIds": [],
|
||||
"roleAttackRange": 350
|
||||
}
|
||||
]
|
@@ -13,8 +13,8 @@
|
||||
"id": 10003,
|
||||
"attackWay": "ParabolicBangRemote",
|
||||
"attackArgs": [
|
||||
"30002",
|
||||
"30001",
|
||||
"140002",
|
||||
"140001",
|
||||
"timo5 007",
|
||||
"0.6",
|
||||
"100",
|
||||
@@ -25,5 +25,10 @@
|
||||
"id": 10004,
|
||||
"attackWay": "Normal",
|
||||
"attackArgs": []
|
||||
},
|
||||
{
|
||||
"id": 10005,
|
||||
"attackWay": "Normal",
|
||||
"attackArgs": []
|
||||
}
|
||||
]
|
@@ -1,32 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 30001,
|
||||
"resName": "爆炸",
|
||||
"resType": "Spine",
|
||||
"resSrc": "effect/爆炸效果/shouji_01/spine/shouji_01"
|
||||
},
|
||||
{
|
||||
"id": 30002,
|
||||
"resName": "炸弹",
|
||||
"resType": "Sprite",
|
||||
"resSrc": "bullets/疯狂松鼠/attack/spriteFrame"
|
||||
},
|
||||
{
|
||||
"id": 30003,
|
||||
"resName": "疯狂松鼠的技能开始 松鼠向天上丢出炸弹",
|
||||
"resType": "Spine",
|
||||
"resSrc": "spine/召唤与合成819个Spine/疯狂松鼠/guaiA4es_2/spine/guaiA4es"
|
||||
},
|
||||
{
|
||||
"id": 30004,
|
||||
"resName": "火球",
|
||||
"resType": "Spine",
|
||||
"resSrc": "effect/子弹效果/base_fly_fire/spine/buff_fire"
|
||||
},
|
||||
{
|
||||
"id": 30005,
|
||||
"resName": "火球爆炸",
|
||||
"resType": "Spine",
|
||||
"resSrc": "effect/爆炸效果/zhouyu_skill2_2/spine/zhouyu_skill2_2"
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user