++护盾技能

This commit is contained in:
panfudan
2025-07-10 00:30:35 +08:00
parent 7dcaf19925
commit 541a944c0c
21 changed files with 1288 additions and 834 deletions

View File

@@ -87,7 +87,7 @@ export class SkillConComp extends CCComp {
target = this.node.position
break
case TGroup.Team: //所有友方
target = this.selectTeamFront()
break
case TGroup.All: //所有单位
@@ -164,7 +164,22 @@ export class SkillConComp extends CCComp {
pos=v3(this.get_front(entities),0)
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