From 252e9ef11dc0eea3bd61218029ea98b4726f9132 Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Wed, 3 Jan 2024 15:51:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/resources/UICanvas.prefab | 88 ++-- .../resources/prefab/ui/主页/MainView.prefab | 387 +++++++++++++----- .../prefab/ui/加载页面/LoadingView.prefab | 2 +- JisolGameCocos/assets/script/App.ts | 12 +- .../assets/script/action/PVPAction.ts | 3 +- .../assets/script/battle/modes/GOnHookMode.ts | 26 +- .../battle/modes/OnHook/GFSMOnHookMode.ts | 2 +- JisolGameCocos/assets/script/consts/GAPI.ts | 9 +- .../assets/script/data/GOnHookData.ts | 25 +- .../manager/battle/mode/GOnHookManager.ts | 15 +- .../assets/script/ui/Home/MainView.ts | 16 +- JisolGameCocos/extensions/ngame | 2 +- .../cn/jisol/game/actions/GRefereeAction.java | 4 +- .../game/mode/GOnHookController.java | 26 +- .../cn/jisol/game/entity/mode/ModeOnHook.java | 5 + .../game/entity/mode/ModeOnHookInfo.java | 9 + .../Main/src/main/resources/application.yml | 4 +- 17 files changed, 470 insertions(+), 165 deletions(-) diff --git a/JisolGameCocos/assets/resources/UICanvas.prefab b/JisolGameCocos/assets/resources/UICanvas.prefab index 2dbe3b3e..d0189e1a 100644 --- a/JisolGameCocos/assets/resources/UICanvas.prefab +++ b/JisolGameCocos/assets/resources/UICanvas.prefab @@ -38,10 +38,13 @@ }, { "__id__": 20 + }, + { + "__id__": 22 } ], "_prefab": { - "__id__": 22 + "__id__": 24 }, "_lpos": { "__type__": "cc.Vec3", @@ -266,7 +269,7 @@ "fileId": "75BOpt00JFQa2ABpf8j5sd" }, { - "__type__": "1c16bQ/GLJGbqTREE81sG8h", + "__type__": "cc.Mask", "_name": "", "_objFlags": 0, "__editorExtras__": {}, @@ -277,49 +280,61 @@ "__prefab": { "__id__": 10 }, - "isAutoWidth": true, - "isAutoHeight": false, + "_type": 0, + "_inverted": false, + "_segments": 64, + "_alphaThreshold": 0.1, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "36gXm5tolLYKrIDVy3UEZ5" + "fileId": "5ecOHE1AVCnoJPcrgz6QCM" }, { - "__type__": "cc.Widget", + "__type__": "cc.Graphics", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { "__id__": 6 }, - "_enabled": false, + "_enabled": true, "__prefab": { "__id__": 12 }, - "_alignFlags": 45, - "_target": null, - "_left": 0, - "_right": 0, - "_top": 0, - "_bottom": 0, - "_horizontalCenter": 0, - "_verticalCenter": 0, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 720, - "_originalHeight": 1280, - "_alignMode": 2, - "_lockFlags": 0, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_lineWidth": 1, + "_strokeColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_lineJoin": 2, + "_lineCap": 0, + "_fillColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 0 + }, + "_miterLimit": 10, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "7a6Iw5uDtLwoWRbGDBWcqh" + "fileId": "4dAbnesxlMxI5/HwZJY6FE" }, { "__type__": "cc.PrefabInfo", @@ -441,6 +456,27 @@ "__type__": "cc.CompPrefabInfo", "fileId": "a5cWASUqZFWbJeQJ2MLLd6" }, + { + "__type__": "1c16bQ/GLJGbqTREE81sG8h", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 23 + }, + "transform": { + "__id__": 7 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b5pMzUMX9Fvb5rlBSoZKr2" + }, { "__type__": "cc.PrefabInfo", "root": { diff --git a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab index 204c72a5..ac368328 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/主页/MainView.prefab @@ -28,32 +28,32 @@ "__id__": 87 }, { - "__id__": 173 + "__id__": 181 }, { - "__id__": 192 + "__id__": 200 }, { - "__id__": 207 + "__id__": 215 }, { - "__id__": 222 + "__id__": 230 } ], "_active": true, "_components": [ { - "__id__": 237 + "__id__": 245 }, { - "__id__": 239 + "__id__": 247 }, { - "__id__": 241 + "__id__": 249 } ], "_prefab": { - "__id__": 243 + "__id__": 251 }, "_lpos": { "__type__": "cc.Vec3", @@ -1666,22 +1666,25 @@ }, { "__id__": 126 + }, + { + "__id__": 166 } ], "_active": true, "_components": [ { - "__id__": 166 + "__id__": 174 }, { - "__id__": 168 + "__id__": 176 }, { - "__id__": 170 + "__id__": 178 } ], "_prefab": { - "__id__": 172 + "__id__": 180 }, "_lpos": { "__type__": "cc.Vec3", @@ -3182,6 +3185,171 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "群介绍", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 87 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 167 + }, + { + "__id__": 169 + }, + { + "__id__": 171 + } + ], + "_prefab": { + "__id__": 173 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -276.195, + "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__": 166 + }, + "_enabled": true, + "__prefab": { + "__id__": 168 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 467.4375, + "height": 54.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "cbaFcoQHRIrbOXcSpymHaA" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 166 + }, + "_enabled": true, + "__prefab": { + "__id__": 170 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "本游戏是内测版本 欢迎大家体验 交流群: 799743786", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 20, + "_fontSize": 20, + "_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": "1fLbylV59CL7vGfKSXb92I" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 166 + }, + "_enabled": true, + "__prefab": { + "__id__": 172 + }, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7byqs6uupBDKKzmzmNvLcI" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "be6Gw1BhlGBb9yhP04XRI5", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -3192,7 +3360,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 167 + "__id__": 175 }, "_contentSize": { "__type__": "cc.Size", @@ -3220,7 +3388,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 169 + "__id__": 177 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3265,7 +3433,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 171 + "__id__": 179 }, "_alignFlags": 44, "_target": null, @@ -3314,26 +3482,26 @@ }, "_children": [ { - "__id__": 174 + "__id__": 182 } ], "_active": true, "_components": [ { - "__id__": 182 + "__id__": 190 }, { - "__id__": 184 + "__id__": 192 }, { - "__id__": 186 + "__id__": 194 }, { - "__id__": 188 + "__id__": 196 } ], "_prefab": { - "__id__": 191 + "__id__": 199 }, "_lpos": { "__type__": "cc.Vec3", @@ -3370,23 +3538,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 173 + "__id__": 181 }, "_children": [], "_active": true, "_components": [ { - "__id__": 175 + "__id__": 183 }, { - "__id__": 177 + "__id__": 185 }, { - "__id__": 179 + "__id__": 187 } ], "_prefab": { - "__id__": 181 + "__id__": 189 }, "_lpos": { "__type__": "cc.Vec3", @@ -3423,11 +3591,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 174 + "__id__": 182 }, "_enabled": true, "__prefab": { - "__id__": 176 + "__id__": 184 }, "_contentSize": { "__type__": "cc.Size", @@ -3451,11 +3619,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 174 + "__id__": 182 }, "_enabled": true, "__prefab": { - "__id__": 178 + "__id__": 186 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3496,11 +3664,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 174 + "__id__": 182 }, "_enabled": true, "__prefab": { - "__id__": 180 + "__id__": 188 }, "_color": { "__type__": "cc.Color", @@ -3535,11 +3703,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 173 + "__id__": 181 }, "_enabled": true, "__prefab": { - "__id__": 183 + "__id__": 191 }, "_contentSize": { "__type__": "cc.Size", @@ -3563,11 +3731,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 173 + "__id__": 181 }, "_enabled": true, "__prefab": { - "__id__": 185 + "__id__": 193 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3608,11 +3776,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 173 + "__id__": 181 }, "_enabled": true, "__prefab": { - "__id__": 187 + "__id__": 195 }, "_alignFlags": 44, "_target": null, @@ -3644,15 +3812,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 173 + "__id__": 181 }, "_enabled": true, "__prefab": { - "__id__": 189 + "__id__": 197 }, "clickEvents": [ { - "__id__": 190 + "__id__": 198 } ], "_interactable": true, @@ -3731,23 +3899,23 @@ }, "_children": [ { - "__id__": 193 + "__id__": 201 } ], "_active": true, "_components": [ { - "__id__": 199 + "__id__": 207 }, { - "__id__": 201 + "__id__": 209 }, { - "__id__": 203 + "__id__": 211 } ], "_prefab": { - "__id__": 206 + "__id__": 214 }, "_lpos": { "__type__": "cc.Vec3", @@ -3784,20 +3952,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 192 + "__id__": 200 }, "_children": [], "_active": true, "_components": [ { - "__id__": 194 + "__id__": 202 }, { - "__id__": 196 + "__id__": 204 } ], "_prefab": { - "__id__": 198 + "__id__": 206 }, "_lpos": { "__type__": "cc.Vec3", @@ -3834,11 +4002,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 193 + "__id__": 201 }, "_enabled": true, "__prefab": { - "__id__": 195 + "__id__": 203 }, "_contentSize": { "__type__": "cc.Size", @@ -3862,11 +4030,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 193 + "__id__": 201 }, "_enabled": true, "__prefab": { - "__id__": 197 + "__id__": 205 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3920,11 +4088,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 192 + "__id__": 200 }, "_enabled": true, "__prefab": { - "__id__": 200 + "__id__": 208 }, "_contentSize": { "__type__": "cc.Size", @@ -3948,11 +4116,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 192 + "__id__": 200 }, "_enabled": true, "__prefab": { - "__id__": 202 + "__id__": 210 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3993,15 +4161,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 192 + "__id__": 200 }, "_enabled": true, "__prefab": { - "__id__": 204 + "__id__": 212 }, "clickEvents": [ { - "__id__": 205 + "__id__": 213 } ], "_interactable": true, @@ -4053,7 +4221,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 192 + "__id__": 200 }, "_id": "" }, @@ -4094,23 +4262,23 @@ }, "_children": [ { - "__id__": 208 + "__id__": 216 } ], "_active": true, "_components": [ { - "__id__": 214 + "__id__": 222 }, { - "__id__": 216 + "__id__": 224 }, { - "__id__": 218 + "__id__": 226 } ], "_prefab": { - "__id__": 221 + "__id__": 229 }, "_lpos": { "__type__": "cc.Vec3", @@ -4147,20 +4315,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 207 + "__id__": 215 }, "_children": [], "_active": true, "_components": [ { - "__id__": 209 + "__id__": 217 }, { - "__id__": 211 + "__id__": 219 } ], "_prefab": { - "__id__": 213 + "__id__": 221 }, "_lpos": { "__type__": "cc.Vec3", @@ -4197,11 +4365,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 208 + "__id__": 216 }, "_enabled": true, "__prefab": { - "__id__": 210 + "__id__": 218 }, "_contentSize": { "__type__": "cc.Size", @@ -4225,11 +4393,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 208 + "__id__": 216 }, "_enabled": true, "__prefab": { - "__id__": 212 + "__id__": 220 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4283,11 +4451,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 207 + "__id__": 215 }, "_enabled": true, "__prefab": { - "__id__": 215 + "__id__": 223 }, "_contentSize": { "__type__": "cc.Size", @@ -4311,11 +4479,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 207 + "__id__": 215 }, "_enabled": true, "__prefab": { - "__id__": 217 + "__id__": 225 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4356,15 +4524,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 207 + "__id__": 215 }, "_enabled": true, "__prefab": { - "__id__": 219 + "__id__": 227 }, "clickEvents": [ { - "__id__": 220 + "__id__": 228 } ], "_interactable": true, @@ -4416,7 +4584,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 207 + "__id__": 215 }, "_id": "" }, @@ -4457,23 +4625,23 @@ }, "_children": [ { - "__id__": 223 + "__id__": 231 } ], "_active": true, "_components": [ { - "__id__": 229 + "__id__": 237 }, { - "__id__": 231 + "__id__": 239 }, { - "__id__": 233 + "__id__": 241 } ], "_prefab": { - "__id__": 236 + "__id__": 244 }, "_lpos": { "__type__": "cc.Vec3", @@ -4510,20 +4678,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 222 + "__id__": 230 }, "_children": [], "_active": true, "_components": [ { - "__id__": 224 + "__id__": 232 }, { - "__id__": 226 + "__id__": 234 } ], "_prefab": { - "__id__": 228 + "__id__": 236 }, "_lpos": { "__type__": "cc.Vec3", @@ -4560,11 +4728,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 223 + "__id__": 231 }, "_enabled": true, "__prefab": { - "__id__": 225 + "__id__": 233 }, "_contentSize": { "__type__": "cc.Size", @@ -4588,11 +4756,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 223 + "__id__": 231 }, "_enabled": true, "__prefab": { - "__id__": 227 + "__id__": 235 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4646,11 +4814,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 222 + "__id__": 230 }, "_enabled": true, "__prefab": { - "__id__": 230 + "__id__": 238 }, "_contentSize": { "__type__": "cc.Size", @@ -4674,11 +4842,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 222 + "__id__": 230 }, "_enabled": true, "__prefab": { - "__id__": 232 + "__id__": 240 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4719,19 +4887,19 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 222 + "__id__": 230 }, "_enabled": true, "__prefab": { - "__id__": 234 + "__id__": 242 }, "clickEvents": [ { - "__id__": 235 + "__id__": 243 } ], "_interactable": true, - "_transition": 2, + "_transition": 3, "_normalColor": { "__type__": "cc.Color", "r": 214, @@ -4779,7 +4947,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 222 + "__id__": 230 }, "_id": "" }, @@ -4820,7 +4988,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 238 + "__id__": 246 }, "_contentSize": { "__type__": "cc.Size", @@ -4848,7 +5016,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 240 + "__id__": 248 }, "_alignFlags": 45, "_target": null, @@ -4884,7 +5052,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 242 + "__id__": 250 }, "mask": false, "maskOpcity": 80, @@ -4895,6 +5063,9 @@ "onHookLabel": { "__id__": 131 }, + "nextLevelBtn": { + "__id__": 241 + }, "_id": "" }, { diff --git a/JisolGameCocos/assets/resources/prefab/ui/加载页面/LoadingView.prefab b/JisolGameCocos/assets/resources/prefab/ui/加载页面/LoadingView.prefab index 73101763..3df2dd9b 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/加载页面/LoadingView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/加载页面/LoadingView.prefab @@ -176,7 +176,7 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "76aadab4-10a3-4c8e-b4b9-dce7807050fc@f9941", + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index d08d170c..89b8e661 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -28,14 +28,14 @@ import AppAction from "./AppAction"; import { Asset } from "cc"; import { Component } from "cc"; -let APIPath = `http://localhost:8080` -let WsPath = `ws://localhost:8080/websocket` +// let APIPath = `http://localhost:8080` +// let WsPath = `ws://localhost:8080/websocket` // let APIPath = `http://192.168.1.23:8080` // let WsPath = `ws://192.168.1.23:8080/websocket` -// let APIPath = `http://192.168.0.116:8080` -// let WsPath = `ws://192.168.0.116:8080/websocket` -// let APIPath = `https://api.pet.jisol.cn` -// let WsPath = `wss://api.pet.jisol.cn/websocket` +// let APIPath = `http://192.168.0.115:8080` +// let WsPath = `ws://192.168.0.115:8080/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/action/PVPAction.ts b/JisolGameCocos/assets/script/action/PVPAction.ts index 7514a8f2..5e3d7d9a 100644 --- a/JisolGameCocos/assets/script/action/PVPAction.ts +++ b/JisolGameCocos/assets/script/action/PVPAction.ts @@ -39,7 +39,8 @@ export default class PVPAction extends BaseAction { //PVP开始等待 onModePVPStartWait(){ //PVP 匹配页面 - app.layer.Open(GUI.PVPModeMatchView); + if(GBattleModeManager.getIns().current != BattleMode.PVP) + app.layer.Open(GUI.PVPModeMatchView); } //PVP结束等待 diff --git a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts index b85e4264..655e9078 100644 --- a/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GOnHookMode.ts @@ -97,6 +97,9 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{ //是否允许攻击 isAllowAttack:boolean = false; + //是否战斗失败 + isFail:boolean = false; + //添加监听事件 addEvent(){ app.event.on(PlayerTacticalEvent.UPDATE_TACTICAL,this.onUpdatePlayerPet,this); @@ -352,7 +355,11 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{ } //生成敌人 - onResetGenerateEnemy(){ + onResetFight(){ + + //初始化战斗失败 + this.isFail = false; + this.enemyRoles = []; let sign = TD.TbGOnHookMaps.get(GOnHookData.getIns().info.onHookMap).sign; let table:{data:TbGEntity.TOnHookLevel} = TD[sign].get(GOnHookData.getIns().info.levelId); @@ -376,13 +383,26 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{ role.node.destroy() },3000) + //清理 + this.onClearCache(); + //如果死亡的是野怪则通知野怪死亡 if(role.getComponent(GRoleOnHookCreepsExpand)){ GOnHookManager.getIns().onKillSreeps(role.getComponent(GRoleOnHookCreepsExpand).creeps); + //如果野怪都死了 并且 战斗成功 则向服务器发送战斗成功 + if(this.enemyRoles.length <= 0 && !this.isFail){ + GOnHookManager.getIns().onWinLevel(); + } } - //清理 - this.onClearCache(); + //如果死亡的是玩家宠物 并且 场上没有玩家宠物则重新战斗 + if(role.getComponent(GRoleOnHookPlayerExpand)){ + if(this.playerRoles.length <= 0){ + //玩家战斗失败 + this.isFail = true; + this.onUpdatePlayerPet(); + } + } } diff --git a/JisolGameCocos/assets/script/battle/modes/OnHook/GFSMOnHookMode.ts b/JisolGameCocos/assets/script/battle/modes/OnHook/GFSMOnHookMode.ts index cc63c3ac..5ef3f1c5 100644 --- a/JisolGameCocos/assets/script/battle/modes/OnHook/GFSMOnHookMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/OnHook/GFSMOnHookMode.ts @@ -78,7 +78,7 @@ export default class GFSMOnHookMode extends GFSMBase{ //生成敌人 onGenEnemyProcess(){ - this.mode.onResetGenerateEnemy(); + this.mode.onResetFight(); return ProcessEnum.LeaveFight; //前往战斗 } diff --git a/JisolGameCocos/assets/script/consts/GAPI.ts b/JisolGameCocos/assets/script/consts/GAPI.ts index 5b058b1a..ecf66be1 100644 --- a/JisolGameCocos/assets/script/consts/GAPI.ts +++ b/JisolGameCocos/assets/script/consts/GAPI.ts @@ -3,11 +3,16 @@ import { app } from "../App"; import { PlayerPetOV, RData, RProto } from "./API"; import { GActionType } from "./GActionType"; +export interface ModeHookInfo{ + maps:{[key:number]:number}; //地图关卡信息 {地图Id: 地图关卡Id} + mapStates:{[key:number]:number}; //地图关卡状态 {地图Id: 状态(0:战斗中, 1:胜利)} +} export interface ModeOnHookOV{ playerId:number; //玩家Id onHookMap:number; //当前玩家所在的地图(配置表Id) levelId:number; //当前关卡Id + hookInfo:ModeHookInfo; //关卡信息 } @@ -25,6 +30,8 @@ export const GAPI = { //出售野怪 GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`),true) as boolean, //下一关 - GOnHookNextLevel : async () => RData(await app.api.post(`/game/mode/onHook/nextLevel`)) as boolean, + GOnHookNextLevel : async () => RData(await app.api.post(`/game/mode/onHook/nextLevel`),true) as ModeOnHookOV, + //战胜当前关卡 + GOnHookWinLevel : async () => RData(await app.api.post(`/game/mode/onHook/winLevel`),true) as ModeOnHookOV, } \ No newline at end of file diff --git a/JisolGameCocos/assets/script/data/GOnHookData.ts b/JisolGameCocos/assets/script/data/GOnHookData.ts index 08448b8a..be13f206 100644 --- a/JisolGameCocos/assets/script/data/GOnHookData.ts +++ b/JisolGameCocos/assets/script/data/GOnHookData.ts @@ -4,19 +4,30 @@ import { GAPI, ModeOnHookOV } from "../consts/GAPI"; import { GUI } from "../ui/UIConfig"; import BaseData from "./BaseData"; +export enum GOnHookDataEnum{ + UPDATE = "GOnHookDataEnum_UPDATE" //刷新信息 +} + //无限模式数据类 export default class GOnHookData extends BaseData{ info:ModeOnHookOV; + //是否允许下一关 + get isNextLevel(){ + if(!this.info) return false; + return this.info.hookInfo.mapStates[this.info.onHookMap] == 1; + } + async onInit() { await this.onUpdateInfo(); console.log("GOnHookData Info",this.info); } //刷新数据 - async onUpdateInfo(){ - this.info = await GAPI.GOnHookInfo(); + async onUpdateInfo(info?){ + this.info = info || await GAPI.GOnHookInfo(); + app.event.emit(GOnHookDataEnum.UPDATE); } //切换地图 @@ -29,8 +40,14 @@ export default class GOnHookData extends BaseData{ //下一关 async onNextLevel(){ - await GAPI.GOnHookNextLevel(); - await this.onUpdateInfo(); + let info = await GAPI.GOnHookNextLevel(); + if(info) this.onUpdateInfo(info); + return !!info; + } + + //战胜当前关卡 + async onWinLevel(){ + this.onUpdateInfo(await GAPI.GOnHookWinLevel()); } } diff --git a/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts b/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts index 13e42dcd..d7b9724d 100644 --- a/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts +++ b/JisolGameCocos/assets/script/manager/battle/mode/GOnHookManager.ts @@ -108,19 +108,16 @@ export default class GOnHookManager extends Singleton{ } - - - }).bind(this)) //生成野怪 - onSpawnSreeps(){ + onSpawnSreeps = NGameUtil.ThrottleASync((async () => { GAPI.GOnHookSpawnCreeps().then(data => { data.pets.forEach(pet => { this._sreeps.set(pet.key,pet as GOnHookPet); }) }); - } + }).bind(this)) //获取下一只野怪 getNextCreeps(){ @@ -204,11 +201,15 @@ export default class GOnHookManager extends Singleton{ //下一关 async onNextLevel(){ - GOnHookData.getIns().onNextLevel(); - app.layer.Open(GUI.Tips,{text:"下一关"}); + await GOnHookData.getIns().onNextLevel(); this.onResetMap(); } + //战胜当前关卡 + async onWinLevel(){ + await GOnHookData.getIns().onWinLevel(); + } + //切换场景 async setMap(mapId:number){ diff --git a/JisolGameCocos/assets/script/ui/Home/MainView.ts b/JisolGameCocos/assets/script/ui/Home/MainView.ts index 8caba9e6..11cfb232 100644 --- a/JisolGameCocos/assets/script/ui/Home/MainView.ts +++ b/JisolGameCocos/assets/script/ui/Home/MainView.ts @@ -8,6 +8,9 @@ import { app } from '../../App'; import { GAction } from '../../consts/GAction'; import { GAPI } from '../../consts/GAPI'; import GOnHookManager, { GOnHookManagerEvent } from '../../manager/battle/mode/GOnHookManager'; +import { Button } from 'cc'; +import GOnHookData, { GOnHookDataEnum } from '../../data/GOnHookData'; +import { Sprite } from 'cc'; const { ccclass, property } = _decorator; @ccclass('MainView') @@ -18,6 +21,9 @@ export class MainView extends JNGLayerBase { @property(Label) onHookLabel:Label; //挂机文本 + + @property(Button) + nextLevelBtn:Button; //下一关按钮 onJNLoad(data?: any): void { @@ -32,6 +38,7 @@ export class MainView extends JNGLayerBase { //监听 app.event.on(GOnHookManagerEvent.UPDATE_ON_HOOK_STATE,this.onUpdateOnHook,this); + app.event.on(GOnHookDataEnum.UPDATE,this.onUpdateOnHookInfo,this); } @@ -39,16 +46,23 @@ export class MainView extends JNGLayerBase { onJNClose(): void { super.onJNClose(); //取消监听 - app.event.on(GOnHookManagerEvent.UPDATE_ON_HOOK_STATE,this.onUpdateOnHook,this); + app.event.off(GOnHookManagerEvent.UPDATE_ON_HOOK_STATE,this.onUpdateOnHook,this); + app.event.off(GOnHookDataEnum.UPDATE,this.onUpdateOnHookInfo,this); } onUpdateOnHook(){ this.onHookLabel.string = (GOnHookManager.getIns().isOnHook) ? "挂机中" : "挂机"; } + onUpdateOnHookInfo(){ + this.nextLevelBtn.node.active = GOnHookData.getIns().isNextLevel; + } + //更新UI界面 onUpdateView(){ this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerId}`; + this.onUpdateOnHookInfo(); + this.onUpdateOnHook(); } //打开Demo页面 diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index ab4de0a5..10cb5e38 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit ab4de0a5e48849a45bdada19489d93c1c9f72bcb +Subproject commit 10cb5e383994f61503b951861ccee9911f0149b7 diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java index ce97b58b..3d22184c 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java @@ -34,8 +34,8 @@ public class GRefereeAction { //headless位置 // public static String Headless = "D:\\myproject\\JisolGame\\headless"; - public static String Headless = "D:\\Jisol\\JisolGame\\headless"; -// public static String Headless = "D:\\wwwroot\\pet.jisol.cn\\headless"; +// public static String Headless = "D:\\Jisol\\JisolGame\\headless"; + public static String Headless = "D:\\wwwroot\\pet.jisol.cn\\headless"; //获取一个空闲的裁决员 public static GRefereeClient getFreeReferee(){ 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 0c852e59..cd7bbe43 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 @@ -11,6 +11,7 @@ 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.entity.mode.ModeOnHook; +import cn.jisol.game.entity.mode.ModeOnHookInfo; import cn.jisol.game.proto.GOnHookMessage; import cn.jisol.game.service.ModeOnHookService; import cn.jisol.game.service.PlayerPetService; @@ -99,6 +100,10 @@ public class GOnHookController { @PostMapping("/nextLevel") public NewsContext nextLevel(@CurrentPlayer Player player){ ModeOnHook data = this.getInfo(player).data; + + //判断是否战胜当前关卡 + if (!data.isWinLevel()) return NewsContext.onFail("请战胜当前关卡",data); + //获取当前关卡Id Integer levelId = data.getLevelId(); @@ -106,11 +111,30 @@ public class GOnHookController { GTbGOnHookLevels.GTbGOnHookLevel nextLevel = data.getGTbGOnHookLevels().get(levelId + 1); data.getHookInfo().getMaps().put(data.getOnHookMap(),nextLevel.getId()); + //并且重置当前关卡状态 + data.getHookInfo().getMapStates().put(data.getOnHookMap(),ModeOnHookInfo.MapState.Fight); + //保存地图 modeOnHookService.saveOrUpdate(data); //下一关 清理历史野怪 CREEPS.put(player.getPlayerId(),new HashMap<>()); - return NewsContext.onSuccess("下一关"); + return NewsContext.onSuccess("下一关",data); + } + + //战胜当前关卡 + @ApiImplicitParams({}) + @ApiOperation(value = "战胜当前关卡") + @PostMapping("/winLevel") + public NewsContext winLevel(@CurrentPlayer Player player){ + ModeOnHook data = this.getInfo(player).data; + + data.getHookInfo().getMapStates().put(data.getOnHookMap(), ModeOnHookInfo.MapState.Win); + + //保存地图 + modeOnHookService.saveOrUpdate(data); + + return NewsContext.onSuccess("战胜当前关卡",data); + } //生成野怪 diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHook.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHook.java index b2d1e5f5..9e8bafeb 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHook.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHook.java @@ -68,4 +68,9 @@ public class ModeOnHook { return levelId; } + //是否战胜当前关卡 + public boolean isWinLevel(){ + return ModeOnHookInfo.MapState.Win.equals(getHookInfo().getMapStates().get(getOnHookMap())); + } + } diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHookInfo.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHookInfo.java index 51d28082..5d0a5bca 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHookInfo.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/entity/mode/ModeOnHookInfo.java @@ -13,8 +13,17 @@ public class ModeOnHookInfo { //地图关卡信息 {地图Id: 地图关卡Id} private Map maps; + //地图关卡状态 {地图Id: 状态(0:战斗中, 1:胜利)} + private Map mapStates; + public ModeOnHookInfo(){ maps = new HashMap<>(); + mapStates = new HashMap<>(); + } + + public interface MapState{ + Integer Fight = 0; + Integer Win = 1; } } diff --git a/JisolGameServer/Main/src/main/resources/application.yml b/JisolGameServer/Main/src/main/resources/application.yml index 9e0d9877..364ad07d 100644 --- a/JisolGameServer/Main/src/main/resources/application.yml +++ b/JisolGameServer/Main/src/main/resources/application.yml @@ -4,8 +4,8 @@ spring: datasource: username: pet_jisol_cn password: sThsBwjfDcaw2wJR - url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 -# url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 +# url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 + url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 driver-class-name: com.mysql.cj.jdbc.Driver jackson: serialization: