From 98b7a52b45a0127bfb7a0a6defcbb00a838fcf8f Mon Sep 17 00:00:00 2001 From: "DESKTOP-5RP3AKU\\Jisol" <2858626794@qq.com> Date: Mon, 20 Nov 2023 03:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=B7=E6=96=B0=20?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=20=E5=87=BA=E5=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataTables/Datas/__tables__.xlsx | Bin 9757 -> 9828 bytes DataTables/Datas/常用/资源表.xlsx | Bin 0 -> 9751 bytes .../assets/resources/UICanvas.prefab | 2 +- .../assets/resources/WorldCanvas.prefab | 2 +- .../assets/resources/config/data/schema.ts | 69 ++ .../resources/config/json/tbgresource.json | 7 + .../config/json/tbgresource.json.meta | 11 + .../resources/prefab/ui/主页/MainView.prefab | 617 +++++++++++------- .../prefab/ui/主页/野怪/野怪列表.prefab | 40 +- .../resources/prefab/ui/常用预制体/资源.meta | 9 + .../ui/常用预制体/资源/玩家资源显示.prefab | 341 ++++++++++ .../常用预制体/资源/玩家资源显示.prefab.meta | 13 + JisolGameCocos/assets/script/App.ts | 8 +- JisolGameCocos/assets/script/AppData.ts | 2 + .../assets/script/battle/modes/GOnHookMode.ts | 30 +- JisolGameCocos/assets/script/consts/API.ts | 19 + JisolGameCocos/assets/script/consts/GAPI.ts | 2 + .../assets/script/data/ResourceData.ts | 57 ++ .../assets/script/data/ResourceData.ts.meta | 9 + .../manager/battle/mode/GOnHookManager.ts | 21 +- .../assets/script/ui/Consts/Resource.meta | 9 + .../ui/Consts/Resource/PlayerResourceShow.ts | 43 ++ .../Resource/PlayerResourceShow.ts.meta | 9 + .../script/ui/Home/Sreeps/MainSreepsList.ts | 18 + JisolGameCocos/extensions/ngame | 2 +- JisolGameServer/JNGame | 2 +- .../src/main/java/cfg/TB/TbGResource.java | 55 ++ .../Main/src/main/java/cfg/Tables.java | 3 + .../Main/src/main/java/cfg/TbGResource.java | 37 ++ .../controller/game/GNoviceController.java | 6 +- .../controller/game/GResourceController.java | 50 ++ .../game/mode/GOnHookController.java | 33 +- .../data/{GlobalIds.java => GlobalId.java} | 3 +- .../java/cn/jisol/game/data/ResourceId.java | 14 + .../cn/jisol/game/entity/game/Resource.java | 23 + .../cn/jisol/game/mapper/ResourceMapper.java | 11 + .../jisol/game/service/ResourceService.java | 17 + .../service/impl/ResourceServiceImpl.java | 63 ++ .../cn/jisol/game/vo/news/NewsResource.java | 53 ++ .../game/vo/news/ov/ResourceUpdateOV.java | 29 + .../src/main/resources/json/tbgresource.json | 7 + 41 files changed, 1483 insertions(+), 263 deletions(-) create mode 100644 DataTables/Datas/常用/资源表.xlsx create mode 100644 JisolGameCocos/assets/resources/config/json/tbgresource.json create mode 100644 JisolGameCocos/assets/resources/config/json/tbgresource.json.meta create mode 100644 JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源.meta create mode 100644 JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab create mode 100644 JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab.meta create mode 100644 JisolGameCocos/assets/script/data/ResourceData.ts create mode 100644 JisolGameCocos/assets/script/data/ResourceData.ts.meta create mode 100644 JisolGameCocos/assets/script/ui/Consts/Resource.meta create mode 100644 JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts create mode 100644 JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts.meta create mode 100644 JisolGameServer/Main/src/main/java/cfg/TB/TbGResource.java create mode 100644 JisolGameServer/Main/src/main/java/cfg/TbGResource.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GResourceController.java rename JisolGameServer/Main/src/main/java/cn/jisol/game/data/{GlobalIds.java => GlobalId.java} (85%) create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/data/ResourceId.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/entity/game/Resource.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/mapper/ResourceMapper.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/service/ResourceService.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/NewsResource.java create mode 100644 JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/ov/ResourceUpdateOV.java create mode 100644 JisolGameServer/Main/src/main/resources/json/tbgresource.json diff --git a/DataTables/Datas/__tables__.xlsx b/DataTables/Datas/__tables__.xlsx index 760bad25c5e5775f62ca28c908e01d823aa9a93a..2201d5e8d02a894d810ea3e974965ee50fe25e66 100644 GIT binary patch delta 2155 zcmV-x2$c7oOyo?klmP_0^Xq1lm;o*UX0yiuEddf~Mo-zvh|zuG4v==|8ev4Ppg*k=jKeQ@SsA~to^eP^)d{b?0-y4(gdug z6-17Vmqfr%ehQnKQ*uyAWf8`c$yHdAyz+I0CI6lp?0C#GnzHPrq?OP`I4y_(|IInC zo37g1;k)V`IBDTtJ3j-9sgCsZqS?q_nP;3e>?neam7%sazRN|pK=)Z@qe6~mm4rXP z)E}U54L7&Xi(GtFx7!(_!hh6h+cs$HCdjIbi$Q~;>yV1%r4g)5i6H)Fr3ifC;bwKn zp^Fl|$LVqHe~Om7DDokoB!A_!Z3f>xLH19ypqZctSS!9KSp6$Kii8%$+P{SXxhVFG zJ5n)9#R>WA5julg^xEm{GSg{=|=2&q*R$O7l!&q^R6^~=Z4OaXzRxGgM^H>p? zriOs2X9er`2UzuLL&8FF>yTJ15{JZskvb$6jXQ_L!m)KoEPo#N4v7Wi!6C7TJUS#c zlCdOy2MO#7KY*lHzl$UtOJa-KokL<#+d3o`wR?xeqW0jBSkyi{B!(JVymHIeJ4(Ea z=G~5R3&VXgVvA;if)>YA2lr|hvRi}_ExNm5aQY5c*o0kfVYqiYwI)qa&?1uRpxZ4< zv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u59Z*Vt%Qd3RRdrl7AuL#R@t} z8G&~i@hY=+E6O-SgtrG#S!^q+vMn8E_iKheN|mg6G0SxH}O9-OM+k61q3A0mWYY?VoVU9o28wW z4YRwYGfPUsLshWlLrM@RA{aCnDj!7@6}!Nnac6h?=xtq^Co?L)iwo-_BHdv|6U z>dh!HFb2|pNY>P_&=zbJ0zi#vaam1~5*K)6)o;rolI+biYLZ2MFFa(D3+3lr)oO(k#B0^ zd1R_Y7G7T`b5mqt*D8G=8%44>M^j|Kc!MW9BBhlsi;-{&O^-BNrBIj{43j-YOPPZ_WzvB;j|9S`KSJ#$!r&P>;{#>!wCY^%~C$~dpO4QWlPBf4A?Y%wo zI7{of!)iG%Zd8}b&hsU*khhOMl9OdxW(174-J)OZmkfJ$&)%KAU^I{F8t!4d7RGZ! z-VmEf_JkhT2}MdxKpA1y$GJ<_AAP2X|FYNwngEpVj)4uf{v>{9U(n7;{w>`J_Ev>| zj@PWrThm##%J)@Qja8?-Mdbs{5ckkSq(ji0#63|KvIEV6APbP5NXQu$@-_#D`um|a zBtZ|*7p#l1Gjo`wHiH?6Jg52YP5SYa8|oj>ym!Rlxr!fR|E&j<9_Pal0kBYZ_9LlQmltQ31bKbfafy0Y_l%KSMhuX_R*%bvEZwF zr$OUSM`T#%tun8^u&;@ktn>2JSH7c;{A2HNa3|mc)FjFJ7xM1RSEZ|t$`kdGrj0b( zy^R<(UH57gU8Wn*yQlF6@BZJANdLYge*sWS0|XQR000O8hfd-^A-<)2PHZI(UU?YHUjtvlX@jT0eh3WC0+_1``FF# T0{{TP4U-}!JO%(F00000?bzFk diff --git a/DataTables/Datas/常用/资源表.xlsx b/DataTables/Datas/常用/资源表.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..c80fd5fbf327df576bb52f4192a5660a73599ea6 GIT binary patch literal 9751 zcma)i1y~$evo`J?B)9~3cPChI4eo9O!yo~IdvFWxu7MCFxVtA1+#xu@f^&z>-OVoF z-tYg<^URrkdg?vZ{Z^mqnyON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ZYTX$3uNrML$nRKXld7oev@%jIL}miO;<)-B~(sjjd~A zY(DKcHRZmAQ%fq;Y{1J5Sl>0j*hYk_|+-9EaUU*oYqWRUo` z1Nx`Zr!MFb^GoUBUzk6(%zsn%xF>&&M`e%WZ+$EO)c3S= + private _dataList: TB.TbGResource[] + constructor(_json_: any) { + this._dataMap = new Map() + this._dataList = [] + for(var _json2_ of _json_) { + let _v: TB.TbGResource + _v = new TB.TbGResource(_json2_) + this._dataList.push(_v) + this._dataMap.set(_v.id, _v) + } + } + + getDataMap(): Map { return this._dataMap; } + getDataList(): TB.TbGResource[] { return this._dataList; } + + get(key: number): TB.TbGResource | undefined { return this._dataMap.get(key); } + + resolve(tables:Tables) + { + for(let data of this._dataList) + { + data.resolve(tables) + } + } + +} + + + + type JsonLoader = (file: string) => any export class Tables { @@ -552,6 +617,8 @@ export class Tables { get TbGMap(): TbGMap { return this._TbGMap;} private _TbGOnHookGlobal: TbGOnHookGlobal get TbGOnHookGlobal(): TbGOnHookGlobal { return this._TbGOnHookGlobal;} + private _TbGResource: TbGResource + get TbGResource(): TbGResource { return this._TbGResource;} constructor(loader: JsonLoader) { this._TbGGlobal = new TbGGlobal(loader('tbgglobal')) @@ -561,6 +628,7 @@ export class Tables { this._TbGRoleSkill = new TbGRoleSkill(loader('tbgroleskill')) this._TbGMap = new TbGMap(loader('tbgmap')) this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal')) + this._TbGResource = new TbGResource(loader('tbgresource')) this._TbGGlobal.resolve(this) this._TbGRole.resolve(this) @@ -569,5 +637,6 @@ export class Tables { this._TbGRoleSkill.resolve(this) this._TbGMap.resolve(this) this._TbGOnHookGlobal.resolve(this) + this._TbGResource.resolve(this) } } diff --git a/JisolGameCocos/assets/resources/config/json/tbgresource.json b/JisolGameCocos/assets/resources/config/json/tbgresource.json new file mode 100644 index 00000000..bf0af7cd --- /dev/null +++ b/JisolGameCocos/assets/resources/config/json/tbgresource.json @@ -0,0 +1,7 @@ +[ + { + "id": 90001, + "name": "金币", + "tig": "金币 (目前叫做金币 名称还没有定) 游戏的基础资源 用于升级宠物" + } +] \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/config/json/tbgresource.json.meta b/JisolGameCocos/assets/resources/config/json/tbgresource.json.meta new file mode 100644 index 00000000..6bfdc586 --- /dev/null +++ b/JisolGameCocos/assets/resources/config/json/tbgresource.json.meta @@ -0,0 +1,11 @@ +{ + "ver": "2.0.1", + "importer": "json", + "imported": true, + "uuid": "97d4ae8c-12df-45cd-8629-87e18f6e8ddf", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab index 08569066..98931b71 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab @@ -25,32 +25,32 @@ "__id__": 10 }, { - "__id__": 47 + "__id__": 59 }, { - "__id__": 131 + "__id__": 143 }, { - "__id__": 150 + "__id__": 162 }, { - "__id__": 165 + "__id__": 177 } ], "_active": true, "_components": [ { - "__id__": 180 + "__id__": 192 }, { - "__id__": 182 + "__id__": 194 }, { - "__id__": 184 + "__id__": 196 } ], "_prefab": { - "__id__": 186 + "__id__": 198 }, "_lpos": { "__type__": "cc.Vec3", @@ -270,19 +270,22 @@ }, { "__id__": 26 + }, + { + "__id__": 42 } ], "_active": true, "_components": [ { - "__id__": 42 + "__id__": 54 }, { - "__id__": 44 + "__id__": 56 } ], "_prefab": { - "__id__": 46 + "__id__": 58 }, "_lpos": { "__type__": "cc.Vec3", @@ -870,6 +873,179 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_prefab": { + "__id__": 43 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 42 + }, + "asset": { + "__uuid__": "f9a7b5b8-0c1a-4b0c-a6c7-bbf2e077442a", + "__expectedType__": "cc.Prefab" + }, + "fileId": "7ehoARooRAIIfX4ttdeppc", + "instance": { + "__id__": 44 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "a7ViMHX7hGBJBmNxJ40Qav", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [ + { + "__id__": 45 + } + ], + "propertyOverrides": [ + { + "__id__": 49 + }, + { + "__id__": 51 + }, + { + "__id__": 52 + }, + { + "__id__": 53 + } + ], + "removedComponents": [] + }, + { + "__type__": "cc.MountedComponentsInfo", + "targetInfo": { + "__id__": 46 + }, + "components": [ + { + "__id__": 47 + } + ] + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "7ehoARooRAIIfX4ttdeppc" + ] + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": { + "mountedRoot": { + "__id__": 42 + } + }, + "node": { + "__id__": 42 + }, + "_enabled": true, + "__prefab": { + "__id__": 48 + }, + "_alignFlags": 1, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 29.331999999999994, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "cbOG5wQ59PyYh4dBFBGh6g" + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 50 + }, + "propertyPath": [ + "_name" + ], + "value": "玩家资源显示" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "7ehoARooRAIIfX4ttdeppc" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 50 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": -46.486, + "y": 520.668, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 50 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 50 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, { "__type__": "cc.UITransform", "_name": "", @@ -880,7 +1056,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 43 + "__id__": 55 }, "_contentSize": { "__type__": "cc.Size", @@ -908,7 +1084,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 45 + "__id__": 57 }, "_alignFlags": 45, "_target": null, @@ -957,29 +1133,29 @@ }, "_children": [ { - "__id__": 48 + "__id__": 60 }, { - "__id__": 72 + "__id__": 84 }, { - "__id__": 86 + "__id__": 98 } ], "_active": true, "_components": [ { - "__id__": 124 + "__id__": 136 }, { - "__id__": 126 + "__id__": 138 }, { - "__id__": 128 + "__id__": 140 } ], "_prefab": { - "__id__": 130 + "__id__": 142 }, "_lpos": { "__type__": "cc.Vec3", @@ -1014,17 +1190,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 47 + "__id__": 59 }, "_prefab": { - "__id__": 49 + "__id__": 61 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 48 + "__id__": 60 }, "asset": { "__uuid__": "a9053170-1055-4272-b3fd-ad6fa75b5f25", @@ -1032,7 +1208,7 @@ }, "fileId": "cfqtEvOKpHO7NzoHh8DAIM", "instance": { - "__id__": 50 + "__id__": 62 }, "targetOverrides": null }, @@ -1046,35 +1222,17 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 51 + "__id__": 63 }, { - "__id__": 53 - }, - { - "__id__": 54 - }, - { - "__id__": 55 - }, - { - "__id__": 56 - }, - { - "__id__": 58 - }, - { - "__id__": 60 - }, - { - "__id__": 62 - }, - { - "__id__": 64 + "__id__": 65 }, { "__id__": 66 }, + { + "__id__": 67 + }, { "__id__": 68 }, @@ -1082,7 +1240,25 @@ "__id__": 70 }, { - "__id__": 71 + "__id__": 72 + }, + { + "__id__": 74 + }, + { + "__id__": 76 + }, + { + "__id__": 78 + }, + { + "__id__": 80 + }, + { + "__id__": 82 + }, + { + "__id__": 83 } ], "removedComponents": [] @@ -1090,7 +1266,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 52 + "__id__": 64 }, "propertyPath": [ "_name" @@ -1106,7 +1282,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 52 + "__id__": 64 }, "propertyPath": [ "_lpos" @@ -1121,7 +1297,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 52 + "__id__": 64 }, "propertyPath": [ "_lrot" @@ -1137,7 +1313,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 52 + "__id__": 64 }, "propertyPath": [ "_euler" @@ -1152,7 +1328,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 57 + "__id__": 69 }, "propertyPath": [ "_right" @@ -1168,7 +1344,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 59 + "__id__": 71 }, "propertyPath": [ "_contentSize" @@ -1188,7 +1364,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 61 + "__id__": 73 }, "propertyPath": [ "_lpos" @@ -1209,7 +1385,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 63 + "__id__": 75 }, "propertyPath": [ "_contentSize" @@ -1229,7 +1405,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 65 + "__id__": 77 }, "propertyPath": [ "_contentSize" @@ -1249,7 +1425,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 67 + "__id__": 79 }, "propertyPath": [ "_lpos" @@ -1270,7 +1446,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 69 + "__id__": 81 }, "propertyPath": [ "_lpos" @@ -1291,7 +1467,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 57 + "__id__": 69 }, "propertyPath": [ "_alignFlags" @@ -1301,7 +1477,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 57 + "__id__": 69 }, "propertyPath": [ "_top" @@ -1314,24 +1490,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 47 + "__id__": 59 }, "_children": [ { - "__id__": 73 + "__id__": 85 } ], "_active": true, "_components": [ { - "__id__": 81 + "__id__": 93 }, { - "__id__": 83 + "__id__": 95 } ], "_prefab": { - "__id__": 85 + "__id__": 97 }, "_lpos": { "__type__": "cc.Vec3", @@ -1366,17 +1542,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 72 + "__id__": 84 }, "_prefab": { - "__id__": 74 + "__id__": 86 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 73 + "__id__": 85 }, "asset": { "__uuid__": "9d7eeadb-58f6-4c42-aaed-bc402f272c84", @@ -1384,7 +1560,7 @@ }, "fileId": "a8T0NC/KpNY7MMbRkPRuwY", "instance": { - "__id__": 75 + "__id__": 87 }, "targetOverrides": null }, @@ -1398,16 +1574,16 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 76 + "__id__": 88 }, { - "__id__": 78 + "__id__": 90 }, { - "__id__": 79 + "__id__": 91 }, { - "__id__": 80 + "__id__": 92 } ], "removedComponents": [] @@ -1415,7 +1591,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 89 }, "propertyPath": [ "_name" @@ -1431,7 +1607,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 89 }, "propertyPath": [ "_lpos" @@ -1446,7 +1622,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 89 }, "propertyPath": [ "_lrot" @@ -1462,7 +1638,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 89 }, "propertyPath": [ "_euler" @@ -1480,11 +1656,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 72 + "__id__": 84 }, "_enabled": true, "__prefab": { - "__id__": 82 + "__id__": 94 }, "_contentSize": { "__type__": "cc.Size", @@ -1508,11 +1684,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 72 + "__id__": 84 }, "_enabled": false, "__prefab": { - "__id__": 84 + "__id__": 96 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1566,27 +1742,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 47 + "__id__": 59 }, "_children": [ { - "__id__": 87 + "__id__": 99 }, { - "__id__": 103 + "__id__": 115 } ], "_active": true, "_components": [ { - "__id__": 119 + "__id__": 131 }, { - "__id__": 121 + "__id__": 133 } ], "_prefab": { - "__id__": 123 + "__id__": 135 }, "_lpos": { "__type__": "cc.Vec3", @@ -1623,27 +1799,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 86 + "__id__": 98 }, "_children": [ { - "__id__": 88 + "__id__": 100 } ], "_active": true, "_components": [ { - "__id__": 96 + "__id__": 108 }, { - "__id__": 98 + "__id__": 110 }, { - "__id__": 100 + "__id__": 112 } ], "_prefab": { - "__id__": 102 + "__id__": 114 }, "_lpos": { "__type__": "cc.Vec3", @@ -1680,23 +1856,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 87 + "__id__": 99 }, "_children": [], "_active": true, "_components": [ { - "__id__": 89 + "__id__": 101 }, { - "__id__": 91 + "__id__": 103 }, { - "__id__": 93 + "__id__": 105 } ], "_prefab": { - "__id__": 95 + "__id__": 107 }, "_lpos": { "__type__": "cc.Vec3", @@ -1733,11 +1909,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 100 }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 102 }, "_contentSize": { "__type__": "cc.Size", @@ -1761,11 +1937,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 100 }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 104 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1806,11 +1982,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 88 + "__id__": 100 }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 106 }, "_color": { "__type__": "cc.Color", @@ -1845,11 +2021,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 87 + "__id__": 99 }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 109 }, "_contentSize": { "__type__": "cc.Size", @@ -1873,11 +2049,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 87 + "__id__": 99 }, "_enabled": true, "__prefab": { - "__id__": 99 + "__id__": 111 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1918,11 +2094,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 87 + "__id__": 99 }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 113 }, "clickEvents": [], "_interactable": true, @@ -1974,7 +2150,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 87 + "__id__": 99 }, "_id": "" }, @@ -2001,27 +2177,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 86 + "__id__": 98 }, "_children": [ { - "__id__": 104 + "__id__": 116 } ], "_active": true, "_components": [ { - "__id__": 112 + "__id__": 124 }, { - "__id__": 114 + "__id__": 126 }, { - "__id__": 116 + "__id__": 128 } ], "_prefab": { - "__id__": 118 + "__id__": 130 }, "_lpos": { "__type__": "cc.Vec3", @@ -2058,23 +2234,23 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 103 + "__id__": 115 }, "_children": [], "_active": true, "_components": [ { - "__id__": 105 + "__id__": 117 }, { - "__id__": 107 + "__id__": 119 }, { - "__id__": 109 + "__id__": 121 } ], "_prefab": { - "__id__": 111 + "__id__": 123 }, "_lpos": { "__type__": "cc.Vec3", @@ -2111,11 +2287,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 104 + "__id__": 116 }, "_enabled": true, "__prefab": { - "__id__": 106 + "__id__": 118 }, "_contentSize": { "__type__": "cc.Size", @@ -2139,11 +2315,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 104 + "__id__": 116 }, "_enabled": true, "__prefab": { - "__id__": 108 + "__id__": 120 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2184,11 +2360,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 104 + "__id__": 116 }, "_enabled": true, "__prefab": { - "__id__": 110 + "__id__": 122 }, "_color": { "__type__": "cc.Color", @@ -2223,11 +2399,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 103 + "__id__": 115 }, "_enabled": true, "__prefab": { - "__id__": 113 + "__id__": 125 }, "_contentSize": { "__type__": "cc.Size", @@ -2251,11 +2427,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 103 + "__id__": 115 }, "_enabled": true, "__prefab": { - "__id__": 115 + "__id__": 127 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2296,11 +2472,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 103 + "__id__": 115 }, "_enabled": true, "__prefab": { - "__id__": 117 + "__id__": 129 }, "clickEvents": [], "_interactable": true, @@ -2352,7 +2528,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 103 + "__id__": 115 }, "_id": "" }, @@ -2379,11 +2555,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 86 + "__id__": 98 }, "_enabled": true, "__prefab": { - "__id__": 120 + "__id__": 132 }, "_contentSize": { "__type__": "cc.Size", @@ -2407,11 +2583,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 86 + "__id__": 98 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 134 }, "_resizeMode": 1, "_layoutType": 2, @@ -2458,11 +2634,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 47 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 125 + "__id__": 137 }, "_contentSize": { "__type__": "cc.Size", @@ -2486,11 +2662,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 47 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 139 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2531,11 +2707,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 47 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 129 + "__id__": 141 }, "_alignFlags": 44, "_target": null, @@ -2584,26 +2760,26 @@ }, "_children": [ { - "__id__": 132 + "__id__": 144 } ], "_active": true, "_components": [ { - "__id__": 140 + "__id__": 152 }, { - "__id__": 142 + "__id__": 154 }, { - "__id__": 144 + "__id__": 156 }, { - "__id__": 146 + "__id__": 158 } ], "_prefab": { - "__id__": 149 + "__id__": 161 }, "_lpos": { "__type__": "cc.Vec3", @@ -2640,23 +2816,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 131 + "__id__": 143 }, "_children": [], "_active": true, "_components": [ { - "__id__": 133 + "__id__": 145 }, { - "__id__": 135 + "__id__": 147 }, { - "__id__": 137 + "__id__": 149 } ], "_prefab": { - "__id__": 139 + "__id__": 151 }, "_lpos": { "__type__": "cc.Vec3", @@ -2693,11 +2869,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 132 + "__id__": 144 }, "_enabled": true, "__prefab": { - "__id__": 134 + "__id__": 146 }, "_contentSize": { "__type__": "cc.Size", @@ -2721,11 +2897,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 132 + "__id__": 144 }, "_enabled": true, "__prefab": { - "__id__": 136 + "__id__": 148 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2766,11 +2942,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 132 + "__id__": 144 }, "_enabled": true, "__prefab": { - "__id__": 138 + "__id__": 150 }, "_color": { "__type__": "cc.Color", @@ -2805,11 +2981,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 131 + "__id__": 143 }, "_enabled": true, "__prefab": { - "__id__": 141 + "__id__": 153 }, "_contentSize": { "__type__": "cc.Size", @@ -2833,11 +3009,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 131 + "__id__": 143 }, "_enabled": true, "__prefab": { - "__id__": 143 + "__id__": 155 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2878,11 +3054,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 131 + "__id__": 143 }, "_enabled": true, "__prefab": { - "__id__": 145 + "__id__": 157 }, "_alignFlags": 44, "_target": null, @@ -2914,15 +3090,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 131 + "__id__": 143 }, "_enabled": true, "__prefab": { - "__id__": 147 + "__id__": 159 }, "clickEvents": [ { - "__id__": 148 + "__id__": 160 } ], "_interactable": true, @@ -3001,23 +3177,23 @@ }, "_children": [ { - "__id__": 151 + "__id__": 163 } ], "_active": true, "_components": [ { - "__id__": 157 + "__id__": 169 }, { - "__id__": 159 + "__id__": 171 }, { - "__id__": 161 + "__id__": 173 } ], "_prefab": { - "__id__": 164 + "__id__": 176 }, "_lpos": { "__type__": "cc.Vec3", @@ -3054,20 +3230,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 150 + "__id__": 162 }, "_children": [], "_active": true, "_components": [ { - "__id__": 152 + "__id__": 164 }, { - "__id__": 154 + "__id__": 166 } ], "_prefab": { - "__id__": 156 + "__id__": 168 }, "_lpos": { "__type__": "cc.Vec3", @@ -3104,11 +3280,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 151 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 153 + "__id__": 165 }, "_contentSize": { "__type__": "cc.Size", @@ -3132,11 +3308,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 151 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 155 + "__id__": 167 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3190,11 +3366,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 150 + "__id__": 162 }, "_enabled": true, "__prefab": { - "__id__": 158 + "__id__": 170 }, "_contentSize": { "__type__": "cc.Size", @@ -3218,11 +3394,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 150 + "__id__": 162 }, "_enabled": true, "__prefab": { - "__id__": 160 + "__id__": 172 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3263,15 +3439,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 150 + "__id__": 162 }, "_enabled": true, "__prefab": { - "__id__": 162 + "__id__": 174 }, "clickEvents": [ { - "__id__": 163 + "__id__": 175 } ], "_interactable": true, @@ -3323,7 +3499,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 150 + "__id__": 162 }, "_id": "" }, @@ -3364,23 +3540,23 @@ }, "_children": [ { - "__id__": 166 + "__id__": 178 } ], "_active": true, "_components": [ { - "__id__": 172 + "__id__": 184 }, { - "__id__": 174 + "__id__": 186 }, { - "__id__": 176 + "__id__": 188 } ], "_prefab": { - "__id__": 179 + "__id__": 191 }, "_lpos": { "__type__": "cc.Vec3", @@ -3417,20 +3593,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 165 + "__id__": 177 }, "_children": [], "_active": true, "_components": [ { - "__id__": 167 + "__id__": 179 }, { - "__id__": 169 + "__id__": 181 } ], "_prefab": { - "__id__": 171 + "__id__": 183 }, "_lpos": { "__type__": "cc.Vec3", @@ -3467,11 +3643,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 166 + "__id__": 178 }, "_enabled": true, "__prefab": { - "__id__": 168 + "__id__": 180 }, "_contentSize": { "__type__": "cc.Size", @@ -3495,11 +3671,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 166 + "__id__": 178 }, "_enabled": true, "__prefab": { - "__id__": 170 + "__id__": 182 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3553,11 +3729,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 165 + "__id__": 177 }, "_enabled": true, "__prefab": { - "__id__": 173 + "__id__": 185 }, "_contentSize": { "__type__": "cc.Size", @@ -3581,11 +3757,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 165 + "__id__": 177 }, "_enabled": true, "__prefab": { - "__id__": 175 + "__id__": 187 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3626,15 +3802,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 165 + "__id__": 177 }, "_enabled": true, "__prefab": { - "__id__": 177 + "__id__": 189 }, "clickEvents": [ { - "__id__": 178 + "__id__": 190 } ], "_interactable": true, @@ -3686,7 +3862,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 165 + "__id__": 177 }, "_id": "" }, @@ -3727,7 +3903,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 181 + "__id__": 193 }, "_contentSize": { "__type__": "cc.Size", @@ -3755,7 +3931,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 183 + "__id__": 195 }, "_alignFlags": 45, "_target": null, @@ -3791,7 +3967,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 185 + "__id__": 197 }, "mask": false, "maskOpcity": 80, @@ -3818,10 +3994,13 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": [ { - "__id__": 73 + "__id__": 85 }, { - "__id__": 48 + "__id__": 60 + }, + { + "__id__": 42 }, { "__id__": 11 diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/野怪/野怪列表.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/野怪/野怪列表.prefab index c21e2f3d..04ec5e81 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/野怪/野怪列表.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/野怪/野怪列表.prefab @@ -31,20 +31,20 @@ "_active": true, "_components": [ { - "__id__": 67 + "__id__": 68 }, { - "__id__": 69 + "__id__": 70 }, { - "__id__": 71 + "__id__": 72 }, { - "__id__": 73 + "__id__": 74 } ], "_prefab": { - "__id__": 75 + "__id__": 76 }, "_lpos": { "__type__": "cc.Vec3", @@ -1109,11 +1109,11 @@ "__id__": 62 }, { - "__id__": 64 + "__id__": 65 } ], "_prefab": { - "__id__": 66 + "__id__": 67 }, "_lpos": { "__type__": "cc.Vec3", @@ -1394,7 +1394,11 @@ "__prefab": { "__id__": 63 }, - "clickEvents": [], + "clickEvents": [ + { + "__id__": 64 + } + ], "_interactable": true, "_transition": 3, "_normalColor": { @@ -1440,6 +1444,16 @@ "__type__": "cc.CompPrefabInfo", "fileId": "46kCHG8yRJL65tBER5eoyC" }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "fe2adMH7MZF5KXgR4KwvwJX", + "handler": "onClickSell", + "customEventData": "" + }, { "__type__": "cc.Widget", "_name": "", @@ -1450,7 +1464,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 65 + "__id__": 66 }, "_alignFlags": 37, "_target": null, @@ -1499,7 +1513,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 68 + "__id__": 69 }, "_contentSize": { "__type__": "cc.Size", @@ -1527,7 +1541,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 70 + "__id__": 71 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1572,7 +1586,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 72 + "__id__": 73 }, "_alignFlags": 40, "_target": null, @@ -1608,7 +1622,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 74 + "__id__": 75 }, "views": { "__id__": 46 diff --git a/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源.meta b/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源.meta new file mode 100644 index 00000000..f7a817da --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "984854ce-ea02-4a29-9a85-ae0d93f322d0", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab b/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab new file mode 100644 index 00000000..e6285429 --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab @@ -0,0 +1,341 @@ +[ + { + "__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__": 10 + }, + { + "__id__": 12 + }, + { + "__id__": 14 + } + ], + "_prefab": { + "__id__": 16 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -46.486, + "y": 520.668, + "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__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + }, + { + "__id__": 5 + }, + { + "__id__": 7 + } + ], + "_prefab": { + "__id__": 9 + }, + "_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__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 4 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 17.34765625, + "height": 54.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7aYBKLDBBBb6gSDGMjRc7V" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 6 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "0", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 24, + "_fontSize": 24, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_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": "ca5SxOX1lI6KJW85+4yzjd" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 8 + }, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "3eNlsJF9tNXZmkwP9l76/E" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "e0KCY2i/BDFrz3/8Kl7xXv", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 11 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 60 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "31Y91EbyVPvqbf1yXWW3mP" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 13 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 235, + "g": 235, + "b": 235, + "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": "829ZRhv3JLKq0wDBYUk3xR" + }, + { + "__type__": "dd6ff3gNGFAzKeTlGPK1jnx", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "type": 90001, + "show": { + "__id__": 5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "22Ciflh0NO/ZUfdrKoAktL" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "7ehoARooRAIIfX4ttdeppc", + "instance": null, + "targetOverrides": null + } +] \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab.meta b/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab.meta new file mode 100644 index 00000000..ca1be259 --- /dev/null +++ b/JisolGameCocos/assets/resources/prefab/ui/常用预制体/资源/玩家资源显示.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.49", + "importer": "prefab", + "imported": true, + "uuid": "f9a7b5b8-0c1a-4b0c-a6c7-bbf2e077442a", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "玩家资源显示" + } +} diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 349d7649..e98e7dca 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -25,12 +25,12 @@ import { StorageData, StorageEnum } from "./consts/GData"; import { JAPI, JAPIConfig } from "../../extensions/ngame/assets/ngame/util/JAPI"; import { AppData } from "./AppData"; -// 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.0.123:8080` // let WsPath = `ws://192.168.0.123: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{ diff --git a/JisolGameCocos/assets/script/AppData.ts b/JisolGameCocos/assets/script/AppData.ts index 9a7eaa6b..c47b0b3f 100644 --- a/JisolGameCocos/assets/script/AppData.ts +++ b/JisolGameCocos/assets/script/AppData.ts @@ -5,6 +5,7 @@ import ChatData from "./data/ChatData"; import PlayerData from "./data/PlayerData"; import PlayerPetData from "./data/PlayerPetData"; import PlayerTacticalData from "./data/PlayerTacticalData"; +import ResourceData from "./data/ResourceData"; //数据类 (用于初始化游戏信息) export class AppData extends SystemBase{ @@ -16,6 +17,7 @@ export class AppData extends SystemBase{ PlayerPetData.getIns(), //玩家宠物信息 ChatData.getIns(), //聊天 PlayerTacticalData.getIns(), //阵法 + ResourceData.getIns(), //玩家资源 ]; async onInit(): Promise { diff --git a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts index 9b3bc7a6..a1658111 100644 --- a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts @@ -326,17 +326,25 @@ export default class GOnHookMode extends GBaseMode<{}>{ //获取敌人 let roles = this.getOnesRoleAlive(enumyOnes); - //返回敌人 - //获取我在第几排 - let playerXY = player.tactical.getXY(player.tacticalIndex); - //通过排数获取最近的敌人 - let sort = roles.sort((enumy1,enumy2) => { - let enumy1XY = enumy1.tactical.getXY(enumy1.tacticalIndex); - let enumy2XY = enumy2.tactical.getXY(enumy2.tacticalIndex); - return Math.abs((playerXY.y * 1000) - (enumy1XY.y * 1000)) + Math.abs((playerXY.x - enumy1XY.x)) - - Math.abs((playerXY.y * 1000) - (enumy2XY.y * 1000)) + Math.abs((playerXY.x - enumy2XY.x)) - }); - return sort[0] + //通过距离获取最近的敌人 + if(roles[0]){ + let len = Math.abs(Vec2.distance(player.v2World,roles[0].v2World)); + let enumy = roles[0]; + + for (let index = 0; index < roles.length; index++) { + const role = roles[index]; + let tLen; + if(tLen = Math.abs(Vec2.distance(player.v2World,role.v2World)) < len){ + enumy = role; + len = tLen; + } + + } + + return enumy; + }else{ + return null; + } } diff --git a/JisolGameCocos/assets/script/consts/API.ts b/JisolGameCocos/assets/script/consts/API.ts index a83f9174..34b515db 100644 --- a/JisolGameCocos/assets/script/consts/API.ts +++ b/JisolGameCocos/assets/script/consts/API.ts @@ -1,9 +1,17 @@ import { app } from "../App"; +import ResourceData from "../data/ResourceData"; import { GUI } from "../ui/UIConfig"; //接受到JSON消息 export const RData = (data:any,isTips:boolean = true) => { if(data.data.state == 200){ + //如果有 Resource 字段 表示要刷新资源 + if(data.data['resources']){ + //刷新资源 + data.data['resources'].forEach(res => { + ResourceData.getIns().onUpdateOV(res.operation,res.resource); + }) + } return data.data.data; }else{ //弹出提示 @@ -68,6 +76,13 @@ export interface PlayerTacticalOV{ playerId:number, //玩家Id tacticalData:string, //阵法数据 } +//玩家资源 +export interface ResourceOV{ + resourceId:number; //资源Id + playerId:number; //玩家Id + resourceTbId:number; //资源配置表Id + resourceValue:number; //资源数量 +} export const API = { @@ -86,5 +101,9 @@ export const API = { /********** 阵法接口 ******************/ GetPlayerTactical: async () => RData(await app.api.get(`/game/tactical/get`),false) as PlayerTacticalOV, //获取玩家阵法 SetPlayerTactical: async (data:PlayerTacticalOV) => RData(await app.api.post(`/game/tactical/set`,data),false) as PlayerTacticalOV, //更新玩家阵法 + + /********** 资源接口 ******************/ + GetPlayerResource: async () => RData(await app.api.get(`/game/resource/get`),false) as ResourceOV[], //获取玩家资源 + } diff --git a/JisolGameCocos/assets/script/consts/GAPI.ts b/JisolGameCocos/assets/script/consts/GAPI.ts index b91257bb..71e3e018 100644 --- a/JisolGameCocos/assets/script/consts/GAPI.ts +++ b/JisolGameCocos/assets/script/consts/GAPI.ts @@ -10,5 +10,7 @@ export const GAPI = { GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'}),GActionType.GOnHookPets) as GOnHookPets, //捕捉野怪 GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`)) as PlayerPetOV, + //出售野怪 + GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`)), } \ No newline at end of file diff --git a/JisolGameCocos/assets/script/data/ResourceData.ts b/JisolGameCocos/assets/script/data/ResourceData.ts new file mode 100644 index 00000000..bc2d6820 --- /dev/null +++ b/JisolGameCocos/assets/script/data/ResourceData.ts @@ -0,0 +1,57 @@ +import { app } from "../App"; +import { API, ResourceOV } from "../consts/API"; +import BaseData from "./BaseData"; + +export enum ResourceEvent{ + UPDATE = "ResourceEvent_UPDATE", //刷新资源 +} + +//资源类型 +export enum ResourceType{ + Gold = 90001, //金币 +} + +//玩家资源数据 +export default class ResourceData extends BaseData{ + + //资源数据 {资源Id:资源数量} + data:{[key:number]:number} = {}; + + //初始化 + async onInit() { + await this.onUpdateResource(); + } + + //更新玩家资源 + async onUpdateResource(){ + + //请求资源 + let res = await API.GetPlayerResource(); + + //保存资源数量 + res.forEach(data => { + this.data[data.resourceTbId] = data.resourceValue; + }) + + } + + //获取指定资源的数量 + getValue(type:ResourceType){ + return this.data[type] || 0; + } + + //刷新返回资源 + onUpdateOV(operation:number,resource:ResourceOV){ + + if(operation == 0){ + //更新资源 + this.data[resource.resourceTbId] = resource.resourceValue; + } + + app.event.emit(ResourceEvent.UPDATE) + } + + +} + + diff --git a/JisolGameCocos/assets/script/data/ResourceData.ts.meta b/JisolGameCocos/assets/script/data/ResourceData.ts.meta new file mode 100644 index 00000000..a6fb2b15 --- /dev/null +++ b/JisolGameCocos/assets/script/data/ResourceData.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "7d3c75f4-37fd-4009-baab-1fcc2430b739", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts b/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts index 5a6fd846..ef5c5d7b 100644 --- a/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts +++ b/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts @@ -74,7 +74,7 @@ export default class GOnHookManager extends Singleton{ let index; if((index = this.killSreeps.indexOf(creeps)) < 0){ - app.layer.Open(GUI.Tips,{text:"不可捕捉该宠物"}); + app.layer.Open(GUI.Tips,{text:"不可捕捉该野怪"}); return false; } @@ -95,6 +95,25 @@ export default class GOnHookManager extends Singleton{ } + //出售野怪 + async onSellCreeps(creeps:GOnHookPet):Promise{ + + let index; + if((index = this.killSreeps.indexOf(creeps)) < 0){ + app.layer.Open(GUI.Tips,{text:"不可出售当前野怪"}); + return false; + } + + //删除 + this.killSreeps.splice(index,1); + + //通知添加野怪被删除 + app.event.emit(GOnHookManagerEvent.DEL_KILL_SREEP,creeps); + + return await GAPI.GOnHookSellCreeps(creeps.key); + + } + } diff --git a/JisolGameCocos/assets/script/ui/Consts/Resource.meta b/JisolGameCocos/assets/script/ui/Consts/Resource.meta new file mode 100644 index 00000000..1a523099 --- /dev/null +++ b/JisolGameCocos/assets/script/ui/Consts/Resource.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "a2e6e211-4b26-493c-85ba-38c5a9f2c614", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts b/JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts new file mode 100644 index 00000000..48ccc998 --- /dev/null +++ b/JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts @@ -0,0 +1,43 @@ +import { Label } from 'cc'; +import { _decorator, Component, Node } from 'cc'; +import ResourceData, { ResourceEvent, ResourceType } from '../../../data/ResourceData'; +import { Enum } from 'cc'; +import { app } from '../../../App'; +const { ccclass, property } = _decorator; + +@ccclass('PlayerResourceShow') +export class PlayerResourceShow extends Component { + + + //显示的资源 + @property({type:Enum(ResourceType)}) + type:ResourceType = ResourceType.Gold; + + //显示文本 + @property(Label) + show:Label; + + protected onLoad(): void { + + //更新 + this.onUpdateView(); + //监听 + app.event.on(ResourceEvent.UPDATE,this.onUpdateView,this); + + } + + protected onDestroy(): void { + app.event.off(ResourceEvent.UPDATE,this.onUpdateView,this); + } + + //刷新 + onUpdateView(){ + + //更新资源数量 + this.show.string = `${ResourceData.getIns().getValue(this.type)}`; + + } + +} + + diff --git a/JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts.meta b/JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts.meta new file mode 100644 index 00000000..47225dcf --- /dev/null +++ b/JisolGameCocos/assets/script/ui/Consts/Resource/PlayerResourceShow.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "dd6ffde0-3461-40cc-a793-9463cad639f1", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/ui/Home/Sreeps/MainSreepsList.ts b/JisolGameCocos/assets/script/ui/Home/Sreeps/MainSreepsList.ts index d6463de5..82397d98 100644 --- a/JisolGameCocos/assets/script/ui/Home/Sreeps/MainSreepsList.ts +++ b/JisolGameCocos/assets/script/ui/Home/Sreeps/MainSreepsList.ts @@ -41,11 +41,13 @@ export class MainSreepsList extends Component { //添加野怪 onAddSreep(sreep:GOnHookPet){ this.views.addData(sreep); + this.onUpdateView(); } //删除野怪 onDelSreep(sreep:GOnHookPet){ this.views.delData(sreep); + this.onUpdateView(); } //刷新 @@ -86,6 +88,22 @@ export class MainSreepsList extends Component { app.layer.Open(GUI.Tips,{text:"捕捉成功!"}); } + + //野怪出售 + async onClickSell(){ + + //获取选中的野怪 + let item = this.views.getItems()[this.index]; + + if(!item){ + app.layer.Open(GUI.Tips,{text:"请选择需要出售的宠物"}); + return; + } + + if(await GOnHookManager.getIns().onSellCreeps(item.data)) + app.layer.Open(GUI.Tips,{text:"出售成功!"}); + + } } diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index 1943c699..be42908e 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit 1943c6992fd3f7269e7a08b174cdf5e49028c074 +Subproject commit be42908eaecd47d952a79d2f1549bd0dd4176765 diff --git a/JisolGameServer/JNGame b/JisolGameServer/JNGame index a57971ec..f3c05c98 160000 --- a/JisolGameServer/JNGame +++ b/JisolGameServer/JNGame @@ -1 +1 @@ -Subproject commit a57971eceadfcc80e06934e75a7dee7469fb10a1 +Subproject commit f3c05c98992ccc4c4bc45ca120b3fcaf5ff6af58 diff --git a/JisolGameServer/Main/src/main/java/cfg/TB/TbGResource.java b/JisolGameServer/Main/src/main/java/cfg/TB/TbGResource.java new file mode 100644 index 00000000..2679c22f --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cfg/TB/TbGResource.java @@ -0,0 +1,55 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg.TB; + +import luban.*; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + + +public final class TbGResource extends AbstractBean { + public TbGResource(JsonObject _buf) { + id = _buf.get("id").getAsInt(); + name = _buf.get("name").getAsString(); + tig = _buf.get("tig").getAsString(); + } + + public static TbGResource deserialize(JsonObject _buf) { + return new cfg.TB.TbGResource(_buf); + } + + /** + * id + */ + public final int id; + /** + * 资源名称 + */ + public final String name; + /** + * 描述 + */ + public final String tig; + + public static final int __ID__ = 1780642599; + + @Override + public int getTypeId() { return __ID__; } + + @Override + public String toString() { + return "{ " + + "(format_field_name __code_style field.name):" + id + "," + + "(format_field_name __code_style field.name):" + name + "," + + "(format_field_name __code_style field.name):" + tig + "," + + "}"; + } +} + diff --git a/JisolGameServer/Main/src/main/java/cfg/Tables.java b/JisolGameServer/Main/src/main/java/cfg/Tables.java index 1e480a79..da8cebe8 100644 --- a/JisolGameServer/Main/src/main/java/cfg/Tables.java +++ b/JisolGameServer/Main/src/main/java/cfg/Tables.java @@ -33,6 +33,8 @@ public final class Tables public cfg.TbGMap getTbGMap() { return _tbgmap; } private final cfg.TbGOnHookGlobal _tbgonhookglobal; public cfg.TbGOnHookGlobal getTbGOnHookGlobal() { return _tbgonhookglobal; } + private final cfg.TbGResource _tbgresource; + public cfg.TbGResource getTbGResource() { return _tbgresource; } public Tables(IJsonLoader loader) throws java.io.IOException { _tbgglobal = new cfg.TbGGlobal(loader.load("tbgglobal")); @@ -42,6 +44,7 @@ public final class Tables _tbgroleskill = new cfg.TbGRoleSkill(loader.load("tbgroleskill")); _tbgmap = new cfg.TbGMap(loader.load("tbgmap")); _tbgonhookglobal = new cfg.TbGOnHookGlobal(loader.load("tbgonhookglobal")); + _tbgresource = new cfg.TbGResource(loader.load("tbgresource")); } } diff --git a/JisolGameServer/Main/src/main/java/cfg/TbGResource.java b/JisolGameServer/Main/src/main/java/cfg/TbGResource.java new file mode 100644 index 00000000..19a38fa3 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cfg/TbGResource.java @@ -0,0 +1,37 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg; + +import luban.*; +import com.google.gson.JsonElement; + + +public final class TbGResource { + private final java.util.HashMap _dataMap; + private final java.util.ArrayList _dataList; + + public TbGResource(JsonElement _buf) { + _dataMap = new java.util.HashMap(); + _dataList = new java.util.ArrayList(); + + for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) { + cfg.TB.TbGResource _v; + _v = cfg.TB.TbGResource.deserialize(_e_.getAsJsonObject()); + _dataList.add(_v); + _dataMap.put(_v.id, _v); + } + } + + public java.util.HashMap getDataMap() { return _dataMap; } + public java.util.ArrayList getDataList() { return _dataList; } + + public cfg.TB.TbGResource get(int key) { return _dataMap.get(key); } + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java index 3c25c1f2..370e4c67 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GNoviceController.java @@ -1,10 +1,9 @@ package cn.jisol.game.controller.game; import cfg.TB.TbGGlobal; -import cn.hutool.json.JSON; import cn.hutool.json.JSONUtil; import cn.jisol.game.controller.argsresolver.CurrentPlayer; -import cn.jisol.game.data.GlobalIds; +import cn.jisol.game.data.GlobalId; import cn.jisol.game.data.TD; import cn.jisol.game.entity.game.Player; import cn.jisol.game.entity.game.PlayerPet; @@ -17,7 +16,6 @@ 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.List; import java.util.Objects; @@ -38,7 +36,7 @@ public class GNoviceController { if(Objects.isNull(petId)) return NewsContext.onFail("请选择宠物"); //判断选择的宠物是否在配置表中 - TbGGlobal info = TD.DATA.getTbGGlobal().get(GlobalIds.SELECT_PET_ID); + TbGGlobal info = TD.DATA.getTbGGlobal().get(GlobalId.SELECT_PET_ID); //判断选择的宠物是否在其中 List ids = JSONUtil.toList(info.args, Integer.class); if (!ids.contains(petId)) return NewsContext.onFail("不可选择这个宠物!"); diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GResourceController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GResourceController.java new file mode 100644 index 00000000..ed120d24 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/GResourceController.java @@ -0,0 +1,50 @@ +package cn.jisol.game.controller.game; + +import cn.jisol.game.controller.argsresolver.CurrentPlayer; +import cn.jisol.game.entity.game.Player; +import cn.jisol.game.entity.game.PlayerTactical; +import cn.jisol.game.entity.game.Resource; +import cn.jisol.game.service.ResourceService; +import cn.jisol.ngame.util.NewsContext; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +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 java.sql.Wrapper; +import java.util.List; + +/** + * 资源 + */ +@Api(value = "JNGameDemo - API", tags = {"资源 - API"}) +@RestController +@RequestMapping("/game/resource") +@ResponseBody +public class GResourceController { + + @Autowired + ResourceService resourceService; + + //获取玩家的资源 + @ApiImplicitParams({}) + @ApiOperation(value = "获取玩家的资源") + @GetMapping("/get") + public NewsContext> getInfo(@CurrentPlayer Player player){ + + //获取玩家全部资源列表 + List list = resourceService.list( + Wrappers.lambdaQuery(Resource.class) + .eq(Resource::getPlayerId, player.getPlayerId()) + ); + + return NewsContext.onSuccess("获取成功",list); + + } + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java index 0660c027..d09c8bd2 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/controller/game/mode/GOnHookController.java @@ -3,15 +3,19 @@ package cn.jisol.game.controller.game.mode; import cfg.TB.TbGRole; import cn.hutool.core.util.RandomUtil; import cn.jisol.game.controller.argsresolver.CurrentPlayer; -import cn.jisol.game.data.GlobalIds; +import cn.jisol.game.data.GlobalId; +import cn.jisol.game.data.ResourceId; import cn.jisol.game.data.TD; import cn.jisol.game.entity.game.Player; import cn.jisol.game.entity.game.PlayerPet; +import cn.jisol.game.entity.game.Resource; import cn.jisol.game.proto.GOnHookMessage; import cn.jisol.game.service.PlayerPetService; +import cn.jisol.game.service.ResourceService; +import cn.jisol.game.vo.news.NewsResource; +import cn.jisol.game.vo.news.ov.ResourceUpdateOV; import cn.jisol.ngame.util.NewsContext; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +36,8 @@ public class GOnHookController { @Autowired PlayerPetService playerPetService; + @Autowired + ResourceService resourceService; //生成的野怪列表 public static Map> CREEPS = new HashMap<>(); @@ -54,7 +60,7 @@ public class GOnHookController { } //获取可生成的最大数量 - int max = Integer.parseInt(TD.DATA.getTbGOnHookGlobal().get(GlobalIds.MODE_ON_HOOK_SPAWN_NUM).args); + int max = Integer.parseInt(TD.DATA.getTbGOnHookGlobal().get(GlobalId.MODE_ON_HOOK_SPAWN_NUM).args); //获取配置表全部宠物 ArrayList tdPets = TD.DATA.getTbGRole().getDataList(); @@ -83,8 +89,25 @@ public class GOnHookController { @ApiImplicitParams({}) @ApiOperation(value = "出售野怪") @PostMapping("/onSellCreeps/{creepId}") - public NewsContext onSellCreeps(@PathVariable String creepId){ - return NewsContext.onSuccess("卖出成功"); + public NewsResource onSellCreeps(@PathVariable String creepId, @CurrentPlayer Player player){ + + //玩家的野怪 + Map creeps; + //找到野怪删除 + if(Objects.isNull(creeps = CREEPS.get(player.getPlayerId()))) return NewsResource.onFail("卖出失败",false); + + if(Objects.nonNull(creeps.remove(creepId))){ + //增加玩家金币 (默认添加100) + Resource res = resourceService.addResourceValue(player.getPlayerId(), ResourceId.Gold, 100L); + return NewsResource.onSuccess( + "卖出成功", + true, + ResourceUpdateOV.onUpdate(res) //更新金币 + ); + }else{ + return NewsResource.onFail("卖出失败",false); + } + } //捕捉野怪 diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalId.java similarity index 85% rename from JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java rename to JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalId.java index 1f053615..0277bc89 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalIds.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/data/GlobalId.java @@ -1,11 +1,10 @@ package cn.jisol.game.data; -public interface GlobalIds { +public interface GlobalId { //选择宠物配置表Id int SELECT_PET_ID = 70001; - //OnHook模式 宠物生成数量 int MODE_ON_HOOK_SPAWN_NUM = 80001; diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/data/ResourceId.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/data/ResourceId.java new file mode 100644 index 00000000..3e049beb --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/data/ResourceId.java @@ -0,0 +1,14 @@ +package cn.jisol.game.data; + +public enum ResourceId { + + //金币资源 + Gold(90001), + ; + + public int id; + + ResourceId(int id) { + this.id = id; + } +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/game/Resource.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/game/Resource.java new file mode 100644 index 00000000..bc4604a1 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/game/Resource.java @@ -0,0 +1,23 @@ +package cn.jisol.game.entity.game; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Builder; +import lombok.Data; + +/** + * 资源类 + */ +@Builder +@Data +@TableName("`resource`") +public class Resource { + + @TableId(type = IdType.AUTO) + private Long resourceId; //资源Id + private Long playerId; //玩家Id + private int resourceTbId; //资源配置表Id + private Long resourceValue; //资源数量 + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/mapper/ResourceMapper.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/mapper/ResourceMapper.java new file mode 100644 index 00000000..73da46bf --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/mapper/ResourceMapper.java @@ -0,0 +1,11 @@ +package cn.jisol.game.mapper; + +import cn.jisol.game.entity.game.Player; +import cn.jisol.game.entity.game.Resource; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Component; + +@Component +public interface ResourceMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/service/ResourceService.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/service/ResourceService.java new file mode 100644 index 00000000..e9531b55 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/service/ResourceService.java @@ -0,0 +1,17 @@ +package cn.jisol.game.service; + +import cn.jisol.game.data.ResourceId; +import cn.jisol.game.entity.game.PlayerPet; +import cn.jisol.game.entity.game.Resource; +import com.baomidou.mybatisplus.extension.service.IService; + +public interface ResourceService extends IService { + + //添加某个资源的数量 + public Resource addResourceValue(Long playerId, ResourceId type, Long value); + + //初始化某个资源 + public Resource initResource(Long playerId, ResourceId type); + public Resource initResource(Resource resource); + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java new file mode 100644 index 00000000..b00baa07 --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/service/impl/ResourceServiceImpl.java @@ -0,0 +1,63 @@ +package cn.jisol.game.service.impl; + +import cn.jisol.game.data.ResourceId; +import cn.jisol.game.entity.game.Player; +import cn.jisol.game.entity.game.Resource; +import cn.jisol.game.mapper.ResourceMapper; +import cn.jisol.game.service.ResourceService; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +@Service +public class ResourceServiceImpl extends ServiceImpl implements ResourceService { + + /** + * @param playerId 玩家Id + * @param type 资源类型 + * @param value 添加的数量 + * @return + */ + @Override + public Resource addResourceValue(Long playerId, ResourceId type, Long value) { + + //获取玩家资源 + Resource res = this.getOne( + Wrappers.lambdaQuery(Resource.class) + .eq(Resource::getPlayerId, playerId) //玩家 + .eq(Resource::getResourceTbId, type.id) //资源 + ); + + //如果没有资源则默认给一个0的资源 + if(Objects.isNull(res)){ + //创建初始资源 + res = this.initResource(playerId,type); + } + + //添加资源 + res.setResourceValue(res.getResourceValue() + value); + + //保存资源 + this.saveOrUpdate(res); + + return res; + } + + //初始化某个资源 + @Override + public Resource initResource(Long playerId, ResourceId type) { + Resource resource = Resource.builder().playerId(playerId).resourceTbId(type.id).resourceValue(0L).build(); + this.initResource(resource); + return resource; + } + + @Override + public Resource initResource(Resource resource) { + this.saveOrUpdate(resource); + return resource; + } + + +} diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/NewsResource.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/NewsResource.java new file mode 100644 index 00000000..ab6ab36c --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/NewsResource.java @@ -0,0 +1,53 @@ +package cn.jisol.game.vo.news; + +import cn.jisol.game.entity.game.Resource; +import cn.jisol.game.vo.news.ov.ResourceUpdateOV; +import cn.jisol.ngame.util.NewsContext; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import lombok.Builder; +import lombok.experimental.SuperBuilder; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + +//返回带资源更新的消息 +@SuperBuilder +@ApiResponses({ + @ApiResponse(code = 200,message = "成功"), + @ApiResponse(code = 500,message = "失败"), +}) +public class NewsResource extends NewsContext { + + //资源刷新 + public List resources = new ArrayList<>(); + + //添加一个刷新资源数据 + public void addUpdateResource(Resource resource){ + this.resources.add(ResourceUpdateOV.onUpdate(resource)); + } + + public static NewsResource onSuccess(String msg){ + return onMessage(msg,null,NEWS_STATE_SUCCESS,new ArrayList<>()); + } + public static NewsResource onSuccess(String msg,T data){ + return onMessage(msg,data,NEWS_STATE_SUCCESS,new ArrayList<>()); + } + public static NewsResource onSuccess(String msg,T data,ResourceUpdateOV... resource){ + return onMessage(msg,data,NEWS_STATE_SUCCESS, Arrays.asList(resource)); + } + + public static NewsResource onFail(String msg){ + return onMessage(msg,null,NEWS_STATE_FAIL,new ArrayList<>()); + } + public static NewsResource onFail(String msg, T data){ + return onMessage(msg,data,NEWS_STATE_FAIL,new ArrayList<>()); + } + + public static NewsResource onMessage(String msg, T data, Integer state,List resource){ + return (NewsResource) NewsResource.builder().state(state).msg(msg).data(data).resources(resource).build(); + } + +} 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 new file mode 100644 index 00000000..e4543aca --- /dev/null +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/vo/news/ov/ResourceUpdateOV.java @@ -0,0 +1,29 @@ +package cn.jisol.game.vo.news.ov; + +import cn.jisol.game.entity.game.Resource; +import lombok.Builder; +import lombok.Data; + +//资源更新类 +@Builder +@Data +public class ResourceUpdateOV { + + Resource resource; + + //操作 + int operation = 0; + + //资源更新类型 + public interface ResourceUpdateType{ + static int UPDATE = 0; //刷新资源数量 + static int MINUS = 1; //减少资源数量 + static int ADD = 2; //添加资源数量 + } + + //返回一个刷新的资源更新类 + public static ResourceUpdateOV onUpdate(Resource resource){ + return ResourceUpdateOV.builder().operation(ResourceUpdateType.UPDATE).resource(resource).build(); + } + +} diff --git a/JisolGameServer/Main/src/main/resources/json/tbgresource.json b/JisolGameServer/Main/src/main/resources/json/tbgresource.json new file mode 100644 index 00000000..bf0af7cd --- /dev/null +++ b/JisolGameServer/Main/src/main/resources/json/tbgresource.json @@ -0,0 +1,7 @@ +[ + { + "id": 90001, + "name": "金币", + "tig": "金币 (目前叫做金币 名称还没有定) 游戏的基础资源 用于升级宠物" + } +] \ No newline at end of file