锻造升级

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-10 01:36:20 +08:00
parent 6fbb142edc
commit 0d745b9715
22 changed files with 5392 additions and 1230 deletions

View File

@@ -4,14 +4,16 @@
"roleName": "小石头",
"spine": 130001,
"roleSkillIds": [],
"roleAttackRange": 100
"roleAttackRange": 100,
"roleHight": 140
},
{
"id": 10002,
"roleName": "坚强小石",
"spine": 130002,
"roleSkillIds": [],
"roleAttackRange": 100
"roleAttackRange": 100,
"roleHight": 140
},
{
"id": 10003,
@@ -20,7 +22,8 @@
"roleSkillIds": [
40001
],
"roleAttackRange": 500
"roleAttackRange": 500,
"roleHight": 140
},
{
"id": 10004,
@@ -29,21 +32,24 @@
"roleSkillIds": [
40002
],
"roleAttackRange": 350
"roleAttackRange": 350,
"roleHight": 140
},
{
"id": 10005,
"roleName": "雷吉艾斯",
"spine": 130005,
"roleSkillIds": [],
"roleAttackRange": 350
"roleAttackRange": 350,
"roleHight": 140
},
{
"id": 10006,
"roleName": "星球杯",
"spine": 130006,
"roleSkillIds": [],
"roleAttackRange": 500
"roleAttackRange": 500,
"roleHight": 140
},
{
"id": 10007,
@@ -52,6 +58,7 @@
"roleSkillIds": [
40003
],
"roleAttackRange": 100
"roleAttackRange": 100,
"roleHight": 140
}
]

View File

