From cb844cf65f2cd9c8d2f9f3434a662c714ee3344d Mon Sep 17 00:00:00 2001 From: walkpan Date: Sat, 1 Nov 2025 15:02:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=BA=9B=E5=B0=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/heros/ha1.prefab | 8 +- assets/resources/game/heros/hc1.prefab | 6 +- assets/resources/game/heros/hh1.prefab | 8 +- assets/resources/game/heros/hk1.prefab | 8 +- assets/resources/game/heros/hm1.prefab | 4 +- assets/resources/game/heros/hm2.prefab | 8 +- assets/resources/game/heros/hz1.prefab | 4 +- assets/resources/game/heros/mo1.prefab | 8 +- assets/resources/game/heros/mo2.prefab | 8 +- assets/resources/game/heros/mo3.prefab | 6 +- assets/resources/game/heros/mo4.prefab | 8 +- .../game/skill/anm/m_ball_water_1.anim | 283 +++++++++++++++++- .../game/skill/atk/m_water_ball_1.prefab | 6 +- assets/script/Main.ts | 13 +- assets/script/game/BezierMove/BezierMove.ts | 7 - assets/script/game/common/config/SkillSet.ts | 21 +- assets/script/game/hero/HeroAtk.ts | 2 + assets/script/game/hero/HeroAttrsComp.ts | 3 + assets/script/game/hero/HeroViewComp.ts | 7 +- assets/script/game/hero/SACastSystem.ts | 2 + assets/script/game/hero/SCDSystem.ts | 2 + assets/script/game/hero/SCastSystem.ts | 2 + assets/script/game/map/MissionComp.ts | 9 +- assets/script/game/map/SIconComp.ts | 2 +- assets/script/game/skill/AtkConCom.ts | 236 --------------- assets/script/game/skill/AtkConCom.ts.meta | 9 - assets/script/game/skill/EndAnmCom.ts | 4 +- assets/script/game/skill/SMoveComp.ts | 3 + assets/script/game/skill/SkillView.ts | 5 +- assets/script/game/skill/SkillViewCom.ts | 156 ---------- assets/script/game/skill/SkillViewCom.ts.meta | 9 - settings/v2/packages/project.json | 16 +- 32 files changed, 368 insertions(+), 505 deletions(-) delete mode 100644 assets/script/game/skill/AtkConCom.ts delete mode 100644 assets/script/game/skill/AtkConCom.ts.meta delete mode 100644 assets/script/game/skill/SkillViewCom.ts delete mode 100644 assets/script/game/skill/SkillViewCom.ts.meta diff --git a/assets/resources/game/heros/ha1.prefab b/assets/resources/game/heros/ha1.prefab index 23639e31..a412360e 100644 --- a/assets/resources/game/heros/ha1.prefab +++ b/assets/resources/game/heros/ha1.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -2.8, + "y": 19.2 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 45.2, + "height": 68.4 }, "_id": "" }, diff --git a/assets/resources/game/heros/hc1.prefab b/assets/resources/game/heros/hc1.prefab index 106ee922..73748a46 100644 --- a/assets/resources/game/heros/hc1.prefab +++ b/assets/resources/game/heros/hc1.prefab @@ -1003,12 +1003,12 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -1.6, + "y": 22.8 }, "_size": { "__type__": "cc.Size", - "width": 48.6, + "width": 47.7, "height": 67.5 }, "_id": "" diff --git a/assets/resources/game/heros/hh1.prefab b/assets/resources/game/heros/hh1.prefab index d7d2d3c9..f2f1e639 100644 --- a/assets/resources/game/heros/hh1.prefab +++ b/assets/resources/game/heros/hh1.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -1.2, + "y": 22.5 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 48.5, + "height": 70 }, "_id": "" }, diff --git a/assets/resources/game/heros/hk1.prefab b/assets/resources/game/heros/hk1.prefab index 9c95de47..ab58a058 100644 --- a/assets/resources/game/heros/hk1.prefab +++ b/assets/resources/game/heros/hk1.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -0.8, + "y": 22.6 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 49.3, + "height": 72.9 }, "_id": "" }, diff --git a/assets/resources/game/heros/hm1.prefab b/assets/resources/game/heros/hm1.prefab index 1948b862..06f747d7 100644 --- a/assets/resources/game/heros/hm1.prefab +++ b/assets/resources/game/heros/hm1.prefab @@ -1004,12 +1004,12 @@ "_offset": { "__type__": "cc.Vec2", "x": -1.1, - "y": 33.8 + "y": 29.2 }, "_size": { "__type__": "cc.Size", "width": 48.6, - "height": 67.5 + "height": 76.8 }, "_id": "" }, diff --git a/assets/resources/game/heros/hm2.prefab b/assets/resources/game/heros/hm2.prefab index 91c07ef4..2c848452 100644 --- a/assets/resources/game/heros/hm2.prefab +++ b/assets/resources/game/heros/hm2.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -2, + "y": 21.7 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 46.8, + "height": 63.4 }, "_id": "" }, diff --git a/assets/resources/game/heros/hz1.prefab b/assets/resources/game/heros/hz1.prefab index bed26452..5c2b036b 100644 --- a/assets/resources/game/heros/hz1.prefab +++ b/assets/resources/game/heros/hz1.prefab @@ -1004,12 +1004,12 @@ "_offset": { "__type__": "cc.Vec2", "x": -1.1, - "y": 33.8 + "y": 28.3 }, "_size": { "__type__": "cc.Size", "width": 48.6, - "height": 67.5 + "height": 78.4 }, "_id": "" }, diff --git a/assets/resources/game/heros/mo1.prefab b/assets/resources/game/heros/mo1.prefab index f621616f..6c66cf10 100644 --- a/assets/resources/game/heros/mo1.prefab +++ b/assets/resources/game/heros/mo1.prefab @@ -1000,13 +1000,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -2, + "y": 18.7 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 46.8, + "height": 64.2 }, "_id": "" }, diff --git a/assets/resources/game/heros/mo2.prefab b/assets/resources/game/heros/mo2.prefab index 160f1b84..2e3c9e8b 100644 --- a/assets/resources/game/heros/mo2.prefab +++ b/assets/resources/game/heros/mo2.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -2.4, + "y": 18 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 46, + "height": 55.9 }, "_id": "" }, diff --git a/assets/resources/game/heros/mo3.prefab b/assets/resources/game/heros/mo3.prefab index 6e0a2987..e58f0ac1 100644 --- a/assets/resources/game/heros/mo3.prefab +++ b/assets/resources/game/heros/mo3.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -1.3, + "y": 22.9 }, "_size": { "__type__": "cc.Size", "width": 48.6, - "height": 67.5 + "height": 64.2 }, "_id": "" }, diff --git a/assets/resources/game/heros/mo4.prefab b/assets/resources/game/heros/mo4.prefab index 6d50e3b9..741d6832 100644 --- a/assets/resources/game/heros/mo4.prefab +++ b/assets/resources/game/heros/mo4.prefab @@ -1003,13 +1003,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": -1.1, - "y": 33.8 + "x": -3.2, + "y": 27.5 }, "_size": { "__type__": "cc.Size", - "width": 48.6, - "height": 67.5 + "width": 52.9, + "height": 80.1 }, "_id": "" }, diff --git a/assets/resources/game/skill/anm/m_ball_water_1.anim b/assets/resources/game/skill/anm/m_ball_water_1.anim index 108c0372..621d8d45 100644 --- a/assets/resources/game/skill/anm/m_ball_water_1.anim +++ b/assets/resources/game/skill/anm/m_ball_water_1.anim @@ -1,7 +1,7 @@ [ { "__type__": "cc.AnimationClip", - "_name": "m_ball_blue1", + "_name": "m_ball_water_1", "_objFlags": 0, "__editorExtras__": { "embeddedPlayerGroups": [] @@ -16,13 +16,16 @@ "_tracks": [ { "__id__": 1 + }, + { + "__id__": 7 } ], "_exoticAnimation": null, "_events": [], "_embeddedPlayers": [], "_additiveSettings": { - "__id__": 7 + "__id__": 18 }, "_auxiliaryCurveEntries": [] }, @@ -92,6 +95,282 @@ } ] }, + { + "__type__": "cc.animation.VectorTrack", + "_binding": { + "__type__": "cc.animation.TrackBinding", + "path": { + "__id__": 8 + }, + "proxy": null + }, + "_channels": [ + { + "__id__": 10 + }, + { + "__id__": 12 + }, + { + "__id__": 14 + }, + { + "__id__": 16 + } + ], + "_nComponents": 3 + }, + { + "__type__": "cc.animation.TrackPath", + "_paths": [ + { + "__id__": 9 + }, + "scale" + ] + }, + { + "__type__": "cc.animation.HierarchyPath", + "path": "Node" + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 11 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [ + 0, + 0.06666666666666667, + 0.13333333333333333, + 0.2 + ], + "_values": [ + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": -1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": -1.2, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": -1.2, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": -1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + } + ], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 13 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [ + 0, + 0.06666666666666667, + 0.13333333333333333, + 0.2 + ], + "_values": [ + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1.2, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1.2, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + } + ], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 15 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [ + 0, + 0.06666666666666667, + 0.13333333333333333, + 0.2 + ], + "_values": [ + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 1, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + } + ], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 17 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [], + "_values": [], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, { "__type__": "cc.AnimationClipAdditiveSettings", "enabled": false, diff --git a/assets/resources/game/skill/atk/m_water_ball_1.prefab b/assets/resources/game/skill/atk/m_water_ball_1.prefab index 92e696d5..278d2a23 100644 --- a/assets/resources/game/skill/atk/m_water_ball_1.prefab +++ b/assets/resources/game/skill/atk/m_water_ball_1.prefab @@ -61,8 +61,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, + "x": 0.7, + "y": 0.7, "z": 1 }, "_mobility": 0, @@ -285,8 +285,6 @@ }, "atk_x": 0, "atk_y": 0, - "runType": 0, - "endType": 2, "_id": "" }, { diff --git a/assets/script/Main.ts b/assets/script/Main.ts index cd08f52b..eb8f5af2 100644 --- a/assets/script/Main.ts +++ b/assets/script/Main.ts @@ -12,14 +12,11 @@ const { ccclass, property } = _decorator; @ccclass('Main') export class Main extends Root { start() { - // if(this.isWxClient()){ - // WxCloudApi.init("cloud1-6gknw0qk911036d8") - // } - // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb | - // EPhysics2DDrawFlags.Pair - // EPhysics2DDrawFlags.CenterOfMass | - // EPhysics2DDrawFlags.Joint | - // EPhysics2DDrawFlags.Shape; + PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb + // |EPhysics2DDrawFlags.Pair + // |EPhysics2DDrawFlags.CenterOfMass + // |EPhysics2DDrawFlags.Joint + // |EPhysics2DDrawFlags.Shape; } protected async run() { smc.initialize = ecs.getEntity(Initialize); diff --git a/assets/script/game/BezierMove/BezierMove.ts b/assets/script/game/BezierMove/BezierMove.ts index 5ea5ea32..00021fb6 100644 --- a/assets/script/game/BezierMove/BezierMove.ts +++ b/assets/script/game/BezierMove/BezierMove.ts @@ -1,6 +1,5 @@ import { _decorator, Component, Node, view, UITransform, Vec3, math, EventHandler, Graphics, Color, TweenEasing, Enum } from 'cc'; import { smc } from '../common/SingletonModuleComp'; -import { AtkConCom } from '../skill/AtkConCom'; const { ccclass, property } = _decorator; // 定义缓动类型枚举 @@ -154,12 +153,6 @@ export class BezierMove extends Component { this._isMoving = false; // 触发移动完成事件 // console.log("onMoveComplete") - - let acom=this.node.getComponent(AtkConCom) - let skill=acom - if(skill){ - skill.doDestroy() - } this._moveEndCallback && this._moveEndCallback.apply(this._moveEndTarget); // 清除轨迹 if (this.showTrajectory && this._graphics) { diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 0e4a44b1..191db25f 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -143,26 +143,26 @@ interface IEndAnm { } // 技能配置接口 - 按照6001格式排列 export interface SkillConfig { - uuid:number,name:string,sp_name:string,AtkedName:AtkedName,path:string,TGroup:TGroup,SType:SType,act:string,DTType:DTType,DType:DType, - ap:number,cd:number,t_num:number,hit_num:number,hit:number,hitcd:number,speed:number,cost:number,with:number,ready:number,endAnm:number,RType:RType,EType:EType, + uuid:number,name:string,sp_name:string,icon:string,TGroup:TGroup,SType:SType,act:string,DTType:DTType,DType:DType, + ap:number,cd:number,t_num:number,hit_num:number,hit:number,hitcd:number,speed:number,cost:number,with:number,ready:number,EAnm:number,DAnm:number,RType:RType,EType:EType, buffs:BuffConf[],neAttrs:NeAttrsConf[],info:string,hero?:number , } export const SkillSet: Record = { // ========== 基础攻击 ========== 6001-6099 6001: { - uuid:6001,name:"挥击",sp_name:"atk_s1",AtkedName:AtkedName.atked,path:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK, - ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,ready:0,endAnm:0,RType:RType.fixed,EType:EType.animationEnd, + uuid:6001,name:"挥击",sp_name:"atk_s1",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK, + ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害", }, 6002: { - uuid:6002,name:"挥砍",sp_name:"atk_s2",AtkedName:AtkedName.atked,path:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK, - ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,ready:0,endAnm:0,RType:RType.fixed,EType:EType.animationEnd, + uuid:6002,name:"挥砍",sp_name:"atk_s2",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK, + ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害", }, 6005: { - uuid:6005,name:"水球",sp_name:"m_water_ball_1",AtkedName:AtkedName.atked,path:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.MAGE, - ap:100,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:20,with:90,ready:8001,endAnm:9001,RType:RType.linear,EType:EType.collision, + uuid:6005,name:"水球",sp_name:"m_water_ball_1",icon:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.MAGE, + ap:100,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:20,with:90,ready:8001,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision, buffs:[],neAttrs:[],info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧", }, @@ -173,9 +173,10 @@ export const SkillReadyConf: Record = { 8001:{uuid:8001,loop:false,SkillTime:0,ReadyTime:0,RType:0,ready_y:0,path:"fire1"}, }; -export const EndAnmConf: Record = { +//技能结束动画EAnm 和集中后动画DAnm, 共用设定数组 +export const EAnmConf: Record = { 0:{uuid:0,path:"",loop:false,time:0}, // 无结束动画 - 9001:{uuid:9001,path:"end1",loop:false,time:0}, + 9001:{uuid:9001,path:"atked",loop:false,time:0}, }; \ No newline at end of file diff --git a/assets/script/game/hero/HeroAtk.ts b/assets/script/game/hero/HeroAtk.ts index c86d4acb..727ea264 100644 --- a/assets/script/game/hero/HeroAtk.ts +++ b/assets/script/game/hero/HeroAtk.ts @@ -6,6 +6,7 @@ import { SkillSet } from "../common/config/SkillSet"; import { HeroAttrsComp } from "./HeroAttrsComp"; import { HeroViewComp } from "./HeroViewComp"; import { DamageQueueComp, DamageEvent, DamageQueueHelper } from "./DamageQueueComp"; +import { smc } from "../common/SingletonModuleComp"; /** 业务层对象 */ @ecs.register('HeroAtk') @@ -39,6 +40,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd * 处理伤害队列中的所有伤害事件 */ update(e: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const model = e.get(HeroAttrsComp); const damageQueue = e.get(DamageQueueComp); diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 9b97bfa6..0eb417a6 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -1,4 +1,5 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; +import { smc } from "../common/SingletonModuleComp"; import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs"; import { BuffConf, SkillSet } from "../common/config/SkillSet"; import { HeroInfo, AttrSet, HeroUpSet } from "../common/config/heroSet"; @@ -417,6 +418,7 @@ export class HeroAttrSystem extends ecs.ComblockSystem * 实体首次进入系统时调用(每个实体只调用一次) */ entityEnter(e: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const model = e.get(HeroAttrsComp); if (!model) return; @@ -439,6 +441,7 @@ export class HeroAttrSystem extends ecs.ComblockSystem * - 这是正确的设计,不是 bug */ update(e: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const model = e.get(HeroAttrsComp); if (!model || model.is_dead) return; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 7eac3c46..58f2f0cc 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -4,7 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu import { HeroSpine } from "./HeroSpine"; import { BoxSet, FacSet } from "../common/config/BoxSet"; import { smc } from "../common/SingletonModuleComp"; -import { SkillSet,} from "../common/config/SkillSet"; +import { EAnmConf, SkillSet,} from "../common/config/SkillSet"; import { oops } from "db://oops-framework/core/Oops"; import { GameEvent } from "../common/config/GameEvent"; import { TooltipTypes } from "../common/config/Mission"; @@ -285,7 +285,7 @@ export class HeroViewComp extends CCComp { // 视图层表现 let SConf=SkillSet[s_uuid] this.back() - this.showDamage(damage, isCrit, SConf.AtkedName); // 暴击状态由战斗系统内部处理 + this.showDamage(damage, isCrit, SConf.DAnm); // 暴击状态由战斗系统内部处理, DAnm和EAnm共用设定数组 } //后退 back(){ @@ -347,7 +347,8 @@ export class HeroViewComp extends CCComp { /** 显示伤害数字 */ - showDamage(damage: number, isCrit: boolean,anm:string="atked") { + showDamage(damage: number, isCrit: boolean,DAnm:number) { + let anm=EAnmConf[DAnm].path // DAnm和EAnm共用设定数组 this.damageQueue.push({ damage, isCrit, diff --git a/assets/script/game/hero/SACastSystem.ts b/assets/script/game/hero/SACastSystem.ts index 07651a00..cec13dfb 100644 --- a/assets/script/game/hero/SACastSystem.ts +++ b/assets/script/game/hero/SACastSystem.ts @@ -5,6 +5,7 @@ import { HeroViewComp } from "./HeroViewComp"; import { SkillSet, SType } from "../common/config/SkillSet"; import { HeroSkillsComp, SkillSlot } from "./HeroSkills"; import { Skill } from "../skill/Skill"; +import { smc } from "../common/SingletonModuleComp"; /** * ==================== 自动施法系统 ==================== @@ -29,6 +30,7 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat } update(e: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const skills = e.get(HeroSkillsComp); const heroAttrs = e.get(HeroAttrsComp); const heroView = e.get(HeroViewComp); diff --git a/assets/script/game/hero/SCDSystem.ts b/assets/script/game/hero/SCDSystem.ts index bd2cdfa3..a5600485 100644 --- a/assets/script/game/hero/SCDSystem.ts +++ b/assets/script/game/hero/SCDSystem.ts @@ -1,4 +1,5 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; +import { smc } from "../common/SingletonModuleComp"; import { HeroSkillsComp } from "./HeroSkills"; /** @@ -23,6 +24,7 @@ export class SkillCDSystem extends ecs.ComblockSystem implements ecs.ISystemUpda } update(e: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const skills = e.get(HeroSkillsComp); if (!skills) return; diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 0a19d7f6..7a06b5be 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -6,6 +6,7 @@ import { SkillSet, SType } from "../common/config/SkillSet"; import { HeroSkillsComp } from "./HeroSkills"; import { Skill } from "../skill/Skill"; import { CSRequestComp } from "../skill/STagComps"; +import { smc } from "../common/SingletonModuleComp"; /** * ==================== 技能施法系统 手动施法==================== @@ -37,6 +38,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.IEntityEnterS * 实体进入时触发(即请求施法时) */ entityEnter(e: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const skillsComp = e.get(HeroSkillsComp); const heroAttrs = e.get(HeroAttrsComp); const request = e.get(CSRequestComp); diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 3238f97a..583126a6 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -7,8 +7,7 @@ import { FightSet} from "../common/config/Mission"; import { GameEvent } from "../common/config/GameEvent"; import { HeroViewComp } from "../hero/HeroViewComp"; import { UIID } from "../common/config/GameUIConfig"; -import { AtkConCom } from "../skill/AtkConCom"; -import { SkillViewCom } from "../skill/SkillViewCom"; +import { SkillView } from "../skill/SkillView"; const { ccclass, property } = _decorator; @@ -141,10 +140,8 @@ export class MissionComp extends CCComp { ecs.query(ecs.allOf(HeroViewComp)).forEach(entity => { entity.destroy(); }); - ecs.query(ecs.allOf(AtkConCom)).forEach(entity => { - entity.destroy(); - }); - ecs.query(ecs.allOf(SkillViewCom)).forEach(entity => { + + ecs.query(ecs.allOf(SkillView)).forEach(entity => { entity.destroy(); }); } diff --git a/assets/script/game/map/SIconComp.ts b/assets/script/game/map/SIconComp.ts index c5c45c07..7e273dee 100644 --- a/assets/script/game/map/SIconComp.ts +++ b/assets/script/game/map/SIconComp.ts @@ -18,7 +18,7 @@ export class SIconCompComp extends CCComp { update_data(s_uuid:number){ let skill_data = SkillSet[s_uuid] - this.node.getChildByName("icon").getComponent(Sprite).spriteFrame = oops.res.get("game/heros/cards/"+skill_data.path, SpriteFrame) + this.node.getChildByName("icon").getComponent(Sprite).spriteFrame = oops.res.get("game/heros/cards/"+skill_data.icon, SpriteFrame) } /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ diff --git a/assets/script/game/skill/AtkConCom.ts b/assets/script/game/skill/AtkConCom.ts deleted file mode 100644 index 7b5fcb41..00000000 --- a/assets/script/game/skill/AtkConCom.ts +++ /dev/null @@ -1,236 +0,0 @@ -import { _decorator, Animation, CCBoolean, Collider2D, Contact2DType, Tween, UITransform, v3, Vec3 } from "cc"; -import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; -import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; -import { BezierMove } from "../BezierMove/BezierMove"; -import { DTType, EType, SkillSet, SType } from "../common/config/SkillSet"; -import { BoxSet, FacSet } from "../common/config/BoxSet"; -import { HeroViewComp } from "../hero/HeroViewComp"; -import { GameEvent } from "../common/config/GameEvent"; -import { smc } from "../common/SingletonModuleComp"; -import { Attrs } from "../common/config/HeroAttrs"; -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('AtkConCom') -@ecs.register('AtkCon', false) -export class AtkConCom extends CCComp { - @property - public anmEnd: boolean = false; - @property - public cbox: boolean = false; - // 核心标识和配置 - s_uuid:number = 0; - // 运行时状态(必须缓存的) - is_destroy:boolean = false; - startPos: Vec3 = v3(); // 起始位置 - targetPos: Vec3 = v3(); // 目标位置 - group:number = 0; //阵营 - fac:number=0; //阵营 - run_time:number = 0; - // 战斗相关运行时数据 - Attrs:any=null - hit_count:number = 0; - // 组件引用 - anim:Animation=null; - tweenInstance:Tween = null; - private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向 - // 缓存的配置对象(避免重复查找) - public Config: any = null; - private isInitialized: boolean = false; - private initializeConfig() { - if (this.isInitialized) return; - // 缓存技能配置,避免重复查找 - this.Config = SkillSet[this.s_uuid]; - if (!this.Config) { - // console.error("[SkillCom] 技能配置不存在:", this.s_uuid); - return; - } - this.isInitialized = true; - // console.log("[SkillCom] 技能配置初始化完成:", this.s_uuid, this.Config.name); - } - start() { - this.initializeConfig(); - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - // this.on(ModuleEvent.Cmd, this.onHandler, this); - - this.anim=this.node.getComponent(Animation) - this.on(GameEvent.MissionEnd, this.doDestroy, this); - this.node.active = true; - let collider = this.getComponent(Collider2D); - if(collider) { - collider.group = this.group; - collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); - } - } - do_anim(){ - if(this.node.getComponent(Animation)){ - let anim = this.node.getComponent(Animation); - //console.log("[SkillCom]:has anim",anim) - anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this); - } - - } - do_parabolic(){ - let bm=this.node.getComponent(BezierMove) - this.node.angle +=10 - // bm.speed=700 - if(this.group==BoxSet.MONSTER) {bm.controlPointSide=-1 } - bm.rotationSmoothness=0.6 - bm.moveTo(this.targetPos) - } - do_line(){ - let bm=this.node.getComponent(BezierMove) - let s_x=this.startPos.x - let s_y=this.startPos.y - let t_x=this.targetPos.x - let t_y=this.targetPos.y - // 设定目标x - this.targetPos.x = 400; - if(this.group == BoxSet.MONSTER) { - bm.controlPointSide = -1; - this.targetPos.x = -400; - } - // 计算斜率 - const k = (t_y - s_y) / (t_x - s_x); - // 按直线公式计算新的y - this.targetPos.y = k * (this.targetPos.x - s_x) + s_y; - bm.controlPointOffset=0 - bm.rotationSmoothness=0.6 - bm.moveTo(this.targetPos); - } - do_fixedEnd(){ - this.node.setPosition(this.targetPos.x > 360?300:this.targetPos.x,this.node.position.y,0) - this.do_anim() - } - do_fixedStart(){ - this.node.setPosition(this.startPos.x,this.node.position.y,0) - this.do_anim() - } - - onAnimationFinished(){ - // console.log("[SkillCom]:onAnimationFinished",this.s_uuid) - if (!this.Config) return; - - if(this.Config.EType==EType.timeEnd) return - if(this.Config.SType!=SType.damage){ - - } - this.is_destroy=true - } - onBeginContact (seCol: Collider2D, oCol: Collider2D) { - // console.log(this.scale+"碰撞开始 ",seCol,oCol); - if(seCol.node.position.x-oCol.node.position.x > 100 ) return - let target = oCol.getComponent(HeroViewComp) - if(oCol.group!=this.group){ - if(target == null) return; - if (!this.Config) return; - // console.log("[SkillCom]:onBeginContact oCol||seCol",oCol.node.position,seCol.node.position) - this.single_damage(target,this.Config.DTType==DTType.range?true:false) - // this.ent.destroy() - } - } - //单体伤害 - single_damage(target:HeroViewComp,is_range:boolean=false){ - // //console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit) - // if(this.hit_count > 0&&!is_range) this.ap=this.ap*(50+this.puncture_damage)/100 // 穿刺后 伤害减半,过滤范围伤害 - if(target == null) return; - if (!this.Config) return; - let damage=Math.floor(this.Attrs[Attrs.AP]*(SkillSet[this.s_uuid].ap/100)) - if(this.hit_count > 0 &&!is_range ){ - let Percentage=Math.pow((50+this.Attrs[Attrs.PUNCTURE_DMG])/100, this.hit_count) - damage=damage*Percentage - } - target.do_atked(damage,this.Attrs,this.s_uuid) // ap 及暴击 属性已经在skill.ts 处理 - // console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position) - this.hit_count++ - // console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.Config.hit,this.puncture) - if(this.hit_count>=(this.Config.hit+this.Attrs[Attrs.PUNCTURE])&&(this.Config.DTType!=DTType.range)&&(this.Config.EType!=EType.animationEnd)&&(this.Config.EType!=EType.timeEnd)) this.is_destroy=true // 技能命中次数 - } - update(deltaTime: number) { - // 确保配置已初始化(处理 update 可能先于 start 执行的情况) - if (!this.isInitialized) { - this.initializeConfig(); - if (!this.Config) return; - } - - if(smc.mission.pause) { - if(this.anim) this.anim.pause() - return; - } - if(this.anim) this.anim.resume() - if (!this.node || !this.node.isValid) return; - - if(this.Config.EType==EType.timeEnd){ - this.run_time+=deltaTime - if(this.run_time>this.Config.in){ - // //console.log("[SkillCom]: timeEnd destroy",this.s_uuid,this.run_time) - this.is_destroy=true - } - } - - this.toDestroy(); - } - public atk(args:any){ - let dis=this.node.getComponent(UITransform).width/2 - let targetsInRange: HeroViewComp[] = [] - - // 收集范围内所有敌方目标 - ecs.query(ecs.allOf(HeroViewComp)).some(e => { - const view = e.get(HeroViewComp); - if(view.fac!=this.fac) { - const distance = Math.abs(this.node.position.x - view.node.position.x); - if(distance <= dis) { - targetsInRange.push(view); - } - } - }); - - // 根据配置的hit_num决定攻击模式 - const hitNum = SkillSet[this.s_uuid].hit_num || 0; - if(hitNum > 0) { - // 限制目标数量:按距离排序,选择最近的N个目标 - if(targetsInRange.length > 0) { - // 按距离排序(从近到远) - targetsInRange.sort((a, b) => { - const distanceA = Math.abs(this.node.position.x - a.node.position.x); - const distanceB = Math.abs(this.node.position.x - b.node.position.x); - return distanceA - distanceB; - }); - - // 限制目标数量 - const maxTargets = Math.min(hitNum, targetsInRange.length); - const selectedTargets = targetsInRange.slice(0, maxTargets); - - selectedTargets.forEach(target => { - this.single_damage(target, false); - }); - } - } else { - // 范围伤害:对所有范围内目标造成伤害 - if(targetsInRange.length > 0) { - targetsInRange.forEach(target => { - this.single_damage(target, false); - }); - } - } - } - toDestroy() { - if(this.is_destroy){ - if (this.ent) { - this.ent.destroy(); - } else { - // 如果ent不存在,直接销毁节点 - if (this.node && this.node.isValid) { - this.node.destroy(); - } - } - } - } - doDestroy(){ - // //console.log("[SkillCom]:doDestroy") - this.is_destroy=true - } - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/skill/AtkConCom.ts.meta b/assets/script/game/skill/AtkConCom.ts.meta deleted file mode 100644 index acc84afa..00000000 --- a/assets/script/game/skill/AtkConCom.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.24", - "importer": "typescript", - "imported": true, - "uuid": "411a8c58-dab3-45d4-92d9-9fe420a9faa0", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/skill/EndAnmCom.ts b/assets/script/game/skill/EndAnmCom.ts index bf13a961..6e48f67b 100644 --- a/assets/script/game/skill/EndAnmCom.ts +++ b/assets/script/game/skill/EndAnmCom.ts @@ -1,4 +1,5 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; +import { smc } from "../common/SingletonModuleComp"; /** 业务层对象 */ @ecs.register('EndAnmCom') @@ -17,8 +18,7 @@ export class EndAnmComSystem extends ecs.ComblockSystem implements ecs.IEntityEn entityEnter(e: ecs.Entity): void { // 注:自定义业务逻辑 - - + if(!smc.mission.play || smc.mission.pause) return; e.remove(EndAnmComComp); } } \ No newline at end of file diff --git a/assets/script/game/skill/SMoveComp.ts b/assets/script/game/skill/SMoveComp.ts index 3e9ec036..cef4d759 100644 --- a/assets/script/game/skill/SMoveComp.ts +++ b/assets/script/game/skill/SMoveComp.ts @@ -3,6 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec import { RType, EType, SkillSet } from "../common/config/SkillSet"; import { BoxSet } from "../common/config/BoxSet"; import { SkillView } from "./SkillView"; +import { smc } from "../common/SingletonModuleComp"; /** * ==================== 技能移动数据组件 ==================== @@ -283,6 +284,7 @@ export class SMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate } entityEnter(entity: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const moveComp = entity.get(SMoveDataComp); const skillView = entity.get(SkillView); @@ -354,6 +356,7 @@ export class SMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate } update(entity: ecs.Entity): void { + if(!smc.mission.play || smc.mission.pause) return; const moveComp = entity.get(SMoveDataComp); const skillView = entity.get(SkillView); diff --git a/assets/script/game/skill/SkillView.ts b/assets/script/game/skill/SkillView.ts index fb83c3d7..15112607 100644 --- a/assets/script/game/skill/SkillView.ts +++ b/assets/script/game/skill/SkillView.ts @@ -15,7 +15,7 @@ import { DamageQueueHelper } from "../hero/DamageQueueComp"; const { ccclass, property } = _decorator; /** 视图层对象 */ -@ccclass('SkillViewComp') +@ccclass('SkillView') @ecs.register('SkillView', false) export class SkillView extends CCComp { /** 视图层逻辑代码分离演示 */ @@ -38,6 +38,7 @@ export class SkillView extends CCComp { if(collider) { collider.group = this.group; collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); + console.log(`[skillView] ${this.sData.caster.ent.get(HeroAttrsComp).hero_name}的 ${this.SConf.name} 碰撞组 ${this.group}`) } if(this.node.getComponent(Animation)){ let anim = this.node.getComponent(Animation); @@ -47,7 +48,7 @@ export class SkillView extends CCComp { } onBeginContact (seCol: Collider2D, oCol: Collider2D) { - // console.log(this.scale+"碰撞开始 ",seCol,oCol); + console.log(`[skillView] ${this.sData.caster.ent.get(HeroAttrsComp).hero_name}的 ${this.SConf.name} 碰撞了 ${oCol.getComponent(HeroViewComp).ent.get(HeroAttrsComp).hero_name}`); if(this.SConf.EType!=EType.collision) return let target = oCol.getComponent(HeroViewComp) let model=target.ent.get(HeroAttrsComp) diff --git a/assets/script/game/skill/SkillViewCom.ts b/assets/script/game/skill/SkillViewCom.ts deleted file mode 100644 index 5a889b0f..00000000 --- a/assets/script/game/skill/SkillViewCom.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { _decorator, CCBoolean, CCFloat, CCInteger, instantiate, Node, Prefab, v3, Vec3 } from "cc"; -import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; -import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; -import { HeroViewComp } from "../hero/HeroViewComp"; -import { RType, SkillSet } from "../common/config/SkillSet"; -import { AtkConCom } from "./AtkConCom"; -import { BoxSet } from "../common/config/BoxSet"; - -const { ccclass, property } = _decorator; - -/** 视图层对象 */ -@ccclass('SkillViewCom') -@ecs.register('SkillView', false) -export class SkillViewCom extends CCComp { - /** 视图层逻辑代码分离演示 */ - @property({ type: Prefab }) - atkPrefab: Prefab = null! - @property - hasReady: boolean = false - @property - withHero: boolean = true - @property - ReadyLoop: boolean = false // 预备是否循环 - @property({ type: CCFloat }) - SkillTime: number = 0 // 技能控制存续时间时间 - @property({ type: CCFloat }) - ReadyTime: number = 0 // 技能前摇时间 - @property({ type: CCInteger }) - runType: number = 0 //技能运行类型 0-线性 1-贝塞尔 2-开始位置固定 3-目标位置固定 - @property({ type: CCInteger }) - ready_y: number = 0 - @property({ type: CCInteger }) - atk_x: number = 0 - @property({ type: CCInteger }) - atk_y: number = 0 - @property({ type: CCInteger }) - s_count:number=1; - @property({ type: CCFloat }) - s_interval:number=0.2; - - endTime: number = 0; - readyFinish: boolean = false; - caster:HeroViewComp=null!; - s_uuid:number=0; - s_cd:number=0; - scale: number = 0; - cName:string=""; - target:HeroViewComp=null; - parent:Node=null; - target_postions:any[]=null - group:number=0 - fac:number=0 - // 战斗相关运行时数据 - Attrs:any=null - startPos:any=null - targetPos:any=null - start() { - // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 - this.node.getChildByName("ready").active = this.hasReady - this.node.setPosition(this.caster.node.position.x,this.caster.node.position.y+this.ready_y) - } - protected update(dt: number): void { - this.doTimer(dt) - this.move(dt) - this.doEnd(dt) - this.do_cd(dt) - if(this.readyFinish) this.doAtk(dt) - } - doEnd(dt: number) { - this.endTime += dt - if(this.endTime >= this.SkillTime) { - this.ent.destroy() - } - } - - doTimer(dt: number){ - if(this.ReadyTime > 0) this.ReadyTime -= dt - if(this.ReadyTime <=0) this.readyFinish=true - } - doAtk(dt:number): void { - if(this.s_cd <= 0&&this.s_count > 0) { - this.doSkill() - this.s_count-- - this.s_cd = this.s_interval - } - } - do_cd(dt:number){ - if(this.s_cd > 0) this.s_cd -= dt - } - doSkill(){ - if(this.atkPrefab!=null){ - let atkNode:Node = instantiate(this.atkPrefab) - atkNode.parent = this.node.parent - atkNode.setPosition(v3(this.node.position.x + this.atk_x*atkNode.scale.x, this.node.position.y + this.atk_y)) - if(this.node.scale.x < 0){ - atkNode.setScale(v3(atkNode.scale.x*-1,atkNode.scale.y,atkNode.scale.z)) - } - let atkCom=atkNode.getComponent(AtkConCom) - // 计算延长后的目标点坐标 - const originalStart = v3(this.node.position.x + this.atk_x, this.node.position.y + this.atk_y); - const originalTarget = v3(this.targetPos[0].x, this.targetPos[0].y + BoxSet.ATK_Y); - const direction = new Vec3(); - Vec3.subtract(direction, originalTarget, originalStart); - const distance = direction.length(); - direction.normalize(); - const extendedTarget = new Vec3(); - Vec3.scaleAndAdd(extendedTarget, originalTarget, direction, 720); - Object.assign(atkCom, { - // 核心标识 - s_uuid: this.s_uuid, - // 位置和施法者信息 - startPos: originalStart, - targetPos: extendedTarget, - group: this.group, - fac: this.fac, - // 技能数值 - Attrs:this.Attrs - - }); - switch(this.runType){ - case RType.linear: - this.do_linear(atkNode) - break - case RType.bezier: - this.do_bezier(atkNode) - break - case RType.fixed: - this.do_fixed(atkNode) - break - case RType.fixedEnd: - this.do_fixedEnd(atkNode) - break - } - } - } - do_linear(atkNode:any): void { - atkNode.getComponent(AtkConCom).do_line() - } - do_bezier(atkNode:any): void { - atkNode.getComponent(AtkConCom).do_parabolic() - } - do_fixed(atkNode:any): void { - atkNode.getComponent(AtkConCom).do_fixedStart() - } - do_fixedEnd(atkNode:any): void { - atkNode.getComponent(AtkConCom).do_fixedEnd() - } - move(dt: number): void { - // console.log(`${this.cName}_[SkillViewCom] move`) - if(this.caster != null&&this.caster.node!=null&&this.withHero) this.node.setPosition(this.caster.node.position.x,this.caster.node.position.y+this.ready_y) - // console.log(`${this.cName}_[skillview]move`,this.caster.node.position,this.node.position) - } - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/skill/SkillViewCom.ts.meta b/assets/script/game/skill/SkillViewCom.ts.meta deleted file mode 100644 index 01a12cda..00000000 --- a/assets/script/game/skill/SkillViewCom.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.24", - "importer": "typescript", - "imported": true, - "uuid": "fa24efd6-db87-4a3a-957f-cde0cc3a4054", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/settings/v2/packages/project.json b/settings/v2/packages/project.json index b988f89d..1d0b32b9 100644 --- a/settings/v2/packages/project.json +++ b/settings/v2/packages/project.json @@ -36,23 +36,15 @@ { "index": 2, "name": "HERO" - }, - { - "index": 5, - "name": "PLAYER" - }, - { - "index": 6, - "name": "BOSS" } ], "collisionMatrix": { - "0": 103, - "1": 55, - "2": 79, + "0": 64, + "1": 20, + "2": 74, "3": 36, "4": 66, - "5": 11, + "5": 8, "6": 21 }, "gravity": {