diff --git a/DataTables/Datas/__tables__.xlsx b/DataTables/Datas/__tables__.xlsx index 60c1dcfc..e696bca0 100644 Binary files a/DataTables/Datas/__tables__.xlsx and b/DataTables/Datas/__tables__.xlsx differ diff --git a/JisolGameCocos/assets/resources/config/data/schema.ts b/JisolGameCocos/assets/resources/config/data/schema.ts index 5c1653aa..7ec0df3d 100644 --- a/JisolGameCocos/assets/resources/config/data/schema.ts +++ b/JisolGameCocos/assets/resources/config/data/schema.ts @@ -343,7 +343,7 @@ export class TbGResource { export namespace TB { -export class TbGRoleCUp { +export class TbGRoleUpLevel { constructor(_json_: any) { if (_json_.grade === undefined) { throw new Error() } @@ -400,7 +400,7 @@ export class Resource { export namespace TB { -export class TbGRoleCStar { +export class TbGRoleUpStar { constructor(_json_: any) { if (_json_.grade === undefined) { throw new Error() } @@ -717,24 +717,24 @@ export class TbGResource{ -export class TbGRoleCUp{ - private _dataMap: Map<number, TB.TbGRoleCUp> - private _dataList: TB.TbGRoleCUp[] +export class TbGRoleUpLevel{ + private _dataMap: Map<number, TB.TbGRoleUpLevel> + private _dataList: TB.TbGRoleUpLevel[] constructor(_json_: any) { - this._dataMap = new Map<number, TB.TbGRoleCUp>() + this._dataMap = new Map<number, TB.TbGRoleUpLevel>() this._dataList = [] for(var _json2_ of _json_) { - let _v: TB.TbGRoleCUp - _v = new TB.TbGRoleCUp(_json2_) + let _v: TB.TbGRoleUpLevel + _v = new TB.TbGRoleUpLevel(_json2_) this._dataList.push(_v) this._dataMap.set(_v.grade, _v) } } - getDataMap(): Map<number, TB.TbGRoleCUp> { return this._dataMap; } - getDataList(): TB.TbGRoleCUp[] { return this._dataList; } + getDataMap(): Map<number, TB.TbGRoleUpLevel> { return this._dataMap; } + getDataList(): TB.TbGRoleUpLevel[] { return this._dataList; } - get(key: number): TB.TbGRoleCUp | undefined { return this._dataMap.get(key); } + get(key: number): TB.TbGRoleUpLevel | undefined { return this._dataMap.get(key); } resolve(tables:Tables) { @@ -749,24 +749,24 @@ export class TbGRoleCUp{ -export class TbGRoleCStar{ - private _dataMap: Map<number, TB.TbGRoleCStar> - private _dataList: TB.TbGRoleCStar[] +export class TbGRoleUpStar{ + private _dataMap: Map<number, TB.TbGRoleUpStar> + private _dataList: TB.TbGRoleUpStar[] constructor(_json_: any) { - this._dataMap = new Map<number, TB.TbGRoleCStar>() + this._dataMap = new Map<number, TB.TbGRoleUpStar>() this._dataList = [] for(var _json2_ of _json_) { - let _v: TB.TbGRoleCStar - _v = new TB.TbGRoleCStar(_json2_) + let _v: TB.TbGRoleUpStar + _v = new TB.TbGRoleUpStar(_json2_) this._dataList.push(_v) this._dataMap.set(_v.grade, _v) } } - getDataMap(): Map<number, TB.TbGRoleCStar> { return this._dataMap; } - getDataList(): TB.TbGRoleCStar[] { return this._dataList; } + getDataMap(): Map<number, TB.TbGRoleUpStar> { return this._dataMap; } + getDataList(): TB.TbGRoleUpStar[] { return this._dataList; } - get(key: number): TB.TbGRoleCStar | undefined { return this._dataMap.get(key); } + get(key: number): TB.TbGRoleUpStar | undefined { return this._dataMap.get(key); } resolve(tables:Tables) { @@ -832,10 +832,10 @@ export class Tables { get TbGOnHookGlobal(): TbGOnHookGlobal { return this._TbGOnHookGlobal;} private _TbGResource: TbGResource get TbGResource(): TbGResource { return this._TbGResource;} - private _TbGRoleCUp: TbGRoleCUp - get TbGRoleCUp(): TbGRoleCUp { return this._TbGRoleCUp;} - private _TbGRoleCStar: TbGRoleCStar - get TbGRoleCStar(): TbGRoleCStar { return this._TbGRoleCStar;} + private _TbGRoleUpLevel: TbGRoleUpLevel + get TbGRoleUpLevel(): TbGRoleUpLevel { return this._TbGRoleUpLevel;} + private _TbGRoleUpStar: TbGRoleUpStar + get TbGRoleUpStar(): TbGRoleUpStar { return this._TbGRoleUpStar;} private _TbSServerInfo: TbSServerInfo get TbSServerInfo(): TbSServerInfo { return this._TbSServerInfo;} @@ -848,8 +848,8 @@ export class Tables { this._TbGMap = new TbGMap(loader('tbgmap')) this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal')) this._TbGResource = new TbGResource(loader('tbgresource')) - this._TbGRoleCUp = new TbGRoleCUp(loader('tbgrolecup')) - this._TbGRoleCStar = new TbGRoleCStar(loader('tbgrolecstar')) + this._TbGRoleUpLevel = new TbGRoleUpLevel(loader('tbgroleuplevel')) + this._TbGRoleUpStar = new TbGRoleUpStar(loader('tbgroleupstar')) this._TbSServerInfo = new TbSServerInfo(loader('tbsserverinfo')) this._TbGGlobal.resolve(this) @@ -860,8 +860,8 @@ export class Tables { this._TbGMap.resolve(this) this._TbGOnHookGlobal.resolve(this) this._TbGResource.resolve(this) - this._TbGRoleCUp.resolve(this) - this._TbGRoleCStar.resolve(this) + this._TbGRoleUpLevel.resolve(this) + this._TbGRoleUpStar.resolve(this) this._TbSServerInfo.resolve(this) } } diff --git a/JisolGameCocos/assets/resources/config/json/tbgrolecup.json b/JisolGameCocos/assets/resources/config/json/tbgroleuplevel.json similarity index 100% rename from JisolGameCocos/assets/resources/config/json/tbgrolecup.json rename to JisolGameCocos/assets/resources/config/json/tbgroleuplevel.json diff --git a/JisolGameCocos/assets/resources/config/json/tbgrolecstar.json.meta b/JisolGameCocos/assets/resources/config/json/tbgroleuplevel.json.meta similarity index 72% rename from JisolGameCocos/assets/resources/config/json/tbgrolecstar.json.meta rename to JisolGameCocos/assets/resources/config/json/tbgroleuplevel.json.meta index ab847f4a..10463c96 100644 --- a/JisolGameCocos/assets/resources/config/json/tbgrolecstar.json.meta +++ b/JisolGameCocos/assets/resources/config/json/tbgroleuplevel.json.meta @@ -2,7 +2,7 @@ "ver": "2.0.1", "importer": "json", "imported": true, - "uuid": "580aaa0b-8b26-4bc6-9abe-6984e9980679", + "uuid": "e973f307-a0ab-478d-85eb-36e1310007a7", "files": [ ".json" ], diff --git a/JisolGameCocos/assets/resources/config/json/tbgrolecstar.json b/JisolGameCocos/assets/resources/config/json/tbgroleupstar.json similarity index 100% rename from JisolGameCocos/assets/resources/config/json/tbgrolecstar.json rename to JisolGameCocos/assets/resources/config/json/tbgroleupstar.json diff --git a/JisolGameCocos/assets/resources/config/json/tbgrolecup.json.meta b/JisolGameCocos/assets/resources/config/json/tbgroleupstar.json.meta similarity index 72% rename from JisolGameCocos/assets/resources/config/json/tbgrolecup.json.meta rename to JisolGameCocos/assets/resources/config/json/tbgroleupstar.json.meta index 714cde23..18c53fde 100644 --- a/JisolGameCocos/assets/resources/config/json/tbgrolecup.json.meta +++ b/JisolGameCocos/assets/resources/config/json/tbgroleupstar.json.meta @@ -2,7 +2,7 @@ "ver": "2.0.1", "importer": "json", "imported": true, - "uuid": "dfe67d28-0f19-440b-ad19-7c1f70b3528b", + "uuid": "02f53704-5e9c-4b95-8ef4-822a6a47882c", "files": [ ".json" ], diff --git a/JisolGameCocos/assets/resources/prefab/ui/宠物/宠物升星页面.prefab b/JisolGameCocos/assets/resources/prefab/ui/宠物/宠物升星页面.prefab index 74659482..c6ea48bc 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/宠物/宠物升星页面.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/宠物/宠物升星页面.prefab @@ -25,17 +25,17 @@ "_active": true, "_components": [ { - "__id__": 136 + "__id__": 150 }, { - "__id__": 138 + "__id__": 152 }, { - "__id__": 140 + "__id__": 154 } ], "_prefab": { - "__id__": 142 + "__id__": 156 }, "_lpos": { "__type__": "cc.Vec3", @@ -79,29 +79,29 @@ "__id__": 3 }, { - "__id__": 49 + "__id__": 63 }, { - "__id__": 93 + "__id__": 107 }, { - "__id__": 110 + "__id__": 124 } ], "_active": true, "_components": [ { - "__id__": 129 + "__id__": 143 }, { - "__id__": 131 + "__id__": 145 }, { - "__id__": 133 + "__id__": 147 } ], "_prefab": { - "__id__": 135 + "__id__": 149 }, "_lpos": { "__type__": "cc.Vec3", @@ -152,22 +152,25 @@ }, { "__id__": 34 + }, + { + "__id__": 48 } ], "_active": true, "_components": [ { - "__id__": 42 + "__id__": 56 }, { - "__id__": 44 + "__id__": 58 }, { - "__id__": 46 + "__id__": 60 } ], "_prefab": { - "__id__": 48 + "__id__": 62 }, "_lpos": { "__type__": "cc.Vec3", @@ -530,7 +533,7 @@ }, { "__type__": "cc.Node", - "_name": "ProgressBar", + "_name": "预览经验条", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -649,7 +652,312 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 150, + "width": 0, + "height": 15 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "04yn5gdT9H6prns8f4vtwT" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 21 + }, + "_enabled": true, + "__prefab": { + "__id__": 25 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 155, + "g": 155, + "b": 155, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "24a704da-2867-446d-8d1a-5e920c75e09d@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": "15K5on3ZtM2I259jz/+Jfk" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "d2XY0P79pJm4Lb7uwM7V48", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 20 + }, + "_enabled": true, + "__prefab": { + "__id__": 28 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 15 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "8emMnBU4BNTKGMmkrl1j68" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 20 + }, + "_enabled": true, + "__prefab": { + "__id__": 30 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "9fd900dd-221b-4f89-8f2c-fba34243c835@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": "37deaMph1MKbayEDbE7t2P" + }, + { + "__type__": "54eabRpC7dM+4sLiGfqzWWw", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 20 + }, + "_enabled": true, + "__prefab": { + "__id__": 32 + }, + "_barSprite": { + "__id__": 24 + }, + "_mode": 0, + "_totalLength": 300, + "_progress": 0, + "_reverse": false, + "scaleTime": 4, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5cKp3l3TpL0r+Ic0Q2WfsL" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "52IYN/Qg9Ee4V7+NOQ2KLP", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "经验条", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 35 + } + ], + "_active": true, + "_components": [ + { + "__id__": 41 + }, + { + "__id__": 43 + }, + { + "__id__": 45 + } + ], + "_prefab": { + "__id__": 47 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 68.52, + "y": -2.96, + "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": "Bar", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 34 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 36 + }, + { + "__id__": 38 + } + ], + "_prefab": { + "__id__": 40 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -150, + "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__": 35 + }, + "_enabled": true, + "__prefab": { + "__id__": 37 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, "height": 15 }, "_anchorPoint": { @@ -669,11 +977,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 21 + "__id__": 35 }, "_enabled": true, "__prefab": { - "__id__": 25 + "__id__": 39 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -727,11 +1035,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 20 + "__id__": 34 }, "_enabled": true, "__prefab": { - "__id__": 28 + "__id__": 42 }, "_contentSize": { "__type__": "cc.Size", @@ -755,11 +1063,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 20 + "__id__": 34 }, - "_enabled": true, + "_enabled": false, "__prefab": { - "__id__": 30 + "__id__": 44 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -795,29 +1103,30 @@ "fileId": "31S5WlPTZLfZ1l6g1cuWzA" }, { - "__type__": "cc.ProgressBar", + "__type__": "54eabRpC7dM+4sLiGfqzWWw", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 20 + "__id__": 34 }, "_enabled": true, "__prefab": { - "__id__": 32 + "__id__": 46 }, "_barSprite": { - "__id__": 24 + "__id__": 38 }, "_mode": 0, "_totalLength": 300, - "_progress": 0.5, + "_progress": 0, "_reverse": false, + "scaleTime": 4, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "bcRbGiZW5D/KadPYIUhJVb" + "fileId": "bdjL6Ut35JS6lQS7QzcUJp" }, { "__type__": "cc.PrefabInfo", @@ -844,17 +1153,17 @@ "_active": true, "_components": [ { - "__id__": 35 + "__id__": 49 }, { - "__id__": 37 + "__id__": 51 }, { - "__id__": 39 + "__id__": 53 } ], "_prefab": { - "__id__": 41 + "__id__": 55 }, "_lpos": { "__type__": "cc.Vec3", @@ -891,11 +1200,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 34 + "__id__": 48 }, "_enabled": true, "__prefab": { - "__id__": 36 + "__id__": 50 }, "_contentSize": { "__type__": "cc.Size", @@ -919,11 +1228,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 34 + "__id__": 48 }, "_enabled": true, "__prefab": { - "__id__": 38 + "__id__": 52 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -964,11 +1273,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 34 + "__id__": 48 }, "_enabled": true, "__prefab": { - "__id__": 40 + "__id__": 54 }, "_color": { "__type__": "cc.Color", @@ -1007,7 +1316,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 43 + "__id__": 57 }, "_contentSize": { "__type__": "cc.Size", @@ -1035,7 +1344,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 45 + "__id__": 59 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1080,7 +1389,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 47 + "__id__": 61 }, "_alignFlags": 41, "_target": null, @@ -1129,29 +1438,29 @@ }, "_children": [ { - "__id__": 50 + "__id__": 64 }, { - "__id__": 68 + "__id__": 82 } ], "_active": true, "_components": [ { - "__id__": 86 + "__id__": 100 }, { - "__id__": 88 + "__id__": 102 }, { - "__id__": 90 + "__id__": 104 }, { - "__id__": 65 + "__id__": 79 } ], "_prefab": { - "__id__": 92 + "__id__": 106 }, "_lpos": { "__type__": "cc.Vec3", @@ -1188,30 +1497,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 49 + "__id__": 63 }, "_children": [ { - "__id__": 51 + "__id__": 65 } ], "_active": true, "_components": [ { - "__id__": 57 + "__id__": 71 }, { - "__id__": 59 + "__id__": 73 }, { - "__id__": 61 + "__id__": 75 }, { - "__id__": 63 + "__id__": 77 } ], "_prefab": { - "__id__": 85 + "__id__": 99 }, "_lpos": { "__type__": "cc.Vec3", @@ -1248,20 +1557,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 50 + "__id__": 64 }, "_children": [], "_active": true, "_components": [ { - "__id__": 52 + "__id__": 66 }, { - "__id__": 54 + "__id__": 68 } ], "_prefab": { - "__id__": 56 + "__id__": 70 }, "_lpos": { "__type__": "cc.Vec3", @@ -1298,11 +1607,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 65 }, "_enabled": true, "__prefab": { - "__id__": 53 + "__id__": 67 }, "_contentSize": { "__type__": "cc.Size", @@ -1326,11 +1635,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 65 }, "_enabled": true, "__prefab": { - "__id__": 55 + "__id__": 69 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1384,11 +1693,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 64 }, "_enabled": true, "__prefab": { - "__id__": 58 + "__id__": 72 }, "_contentSize": { "__type__": "cc.Size", @@ -1412,11 +1721,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 64 }, "_enabled": true, "__prefab": { - "__id__": 60 + "__id__": 74 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1457,11 +1766,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 64 }, "_enabled": true, "__prefab": { - "__id__": 62 + "__id__": 76 }, "_alignFlags": 37, "_target": null, @@ -1493,17 +1802,17 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 50 + "__id__": 64 }, "_enabled": true, "__prefab": { - "__id__": 64 + "__id__": 78 }, "_scrollView": { - "__id__": 65 + "__id__": 79 }, "_handle": { - "__id__": 54 + "__id__": 68 }, "_direction": 1, "_enableAutoHide": false, @@ -1520,11 +1829,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 66 + "__id__": 80 }, "bounceDuration": 0.23, "brake": 0.75, @@ -1535,11 +1844,11 @@ "cancelInnerEvents": true, "scrollEvents": [], "_content": { - "__id__": 67 + "__id__": 81 }, "_horizontalScrollBar": null, "_verticalScrollBar": { - "__id__": 63 + "__id__": 77 }, "itemPrefab": { "__uuid__": "fc8eb7b6-f756-49f4-9102-ac3cca3a20ae", @@ -1557,23 +1866,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 68 + "__id__": 82 }, "_children": [], "_active": true, "_components": [ { - "__id__": 78 + "__id__": 92 }, { - "__id__": 80 + "__id__": 94 }, { - "__id__": 82 + "__id__": 96 } ], "_prefab": { - "__id__": 84 + "__id__": 98 }, "_lpos": { "__type__": "cc.Vec3", @@ -1610,30 +1919,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 49 + "__id__": 63 }, "_children": [ { - "__id__": 67 + "__id__": 81 } ], "_active": true, "_components": [ { - "__id__": 69 + "__id__": 83 }, { - "__id__": 71 + "__id__": 85 }, { - "__id__": 73 + "__id__": 87 }, { - "__id__": 75 + "__id__": 89 } ], "_prefab": { - "__id__": 77 + "__id__": 91 }, "_lpos": { "__type__": "cc.Vec3", @@ -1670,11 +1979,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 68 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 70 + "__id__": 84 }, "_contentSize": { "__type__": "cc.Size", @@ -1698,11 +2007,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 68 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 72 + "__id__": 86 }, "_type": 0, "_inverted": false, @@ -1720,11 +2029,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 68 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 74 + "__id__": 88 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1766,11 +2075,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 68 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 76 + "__id__": 90 }, "_alignFlags": 45, "_target": null, @@ -1815,11 +2124,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 81 }, "_enabled": true, "__prefab": { - "__id__": 79 + "__id__": 93 }, "_contentSize": { "__type__": "cc.Size", @@ -1843,11 +2152,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 81 }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 95 }, "_resizeMode": 1, "_layoutType": 3, @@ -1881,11 +2190,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 81 }, "_enabled": true, "__prefab": { - "__id__": 83 + "__id__": 97 }, "_alignFlags": 40, "_target": null, @@ -1943,11 +2252,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 87 + "__id__": 101 }, "_contentSize": { "__type__": "cc.Size", @@ -1971,11 +2280,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 89 + "__id__": 103 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2016,11 +2325,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 91 + "__id__": 105 }, "_alignFlags": 45, "_target": null, @@ -2069,23 +2378,23 @@ }, "_children": [ { - "__id__": 94 + "__id__": 108 } ], "_active": true, "_components": [ { - "__id__": 102 + "__id__": 116 }, { - "__id__": 104 + "__id__": 118 }, { - "__id__": 106 + "__id__": 120 } ], "_prefab": { - "__id__": 109 + "__id__": 123 }, "_lpos": { "__type__": "cc.Vec3", @@ -2122,23 +2431,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 93 + "__id__": 107 }, "_children": [], "_active": true, "_components": [ { - "__id__": 95 + "__id__": 109 }, { - "__id__": 97 + "__id__": 111 }, { - "__id__": 99 + "__id__": 113 } ], "_prefab": { - "__id__": 101 + "__id__": 115 }, "_lpos": { "__type__": "cc.Vec3", @@ -2175,11 +2484,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 94 + "__id__": 108 }, "_enabled": true, "__prefab": { - "__id__": 96 + "__id__": 110 }, "_contentSize": { "__type__": "cc.Size", @@ -2203,11 +2512,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 94 + "__id__": 108 }, "_enabled": true, "__prefab": { - "__id__": 98 + "__id__": 112 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2248,11 +2557,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 94 + "__id__": 108 }, "_enabled": true, "__prefab": { - "__id__": 100 + "__id__": 114 }, "_color": { "__type__": "cc.Color", @@ -2287,11 +2596,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 103 + "__id__": 117 }, "_contentSize": { "__type__": "cc.Size", @@ -2315,11 +2624,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 105 + "__id__": 119 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2360,15 +2669,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 107 + "__id__": 121 }, "clickEvents": [ { - "__id__": 108 + "__id__": 122 } ], "_interactable": true, @@ -2420,7 +2729,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 93 + "__id__": 107 }, "_id": "" }, @@ -2461,26 +2770,26 @@ }, "_children": [ { - "__id__": 111 + "__id__": 125 } ], "_active": true, "_components": [ { - "__id__": 119 + "__id__": 133 }, { - "__id__": 121 + "__id__": 135 }, { - "__id__": 123 + "__id__": 137 }, { - "__id__": 126 + "__id__": 140 } ], "_prefab": { - "__id__": 128 + "__id__": 142 }, "_lpos": { "__type__": "cc.Vec3", @@ -2517,23 +2826,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 110 + "__id__": 124 }, "_children": [], "_active": true, "_components": [ { - "__id__": 112 + "__id__": 126 }, { - "__id__": 114 + "__id__": 128 }, { - "__id__": 116 + "__id__": 130 } ], "_prefab": { - "__id__": 118 + "__id__": 132 }, "_lpos": { "__type__": "cc.Vec3", @@ -2570,11 +2879,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 111 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 113 + "__id__": 127 }, "_contentSize": { "__type__": "cc.Size", @@ -2598,11 +2907,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 111 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 115 + "__id__": 129 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2643,11 +2952,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 111 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 117 + "__id__": 131 }, "_color": { "__type__": "cc.Color", @@ -2682,11 +2991,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 110 + "__id__": 124 }, "_enabled": true, "__prefab": { - "__id__": 120 + "__id__": 134 }, "_contentSize": { "__type__": "cc.Size", @@ -2710,11 +3019,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 110 + "__id__": 124 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 136 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2755,15 +3064,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 110 + "__id__": 124 }, "_enabled": true, "__prefab": { - "__id__": 124 + "__id__": 138 }, "clickEvents": [ { - "__id__": 125 + "__id__": 139 } ], "_interactable": true, @@ -2815,7 +3124,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 110 + "__id__": 124 }, "_id": "" }, @@ -2839,11 +3148,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 110 + "__id__": 124 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 141 }, "_alignFlags": 32, "_target": null, @@ -2892,7 +3201,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 130 + "__id__": 144 }, "_contentSize": { "__type__": "cc.Size", @@ -2920,7 +3229,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 132 + "__id__": 146 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2965,7 +3274,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 134 + "__id__": 148 }, "_id": "" }, @@ -2996,7 +3305,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 137 + "__id__": 151 }, "_contentSize": { "__type__": "cc.Size", @@ -3024,7 +3333,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 139 + "__id__": 153 }, "_alignFlags": 45, "_target": null, @@ -3060,23 +3369,29 @@ }, "_enabled": true, "__prefab": { - "__id__": 141 + "__id__": 155 }, "mask": true, "maskOpcity": 80, "isClickMaskeClose": true, "views": { - "__id__": 65 + "__id__": 79 }, "petNameLabel": { "__id__": 7 }, "petStar": { - "__id__": 37 + "__id__": 51 }, "petStarExp": { "__id__": 15 }, + "petExpProgress": { + "__id__": 45 + }, + "viewPetExpProgress": { + "__id__": 31 + }, "_id": "" }, { diff --git a/JisolGameCocos/assets/script/consts/API.ts b/JisolGameCocos/assets/script/consts/API.ts index 34eefc6f..d1e21951 100644 --- a/JisolGameCocos/assets/script/consts/API.ts +++ b/JisolGameCocos/assets/script/consts/API.ts @@ -1,4 +1,5 @@ import { app } from "../App"; +import PlayerPetData from "../data/PlayerPetData"; import ResourceData from "../data/ResourceData"; import { GUI } from "../ui/UIConfig"; @@ -9,7 +10,8 @@ export const RData = (data:any,isTips:boolean = true) => { if(data.data['resources']){ //刷新资源 data.data['resources'].forEach(res => { - ResourceData.getIns().onUpdateOV(res.operation,res.resource); + ResourceData.getIns().onUpdateOV(res.operation,res.resource); //刷新资源 + PlayerPetData.getIns().onUpdateOV(res.operation,res.pet); //刷新宠物 }) } return data.data.data; diff --git a/JisolGameCocos/assets/script/data/PlayerPetData.ts b/JisolGameCocos/assets/script/data/PlayerPetData.ts index 0712a805..3eb6b0ec 100644 --- a/JisolGameCocos/assets/script/data/PlayerPetData.ts +++ b/JisolGameCocos/assets/script/data/PlayerPetData.ts @@ -1,6 +1,15 @@ +import { app } from "../App"; import { API, PlayerInfoOV, PlayerPetOV } from "../consts/API"; import BaseData from "./BaseData"; +import PlayerTacticalData from "./PlayerTacticalData"; +import { ResourceUpdateType } from "./ResourceData"; +export enum PlayerPetEvent{ + UPDATE = "PlayerPetEvent_UPDATE", //刷新宠物 + UPDATE_INFO = "PlayerPetEvent_UPDATE_INFO", //刷新宠物信息 + UPDATE_ADD = "PlayerPetEvent_UPDATE_ADD", //添加宠物 + UPDATE_MINUS = "PlayerPetEvent_UPDATE_MINUS", //减少宠物 +} //玩家宠物数据 export default class PlayerPetData extends BaseData{ @@ -20,6 +29,16 @@ export default class PlayerPetData extends BaseData{ return this.datas; } + //获取指定宠物 + getPetIdData(petTbId:number,datas:PlayerPetOV[] = this.datas):PlayerPetOV[]{ + return datas.filter(data => data.petTbId == petTbId); + } + + //获取未上阵的宠物 + getNoTacticalData():PlayerPetOV[]{ + return this.datas.filter(data => PlayerTacticalData.getIns().getTacticalInfo().indexOf(data.petId) < 0); + } + //更新玩家宠物 async UpdatePlayerPet(){ //获取全部宠物 @@ -43,6 +62,54 @@ export default class PlayerPetData extends BaseData{ this.datas.push(pet); } + //刷新返回宠物 + onUpdateOV(operation:number,resource:PlayerPetOV){ + + //如果没有刷新的宠物 则 返回 + if(!resource) return; + + if(operation == ResourceUpdateType.UPDATE){ + //更新资源 + //找到需要被刷新的宠物 然后刷新 找不到则添加 + let pet = this.datas.filter(pet => pet.petId == resource.petId)[0]; + if(pet){ + //更新数据 + Object.assign(pet,resource); + app.event.emit(PlayerPetEvent.UPDATE_INFO) + }else{ + operation = ResourceUpdateType.ADD; + this.onUpdateOV(operation,resource); + } + }else if(operation == ResourceUpdateType.ADD){ + //查询如果没有这个宠物则添加 负责 刷新 + let pet = this.datas.filter(pet => pet.petId != resource.petId)[0]; + if(!pet){ + //没有则添加 + this.datas.push(resource); + app.event.emit(PlayerPetEvent.UPDATE) + app.event.emit(PlayerPetEvent.UPDATE_ADD,pet) + }else{ + operation = ResourceUpdateType.UPDATE; + this.onUpdateOV(operation,resource); + } + }else if(operation == ResourceUpdateType.MINUS){ + + //删除的宠物 + let delPet; + //删除指定的宠物 + this.datas = this.datas.filter(pet => { + if(pet.petId == resource.petId){ + delPet = pet; + return false; + } + return true; + }); + app.event.emit(PlayerPetEvent.UPDATE) + delPet && app.event.emit(PlayerPetEvent.UPDATE_MINUS,delPet) + + } + + } } diff --git a/JisolGameCocos/assets/script/data/ResourceData.ts b/JisolGameCocos/assets/script/data/ResourceData.ts index bc2d6820..6e50cfc4 100644 --- a/JisolGameCocos/assets/script/data/ResourceData.ts +++ b/JisolGameCocos/assets/script/data/ResourceData.ts @@ -11,6 +11,13 @@ export enum ResourceType{ Gold = 90001, //金币 } +//资源刷新类型 +export enum ResourceUpdateType{ + UPDATE = 0, //刷新资源数量 + MINUS = 1, //减少资源数量 + ADD = 2, //添加资源数量 +} + //玩家资源数据 export default class ResourceData extends BaseData{ @@ -43,12 +50,15 @@ export default class ResourceData extends BaseData{ //刷新返回资源 onUpdateOV(operation:number,resource:ResourceOV){ - if(operation == 0){ + //如果没有刷新的资源 则 返回 + if(!resource) return; + + if(operation == ResourceUpdateType.UPDATE){ //更新资源 this.data[resource.resourceTbId] = resource.resourceValue; + app.event.emit(ResourceEvent.UPDATE) } - app.event.emit(ResourceEvent.UPDATE) } diff --git a/JisolGameCocos/assets/script/ui/Pet/PetUpStarView.ts b/JisolGameCocos/assets/script/ui/Pet/PetUpStarView.ts index 5379850a..50cd98bc 100644 --- a/JisolGameCocos/assets/script/ui/Pet/PetUpStarView.ts +++ b/JisolGameCocos/assets/script/ui/Pet/PetUpStarView.ts @@ -1,7 +1,7 @@ import { _decorator, Component, Node } from 'cc'; import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase'; import JNScrollView from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView'; -import PlayerPetData from '../../data/PlayerPetData'; +import PlayerPetData, { PlayerPetEvent } from '../../data/PlayerPetData'; import { API, PlayerPetOV } from '../../consts/API'; import { PetOV, PlayerPetOVSelect } from '../VO/PetOV'; import { PetIconSelectScroll } from '../Consts/Pet/PetIconSelectScroll'; @@ -9,6 +9,8 @@ import { NodeEventType } from 'cc'; import { Label } from 'cc'; import { app, TD } from '../../App'; import { GUI } from '../UIConfig'; +import { ProgressBar } from 'cc'; +import JProgressBar from '../../../../extensions/ngame/assets/ngame/util/components/Progress/JProgressBar'; const { ccclass, property } = _decorator; @ccclass('PetUpStarView') @@ -23,9 +25,10 @@ export class PetUpStarView extends JNLayerBase { petStar:Label; //宠物星级 @property(Label) petStarExp:Label; //宠物星级经验 - - //宠物数据 - pets:PlayerPetOVSelect[] = []; + @property(JProgressBar) + petExpProgress:JProgressBar; //宠物经验条 + @property(JProgressBar) + viewPetExpProgress:JProgressBar; //预览宠物经验条 data:PlayerPetOV; @@ -35,6 +38,16 @@ export class PetUpStarView extends JNLayerBase { this.data = data; this.onUpdateView(); + //监听 + app.event.on(PlayerPetEvent.UPDATE_INFO,this.onUpdateInfo,this); //刷新宠物信息 + app.event.on(PlayerPetEvent.UPDATE_MINUS,this.onPetMinus,this); //减少宠物 + + } + + onJNClose(): void { + //取消监听 + app.event.off(PlayerPetEvent.UPDATE_INFO,this.onUpdateInfo,this); //刷新宠物信息 + app.event.off(PlayerPetEvent.UPDATE_MINUS,this.onPetMinus,this); //减少宠物 } @@ -43,9 +56,14 @@ export class PetUpStarView extends JNLayerBase { this.onUpdateInfo(); - //获取所有玩家宠物 - this.pets = PetOV.PlayerPetOVSelects(PlayerPetData.getIns().getData()); - this.views.refreshData(this.pets); + //当前需要升星的宠物并且未上阵 并且排除自己 + let pets = PetOV.PlayerPetOVSelects( + PlayerPetData.getIns().getPetIdData( + this.data.petTbId, //同一种宠物 + PlayerPetData.getIns().getNoTacticalData() //非上阵宠物 + ).filter(pet => pet.petId != this.data.petId) //排除自己 + ); + this.views.refreshData(pets); //向子节点添加点击事件 this.views.addItemEvent(NodeEventType.TOUCH_START,this.onClickItem.bind(this)); @@ -60,10 +78,21 @@ export class PetUpStarView extends JNLayerBase { //显示宠物名称 this.petNameLabel.string = TD.TbGRole.get(this.data.petTbId).roleName; this.petStar.string = `当前星级: ${this.data.petStar} 星`; - this.petStarExp.string = `升级所需经验 / ${this.data.petStarExp}`; + + let upStarExp = TD.TbGRoleUpStar.get(this.data.petStar + 1).merge; + this.petStarExp.string = `升级进度: ${upStarExp} / ${this.data.petStarExp}`; + this.petExpProgress.value = (this.data.petStarExp / upStarExp); } + //减少宠物 + onPetMinus(pet:PlayerPetOV){ + this.views.getItems<PetIconSelectScroll>().forEach(item => { + if(item.data.petId == pet.petId) + this.views.delData(item.data); + }); + } + //刷新选择 onUpdateSelect(){ @@ -73,31 +102,55 @@ export class PetUpStarView extends JNLayerBase { item.select.isSelect = data.isSelect; }) + this.onUpdatePreview(); + + } + + //更新预览进度条 + onUpdatePreview(){ + + //选择得到的经验 + let exp = this.views.getItems<PetIconSelectScroll>().filter(item => item.select.isSelect).length; + + let upStarExp; + let petStarExp = this.data.petStarExp + exp; + let petStar = this.data.petStar; + + while(petStarExp >= (upStarExp = TD.TbGRoleUpStar.get(petStar + 1).merge)){ + petStar++; + petStarExp = Math.floor(petStarExp - upStarExp); + } + + this.petStar.string = `当前星级: ${petStar} 星`; + this.petStarExp.string = `升级进度: ${upStarExp} / ${petStarExp}`; + //预览进度 + this.viewPetExpProgress.value = (petStarExp / upStarExp); + } //选择全部 onClickAll(){ + let pets = this.views.getData<PlayerPetOVSelect>(); //如果全部选择则全部取消 - if(this.pets.filter(pet => pet.isSelect).length == this.pets.length){ - this.pets.forEach(pet => pet.isSelect = false); + if(pets.filter(pet => pet.isSelect).length == pets.length){ + pets.forEach(pet => pet.isSelect = false); }else{ - this.pets.forEach(pet => pet.isSelect = true); + pets.forEach(pet => pet.isSelect = true); } this.onUpdateSelect(); } //点击Item onClickItem(index:number){ - - this.pets[index].isSelect = !this.pets[index].isSelect; + let pets = this.views.getData<PlayerPetOVSelect>(); + pets[index].isSelect = !pets[index].isSelect; this.onUpdateSelect(); - } //点击合成 async onClickUp(){ //获取被合成的Id - let pets = this.pets.filter(pet => pet.isSelect).map(pet => pet.petId); + let pets = this.views.getData<PlayerPetOVSelect>().filter(pet => pet.isSelect).map(pet => pet.petId); if(pets.length <= 0){ app.layer.Open(GUI.Tips,{text:"请选择需要被合成的宠物"}); diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index 0ac0cc67..8c270e5f 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit 0ac0cc67b0cd8bd70fa3c9ead11fee366a6d7d68 +Subproject commit 8c270e5f8d9df4b531c5c102a43c1a66c85e2e53 diff --git a/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleCUp.java b/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleUpLevel.java similarity index 83% rename from JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleCUp.java rename to JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleUpLevel.java index 82d0d9f7..df1241a9 100644 --- a/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleCUp.java +++ b/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleUpLevel.java @@ -14,14 +14,14 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; -public final class TbGRoleCUp extends AbstractBean { - public TbGRoleCUp(JsonObject _buf) { +public final class TbGRoleUpLevel extends AbstractBean { + public TbGRoleUpLevel(JsonObject _buf) { grade = _buf.get("grade").getAsInt(); { com.google.gson.JsonArray _json0_ = _buf.get("materials").getAsJsonArray(); int __n0 = _json0_.size(); materials = new cfg.TbGEntity.Resource[__n0]; int __index0=0; for(JsonElement __e0 : _json0_) { cfg.TbGEntity.Resource __v0; __v0 = cfg.TbGEntity.Resource.deserialize(__e0.getAsJsonObject()); materials[__index0++] = __v0; } } } - public static TbGRoleCUp deserialize(JsonObject _buf) { - return new cfg.TB.TbGRoleCUp(_buf); + public static TbGRoleUpLevel deserialize(JsonObject _buf) { + return new cfg.TB.TbGRoleUpLevel(_buf); } /** @@ -33,7 +33,7 @@ public final class TbGRoleCUp extends AbstractBean { */ public final cfg.TbGEntity.Resource[] materials; - public static final int __ID__ = 1860940751; + public static final int __ID__ = -877225318; @Override public int getTypeId() { return __ID__; } diff --git a/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleCStar.java b/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleUpStar.java similarity index 79% rename from JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleCStar.java rename to JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleUpStar.java index b3f6ff02..bcbd2ab8 100644 --- a/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleCStar.java +++ b/JisolGameServer/Main/src/main/java/cfg/TB/TbGRoleUpStar.java @@ -14,14 +14,14 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; -public final class TbGRoleCStar extends AbstractBean { - public TbGRoleCStar(JsonObject _buf) { +public final class TbGRoleUpStar extends AbstractBean { + public TbGRoleUpStar(JsonObject _buf) { grade = _buf.get("grade").getAsInt(); merge = _buf.get("merge").getAsInt(); } - public static TbGRoleCStar deserialize(JsonObject _buf) { - return new cfg.TB.TbGRoleCStar(_buf); + public static TbGRoleUpStar deserialize(JsonObject _buf) { + return new cfg.TB.TbGRoleUpStar(_buf); } /** @@ -33,7 +33,7 @@ public final class TbGRoleCStar extends AbstractBean { */ public final int merge; - public static final int __ID__ = 1657613958; + public static final int __ID__ = 387566716; @Override public int getTypeId() { return __ID__; } diff --git a/JisolGameServer/Main/src/main/java/cfg/Tables.java b/JisolGameServer/Main/src/main/java/cfg/Tables.java index bdf6fb68..e5e0bb64 100644 --- a/JisolGameServer/Main/src/main/java/cfg/Tables.java +++ b/JisolGameServer/Main/src/main/java/cfg/Tables.java @@ -35,10 +35,10 @@ public final class Tables public cfg.TbGOnHookGlobal getTbGOnHookGlobal() { return _tbgonhookglobal; } private final cfg.TbGResource _tbgresource; public cfg.TbGResource getTbGResource() { return _tbgresource; } - private final cfg.TbGRoleCUp _tbgrolecup; - public cfg.TbGRoleCUp getTbGRoleCUp() { return _tbgrolecup; } - private final cfg.TbGRoleCStar _tbgrolecstar; - public cfg.TbGRoleCStar getTbGRoleCStar() { return _tbgrolecstar; } + private final cfg.TbGRoleUpLevel _tbgroleuplevel; + public cfg.TbGRoleUpLevel getTbGRoleUpLevel() { return _tbgroleuplevel; } + private final cfg.TbGRoleUpStar _tbgroleupstar; + public cfg.TbGRoleUpStar getTbGRoleUpStar() { return _tbgroleupstar; } private final cfg.TbSServerInfo _tbsserverinfo; public cfg.TbSServerInfo getTbSServerInfo() { return _tbsserverinfo; } @@ -51,8 +51,8 @@ public final class Tables _tbgmap = new cfg.TbGMap(loader.load("tbgmap")); _tbgonhookglobal = new cfg.TbGOnHookGlobal(loader.load("tbgonhookglobal")); _tbgresource = new cfg.TbGResource(loader.load("tbgresource")); - _tbgrolecup = new cfg.TbGRoleCUp(loader.load("tbgrolecup")); - _tbgrolecstar = new cfg.TbGRoleCStar(loader.load("tbgrolecstar")); + _tbgroleuplevel = new cfg.TbGRoleUpLevel(loader.load("tbgroleuplevel")); + _tbgroleupstar = new cfg.TbGRoleUpStar(loader.load("tbgroleupstar")); _tbsserverinfo = new cfg.TbSServerInfo(loader.load("tbsserverinfo")); } } diff --git a/JisolGameServer/Main/src/main/java/cfg/TbGRoleCStar.java b/JisolGameServer/Main/src/main/java/cfg/TbGRoleCStar.java deleted file mode 100644 index b1e89aff..00000000 --- a/JisolGameServer/Main/src/main/java/cfg/TbGRoleCStar.java +++ /dev/null @@ -1,37 +0,0 @@ - -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -package cfg; - -import luban.*; -import com.google.gson.JsonElement; - - -public final class TbGRoleCStar { - private final java.util.HashMap<Integer, cfg.TB.TbGRoleCStar> _dataMap; - private final java.util.ArrayList<cfg.TB.TbGRoleCStar> _dataList; - - public TbGRoleCStar(JsonElement _buf) { - _dataMap = new java.util.HashMap<Integer, cfg.TB.TbGRoleCStar>(); - _dataList = new java.util.ArrayList<cfg.TB.TbGRoleCStar>(); - - for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { - cfg.TB.TbGRoleCStar _v; - _v = cfg.TB.TbGRoleCStar.deserialize(_e_.getAsJsonObject()); - _dataList.add(_v); - _dataMap.put(_v.grade, _v); - } - } - - public java.util.HashMap<Integer, cfg.TB.TbGRoleCStar> getDataMap() { return _dataMap; } - public java.util.ArrayList<cfg.TB.TbGRoleCStar> getDataList() { return _dataList; } - - public cfg.TB.TbGRoleCStar get(int key) { return _dataMap.get(key); } - -} diff --git a/JisolGameServer/Main/src/main/java/cfg/TbGRoleCUp.java b/JisolGameServer/Main/src/main/java/cfg/TbGRoleCUp.java deleted file mode 100644 index 8b29753e..00000000 --- a/JisolGameServer/Main/src/main/java/cfg/TbGRoleCUp.java +++ /dev/null @@ -1,37 +0,0 @@ - -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -package cfg; - -import luban.*; -import com.google.gson.JsonElement; - - -public final class TbGRoleCUp { - private final java.util.HashMap<Integer, cfg.TB.TbGRoleCUp> _dataMap; - private final java.util.ArrayList<cfg.TB.TbGRoleCUp> _dataList; - - public TbGRoleCUp(JsonElement _buf) { - _dataMap = new java.util.HashMap<Integer, cfg.TB.TbGRoleCUp>(); - _dataList = new java.util.ArrayList<cfg.TB.TbGRoleCUp>(); - - for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { - cfg.TB.TbGRoleCUp _v; - _v = cfg.TB.TbGRoleCUp.deserialize(_e_.getAsJsonObject()); - _dataList.add(_v); - _dataMap.put(_v.grade, _v); - } - } - - public java.util.HashMap<Integer, cfg.TB.TbGRoleCUp> getDataMap() { return _dataMap; } - public java.util.ArrayList<cfg.TB.TbGRoleCUp> getDataList() { return _dataList; } - - public cfg.TB.TbGRoleCUp get(int key) { return _dataMap.get(key); } - -} diff --git a/JisolGameServer/Main/src/main/java/cfg/TbGRoleUpLevel.java b/JisolGameServer/Main/src/main/java/cfg/TbGRoleUpLevel.java new file mode 100644 index 00000000..77206ded --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cfg/TbGRoleUpLevel.java @@ -0,0 +1,37 @@ + +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +package cfg; + +import luban.*; +import com.google.gson.JsonElement; + + +public final class TbGRoleUpLevel { + private final java.util.HashMap<Integer, cfg.TB.TbGRoleUpLevel> _dataMap; + private final java.util.ArrayList<cfg.TB.TbGRoleUpLevel> _dataList; + + public TbGRoleUpLevel(JsonElement _buf) { + _dataMap = new java.util.HashMap<Integer, cfg.TB.TbGRoleUpLevel>(); + _dataList = new java.util.ArrayList<cfg.TB.TbGRoleUpLevel>(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + cfg.TB.TbGRoleUpLevel _v; + _v = cfg.TB.TbGRoleUpLevel.deserialize(_e_.getAsJsonObject()); + _dataList.add(_v); + _dataMap.put(_v.grade, _v); + } + } + + public java.util.HashMap<Integer, cfg.TB.TbGRoleUpLevel> getDataMap() { return _dataMap; } + public java.util.ArrayList<cfg.TB.TbGRoleUpLevel> getDataList() { return _dataList; } + + public cfg.TB.TbGRoleUpLevel get(int key) { return _dataMap.get(key); } + +} diff --git a/JisolGameServer/Main/src/main/java/cfg/TbGRoleUpStar.java b/JisolGameServer/Main/src/main/java/cfg/TbGRoleUpStar.java new file mode 100644 index 00000000..15b98789 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cfg/TbGRoleUpStar.java @@ -0,0 +1,37 @@ + +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +package cfg; + +import luban.*; +import com.google.gson.JsonElement; + + +public final class TbGRoleUpStar { + private final java.util.HashMap<Integer, cfg.TB.TbGRoleUpStar> _dataMap; + private final java.util.ArrayList<cfg.TB.TbGRoleUpStar> _dataList; + + public TbGRoleUpStar(JsonElement _buf) { + _dataMap = new java.util.HashMap<Integer, cfg.TB.TbGRoleUpStar>(); + _dataList = new java.util.ArrayList<cfg.TB.TbGRoleUpStar>(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + cfg.TB.TbGRoleUpStar _v; + _v = cfg.TB.TbGRoleUpStar.deserialize(_e_.getAsJsonObject()); + _dataList.add(_v); + _dataMap.put(_v.grade, _v); + } + } + + public java.util.HashMap<Integer, cfg.TB.TbGRoleUpStar> getDataMap() { return _dataMap; } + public java.util.ArrayList<cfg.TB.TbGRoleUpStar> getDataList() { return _dataList; } + + public cfg.TB.TbGRoleUpStar get(int key) { return _dataMap.get(key); } + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java index 6e5b3761..3c4c8e14 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GPlayerPetController.java @@ -1,9 +1,12 @@ package cn.jisol.game.controller.game; import cn.jisol.game.controller.argsresolver.CurrentPlayer; +import cn.jisol.game.data.TD; import cn.jisol.game.entity.game.Player; import cn.jisol.game.entity.game.PlayerPet; import cn.jisol.game.service.PlayerPetService; +import cn.jisol.game.vo.news.NewsResource; +import cn.jisol.game.vo.news.ov.ResourceUpdateOV; import cn.jisol.game.vo.pet.PetUpStarOV; import cn.jisol.ngame.util.NewsContext; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -14,6 +17,8 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -47,11 +52,11 @@ public class GPlayerPetController { @ApiImplicitParams({}) @ApiOperation(value = "提升宠物星") @PostMapping("/up/star") - public NewsContext<PlayerPet> onUpStar(@RequestBody PetUpStarOV info,@CurrentPlayer Player player){ + public NewsResource<PlayerPet> onUpStar(@RequestBody PetUpStarOV info, @CurrentPlayer Player player){ //判断参数 if(info.getPets().size() <= 0 || Objects.isNull(info.getPetId())){ - return NewsContext.onFail("参数错误"); + return NewsResource.onFail("参数错误"); } //查询被合成的宠物列表 @@ -69,7 +74,7 @@ public class GPlayerPetController { ); if(info.getPets().size() != petCount){ - return NewsContext.onFail("合成宠物信息错误"); + return NewsResource.onFail("合成宠物信息错误"); } //查询被升级的宠物 @@ -77,19 +82,37 @@ public class GPlayerPetController { //判断宠物是否是自己的 if(!Objects.equals(pet.getPetPlayerId(), player.getPlayerId())){ - return NewsContext.onFail("宠物不是自己的"); + return NewsResource.onFail("宠物不是自己的"); } //升级星 pet.setPetStarExp(pet.getPetStarExp() + info.getPets().size()); + //判断是否可以升下一星 如果可以则 升 + int upStarExp; + while (pet.getPetStarExp() >= (upStarExp = TD.DATA.getTbGRoleUpStar().get(pet.getPetStar() + 1).merge)){ + //消耗经验 + pet.setPetStarExp(pet.getPetStarExp() - upStarExp); + //升星 + pet.setPetStar(pet.getPetStar() + 1); + } + //保存宠物信息 playerPetService.updateById(pet); //删除被合成的宠物 playerPetService.removeByIds(info.getPets()); - return NewsContext.onSuccess("升星成功",pet); + //整理刷新数据 + ArrayList<ResourceUpdateOV> resources = new ArrayList<>(); + //刷新宠物 + resources.add(ResourceUpdateOV.onPet(ResourceUpdateOV.ResourceUpdateType.UPDATE,pet)); + //删除被合成的宠物 + info.getPets().forEach(item -> { + resources.add(ResourceUpdateOV.onPet(ResourceUpdateOV.ResourceUpdateType.MINUS,PlayerPet.builder().petId(new Long(item)).build())); + }); + + return NewsResource.onSuccess("升星成功",null, resources.toArray(new ResourceUpdateOV[0])); } diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/ov/ResourceUpdateOV.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/ov/ResourceUpdateOV.java index e4543aca..e60f0c0c 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/ov/ResourceUpdateOV.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/ov/ResourceUpdateOV.java @@ -1,5 +1,6 @@ package cn.jisol.game.vo.news.ov; +import cn.jisol.game.entity.game.PlayerPet; import cn.jisol.game.entity.game.Resource; import lombok.Builder; import lombok.Data; @@ -9,7 +10,8 @@ import lombok.Data; @Data public class ResourceUpdateOV { - Resource resource; + Resource resource; //资源 + PlayerPet pet; //宠物 //操作 int operation = 0; @@ -26,4 +28,9 @@ public class ResourceUpdateOV { return ResourceUpdateOV.builder().operation(ResourceUpdateType.UPDATE).resource(resource).build(); } + //返回宠物 + public static ResourceUpdateOV onPet(int type,PlayerPet pet){ + return ResourceUpdateOV.builder().operation(type).pet(pet).build(); + } + } diff --git a/JisolGameServer/Main/src/main/resources/json/tbgrolecup.json b/JisolGameServer/Main/src/main/resources/json/tbgroleuplevel.json similarity index 100% rename from JisolGameServer/Main/src/main/resources/json/tbgrolecup.json rename to JisolGameServer/Main/src/main/resources/json/tbgroleuplevel.json diff --git a/JisolGameServer/Main/src/main/resources/json/tbgrolecstar.json b/JisolGameServer/Main/src/main/resources/json/tbgroleupstar.json similarity index 100% rename from JisolGameServer/Main/src/main/resources/json/tbgrolecstar.json rename to JisolGameServer/Main/src/main/resources/json/tbgroleupstar.json