@@ -28,23 +28,23 @@
"__id__": 109
},
{
"__id__": 126
"__id__": 152
}
],
"_active": true,
"_components": [
{
"__id__": 143
"__id__": 169
},
{
"__id__": 145
"__id__": 171
},
{
"__id__": 147
"__id__": 173
}
],
"_prefab": {
"__id__": 149
"__id__": 175
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1689,22 +1689,28 @@
"_children": [
{
"__id__": 110
},
{
"__id__": 118
},
{
"__id__": 126
}
],
"_active": true,
"_components": [
{
"__id__": 118
"__id__": 144
},
{
"__id__": 120
"__id__": 146
},
{
"__id__": 122
"__id__": 148
}
],
"_prefab": {
"__id__": 125
"__id__": 151
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1762,7 +1768,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"y": 12.701,
"z": 0
},
"_lrot": {
@@ -1803,7 +1809,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 76,
"height": 159.2
"height": 58.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1844,7 +1850,7 @@
"_actualFontSize": 34,
"_fontSize": 34,
"_fontFamily": "Arial",
"_lineHeight": 120,
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": false,
"_font": null,
@@ -1900,6 +1906,568 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Label-001",
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 109
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 119
},
{
"__id__": 121
},
{
"__id__": 123
}
],
"_prefab": {
"__id__": 125
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -25.402,
"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__": 118
},
"_enabled": true,
"__prefab": {
"__id__": 120
},
"_contentSize": {
"__type__": "cc.Size",
"width": 126.216796875,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d2J5fsfE1Cq5D3n3dxiNZF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 118
},
"_enabled": true,
"__prefab": {
"__id__": 122
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "(锻造等级: 1 )",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": false,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8ce7qpW/lOcbG+f/uVGBGS"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 118
},
"_enabled": true,
"__prefab": {
"__id__": 124
},
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_width": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55vlps5RBCC6k8s3PF7w9w"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7cAKB5f9RI2IEFbj3a+6qM",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Button",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 109
},
"_children": [
{
"__id__": 127
}
],
"_active": true,
"_components": [
{
"__id__": 135
},
{
"__id__": 137
},
{
"__id__": 139
},
{
"__id__": 141
}
],
"_prefab": {
"__id__": 143
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -124.631,
"y": 23.566,
"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": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 126
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 128
},
{
"__id__": 130
},
{
"__id__": 132
}
],
"_prefab": {
"__id__": 134
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -5.028,
"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__": 127
},
"_enabled": true,
"__prefab": {
"__id__": 129
},
"_contentSize": {
"__type__": "cc.Size",
"width": 30.86328125,
"height": 61.96
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "bahCSRZaZM8pq0s2KP+lGl"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 127
},
"_enabled": true,
"__prefab": {
"__id__": 131
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_string": "^",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 46,
"_fontSize": 46,
"_fontFamily": "Arial",
"_lineHeight": 46,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7413dQ3ZtBorXpid+edDe4"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 127
},
"_enabled": true,
"__prefab": {
"__id__": 133
},
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_width": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d0TCHBBmxJr7sQpfzYqRVO"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f7l1O1NSJIyqaTx4ZhrX+I",
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
},
"_enabled": true,
"__prefab": {
"__id__": 136
},
"_contentSize": {
"__type__": "cc.Size",
"width": 50,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "25vBklfIVIvL0rfhhe2LI/"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
},
"_enabled": true,
"__prefab": {
"__id__": 138
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 105,
"g": 105,
"b": 105,
"a": 255
},
"_spriteFrame": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_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": "2dahwdyopDRooLQM7/D6LL"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
},
"_enabled": true,
"__prefab": {
"__id__": 140
},
"clickEvents": [],
"_interactable": true,
"_transition": 3,
"_normalColor": {
"__type__": "cc.Color",
"r": 214,
"g": 214,
"b": 214,
"a": 255
},
"_hoverColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_pressedColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_normalSprite": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_hoverSprite": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_pressedSprite": {
"__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_disabledSprite": {
"__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": {
"__id__": 126
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b7lvydUiJKCLmbPfX3P0H1"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
},
"_enabled": true,
"__prefab": {
"__id__": 142
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e0UISHT75LJK4Jlo/8Hcnb"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "598oGp5hlF0ZM0pl8FabVd",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -1910,7 +2478,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 119
"__id__": 145
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1938,7 +2506,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 121
"__id__": 147
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1983,11 +2551,11 @@
},
"_enabled": true,
"__prefab": {
"__id__": 123
"__id__": 149
},
"clickEvents": [
{
"__id__": 124
"__id__": 150
}
],
"_interactable": true,
@@ -2066,8 +2634,6 @@
"__id__": 0
},
"fileId": "51PZvcuWZIko9Ta8D+mTRP",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
@@ -2080,23 +2646,23 @@
},
"_children": [
{
"__id__": 127
"__id__": 153
}
],
"_active": true,
"_components": [
{
"__id__": 135
"__id__": 161
},
{
"__id__": 137
"__id__": 163
},
{
"__id__": 139
"__id__": 165
}
],
"_prefab": {
"__id__": 142
"__id__": 168
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2133,23 +2699,23 @@
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 126
"__id__": 152
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 128
"__id__": 154
},
{
"__id__": 130
"__id__": 156
},
{
"__id__": 132
"__id__": 158
}
],
"_prefab": {
"__id__": 134
"__id__": 160
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2186,11 +2752,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 127
"__id__": 153
},
"_enabled": true,
"__prefab": {
"__id__": 129
"__id__": 155
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2214,11 +2780,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 127
"__id__": 153
},
"_enabled": true,
"__prefab": {
"__id__": 131
"__id__": 157
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2259,11 +2825,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 127
"__id__": 153
},
"_enabled": true,
"__prefab": {
"__id__": 133
"__id__": 159
},
"_color": {
"__type__": "cc.Color",
@@ -2298,11 +2864,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
"__id__": 152
},
"_enabled": true,
"__prefab": {
"__id__": 136
"__id__": 162
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2326,11 +2892,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
"__id__": 152
},
"_enabled": true,
"__prefab": {
"__id__": 138
"__id__": 164
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2371,15 +2937,15 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 126
"__id__": 152
},
"_enabled": true,
"__prefab": {
"__id__": 140
"__id__": 166
},
"clickEvents": [
{
"__id__": 141
"__id__": 167
}
],
"_interactable": true,
@@ -2431,7 +2997,7 @@
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": {
"__id__": 126
"__id__": 152
},
"_id": ""
},
@@ -2470,7 +3036,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 144
"__id__": 170
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2498,7 +3064,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 146
"__id__": 172
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2543,7 +3109,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 148
"__id__": 174
},
"petView": null,
"equips": {
@@ -2567,7 +3133,7 @@
"instance": null,
"targetOverrides": [
{
"__id__": 150
"__id__": 176
}
],
"nestedPrefabInstanceRoots": [
@@ -2609,7 +3175,7 @@
{
"__type__": "cc.TargetOverrideInfo",
"source": {
"__id__": 147
"__id__": 173
},
"sourceInfo": null,
"propertyPath": [
@@ -2619,7 +3185,7 @@
"__id__": 89
},
"targetInfo": {
"__id__": 151
"__id__": 177
}
},
{

View File

@@ -30,12 +30,12 @@ import { Component } from "cc";
// 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.1.23:8080`
let WsPath = `ws://192.168.1.23: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`
// let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket`
//重写UI
class JNGLayer extends JNLayer{

View File

@@ -106,12 +106,7 @@ export default class GRoleDefault extends GRoleBase<{}>{
//设置血条位置
if(this.spine){
let runtimeData = this.spine.skeletonData.getRuntimeData();
let height = Math.abs(runtimeData.height);
let y = Math.abs(runtimeData.y);
let x = Math.abs(this.spine.node.scale.x);
let headY = (height + y + 20) * x;
this.headInfo.setPosition(v3(this.headInfo.position.x,headY,this.headInfo.position.z))
this.headInfo.setPosition(v3(this.headInfo.position.x,role.roleHight,this.headInfo.position.z))
}
}

View File

@@ -59,6 +59,8 @@ export class TbGRole {
{ this.roleSkillIds = []; for(let _ele of _json_.roleSkillIds) { let _e; _e = _ele; this.roleSkillIds.push(_e);}}
if (_json_.roleAttackRange === undefined) { throw new Error() }
this.roleAttackRange = _json_.roleAttackRange
if (_json_.roleHight === undefined) { throw new Error() }
this.roleHight = _json_.roleHight
}
/**
@@ -81,6 +83,10 @@ export class TbGRole {
* 角色攻击范围
*/
readonly roleAttackRange: number
/**
* 角色高度
*/
readonly roleHight: number
resolve(tables:Tables)
{
@@ -844,6 +850,10 @@ export class TbGRoleEquipQuality {
{ this.odds = []; for(let _ele of _json_.odds) { let _e; _e = _ele; this.odds.push(_e);}}
if (_json_.total === undefined) { throw new Error() }
this.total = _json_.total
if (_json_.materials === undefined) { throw new Error() }
{ this.materials = []; for(let _ele of _json_.materials) { let _e; _e = new TbGEntity.TResource(_ele); this.materials.push(_e);}}
if (_json_.upTime === undefined) { throw new Error() }
this.upTime = _json_.upTime
}
/**
@@ -858,6 +868,14 @@ export class TbGRoleEquipQuality {
* 总概率
*/
readonly total: number
/**
* 升级消耗的材料
*/
readonly materials: TbGEntity.TResource[]
/**
* 升级所需时间(s)
*/
readonly upTime: number
resolve(tables:Tables)
{

View File

@@ -2,9 +2,18 @@
export default class NumberTools {
//随机
public GetRank(min, max) {
public static GetRank(min, max) {
return Math.round(Math.random() * (max - min)) + min;
}
//显示文本数字
public static NumberStr(value:number){
if(Math.floor(value / 1000000))
return `${(value / 1000000).toFixed(1)}M`
if(Math.floor(value / 1000))
return `${(value / 1000).toFixed(1)}K`
return value;
}
}

View File

@@ -3,6 +3,7 @@ import { _decorator, Component, Node } from 'cc';
import ResourceData, { ResourceEvent, ResourceType } from '../../../data/ResourceData';
import { Enum } from 'cc';
import { app } from '../../../App';
import NumberTools from '../../../tools/NumberTools';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceShow')
@@ -34,7 +35,7 @@ export class PlayerResourceShow extends Component {
onUpdateView(){
//更新资源数量
this.show.string = `${ResourceData.getIns().getValue(this.type)}`;
this.show.string = `${NumberTools.NumberStr(ResourceData.getIns().getValue(this.type))}`;
}

View File

@@ -60,7 +60,7 @@ export class MainView extends JNGLayerBase {
//更新UI界面
onUpdateView(){
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerId}`;
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerName}`;
this.onUpdateOnHookInfo();
this.onUpdateOnHook();
}