This commit is contained in:
2024-09-20 17:13:16 +08:00
parent 4baee558c5
commit 96c96da552
8 changed files with 146 additions and 46 deletions

View File

@@ -232,6 +232,10 @@ export class RoleViewComp extends CCComp {
let {pos,t_pos}=this.get_enemy_pos()
pos.y=pos.y + y
pos.x=pos.x + x
if(smc.skills[skill_uuid].type==11){
pos.y=300
t_pos.y=t_pos.y-300
}
skill.load(pos,BoxSet.HERO,this.node,skill_uuid,atk,t_pos);
// this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid);
}

View File

@@ -102,8 +102,8 @@ export class SingletonModuleComp extends ecs.Comp {
skill:1004,
skills:[
{uuid:1002,cd:2,alive:true },
{uuid:1003,cd:3,alive:true},
{uuid:1004,cd:4,alive:true},
{uuid:4012,cd:3,alive:true},
{uuid:4011,cd:4,alive:true},
{uuid:0,cd:0,alive:false},
{uuid:0,cd:0,alive:false},
]

View File

@@ -1,6 +1,8 @@
/*
type
1 远距离攻击,碰撞后 结束
11远距离攻击从天降下
12远距离攻击目标点显现
2 远距离攻击,碰撞后 持续,直到技能结束
3 远距离攻击,碰撞后 持续,带击退功能
4 双技能技能1技能结束后触发2技能
@@ -44,9 +46,9 @@ export const SkillSet={
3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人",
dis:1,count:3,in:0.3,run:2,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
4011:{uuid: 4011,path: "1011",type: 1,tg:3,angle:true,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人",
4011:{uuid: 4011,path: "1011",type: 11,tg:3,angle:true,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人",
dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
4012:{uuid: 4012,path: "1012",type: 1,tg:3,angle:true,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人",
4012:{uuid: 4012,path: "1012",type: 11,tg:3,angle:true,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人",
dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
9001:{uuid: 9001,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "普攻",sp_name:"patk",info:"释放一个魔法球攻击敌人",

View File

@@ -46,12 +46,12 @@ export class Skill extends ecs.Entity {
if(t_pos.x < pos.x){
scale= - 1
}
let angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
if(scale == -1){
angle = angle +180
}
if(!smc.skills[uuid].angle){
angle=0
let angle=0
if(smc.skills[uuid].angle){
angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
if(scale == -1){
angle = angle +180
}
}
sv.angle = angle;
// console.log(smc.skills[uuid].name+"angle:"+angle)

View File

@@ -57,13 +57,15 @@ export class SkillCom extends CCComp {
if(this.run_type == 0){ //直线,默认直线,有特定目标 朝向目标直线
let time = 720 / this.speed;
let squaredDistance = this.t_pos.x * this.t_pos.x + this.t_pos.y * this.t_pos.y;
let distance = Math.sqrt(squaredDistance);
time = distance / this.speed;
let e_pos=v3(this.node.position.x+this.t_pos.x,this.node.position.y+this.t_pos.y)
tween(this.node).to( time,{ angle:this.angle,position: e_pos},
this.node.getChildByName("skill").setRotationFromEuler(0,0,this.angle)
console.log("skill ",this.node.getRotation())
tween(this.node).to( time,{ position: e_pos},
{
easing: "linear",
onUpdate: (target: Vec3, ratio: number) => { },