群体技能还是需要修改

This commit is contained in:
2025-07-17 10:09:52 +08:00
parent 5a9da59acc
commit db026e990d
7 changed files with 26 additions and 40 deletions

View File

@@ -106,8 +106,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0, "z": 0.7071067811865475,
"w": 1 "w": 0.7071067811865476
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -121,7 +121,7 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 90
}, },
"_id": "" "_id": ""
}, },

View File

@@ -106,8 +106,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0.7071067811865475, "z": 1,
"w": 0.7071067811865476 "w": 6.123233995736766e-17
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -121,7 +121,7 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 90 "z": 180
}, },
"_id": "" "_id": ""
}, },

View File

@@ -103,8 +103,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0, "z": 0.7071067811865475,
"w": 1 "w": 0.7071067811865476
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -118,7 +118,7 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 90
}, },
"_id": "" "_id": ""
}, },

View File

@@ -103,8 +103,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0, "z": 0.7071067811865475,
"w": 1 "w": 0.7071067811865476
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -118,7 +118,7 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 90
}, },
"_id": "" "_id": ""
}, },

View File

@@ -103,8 +103,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0, "z": 0.7071067811865475,
"w": 1 "w": 0.7071067811865476
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -118,7 +118,7 @@
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 90
}, },
"_id": "" "_id": ""
}, },

View File

@@ -268,10 +268,10 @@
}, },
"speed": 600, "speed": 600,
"controlPointSide": 1, "controlPointSide": 1,
"controlPointOffset": 0.5, "controlPointOffset": 0,
"controlPointRandomness": 0.3, "controlPointRandomness": 0,
"autoRotate": true, "autoRotate": false,
"showTrajectory": true, "showTrajectory": false,
"trajectoryColor": { "trajectoryColor": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 0, "r": 0,
@@ -281,7 +281,7 @@
}, },
"trajectoryWidth": 3, "trajectoryWidth": 3,
"easing": "linear", "easing": "linear",
"rotationSmoothness": 0.6, "rotationSmoothness": 0,
"_id": "" "_id": ""
}, },
{ {

View File

@@ -28,7 +28,7 @@ export class SkillConComp extends CCComp {
private aoe_timers: Map<number, number> = new Map(); // 每个技能的独立计时器 private aoe_timers: Map<number, number> = new Map(); // 每个技能的独立计时器
private readonly AOE_INTERVAL: number = 0.4; // 执行间隔,单位秒 private readonly AOE_INTERVAL: number = 0.4; // 执行间隔,单位秒
private skill_id_counter: number = 0; // 技能ID计数器 private skill_id_counter: number = 0; // 技能ID计数器
aoe_target_pos:Vec3=new Vec3(180,0,0) aoe_target_pos:Vec3=new Vec3(180,40,0)
init(): void { init(): void {
@@ -137,7 +137,7 @@ export class SkillConComp extends CCComp {
target = this.node.position target = this.node.position
break break
case TGroup.Team: //所有友方 case TGroup.Team: //所有友方
target = this.selectTeamFront() target = this.node.position
break break
case TGroup.All: //所有单位 case TGroup.All: //所有单位
@@ -215,25 +215,11 @@ export class SkillConComp extends CCComp {
pos=v3(this.get_front(entities)) pos=v3(this.get_front(entities))
return pos return pos
} }
private selectTeamFront(){
let pos=this.node.position
let entities=null
if(this.HeroView.fac==FacSet.HERO){
entities=ecs.query(ecs.allOf(HeroModelComp))
}else{
entities=ecs.query(ecs.allOf(MonModelComp))
}
if(entities.length==0){
return pos
}
let keyPos = this.HeroView.fac==FacSet.HERO ?
Math.max(...entities.map(e => e.get(HeroViewComp).node.position.x)) :
Math.min(...entities.map(e => e.get(HeroViewComp).node.position.x));
return v3(keyPos,20)
}
private selectAllyTargets( ): Vec3 { private selectAllyTargets( ): Vec3 {
// 敌方最前排是x坐标最大的+50我方最前排是x坐标最小的+50,若目标不存在,敌人 取320/2,我方取-320/2 // 敌方最前排是x坐标最大的+50我方最前排是x坐标最小的+50,若目标不存在,敌人 取320/2,我方取-320/2
let kp=0 let kp=50
if(this.HeroView.fac==FacSet.MON) kp=0
let pos=v3(0,0) let pos=v3(0,0)
let entities=this.check_target() let entities=this.check_target()
if(entities.length==0){ if(entities.length==0){
@@ -243,7 +229,7 @@ export class SkillConComp extends CCComp {
return v3(-320/2-kp,0) return v3(-320/2-kp,0)
} }
} }
pos=v3(this.get_front(entities)+kp,0) pos=v3(this.get_front(entities).x+kp,this.get_front(entities).y-BoxSet.ATK_Y,0)
return pos return pos
} }