提交锻造系统

This commit is contained in:
PC-20230316NUNE\Administrator 2024-01-08 18:55:00 +08:00
parent e737a09828
commit e8a1cb9362
39 changed files with 9319 additions and 2035 deletions

View File

@ -3,5 +3,10 @@
"id": 90001,
"name": "金币",
"tig": "金币 (目前叫做金币 名称还没有定) 游戏的基础资源 用于升级宠物"
},
{
"id": 90002,
"name": "锻造石",
"tig": "锻造石 可以锻造装备的石头"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -1,402 +1,402 @@
[
{
"id": 1,
"exp": 1
"exp": 0
},
{
"id": 2,
"exp": 2
"exp": 1
},
{
"id": 3,
"exp": 3
"exp": 2
},
{
"id": 4,
"exp": 4
"exp": 3
},
{
"id": 5,
"exp": 5
"exp": 4
},
{
"id": 6,
"exp": 6
"exp": 5
},
{
"id": 7,
"exp": 7
"exp": 6
},
{
"id": 8,
"exp": 8
"exp": 7
},
{
"id": 9,
"exp": 9
"exp": 8
},
{
"id": 10,
"exp": 10
"exp": 9
},
{
"id": 11,
"exp": 11
"exp": 10
},
{
"id": 12,
"exp": 12
"exp": 11
},
{
"id": 13,
"exp": 13
"exp": 12
},
{
"id": 14,
"exp": 14
"exp": 13
},
{
"id": 15,
"exp": 15
"exp": 14
},
{
"id": 16,
"exp": 16
"exp": 15
},
{
"id": 17,
"exp": 17
"exp": 16
},
{
"id": 18,
"exp": 18
"exp": 17
},
{
"id": 19,
"exp": 19
"exp": 18
},
{
"id": 20,
"exp": 20
"exp": 19
},
{
"id": 21,
"exp": 21
"exp": 20
},
{
"id": 22,
"exp": 22
"exp": 21
},
{
"id": 23,
"exp": 23
"exp": 22
},
{
"id": 24,
"exp": 24
"exp": 23
},
{
"id": 25,
"exp": 25
"exp": 24
},
{
"id": 26,
"exp": 26
"exp": 25
},
{
"id": 27,
"exp": 27
"exp": 26
},
{
"id": 28,
"exp": 28
"exp": 27
},
{
"id": 29,
"exp": 29
"exp": 28
},
{
"id": 30,
"exp": 30
"exp": 29
},
{
"id": 31,
"exp": 31
"exp": 30
},
{
"id": 32,
"exp": 32
"exp": 31
},
{
"id": 33,
"exp": 33
"exp": 32
},
{
"id": 34,
"exp": 34
"exp": 33
},
{
"id": 35,
"exp": 35
"exp": 34
},
{
"id": 36,
"exp": 36
"exp": 35
},
{
"id": 37,
"exp": 37
"exp": 36
},
{
"id": 38,
"exp": 38
"exp": 37
},
{
"id": 39,
"exp": 39
"exp": 38
},
{
"id": 40,
"exp": 40
"exp": 39
},
{
"id": 41,
"exp": 41
"exp": 40
},
{
"id": 42,
"exp": 42
"exp": 41
},
{
"id": 43,
"exp": 43
"exp": 42
},
{
"id": 44,
"exp": 44
"exp": 43
},
{
"id": 45,
"exp": 45
"exp": 44
},
{
"id": 46,
"exp": 46
"exp": 45
},
{
"id": 47,
"exp": 47
"exp": 46
},
{
"id": 48,
"exp": 48
"exp": 47
},
{
"id": 49,
"exp": 49
"exp": 48
},
{
"id": 50,
"exp": 50
"exp": 49
},
{
"id": 51,
"exp": 51
"exp": 50
},
{
"id": 52,
"exp": 52
"exp": 51
},
{
"id": 53,
"exp": 53
"exp": 52
},
{
"id": 54,
"exp": 54
"exp": 53
},
{
"id": 55,
"exp": 55
"exp": 54
},
{
"id": 56,
"exp": 56
"exp": 55
},
{
"id": 57,
"exp": 57
"exp": 56
},
{
"id": 58,
"exp": 58
"exp": 57
},
{
"id": 59,
"exp": 59
"exp": 58
},
{
"id": 60,
"exp": 60
"exp": 59
},
{
"id": 61,
"exp": 61
"exp": 60
},
{
"id": 62,
"exp": 62
"exp": 61
},
{
"id": 63,
"exp": 63
"exp": 62
},
{
"id": 64,
"exp": 64
"exp": 63
},
{
"id": 65,
"exp": 65
"exp": 64
},
{
"id": 66,
"exp": 66
"exp": 65
},
{
"id": 67,
"exp": 67
"exp": 66
},
{
"id": 68,
"exp": 68
"exp": 67
},
{
"id": 69,
"exp": 69
"exp": 68
},
{
"id": 70,
"exp": 70
"exp": 69
},
{
"id": 71,
"exp": 71
"exp": 70
},
{
"id": 72,
"exp": 72
"exp": 71
},
{
"id": 73,
"exp": 73
"exp": 72
},
{
"id": 74,
"exp": 74
"exp": 73
},
{
"id": 75,
"exp": 75
"exp": 74
},
{
"id": 76,
"exp": 76
"exp": 75
},
{
"id": 77,
"exp": 77
"exp": 76
},
{
"id": 78,
"exp": 78
"exp": 77
},
{
"id": 79,
"exp": 79
"exp": 78
},
{
"id": 80,
"exp": 80
"exp": 79
},
{
"id": 81,
"exp": 81
"exp": 80
},
{
"id": 82,
"exp": 82
"exp": 81
},
{
"id": 83,
"exp": 83
"exp": 82
},
{
"id": 84,
"exp": 84
"exp": 83
},
{
"id": 85,
"exp": 85
"exp": 84
},
{
"id": 86,
"exp": 86
"exp": 85
},
{
"id": 87,
"exp": 87
"exp": 86
},
{
"id": 88,
"exp": 88
"exp": 87
},
{
"id": 89,
"exp": 89
"exp": 88
},
{
"id": 90,
"exp": 90
"exp": 89
},
{
"id": 91,
"exp": 91
"exp": 90
},
{
"id": 92,
"exp": 92
"exp": 91
},
{
"id": 93,
"exp": 93
"exp": 92
},
{
"id": 94,
"exp": 94
"exp": 93
},
{
"id": 95,
"exp": 95
"exp": 94
},
{
"id": 96,
"exp": 96
"exp": 95
},
{
"id": 97,
"exp": 97
"exp": 96
},
{
"id": 98,
"exp": 98
"exp": 97
},
{
"id": 99,
"exp": 99
"exp": 98
},
{
"id": 100,
"exp": 100
"exp": 99
}
]

View File

@ -0,0 +1,42 @@
[
{
"id": 1,
"name": "武器"
},
{
"id": 2,
"name": "帽子"
},
{
"id": 3,
"name": "项链"
},
{
"id": 4,
"name": "护肩"
},
{
"id": 5,
"name": "衣服"
},
{
"id": 6,
"name": "腰带"
},
{
"id": 7,
"name": "手套"
},
{
"id": 8,
"name": "戒指"
},
{
"id": 9,
"name": "裤子"
},
{
"id": 10,
"name": "鞋子"
}
]

View File

@ -0,0 +1,11 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "e008c256-6877-43f8-9bf7-b37fc8fbc1d7",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "774f6da9-81bf-4898-b817-2c063837d56c",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "060c67fc-087c-45b5-8a09-ee63c3ebdd25",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "锻造台"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "31e49374-f85f-4d5c-afc9-a4159c775faa",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "宠物单选页面"
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "e43152a4-a8b5-48c6-8599-caec1aa4cee4",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,442 @@
[
{
"__type__": "cc.Prefab",
"_name": "弹出锻造装备页面",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "弹出锻造装备页面",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
}
],
"_prefab": {
"__id__": 20
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "content",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "SpriteSplash",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 8
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9a2bOSmL9PhY4egC6BTrR0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 85,
"g": 85,
"b": 85,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6ac8NoYVpEz4GUr35vJGoA"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b8tFSRSSFFPb/gcLBI1aE8",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "13ov9yBmlJ1qtJlZGH3eRG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "664iSL/SBE9psYRMeSLUPj"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f5F0XQeN1PbJNvOrjuwjQ3",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1dgJxmIH5HIpXD6y0/xMwI"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "582zBz6m5DKqmkTkiS/LE0"
},
{
"__type__": "19e44aZZFxLB6/zVS3HoSuo",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"mask": true,
"maskOpcity": 80,
"isClickMaskeClose": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3dQ+FqzyZN2aiN+7PEKQ9I"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "08xLpDDa9NlK3pgR7XiOqb",
"instance": null,
"targetOverrides": []
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "7eaf6bc2-e208-4edf-985e-e2b435284f92",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "弹出锻造装备页面"
}
}

