群体技能还是需要修改
This commit is contained in:
@@ -28,7 +28,7 @@ export class SkillConComp extends CCComp {
|
||||
private aoe_timers: Map<number, number> = new Map(); // 每个技能的独立计时器
|
||||
private readonly AOE_INTERVAL: number = 0.4; // 执行间隔,单位秒
|
||||
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 {
|
||||
@@ -137,7 +137,7 @@ export class SkillConComp extends CCComp {
|
||||
target = this.node.position
|
||||
break
|
||||
case TGroup.Team: //所有友方
|
||||
target = this.selectTeamFront()
|
||||
target = this.node.position
|
||||
break
|
||||
case TGroup.All: //所有单位
|
||||
|
||||
@@ -215,25 +215,11 @@ export class SkillConComp extends CCComp {
|
||||
pos=v3(this.get_front(entities))
|
||||
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 {
|
||||
// 敌方最前排是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 entities=this.check_target()
|
||||
if(entities.length==0){
|
||||
@@ -243,7 +229,7 @@ export class SkillConComp extends CCComp {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user