From 64ab2b0fe5e4511c620cceef399be3ecd8651947 Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Mon, 30 Oct 2023 18:53:21 +0800 Subject: [PATCH] update --- JNGame | 2 +- .../resources/config/game/GRoleSkill.json | 2 +- .../resources/prefab/ui/Home/HomeView.prefab | 380 +++++++++++++++++- JisolGameCocos/assets/script/App.ts | 2 +- JisolGameCocos/assets/script/WorldCanvas.ts | 3 + .../base/attack/GAttackParabolicBangRemote.ts | 7 +- .../base/fsm/base/GFSMBattle/GFSMBattle.ts | 30 +- .../fsm/base/GFSMBattle/GFSMBattleAmin.ts | 9 +- .../script/battle/base/role/GRoleBase.ts | 43 +- .../battle/base/role/PVP/GRolePVPEntity.ts | 4 + .../assets/script/battle/skill/GSkill.ts | 6 + .../script/battle/skill/GSkillAngerBase.ts | 29 ++ .../battle/skill/GSkillAngerBase.ts.meta | 9 + .../script/battle/skill/GSkillCDBase.ts | 42 +- .../skill/RoleSkill/GSkillCrazySquirrel.ts | 1 - .../assets/script/ui/Home/HomeView.ts | 9 +- JisolGameCocos/config/GRoleSkill.xlsx | Bin 11389 -> 11403 bytes JisolGameCocos/extensions/ngame | 2 +- JisolGameServer/pom.xml | 9 +- .../src/main/resources/META-INF/MANIFEST.MF | 3 + 20 files changed, 544 insertions(+), 48 deletions(-) create mode 100644 JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts create mode 100644 JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts.meta create mode 100644 JisolGameServer/src/main/resources/META-INF/MANIFEST.MF diff --git a/JNGame b/JNGame index e5ae6946..bce1ad35 160000 --- a/JNGame +++ b/JNGame @@ -1 +1 @@ -Subproject commit e5ae6946c8f1663d3025514e3ec9e3598debdcec +Subproject commit bce1ad3522fb8ed1497eee9e01bba38d53e97279 diff --git a/JisolGameCocos/assets/resources/config/game/GRoleSkill.json b/JisolGameCocos/assets/resources/config/game/GRoleSkill.json index bd9d1b8b..e80ead65 100644 --- a/JisolGameCocos/assets/resources/config/game/GRoleSkill.json +++ b/JisolGameCocos/assets/resources/config/game/GRoleSkill.json @@ -1 +1 @@ -{"40001":{"id":40001,"skillName":"疯狂松鼠","skillController":"GSkillCrazySquirrel","skillArgs":["10","250","250"],"skillText":"疯狂松鼠的技能 丢出巨大炸弹 轰炸全部玩家"}} \ No newline at end of file +{"40001":{"id":40001,"skillName":"疯狂松鼠","skillController":"GSkillCrazySquirrel","skillArgs":["5","250","250"],"skillText":"疯狂松鼠的技能 丢出巨大炸弹 轰炸全部玩家"}} \ No newline at end of file diff --git a/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab b/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab index bc2969b8..52af3e57 100644 --- a/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab +++ b/JisolGameCocos/assets/resources/prefab/ui/Home/HomeView.prefab @@ -32,22 +32,25 @@ }, { "__id__": 60 + }, + { + "__id__": 75 } ], "_active": true, "_components": [ { - "__id__": 75 + "__id__": 90 }, { - "__id__": 77 + "__id__": 92 }, { - "__id__": 79 + "__id__": 94 } ], "_prefab": { - "__id__": 81 + "__id__": 96 }, "_lpos": { "__type__": "cc.Vec3", @@ -1777,6 +1780,369 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, + { + "__type__": "cc.Node", + "_name": "Button-001", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 76 + } + ], + "_active": true, + "_components": [ + { + "__id__": 82 + }, + { + "__id__": 84 + }, + { + "__id__": 86 + } + ], + "_prefab": { + "__id__": 89 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 108.634, + "y": 414.543, + "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": 512, + "__editorExtras__": {}, + "_parent": { + "__id__": 75 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 77 + }, + { + "__id__": 79 + } + ], + "_prefab": { + "__id__": 81 + }, + "_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__": 76 + }, + "_enabled": true, + "__prefab": { + "__id__": 78 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5fboR6YyBN54l5x0btJQyW" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 76 + }, + "_enabled": true, + "__prefab": { + "__id__": 80 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_string": "重置服务器帧", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 20, + "_fontSize": 20, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a6QibMTH5G+7LMHG0qhbVT" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "da36iiJxtJPZLjwyxqfLYI", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 75 + }, + "_enabled": true, + "__prefab": { + "__id__": 83 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "11gVfKX15J75lmC5wMXNoV" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 75 + }, + "_enabled": true, + "__prefab": { + "__id__": 85 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "6bzNThqslF4rtzhtv4z/wB" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 75 + }, + "_enabled": true, + "__prefab": { + "__id__": 87 + }, + "clickEvents": [ + { + "__id__": 88 + } + ], + "_interactable": true, + "_transition": 2, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 75 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "33456IPOpL9oM7x0gq/Oo4" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "15051raQgZN6J5ICgY2OfSS", + "handler": "onClickResetServer", + "customEventData": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "17rzI8RjNOmqCFQhUeM594", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -1787,7 +2153,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 76 + "__id__": 91 }, "_contentSize": { "__type__": "cc.Size", @@ -1815,7 +2181,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 78 + "__id__": 93 }, "_alignFlags": 45, "_target": null, @@ -1851,7 +2217,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 80 + "__id__": 95 }, "frameText": { "__id__": 11 diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index b3943123..562fb857 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -25,7 +25,7 @@ import { TableGRoleAttackEffect } from "../resources/config/ts/TableGRoleAttackE import { TableGRoleSkill } from "../resources/config/ts/TableGRoleSkill"; import { TableGRoleSkillEffect } from "../resources/config/ts/TableGRoleSkillEffect"; -let IP = "192.168.1.23"; +let IP = "localhost"; //重写UI class JNGLayer extends JNLayer{ diff --git a/JisolGameCocos/assets/script/WorldCanvas.ts b/JisolGameCocos/assets/script/WorldCanvas.ts index 34201903..18a20d57 100644 --- a/JisolGameCocos/assets/script/WorldCanvas.ts +++ b/JisolGameCocos/assets/script/WorldCanvas.ts @@ -41,6 +41,9 @@ export class WorldCanvas extends Component { //创建世界 create(){ this.root.addChild(instantiate(this.prefab)) + this.scheduleOnce(() => { + app.sync.onStart(); + }); } update(deltaTime: number) { diff --git a/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts b/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts index 2bb7d9f7..72a1660f 100644 --- a/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts +++ b/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicBangRemote.ts @@ -8,16 +8,14 @@ import { v3 } from "cc"; import { bezier } from "cc"; import { v2 } from "cc"; import { Vec2 } from "cc"; -import { sp } from "cc"; import GEffectUtil from "../../effect/GEffectUtil"; import { TableGRoleAttackEffect } from "../../../../resources/config/ts/TableGRoleAttackEffect"; import GDetection from "../common/GDetection"; import { rect } from "cc"; -import { UITransform } from "cc"; -import { BoxCollider2D } from "cc"; + /** * 抛物线 爆炸普攻 - * 攻击子弹,爆炸特效,龙骨-初始位置,子弹大小 + * 攻击子弹,爆炸特效,龙骨-初始位置,子弹大小,爆炸宽度,爆炸高度 */ export default class GAttackParabolicRemote implements GAttackBase{ @@ -26,7 +24,6 @@ export default class GAttackParabolicRemote implements GAttackBase{ let enemy = role.fsm.enemy; if(!enemy) return; - //[子弹图片] let image:SpriteFrame = app.role.bullets[info.attackArgs[0]]; let bang = { ske: app.role.effects[info.attackArgs[1]], diff --git a/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattle.ts b/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattle.ts index ca8bdefb..a6e62242 100644 --- a/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattle.ts +++ b/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattle.ts @@ -149,14 +149,17 @@ export default abstract class GFSMBattle extends GFSMBase{ this.player.fsmAnim.isAttack = true; //如果有敌人则攻击 没有 则 重置 if(this.enemy){ - // if(){ - // //如果可以释放大招 - // }else{ - // //不可以则普攻 //朝向敌人 this.player.onTowardsTarget(this.enemy); - return GFSMProcessEnum.Wait; - // } + + //是否可释放技能 + if(this.player.isReleaseSkill()){ + //则释放技能 + return ProcessEnum.ReleaseSkills; + }else{ + return GFSMProcessEnum.Wait; + } + }else{ return ProcessEnum.SeekEnemy; } @@ -165,6 +168,21 @@ export default abstract class GFSMBattle extends GFSMBase{ //释放技能 onReleaseSkillsProcess(){ + //如果正在释放则等待 + if(this.player.isReleasingSkill()){ + return GFSMProcessEnum.Wait; + } + + //释放技能 + if(this.player.isReleaseSkill()){ + //如果可以释放技能则释放 + this.player.onReleaseSkill(); + return GFSMProcessEnum.Wait; + }else{ + //不可以则回到攻击 + return ProcessEnum.AttackEnemy; + } + } diff --git a/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattleAmin.ts b/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattleAmin.ts index 05d72a12..29832dab 100644 --- a/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattleAmin.ts +++ b/JisolGameCocos/assets/script/battle/base/fsm/base/GFSMBattle/GFSMBattleAmin.ts @@ -1,5 +1,8 @@ import { sp } from "cc"; import GFSMBase, { GFSMProcessEnum, GFSMProcessInfo, GFSMProcessMode } from "../../GFSMBase"; +import GRoleBase from "../../../role/GRoleBase"; +import GRolePVPEntity from "../../../role/PVP/GRolePVPEntity"; +import GObject from "../../../GObject"; //角色动画名称枚举 export enum GFSMBattleAminEnum { @@ -63,7 +66,8 @@ export class GFSMBattleAmin extends GFSMBase{ this.trackIndex = trackIndex || 0; //设置监听 this.spine.setEventListener(this.onEventListener.bind(this)); - this.spine.setStartListener(this.onStartListener.bind(this)); + //因为SpineBUG所以不使用Spine监听 采用自己调用 + // this.spine.setStartListener(this.onStartListener.bind(this)); } //添加事件监听 @@ -176,8 +180,9 @@ export class GFSMBattleAmin extends GFSMBase{ //播放动画 if(!info.track){ - console.log("播放动画",info); + console.log(`播放动画-${this.spine.getComponent(GObject).nId}-`,info); info.track = this.spine.setAnimation(this.trackIndex,info.animName,info.isLoop); + this.onStartListener(info.track); } return to; diff --git a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts index 6ec50658..84548c43 100644 --- a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts +++ b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts @@ -13,7 +13,7 @@ import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAtta import { GAttack, GAttackBase } from "../attack/GAttack"; import { TableGRole } from "../../../../resources/config/ts/TableGRole"; import { TableGRoleSkill } from "../../../../resources/config/ts/TableGRoleSkill"; -import { GSkill, GSkillBase } from "../../skill/GSkill"; +import { GSkill, GSkillBase, GSkillState } from "../../skill/GSkill"; import JNSkeleton from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/spine/JNFrameSkeleton"; const { ccclass, property } = _decorator; @@ -131,9 +131,8 @@ export default abstract class GRoleBase extends GObject{ this.fsm && this.fsm.onUpdate(dt / 1000); this.fsmAnim && this.fsmAnim.onUpdate(dt / 1000); - if(frame.index == 100){ - this.skills[0] && this.skills[0].release(); - } + //更新技能 + this.skills.forEach(skill => skill.onUpdate(dt)); } @@ -227,12 +226,13 @@ export default abstract class GRoleBase extends GObject{ //击飞 onFly(){ - console.log("onFly"); + if(this.nId == 1) + console.log("onFly"); let vWorld = this.node.worldPosition; let vEndWorld = this.getWorldBackLen(v2(1000,500)); this.JTween(vWorld) .to({x:vEndWorld.x},800) - .onUpdate(pos => this.node.worldPosition = vWorld) + .onUpdate(pos => this.node.worldPosition = pos) .start(); this.JTween(vWorld) .to({y:vEndWorld.y},800) @@ -252,6 +252,37 @@ export default abstract class GRoleBase extends GObject{ return roles.filter(role => role.type != this.type); } + //判断是否可以释放技能 + isReleaseSkill():boolean{ + for (const skill of this.skills) { + if(skill.isRelease()){ + return true; + } + } + return false; + } + + //释放技能 + onReleaseSkill():boolean{ + for (const skill of this.skills) { + if(skill.isRelease()){ + skill.release(); + return true; + } + } + return false; + } + + //是否正在释放技能 + isReleasingSkill():boolean { + for (const skill of this.skills) { + if(skill.state() == GSkillState.Releasing){ + return true; + } + } + return false; + } + } diff --git a/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts b/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts index 27e778ab..2238c743 100644 --- a/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts +++ b/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts @@ -51,6 +51,10 @@ export default class GRolePVPEntity extends GRoleBase{ //更新显示 this.bloodVolume.progress = this.blood / this.fullBlood; + //显示第一个技能进度条 + if(this.skills[0]){ + this.energyVolume.progress = this.skills[0].getProgress(); + } } diff --git a/JisolGameCocos/assets/script/battle/skill/GSkill.ts b/JisolGameCocos/assets/script/battle/skill/GSkill.ts index 2f39bdc8..83a45393 100644 --- a/JisolGameCocos/assets/script/battle/skill/GSkill.ts +++ b/JisolGameCocos/assets/script/battle/skill/GSkill.ts @@ -24,6 +24,12 @@ export interface GSkillBase { //技能状态 state():GSkillState; + //技能更新 + onUpdate(dt:number); + + //返回进度条 + getProgress():number; + } diff --git a/JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts b/JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts new file mode 100644 index 00000000..025d1f96 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts @@ -0,0 +1,29 @@ +import { TableGRoleSkill } from "../../../resources/config/ts/TableGRoleSkill"; +import GRoleBase from "../base/role/GRoleBase"; +import { GSkillBase, GSkillState } from "./GSkill"; + + +//怒气冷却 +export default abstract class GSkillAngerBase implements GSkillBase { + + bind(role: GRoleBase<{}>, info: TableGRoleSkill): GSkillBase { + throw new Error("Method not implemented."); + } + isRelease(): boolean { + throw new Error("Method not implemented."); + } + release(): boolean { + throw new Error("Method not implemented."); + } + state(): GSkillState { + throw new Error("Method not implemented."); + } + onUpdate(dt: number) { + throw new Error("Method not implemented."); + } + getProgress(): number { + throw new Error("Method not implemented."); + } + +} + diff --git a/JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts.meta b/JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts.meta new file mode 100644 index 00000000..f507cad4 --- /dev/null +++ b/JisolGameCocos/assets/script/battle/skill/GSkillAngerBase.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "e648aeed-c49c-4f10-b24f-6aef45fc14f5", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts b/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts index 1b465220..fb43eb36 100644 --- a/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts +++ b/JisolGameCocos/assets/script/battle/skill/GSkillCDBase.ts @@ -7,33 +7,61 @@ import { GSkillBase, GSkillState } from "./GSkill"; export default abstract class GSkillCDBase implements GSkillBase { //冷却总时间 - cdTatal:number; + cdTatal:number = 0; //冷却时间 - cdTime:number; + cdTime:number = 0; bind(role:GRoleBase<{}>,info: TableGRoleSkill):GSkillCDBase { return this; } + //是否可以释放技能 isRelease(): boolean { - //冷却时间小于等于0可释放 - return this.cdTime <= 0; + return this.cdTime >= this.cdTatal; } //释放技能 release():boolean { - // //是否可以释放技能 - // if(!this.isRelease()) return false; + //是否可以释放技能 + if(!this.isRelease()) return false; + this.cdTime = 0; return this.onRelease(); } //子类实现释放 abstract onRelease():boolean; + //查询状态 state(): GSkillState { - if(this.isRelease()) + + if(this.isReleasing()){ return GSkillState.Releasing + } + + if(this.isRelease()) + return GSkillState.Releasable else return GSkillState.NoRelease + } + + //是否正在释放技能 + isReleasing(): boolean{ + return false; + } + + //更新 + onUpdate(dt:number){ + + if(this.state() == GSkillState.NoRelease){ + this.cdTime += (dt / 1000); + } + + } + + //返回进度 + getProgress():number{ + return this.cdTime / this.cdTatal; + } + } diff --git a/JisolGameCocos/assets/script/battle/skill/RoleSkill/GSkillCrazySquirrel.ts b/JisolGameCocos/assets/script/battle/skill/RoleSkill/GSkillCrazySquirrel.ts index 8e354544..faaf896e 100644 --- a/JisolGameCocos/assets/script/battle/skill/RoleSkill/GSkillCrazySquirrel.ts +++ b/JisolGameCocos/assets/script/battle/skill/RoleSkill/GSkillCrazySquirrel.ts @@ -20,7 +20,6 @@ export default class GSkillCrazySquirrel extends GSkillCDBase{ info: TableGRoleSkill; bind(role:GRoleBase<{}>,info: TableGRoleSkill):GSkillCrazySquirrel { - //技能冷却 this.cdTatal = parseInt(info.skillArgs[0]); this.role = role; diff --git a/JisolGameCocos/assets/script/ui/Home/HomeView.ts b/JisolGameCocos/assets/script/ui/Home/HomeView.ts index b859ff3f..5e042da1 100644 --- a/JisolGameCocos/assets/script/ui/Home/HomeView.ts +++ b/JisolGameCocos/assets/script/ui/Home/HomeView.ts @@ -3,6 +3,7 @@ import { app, JNGLayerBase } from '../../App'; import { director } from 'cc'; import GRolePVPEntity from '../../battle/base/role/PVP/GRolePVPEntity'; import { Toggle } from 'cc'; +import { JNSyncAction } from '../../../../extensions/ngame/assets/ngame/sync/JNSyncAction'; const { ccclass, property } = _decorator; @ccclass('HomeView') @@ -34,9 +35,11 @@ export class HomeView extends JNGLayerBase { //重置 onClickReset(){ app.sync.onReset(); - this.scheduleOnce(() => { - app.sync.onStart(); - }); + } + + //重置服务器帧 + onClickResetServer(){ + app.socket.Send(JNSyncAction.NSyncFrameReset); } } diff --git a/JisolGameCocos/config/GRoleSkill.xlsx b/JisolGameCocos/config/GRoleSkill.xlsx index b94c709d97478a32a3f3a3becb7fca685a3f96c8..82266c3744d4d393c5ee359290eeac038d89778d 100644 GIT binary patch delta 2453 zcmV;G32OHJSc_S(p8o*c~9&#v?^ATN`N|135g&On`OV2h{TC(L)wvrnF++g3E%+S2g)^Yk~Xvg zG1~v{&!3+hj^=sh+=9|+AtU5_1UVpiAyPSu&{;Behse=}Nx^@zLPCTVpwTGa-3fU~ zd7f_5xPYRbz9T^UnSj5WW4oN3QCqz$Kq%9*iCHNz$2*K7v3N5}x@V3=Tr z;Tq_c9TBaNf_KRBMr92^a10sbAdSYp=i{HQ0hQ}N4>ZX}Gf&N;v~ODJZn6b$!>&Eo zX;-YO%BzA#!}@>w_+oN=+C0@wWj!knC=LauTmdtMikENqU$4(0-q@*rm3WMX&mL>U*iw zTM7knG2#|JtKo2M;K5`GF}3JAjwa-uHY}TV2G?5KpG{nUOo^oqb=2x`ZPcB~S$Waa zz~~!rS{bg5axn4Op@VU%)52Sw{WmMphL5XD71nEvO>%ov%98~H1WFB~4Jt<~MeD4^ zgQcs0jDU65b7+DXl|Q!Hu-p|$Uv8b7=?l865qCp`+ed7Nh*=*I5@HGM)p+sxi2I=p zzeP+T(>7gyNc1PtZMEA#=B*oDkh>vb(MN2*iwFtPO?TP1asQr;Ub?{PpGdd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l1QIcM{fwFE7jI$dkcXv09@Y+oC>(=W5HDbOCJ#Z?`s068JqyafiMFrFbUur zV8Fw`jDay^O9xOy8Y=()fbG_Mm%t#6U2X~ZA#w0LSr8~T6dlQk3k{A0k_AV!|S*k>ucDMkM+K0SuAZo#Fp< w)c;O82&Ax!{-l2gt`h=q;_6Lga3ol4P{|N`+q9`4Y3wVkpKVy diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index 4180e907..eee2a612 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit 4180e907fcd63bbc8769dac502923d0f314dbd76 +Subproject commit eee2a6129cee115fa9f03d0f0a98a12da1e63741 diff --git a/JisolGameServer/pom.xml b/JisolGameServer/pom.xml index e2998623..3b73f5c1 100644 --- a/JisolGameServer/pom.xml +++ b/JisolGameServer/pom.xml @@ -7,12 +7,7 @@ org.example JisolGameServer 1.0-SNAPSHOT - - - cn.jisol - JNGame - 1.0-SNAPSHOT - + jar 8 @@ -24,7 +19,7 @@ cn.jisol JNGame - 1.0-SNAPSHOT + 2.0-SNAPSHOT diff --git a/JisolGameServer/src/main/resources/META-INF/MANIFEST.MF b/JisolGameServer/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..30abd302 --- /dev/null +++ b/JisolGameServer/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: cn.jisol.game.JGameApplication +