From ca5adce58934b7fc156350cd03e5170c29794c3f Mon Sep 17 00:00:00 2001 From: walkpan Date: Tue, 7 Jan 2025 07:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BDlayer=E6=94=B9=E5=8F=98?= =?UTF-8?q?=EF=BC=8C=E4=BD=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/heros/zh1.prefab | 262 +----------------- assets/resources/game/heros/zh2.prefab | 262 +----------------- assets/resources/game/skills/fires.prefab | 4 +- assets/script/game/common/config/GameEvent.ts | 2 + assets/script/game/common/config/SkillSet.ts | 18 +- assets/script/game/hero/BuffComp.ts | 2 + assets/script/game/hero/Hero.ts | 6 - assets/script/game/hero/HeroViewComp.ts | 11 +- assets/script/game/map/MissionComp.ts | 2 + assets/script/game/skills/BezCom.ts | 19 +- assets/script/game/skills/LineCom.ts | 2 + assets/script/game/skills/Skill.ts | 5 +- assets/script/game/skills/SkillCom.ts | 8 +- assets/script/game/skills/TgCom.ts | 5 +- assets/script/game/skills/debuff.ts | 2 + assets/script/game/skills/timedCom.ts | 1 + 16 files changed, 75 insertions(+), 536 deletions(-) diff --git a/assets/resources/game/heros/zh1.prefab b/assets/resources/game/heros/zh1.prefab index da75a41b..6fb76aec 100644 --- a/assets/resources/game/heros/zh1.prefab +++ b/assets/resources/game/heros/zh1.prefab @@ -47,37 +47,31 @@ }, { "__id__": 87 - }, - { - "__id__": 95 - }, - { - "__id__": 103 } ], "_active": true, "_components": [ { - "__id__": 111 + "__id__": 95 }, { - "__id__": 113 + "__id__": 97 }, { - "__id__": 115 + "__id__": 99 }, { - "__id__": 117 + "__id__": 101 }, { - "__id__": 119 + "__id__": 103 }, { - "__id__": 121 + "__id__": 105 } ], "_prefab": { - "__id__": 123 + "__id__": 107 }, "_lpos": { "__type__": "cc.Vec3", @@ -1495,230 +1489,6 @@ "z": 0 } }, - { - "__type__": "cc.Node", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_prefab": { - "__id__": 96 - }, - "__editorExtras__": {} - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 95 - }, - "asset": { - "__uuid__": "b9f0b656-fc60-43f6-bf8b-c3efa8997408", - "__expectedType__": "cc.Prefab" - }, - "fileId": "d9UYSvjCpD24d1H7HhaHEv", - "instance": { - "__id__": 97 - }, - "targetOverrides": null - }, - { - "__type__": "cc.PrefabInstance", - "fileId": "84huy4k/VOL5ykMOpg0H5B", - "prefabRootNode": { - "__id__": 1 - }, - "mountedChildren": [], - "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 98 - }, - { - "__id__": 100 - }, - { - "__id__": 101 - }, - { - "__id__": 102 - } - ], - "removedComponents": [] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_name" - ], - "value": "iced" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "d9UYSvjCpD24d1H7HhaHEv" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "__type__": "cc.Node", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_prefab": { - "__id__": 104 - }, - "__editorExtras__": {} - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 103 - }, - "asset": { - "__uuid__": "59df223f-5afb-41e7-a006-4cef8441130d", - "__expectedType__": "cc.Prefab" - }, - "fileId": "afovdb7bBEUpz+8xJHMv4X", - "instance": { - "__id__": 105 - }, - "targetOverrides": null - }, - { - "__type__": "cc.PrefabInstance", - "fileId": "61izU9WRVJ255b6c6Hu27c", - "prefabRootNode": { - "__id__": 1 - }, - "mountedChildren": [], - "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 106 - }, - { - "__id__": 108 - }, - { - "__id__": 109 - }, - { - "__id__": 110 - } - ], - "removedComponents": [] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_name" - ], - "value": "yun" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "afovdb7bBEUpz+8xJHMv4X" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 87.398, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, { "__type__": "cc.UITransform", "_name": "", @@ -1729,7 +1499,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 112 + "__id__": 96 }, "_contentSize": { "__type__": "cc.Size", @@ -1757,7 +1527,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 114 + "__id__": 98 }, "enabledContactListener": true, "bullet": true, @@ -1791,7 +1561,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 116 + "__id__": 100 }, "tag": 0, "_group": 4, @@ -1825,7 +1595,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 118 + "__id__": 102 }, "anm": { "__id__": 22 @@ -1846,7 +1616,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 120 + "__id__": 104 }, "_id": "" }, @@ -1864,7 +1634,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 106 }, "_id": "" }, @@ -1884,12 +1654,6 @@ "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": [ - { - "__id__": 103 - }, - { - "__id__": 95 - }, { "__id__": 87 }, diff --git a/assets/resources/game/heros/zh2.prefab b/assets/resources/game/heros/zh2.prefab index 51c3c896..676650a8 100644 --- a/assets/resources/game/heros/zh2.prefab +++ b/assets/resources/game/heros/zh2.prefab @@ -47,37 +47,31 @@ }, { "__id__": 87 - }, - { - "__id__": 95 - }, - { - "__id__": 103 } ], "_active": true, "_components": [ { - "__id__": 111 + "__id__": 95 }, { - "__id__": 113 + "__id__": 97 }, { - "__id__": 115 + "__id__": 99 }, { - "__id__": 117 + "__id__": 101 }, { - "__id__": 119 + "__id__": 103 }, { - "__id__": 121 + "__id__": 105 } ], "_prefab": { - "__id__": 123 + "__id__": 107 }, "_lpos": { "__type__": "cc.Vec3", @@ -1495,230 +1489,6 @@ "z": 0 } }, - { - "__type__": "cc.Node", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_prefab": { - "__id__": 96 - }, - "__editorExtras__": {} - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 95 - }, - "asset": { - "__uuid__": "b9f0b656-fc60-43f6-bf8b-c3efa8997408", - "__expectedType__": "cc.Prefab" - }, - "fileId": "d9UYSvjCpD24d1H7HhaHEv", - "instance": { - "__id__": 97 - }, - "targetOverrides": null - }, - { - "__type__": "cc.PrefabInstance", - "fileId": "84huy4k/VOL5ykMOpg0H5B", - "prefabRootNode": { - "__id__": 1 - }, - "mountedChildren": [], - "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 98 - }, - { - "__id__": 100 - }, - { - "__id__": 101 - }, - { - "__id__": 102 - } - ], - "removedComponents": [] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_name" - ], - "value": "iced" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "d9UYSvjCpD24d1H7HhaHEv" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 99 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "__type__": "cc.Node", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_prefab": { - "__id__": 104 - }, - "__editorExtras__": {} - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 103 - }, - "asset": { - "__uuid__": "59df223f-5afb-41e7-a006-4cef8441130d", - "__expectedType__": "cc.Prefab" - }, - "fileId": "afovdb7bBEUpz+8xJHMv4X", - "instance": { - "__id__": 105 - }, - "targetOverrides": null - }, - { - "__type__": "cc.PrefabInstance", - "fileId": "61izU9WRVJ255b6c6Hu27c", - "prefabRootNode": { - "__id__": 1 - }, - "mountedChildren": [], - "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 106 - }, - { - "__id__": 108 - }, - { - "__id__": 109 - }, - { - "__id__": 110 - } - ], - "removedComponents": [] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_name" - ], - "value": "yun" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "afovdb7bBEUpz+8xJHMv4X" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 87.398, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 107 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, { "__type__": "cc.UITransform", "_name": "", @@ -1729,7 +1499,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 112 + "__id__": 96 }, "_contentSize": { "__type__": "cc.Size", @@ -1757,7 +1527,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 114 + "__id__": 98 }, "enabledContactListener": true, "bullet": true, @@ -1791,7 +1561,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 116 + "__id__": 100 }, "tag": 0, "_group": 4, @@ -1825,7 +1595,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 118 + "__id__": 102 }, "anm": { "__id__": 22 @@ -1846,7 +1616,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 120 + "__id__": 104 }, "_id": "" }, @@ -1864,7 +1634,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 106 }, "_id": "" }, @@ -1884,12 +1654,6 @@ "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": [ - { - "__id__": 103 - }, - { - "__id__": 95 - }, { "__id__": 87 }, diff --git a/assets/resources/game/skills/fires.prefab b/assets/resources/game/skills/fires.prefab index d768aeed..5cfad362 100644 --- a/assets/resources/game/skills/fires.prefab +++ b/assets/resources/game/skills/fires.prefab @@ -115,7 +115,7 @@ "_lscale": { "__type__": "cc.Vec3", "x": 1, - "y": 1, + "y": 0.7, "z": 1 }, "_mobility": 0, @@ -251,7 +251,7 @@ "_lscale": { "__type__": "cc.Vec3", "x": 1, - "y": 1, + "y": 0.7, "z": 1 }, "_mobility": 0, diff --git a/assets/script/game/common/config/GameEvent.ts b/assets/script/game/common/config/GameEvent.ts index d141e101..97a9bbde 100644 --- a/assets/script/game/common/config/GameEvent.ts +++ b/assets/script/game/common/config/GameEvent.ts @@ -12,4 +12,6 @@ export enum GameEvent { /** 登陆成功 */ LoginSuccess = "LoginSuccess", MSSelected = "MSSelected", + MissionStart = "MissionStart", + MissionEnd = "MissionEnd", } \ No newline at end of file diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 7d8f7334..15de3841 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -29,22 +29,22 @@ debuff: 0depb:50,:无,1:冰,2:灼烧,3:眩晕,4:降低攻击,5 */ export const SkillSet={ 6001:{uuid: 6001,path: "6001",type: 1,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "寒冰弹",sp_name:"ball_blue",info:"释放一个火球术攻击敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, 6002:{uuid: 6002,path: "6002",type: 1,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "火焰弹",sp_name:"ball_red",info:"释放一个火球术攻击敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, 6003:{uuid: 6003,path: "6003",type: 1,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "魔法弹",sp_name:"ball_green",info:"释放一个火球术攻击敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, 6004:{uuid: 6004,path: "6004",type: 1,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "圣光弹",sp_name:"ball_yellow",info:"释放一个火球术攻击敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, 6005:{uuid: 6005,path: "6005",type: 1,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "无形剑气",sp_name:"patk",info:"释放无形剑气攻击前方直线100码的敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450,}, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450,}, 6006:{uuid: 6006,path: "6006",type: 1,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "射击",sp_name:"arrow",info:"释放无形剑气攻击前方直线100码的敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450,}, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450,}, 6011:{uuid: 6011,path: "6011",type: 2,tg:3,debuff:0,depb:50,debtime:2,derate:1,name: "有形剑气",sp_name:"dadao",info:"释放有形剑气攻击前方直线300码的敌人", in:1,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450,}, @@ -53,7 +53,7 @@ export const SkillSet={ in:1,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450,}, 6013:{uuid: 6013,path: "6013",type: 2,tg:3,debuff:7,depb:50,debtime:2,derate:0.01,name: "火墙",sp_name:"fires",info:"释放有形剑气攻击前方直线300码的敌人", - in:5,count:1,apup:0,ap:1,hp:0,cd:2,shield:0,speed:450,}, + in:10,count:1,apup:0,ap:1,hp:0,cd:2,shield:0,speed:450,}, 6014:{uuid: 6014,path: "6014",type: 2,tg:3,debuff:1,depb:50,debtime:2,derate:1,name: "冰破术",sp_name:"ice",info:"释放有形剑气攻击前方直线300码的敌人", in:1,count:1,apup:0,ap:2,hp:0,cd:1,shield:0,speed:450,}, @@ -68,10 +68,10 @@ export const SkillSet={ in:0.5,count:1,apup:0,ap:1,hp:3,shield:0,speed:450, }, 6018:{uuid: 6018,path: "6018",type: 91,tg:0,debuff:0,depb:50,debtime:2,derate:1,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:1,speed:450, }, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:1,speed:450, }, 6019:{uuid: 6019,path: "6019",type: 91,tg:0,debuff:0,depb:50,debtime:2,derate:1,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人", - in:0.2,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, + in:0.8,count:1,apup:0,ap:1,hp:0,cd:1,shield:0,speed:450, }, } diff --git a/assets/script/game/hero/BuffComp.ts b/assets/script/game/hero/BuffComp.ts index f2742499..83a03220 100644 --- a/assets/script/game/hero/BuffComp.ts +++ b/assets/script/game/hero/BuffComp.ts @@ -4,6 +4,7 @@ import { oops } from 'db://oops-framework/core/Oops'; import { ecs } from 'db://oops-framework/libs/ecs/ECS'; import { Tooltip } from '../skills/Tooltip'; import { timedCom } from '../skills/timedCom'; +import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('BuffComp') @@ -40,6 +41,7 @@ export class BuffComp extends Component { } update(deltaTime: number) { + if(smc.mission.pause) return if(this.ap_cd > 0 ) this.ap_cd -= deltaTime; if(this.ap_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active){ this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false; diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 78474df7..444ebf3c 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -1,10 +1,4 @@ -/* - * @Author: dgflash - * @Date: 2021-11-18 17:47:56 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-04 15:43:04 - */ import { instantiate, Node, Prefab, Vec3 ,v3,resources,SpriteFrame,Sprite,SpriteAtlas} from "cc"; import { UICallbacks } from "../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index ff24a543..c0ce1f7f 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -312,13 +312,12 @@ export class HeroViewComp extends CCComp { } skill_pos(){ - return v3(0,35) + return v3((this.node.position.x,this.node.position.y + 35)) } get_enemy_pos(){ let t_pos:Vec3 = v3(720,0) if(this.enemy){ - t_pos = v3(this.enemy.x-this.node.position.x,this.enemy.y-this.node.position.y) - + t_pos = v3(this.enemy.x,this.enemy.y) } console.log(this.hero_name+":"+this.uuid+"enemy ="+this.enemy.x+" x"+this.node.position.x+" t_pos"+t_pos); return t_pos @@ -328,7 +327,7 @@ export class HeroViewComp extends CCComp { if(!hero.node.isValid){ return }else{ - t_pos = v3(hero.node.position.x-this.node.position.x,hero.node.position.y-this.node.position.y) + t_pos = v3(hero.node.position.x,hero.node.position.y) } return t_pos @@ -555,8 +554,8 @@ export class HeroViewComp extends CCComp { let skill = ecs.getEntity(Skill); let t_pos=this.get_enemy_pos() let pos =this.skill_pos() - pos.y=pos.y + y - pos.x=pos.x + x + pos.y=this.node.position.y + y + pos.x=this.node.position.x + x let is_crit=this.check_crit() skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add); console.log(this.scale+this.hero_name+"使用技能:"+sk+" t_pos:"+t_pos+" box:"+this.box_group,); diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index fe81723d..703cb8b3 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -26,6 +26,7 @@ import { Monster } from "../hero/Mon"; import { UIID } from "../common/config/GameUIConfig"; import { CardControllerComp } from "./CardController"; import { MissionHomeComp } from "./MissionHomeComp"; +import { GameEvent } from "../common/config/GameEvent"; const { ccclass, property } = _decorator; /** 视图层对象 */ @@ -84,6 +85,7 @@ export class MissionComp extends CCComp { } mission_end(){ + oops.message.dispatchEvent(GameEvent.MissionEnd) smc.mission.play=false smc.mission.pause=false let heros:any= this.get_heros();; diff --git a/assets/script/game/skills/BezCom.ts b/assets/script/game/skills/BezCom.ts index 85cf7b82..7cccf41e 100644 --- a/assets/script/game/skills/BezCom.ts +++ b/assets/script/game/skills/BezCom.ts @@ -1,27 +1,28 @@ import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc'; import { SkillCom } from './SkillCom'; +import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('BezCom') export class BezCom extends Component { start() { let base =this.node.getComponent(SkillCom) - if(this.node.parent.scale.x < 0){ - base.t_pos.x=base.t_pos.x*-1 - } - let s_pos = v3(this.node.position.x,this.node.position.y) - let c_pos = v3((base.t_pos.x+this.node.position.x)/2,this.node.position.y+100) - let e_pos = v3(this.node.position.x+base.t_pos.x,this.node.position.y+base.t_pos.y) + // if(this.node.parent.scale.x < 0){ + // base.t_pos.x=base.t_pos.x*-1 + // } + let s_pos = v3(this.node.position.x,this.node.position.y+35) + let c_pos = v3((base.t_pos.x+this.node.position.x)/2,this.node.position.y+200) + let e_pos = v3(base.t_pos.x,this.node.position.y+50) let time =Math.abs(base.t_pos.x/base.speed) - BezCom.bezierTo(this.node,time,s_pos,c_pos,e_pos,{ + BezCom.bezierTo(this.node,base.in_time,s_pos,c_pos,e_pos,{ onComplete: (target?: object) => { base.is_destroy=true - }, + }, }).start(); } update(deltaTime: number) { - + if(smc.mission.pause) return } public static bezierTo(target: any, duration: number, c1: Vec3, c2: Vec3, to: Vec3, opts: any) { diff --git a/assets/script/game/skills/LineCom.ts b/assets/script/game/skills/LineCom.ts index 9b3f6c4c..cf42e72e 100644 --- a/assets/script/game/skills/LineCom.ts +++ b/assets/script/game/skills/LineCom.ts @@ -1,5 +1,6 @@ import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc'; import { SkillCom } from './SkillCom'; +import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('LineCom') @@ -11,6 +12,7 @@ export class LineCom extends Component { } update(deltaTime: number) { + if(smc.mission.pause) return this.node.setPosition(this.node.position.x+this.base.speed*deltaTime,this.node.position.y,this.node.position.z) if(this.node.position.x>1000||this.node.position.x<-1000){ this.base.is_destroy = true diff --git a/assets/script/game/skills/Skill.ts b/assets/script/game/skills/Skill.ts index 8fa6e76d..9e031f60 100644 --- a/assets/script/game/skills/Skill.ts +++ b/assets/script/game/skills/Skill.ts @@ -29,8 +29,9 @@ export class Skill extends ecs.Entity { // console.log("load skill :",path,prefab) var node = instantiate(prefab); pos=v3(pos.x,pos.y) - node.parent = parent; + node.parent = parent.parent; node.setPosition(pos) + if(group==BoxSet.MONSTER) node.setScale(v3(-1*node.scale.x,node.scale.y)); var sv = node.getComponent(SkillCom); // let angle=0 // if(SkillSet[uuid].angle){ @@ -54,7 +55,7 @@ export class Skill extends ecs.Entity { // node.setScale(v3(node.scale.x*scale,node.scale.y)) sv.speed=SkillSet[uuid].speed; sv.in_time=SkillSet[uuid].in; - // if(group==BoxSet.MONSTER) t_pos.x=-1*t_pos.x + sv.t_pos = t_pos; // 目标增量 sv.type = SkillSet[uuid].type; sv.box_tag= BoxSet.SKILL_TAG; diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index ec5de323..b9f5d694 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -5,6 +5,8 @@ import { BoxSet } from "../common/config/BoxSet"; import { smc } from "../common/SingletonModuleComp"; import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; import { HeroViewComp } from "../hero/HeroViewComp"; +import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; +import { GameEvent } from "../common/config/GameEvent"; const { ccclass, property } = _decorator; @@ -35,6 +37,7 @@ export class SkillCom extends CCComp { in_time:number = 0.3; // 不动技能持续时间 enemys:any = []; start() { + oops.message.on(GameEvent.MissionEnd, this.doDestroy, this); this.node.active=true let collider = this.getComponent(Collider2D); collider.group = this.box_group; @@ -73,7 +76,7 @@ export class SkillCom extends CCComp { } update(deltaTime: number) { - + if(smc.mission.pause) return this.toDestroy() } @@ -82,6 +85,9 @@ export class SkillCom extends CCComp { this.ent.destroy() } } + doDestroy(){ + this.is_destroy=true + } /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ reset() { this.is_destroy=false diff --git a/assets/script/game/skills/TgCom.ts b/assets/script/game/skills/TgCom.ts index 508f5c0f..33f84378 100644 --- a/assets/script/game/skills/TgCom.ts +++ b/assets/script/game/skills/TgCom.ts @@ -1,6 +1,7 @@ import { _decorator, Component, Node, v3 } from 'cc'; import { SkillCom } from './SkillCom'; import { BoxSet } from '../common/config/BoxSet'; +import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('TgCom') @@ -10,13 +11,11 @@ export class TgCom extends Component { base:SkillCom = null start() { this.base =this.node.getComponent(SkillCom) - if(this.base.box_group==BoxSet.MONSTER){ - this.base.t_pos.x=-1*this.base.t_pos.x - } this.node.setPosition(this.base.t_pos) } update(deltaTime: number) { + if(smc.mission.pause) return this.cd+=deltaTime if(this.cd>=1){ // this.node.setPosition(v3(-1000,0,0)) diff --git a/assets/script/game/skills/debuff.ts b/assets/script/game/skills/debuff.ts index 0d0cff4b..3ffc002a 100644 --- a/assets/script/game/skills/debuff.ts +++ b/assets/script/game/skills/debuff.ts @@ -1,6 +1,7 @@ import { _decorator, Component, Node } from 'cc'; import { timedCom } from './timedCom'; import { HeroViewComp } from '../hero/HeroViewComp'; +import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('debuff') @@ -16,6 +17,7 @@ export class debuff extends Component { } update(deltaTime: number) { + if(smc.mission.pause) return this.cd += deltaTime if(this.cd >=1){ // this.node.setPosition(v3(-1000,0,0)) diff --git a/assets/script/game/skills/timedCom.ts b/assets/script/game/skills/timedCom.ts index dc13cc42..4f5f4192 100644 --- a/assets/script/game/skills/timedCom.ts +++ b/assets/script/game/skills/timedCom.ts @@ -1,5 +1,6 @@ import { _decorator, Component, Node } from 'cc'; import { SkillSet } from '../common/config/SkillSet'; +import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('timedCom')