View File

@ -28,12 +28,12 @@ import AppAction from "./AppAction";
import { Asset } from "cc";
import { Component } from "cc";
let APIPath = `http://localhost:8080`
let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://localhost:8080`
// let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://192.168.1.23:8080`
// let WsPath = `ws://192.168.1.23:8080/websocket`
// let APIPath = `http://192.168.0.121:8080`
// let WsPath = `ws://192.168.0.121:8080/websocket`
let APIPath = `http://192.168.0.119:8080`
let WsPath = `ws://192.168.0.119:8080/websocket`
// let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket`

View File

@ -3,6 +3,7 @@ import { app } from "./App";
import BaseData from "./data/BaseData";
import ChatData from "./data/ChatData";
import GOnHookData from "./data/GOnHookData";
import PetEquipData from "./data/PetEquipData";
import PlayerData from "./data/PlayerData";
import PlayerPetData from "./data/PlayerPetData";
import PlayerTacticalData from "./data/PlayerTacticalData";
@ -20,6 +21,7 @@ export class AppData extends SystemBase{
PlayerTacticalData.getIns(), //阵法
ResourceData.getIns(), //玩家资源
GOnHookData.getIns(), //无限模式信息类 (无限模式是游戏基础模式玩法 需要默认信息)
PetEquipData.getIns(), //宠物装备数据类
];
async onInit(): Promise<any> {

View File

@ -710,8 +710,8 @@ export class TbGRoleEquip {
this.id = _json_.id
if (_json_.name === undefined) { throw new Error() }
this.name = _json_.name
if (_json_.type === undefined) { throw new Error() }
this.type = _json_.type
if (_json_.position === undefined) { throw new Error() }
this.position = _json_.position
if (_json_.quality === undefined) { throw new Error() }
this.quality = _json_.quality
if (_json_.icon === undefined) { throw new Error() }
@ -739,7 +739,7 @@ export class TbGRoleEquip {
/**
* (1=/2=/3=/4=/5=/6=/7=/8=/9=/10=)
*/
readonly type: number
readonly position: number
/**
*
*/
@ -867,6 +867,33 @@ export class TbGRoleEquipQuality {
}
export namespace TB {
export class TbGRoleEquipType {
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
}
/**
* Id
*/
readonly id: number
/**
*
*/
readonly name: string
resolve(tables:Tables)
{
}
}
}
export namespace TB {
export class TbGSysFuben {
@ -1504,6 +1531,38 @@ export class TbGRoleEquipQuality{
export class TbGRoleEquipType{
private _dataMap: Map<number, TB.TbGRoleEquipType>
private _dataList: TB.TbGRoleEquipType[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.TbGRoleEquipType>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.TbGRoleEquipType
_v = new TB.TbGRoleEquipType(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, TB.TbGRoleEquipType> { return this._dataMap; }
getDataList(): TB.TbGRoleEquipType[] { return this._dataList; }
get(key: number): TB.TbGRoleEquipType | undefined { return this._dataMap.get(key); }
resolve(tables:Tables)
{
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export class TbGSysFuben{
private _dataMap: Map<number, TB.TbGSysFuben>
private _dataList: TB.TbGSysFuben[]
@ -1577,6 +1636,8 @@ export class Tables {
get TbGRoleEquipLevel(): TbGRoleEquipLevel { return this._TbGRoleEquipLevel;}
private _TbGRoleEquipQuality: TbGRoleEquipQuality
get TbGRoleEquipQuality(): TbGRoleEquipQuality { return this._TbGRoleEquipQuality;}
private _TbGRoleEquipType: TbGRoleEquipType
get TbGRoleEquipType(): TbGRoleEquipType { return this._TbGRoleEquipType;}
private _TbGSysFuben: TbGSysFuben
get TbGSysFuben(): TbGSysFuben { return this._TbGSysFuben;}
@ -1600,6 +1661,7 @@ export class Tables {
this._TbGRoleEquip = new TbGRoleEquip(loader('tbgroleequip'))
this._TbGRoleEquipLevel = new TbGRoleEquipLevel(loader('tbgroleequiplevel'))
this._TbGRoleEquipQuality = new TbGRoleEquipQuality(loader('tbgroleequipquality'))
this._TbGRoleEquipType = new TbGRoleEquipType(loader('tbgroleequiptype'))
this._TbGSysFuben = new TbGSysFuben(loader('tbgsysfuben'))
this._TbGGlobal.resolve(this)
@ -1621,6 +1683,7 @@ export class Tables {
this._TbGRoleEquip.resolve(this)
this._TbGRoleEquipLevel.resolve(this)
this._TbGRoleEquipQuality.resolve(this)
this._TbGRoleEquipType.resolve(this)
this._TbGSysFuben.resolve(this)
}
}

View File

@ -2,6 +2,7 @@ import { app } from "../App";
import PlayerPetData from "../data/PlayerPetData";
import ResourceData from "../data/ResourceData";
import { GUI } from "../ui/UIConfig";
import { GAttribute } from "./entity/EntityData";
//接受到JSON消息
export const RData = (data:any,isTips:boolean = false) => {
@ -101,6 +102,29 @@ export interface ModeOnHookRankingOV{
mapId:number; //地图Id
}
//宠物装备
export interface PetEquip{
equipId:number; //装备唯一Id
equipCfgId:number; //装备配置表Id
equipPlayerId:number; //装备的所属玩家Id
equipLevel:number; //装备等级
equipWear:number; //当前装备穿戴的宠物Id
equipPosition:number; //装备部位
equipBaseAttributes:GAttribute[]; //基础属性
equipHighAttributes:GAttribute[]; //高级属性
}
//宠物锻造台
export interface EquipForgingBench{
forgingId:number; //锻造台Id
playerId:number; //锻造台所属的玩家Id
forgingExp:number; //锻造等级经验
forgingQuality:number; //锻造品质等级
forgingPetId:number; //当前占用宠物Id
}
export const API = {
UserRegister : async () => RData(await app.api.post(`/user/register`)) as UserVO, //玩家注册
@ -129,5 +153,11 @@ export const API = {
/********** 排行榜接口(无限模式) *******************/
GOnHookRankings: async (mapId:number) => RData(await app.api.get(`/game/mode/onHook/onRankings/${mapId}`),false) as ModeOnHookRankingOV[], //获取玩家资源
/********** 宠物装备系统接口 ****************/
PetEquipAll: async () => RData(await app.api.get(`/game/equip/all`),false) as PetEquip[], //获取全部装备
PetEquipForging: async () => RData(await app.api.get(`/game/equip/forging`),true) as PetEquip, //锻造装备
PetEquipForgingInfo: async () => RData(await app.api.get(`/game/equip/forging/info`),true) as EquipForgingBench, //锻造台
PetEquipForgingPetId: async (petId) => RData(await app.api.get(`/game/equip/forging/petId/${petId}`),true) as EquipForgingBench, //设置锻造宠
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "2476b527-7c23-4d00-b752-94a0595f3585",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
//属性类
export interface GAttribute{
id:number;
value:number;
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "a861d195-9b8d-424e-8122-b1ccb06b516c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,33 @@
import { API, EquipForgingBench, PetEquip } from "../consts/API";
import BaseData from "./BaseData";
import PlayerPetData from "./PlayerPetData";
//宠物装备数据类
export default class PetEquipData extends BaseData{
//装备
equips:PetEquip[];
//锻造台
info:EquipForgingBench;
//锻造台是否有宠物
get isForgingBenchPet(){
return !!PlayerPetData.getIns().petIdQueryPetInfo(this.info.forgingPetId);
}
async onInit() {
this.equips = await API.PetEquipAll();
this.info = await API.PetEquipForgingInfo();
}
//锻造
async forging(){
await API.PetEquipForging();
}
//设置锻造宠
async setForgingPetId(petId:number){
await API.PetEquipForgingPetId(petId);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "ea657593-8f6d-4713-addc-2d01393bf466",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -1,6 +1,7 @@
import { app } from "../App";
import { API, PlayerTacticalOV } from "../consts/API";
import BaseData from "./BaseData";
import PlayerPetData from "./PlayerPetData";
export enum PlayerTacticalEvent{
//更新上阵信息
@ -31,7 +32,7 @@ export default class PlayerTacticalData extends BaseData{
}
this.info = {
...ov,
roles: JSON.parse(ov.tacticalData),
roles: JSON.parse(ov.tacticalData).map(id => PlayerPetData.getIns().petIdQueryPetInfo(id) ? id : 0),
}
//通知阵法信息已更新
@ -56,6 +57,7 @@ export default class PlayerTacticalData extends BaseData{
//修改指定位置的上阵 上阵下标,上阵的宠物Id
async UpdateIndexTactical(index:number,petId:number){
this.info.roles = this.info.roles.map(id => petId == id ? 0 : id);
this.info.roles[index] = petId;
await this.UpdateTactical(this.info.roles);
}
@ -65,6 +67,11 @@ export default class PlayerTacticalData extends BaseData{
return this.info.roles[index];
}
//获取宠物的阵法下标
getItemIndex(roleId:number){
return this.info.roles.indexOf(roleId);
}
//获取初始化上阵信息
getInitTacticalInfo():number[]{
return [0,0,0,0,0,0,0,0,0]

View File

@ -9,6 +9,7 @@ import { API, PlayerPetOV } from "../../../consts/API";
import { GAPI } from "../../../consts/GAPI";
import GOnHookData from "../../../data/GOnHookData";
import PlayerPetData from "../../../data/PlayerPetData";
import PlayerTacticalData from "../../../data/PlayerTacticalData";
import { GUI } from "../../../ui/UIConfig";
export enum GOnHookManagerEvent{
@ -96,9 +97,9 @@ export default class GOnHookManager extends Singleton{
//自动吞噬
for (const item of this.onHookEngulfPets) {
//获取可吞噬的宠物
//获取可吞噬的宠物 ( 等级0, 同类宠物, 不是自己, 不在阵法中)
let engulfs = PlayerPetData.getIns().getData()
.filter(value => (value.petStar || 0) == 0 && item.petTbId == value.petTbId && item.petId != value.petId)
.filter(value => (value.petStar || 0) == 0 && item.petTbId == value.petTbId && item.petId != value.petId && PlayerTacticalData.getIns().getItemIndex(value.petId) != -1)
.map(value => value.petId);
//吞噬

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "30ce933c-5000-49b3-a16a-3595e42bacbb",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,29 @@
import { _decorator, Component, Node } from 'cc';
import PetEquipData from '../../../data/PetEquipData';
import { app } from '../../../App';
import { GUI } from '../../UIConfig';
const { ccclass, property } = _decorator;
//锻造台
@ccclass('MainForgingBench')
export class MainForgingBench extends Component {
//点击锻造
async onClickForging(){
if(!PetEquipData.getIns().isForgingBenchPet){
app.layer.Open(GUI.Tips,{text:"请选择锻造宠"});
return;
}
PetEquipData.getIns().forging();
app.layer.Open(GUI.PetEquipForgingPopupView);
}
//点击锻造宠
async onClickForgingPet(){
app.layer.Open(GUI.PetRadioView);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "9b2f1109-b0bc-4cfc-978e-768af2a09b25",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,11 @@
import { _decorator, Component, Node } from 'cc';
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
const { ccclass, property } = _decorator;
//宠物单选页面
@ccclass('PetRadioView')
export class PetRadioView extends JNLayerBase {
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "54ddf509-ad07-4caa-8931-ce6abfd7bbc5",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "d35cf27a-07da-4228-b168-0b8b1f030c5f",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,10 @@
import { _decorator, Component, Node } from 'cc';
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
const { ccclass, property } = _decorator;
//锻造宠物装备页面
@ccclass('PetEquipForgingPopupView')
export class PetEquipForgingPopupView extends JNLayerBase {
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "19e44699-645c-4b07-aff3-552dc7a12ba8",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -15,6 +15,10 @@ import { PetPreviewWindow } from '../Consts/Pet/info/PetPreviewWindow';
import { Label } from 'cc';
const { ccclass, property } = _decorator;
export enum IntoBattleState{
= "请选择", = "下阵", = "替阵", = "上阵"
}
//上阵页面
@ccclass('IntoBattleView')
export class IntoBattleView extends JNLayerBase {
@ -100,9 +104,35 @@ export class IntoBattleView extends JNLayerBase {
//刷新上阵
onUpdateTactical(){
//获取当前阵法下标是否存在宠物
let petId = PlayerTacticalData.getIns().getItem(this.tIndex);
this.tacticalLabel.string = `${petId ? "下阵" : "上阵"}`
//选择的宠物
this.tacticalLabel.string = `${this.getIntoBattleState()}`;
}
//获取当前状态
getIntoBattleState():IntoBattleState{
//选择的宠物
let selectPet = this.pets[this.index];
if(this.index == -1 || !selectPet) {
return IntoBattleState.
}
//判断选中的宠物是否存在阵法里 存在则下阵
let selectIndex = PlayerTacticalData.getIns().getItemIndex(selectPet.petId);
if(selectIndex >= 0){
//存在 如果存在的下标是当前下标则下阵 不是 则替换
if(selectIndex == this.tIndex)
return IntoBattleState.
else return IntoBattleState.;
}else{
//不存在则上阵
return IntoBattleState.;
}
}
//点击Item
@ -118,25 +148,20 @@ export class IntoBattleView extends JNLayerBase {
//点击上阵
async onClickTactical(){
if(this.index < 0){
let state = this.getIntoBattleState();
if(state == IntoBattleState.){
app.layer.Open(GUI.Tips,{text:"请选择要上阵的宠物."})
return;
}
//获取当前阵法下标是否存在宠物
let petId = PlayerTacticalData.getIns().getItem(this.tIndex);
if(petId) {
//下阵
await PlayerTacticalData.getIns().UpdateIndexTactical(this.tIndex,0);
app.layer.Open(GUI.Tips,{text:"下阵成功"});
//上阵完 关闭页面
app.layer.CloseNode(this.node);
return;
}
}else if(state == IntoBattleState. || state == IntoBattleState.){
//修改上阵信息
await PlayerTacticalData.getIns().UpdateIndexTactical(this.tIndex,this.pets[this.index].petId);
app.layer.Open(GUI.Tips,{text:"上阵成功"});
}else if(state == IntoBattleState.){
//修改上阵信息
await PlayerTacticalData.getIns().UpdateIndexTactical(this.tIndex,0);
app.layer.Open(GUI.Tips,{text:"下阵成功"});
}
//上阵完 关闭页面
app.layer.CloseNode(this.node);

View File

@ -21,10 +21,16 @@ export enum GUI{
/** 主页页面 */
MainChat = "MainChat", //主页聊天页面
IntoBattleView = "IntoBattleView", //上阵页面
PetUpStarView = "PetUpStarView", //宠物升星页面
MainOnHookView = "MainOnHookView", //挂机弹窗
MapSelectView = "MapSelectView", //地图选择页面
/**宠物 */
PetUpStarView = "PetUpStarView", //宠物升星页面
PetRadioView = "PetRadioView", //宠物单选页面
PetEquipForgingPopupView = "PetEquipForgingPopupView", //弹出锻造宠物装备页面
/**游戏模式页面 */
PVPModeMatchView = "PVPModeMatchView", //PVP模式匹配页面
CampGuardianView = "CampGuardianView", //阵营守护战斗页面
@ -106,6 +112,16 @@ const UIPetConfig:{ [key: string]: JNLayerInfo; } = {
uri: "prefab/ui/宠物/宠物升星页面",
anims:BackOutScale,
},
[GUI.PetRadioView]:{
layer:GLayer.Popup,
uri: "prefab/ui/宠物/宠物单选页面",
anims:BackOutScale,
},
[GUI.PetEquipForgingPopupView]:{
layer:GLayer.Popup,
uri: "prefab/ui/宠物装备/弹出锻造装备页面",
anims:BackOutScale,
},
}

View File

@ -21,10 +21,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
@ -48,7 +45,7 @@ public class GPlayerEquipController {
@Autowired
ResourceService resourceService;
//获取玩家宠物列表
//锻造装备(扣除玩家锻造石 打造一件装备)
@ApiImplicitParams({})
@ApiOperation(value = "锻造装备(扣除玩家锻造石 打造一件装备)")
@GetMapping("/forging")
@ -75,6 +72,7 @@ public class GPlayerEquipController {
//随机取一个装备
TbGRoleEquip equipInfo = GRandomUtil.randomArray(equips);
//封装
PetEquip equip = new PetEquip();
equip.setEquipCfgId(equipInfo.id);
equip.setEquipPlayerId(player.getPlayerId());
@ -109,6 +107,18 @@ public class GPlayerEquipController {
}
//获取所有装备
@ApiImplicitParams({})
@ApiOperation(value = "获取所有装备")
@GetMapping("/all")
public NewsContext<List<PetEquip>> all(@CurrentPlayer Player player){
return NewsContext.onSuccess("获取成功",
petEquipService.list(Wrappers.lambdaQuery(PetEquip.class)
.eq(PetEquip::getEquipPlayerId,player.getPlayerId()))
);
}
//获取锻造台等级
@ApiImplicitParams({})
@ApiOperation(value = "获取锻造台")
@ -122,15 +132,35 @@ public class GPlayerEquipController {
try{
info = EquipForgingBench.builder().playerId(player.getPlayerId())
.forgingQuality(TD.DATA.getTbGRoleEquipQuality().getDataList().get(0).id)
.forgingLevel(TD.DATA.getTbGRoleEquipLevel().getDataList().get(0).id).build();
.forgingExp(0).build();
equipForgingBenchService.saveOrUpdate(info);
}catch (Exception ignored){}
assert equipForgingBenchService != null;
info = equipForgingBenchService.getById(player.getPlayerId());
info = equipForgingBenchService.getOne(Wrappers.lambdaQuery(EquipForgingBench.class).eq(EquipForgingBench::getPlayerId,player.getPlayerId()));
}
return NewsContext.onSuccess("获取成功",info);
}
//设置锻造宠
@ApiImplicitParams({})
@ApiOperation(value = "设置锻造宠")
@PostMapping("/forging/petId/{petId}")
public NewsContext<EquipForgingBench> setForgingPetId(@CurrentPlayer Player player, @PathVariable Integer petId){
EquipForgingBench info = equipForgingBenchService.getOne(Wrappers.lambdaQuery(EquipForgingBench.class).eq(EquipForgingBench::getPlayerId,player.getPlayerId()));
if(Objects.isNull(info)){
return NewsContext.onFail("没有找到锻造台");
}
info.setForgingPetId(petId);
equipForgingBenchService.saveOrUpdate(info);
return NewsContext.onSuccess("设置成功",info);
}
}

View File

@ -1,11 +1,16 @@
package cn.jisol.game.entity.table;
import cfg.TB.TbGRoleEquipLevel;
import cn.jisol.game.data.TD;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
import java.util.List;
import java.util.stream.Collectors;
@Builder
@Data
@TableName("`equip_forging_bench`")
@ -14,7 +19,13 @@ public class EquipForgingBench {
@TableId(type = IdType.AUTO)
private Integer forgingId; //锻造台Id
private Long playerId; //锻造台所属的玩家Id
private Integer forgingLevel; //锻造等级
private Integer forgingExp; //锻造等级经验
private Integer forgingQuality; //锻造品质等级
private Integer forgingPetId; //当前占用宠物Id
//获取锻造等级
public Integer getForgingLevel() {
List<TbGRoleEquipLevel> collect = TD.DATA.getTbGRoleEquipLevel().getDataList().stream().filter(info -> info.exp <= this.forgingExp).collect(Collectors.toList());
return collect.get(collect.size() - 1).id;
}
}

View File

@ -1,402 +1,402 @@
[
{
"id": 1,
"exp": 1
"exp": 0
},
{
"id": 2,
"exp": 2
"exp": 1
},
{
"id": 3,
"exp": 3
"exp": 2
},
{
"id": 4,
"exp": 4
"exp": 3
},
{
"id": 5,
"exp": 5
"exp": 4
},
{
"id": 6,
"exp": 6
"exp": 5
},
{
"id": 7,
"exp": 7
"exp": 6
},
{
"id": 8,
"exp": 8
"exp": 7
},
{
"id": 9,
"exp": 9
"exp": 8
},
{
"id": 10,
"exp": 10
"exp": 9
},
{
"id": 11,
"exp": 11
"exp": 10
},
{
"id": 12,
"exp": 12
"exp": 11
},
{
"id": 13,
"exp": 13
"exp": 12
},
{
"id": 14,
"exp": 14
"exp": 13
},
{
"id": 15,
"exp": 15
"exp": 14
},
{
"id": 16,
"exp": 16
"exp": 15
},
{
"id": 17,
"exp": 17
"exp": 16
},
{
"id": 18,
"exp": 18
"exp": 17
},
{
"id": 19,
"exp": 19
"exp": 18
},
{
"id": 20,
"exp": 20
"exp": 19
},
{
"id": 21,
"exp": 21
"exp": 20
},
{
"id": 22,
"exp": 22
"exp": 21
},
{
"id": 23,
"exp": 23
"exp": 22
},
{
"id": 24,
"exp": 24
"exp": 23
},
{
"id": 25,
"exp": 25
"exp": 24
},
{
"id": 26,
"exp": 26
"exp": 25
},
{
"id": 27,
"exp": 27
"exp": 26
},
{
"id": 28,
"exp": 28
"exp": 27
},
{
"id": 29,
"exp": 29
"exp": 28
},
{
"id": 30,
"exp": 30
"exp": 29
},
{
"id": 31,
"exp": 31
"exp": 30
},
{
"id": 32,
"exp": 32
"exp": 31
},
{
"id": 33,
"exp": 33
"exp": 32
},
{
"id": 34,
"exp": 34
"exp": 33
},
{
"id": 35,
"exp": 35
"exp": 34
},
{
"id": 36,
"exp": 36
"exp": 35
},
{
"id": 37,
"exp": 37
"exp": 36
},
{
"id": 38,
"exp": 38
"exp": 37
},
{
"id": 39,
"exp": 39
"exp": 38
},
{
"id": 40,
"exp": 40
"exp": 39
},
{
"id": 41,
"exp": 41
"exp": 40
},
{
"id": 42,
"exp": 42
"exp": 41
},
{
"id": 43,
"exp": 43
"exp": 42
},
{
"id": 44,
"exp": 44
"exp": 43
},
{
"id": 45,
"exp": 45
"exp": 44
},
{
"id": 46,
"exp": 46
"exp": 45
},
{
"id": 47,
"exp": 47
"exp": 46
},
{
"id": 48,
"exp": 48
"exp": 47
},
{
"id": 49,
"exp": 49
"exp": 48
},
{
"id": 50,
"exp": 50
"exp": 49
},
{
"id": 51,
"exp": 51
"exp": 50
},
{
"id": 52,
"exp": 52
"exp": 51
},
{
"id": 53,
"exp": 53
"exp": 52
},
{
"id": 54,
"exp": 54
"exp": 53
},
{
"id": 55,
"exp": 55
"exp": 54
},
{
"id": 56,
"exp": 56
"exp": 55
},
{
"id": 57,
"exp": 57
"exp": 56
},
{
"id": 58,
"exp": 58
"exp": 57
},
{
"id": 59,
"exp": 59
"exp": 58
},
{
"id": 60,
"exp": 60
"exp": 59
},
{
"id": 61,
"exp": 61
"exp": 60
},
{
"id": 62,
"exp": 62
"exp": 61
},
{
"id": 63,
"exp": 63
"exp": 62
},
{
"id": 64,
"exp": 64
"exp": 63
},
{
"id": 65,
"exp": 65
"exp": 64
},
{
"id": 66,
"exp": 66
"exp": 65
},
{
"id": 67,
"exp": 67
"exp": 66
},
{
"id": 68,
"exp": 68
"exp": 67
},
{
"id": 69,
"exp": 69
"exp": 68
},
{
"id": 70,
"exp": 70
"exp": 69
},
{
"id": 71,
"exp": 71
"exp": 70
},
{
"id": 72,
"exp": 72
"exp": 71
},
{
"id": 73,
"exp": 73
"exp": 72
},
{
"id": 74,
"exp": 74
"exp": 73
},
{
"id": 75,
"exp": 75
"exp": 74
},
{
"id": 76,
"exp": 76
"exp": 75
},
{
"id": 77,
"exp": 77
"exp": 76
},
{
"id": 78,
"exp": 78
"exp": 77
},
{
"id": 79,
"exp": 79
"exp": 78
},
{
"id": 80,
"exp": 80
"exp": 79
},
{
"id": 81,
"exp": 81
"exp": 80
},
{
"id": 82,
"exp": 82
"exp": 81
},
{
"id": 83,
"exp": 83
"exp": 82
},
{
"id": 84,
"exp": 84
"exp": 83
},
{
"id": 85,
"exp": 85
"exp": 84
},
{
"id": 86,
"exp": 86
"exp": 85
},
{
"id": 87,
"exp": 87
"exp": 86
},
{
"id": 88,
"exp": 88
"exp": 87
},
{
"id": 89,
"exp": 89
"exp": 88
},
{
"id": 90,
"exp": 90
"exp": 89
},
{
"id": 91,
"exp": 91
"exp": 90
},
{
"id": 92,
"exp": 92
"exp": 91
},
{
"id": 93,
"exp": 93
"exp": 92
},
{
"id": 94,
"exp": 94
"exp": 93
},
{
"id": 95,
"exp": 95
"exp": 94
},
{
"id": 96,
"exp": 96
"exp": 95
},
{
"id": 97,
"exp": 97
"exp": 96
},
{
"id": 98,
"exp": 98
"exp": 97
},
{
"id": 99,
"exp": 99
"exp": 98
},
{
"id": 100,
"exp": 100
"exp": 99
}
]