英雄动画修复,技能反向修复

This commit is contained in:
2024-11-16 16:27:46 +08:00
parent 6ef4ccb773
commit 0793334379
29 changed files with 2899 additions and 2936 deletions

View File

@@ -54,7 +54,7 @@ export const SkillSet={
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:"释放一个魔法球攻击敌人",
dis:1,count:1,in:0,run:0,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:6000,},
dis:1,count:1,in:0,run:0,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:1000,},
9002:{uuid: 9002,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "魔法小球",sp_name:"mball",info:"释放一个魔法球攻击敌人",
dis:1,count:1,in:0,run:0,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
9003:{uuid: 9003,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "射击",sp_name:"arrow",info:"释放一个魔法球攻击敌人",

View File

@@ -2,9 +2,9 @@
export const HeroInfo = {
9001: {
uuid: 9001, path: "k1", type: 1, lv: 1,name: "白骑士", wp:1001,arm:2001,ring:3001,shoes:4001,
exp_type:0,lv2:5,lv3:10,lv4:20,lv5:30,a_exp:1,ua_exp:1,d_exp:10,ed_exp:1,
exp_type:0,lv2:5,lv3:10,lv4:20,lv5:30,a_exp:1,ua_exp:1,d_exp:10,ed_exp:1,a_buff:8101,ua_buff:8201,d_buff:8301,ed_buff:8401,
ap: 20, ap_rate:0.1, hp: 100, hp_rate:0.1, def:10,def_rate:0.1, dis: 100, a_cd: 1, power: 0, power_max: 15, speed: 40,
sk1: 9001, sk2: 2002, sk3: 9001, sk4: 2002, sk5: 9001, sk6: 2002, atktype: 1,
sk1: 9001, sk2: 2002, sk3: 9003, sk4: 9004, sk5: 9005, sk6: 9006, atktype: 1,
},

View File

@@ -73,7 +73,7 @@ export class HeroSpine extends Component {
}
idle(){
if(!this.in_playing()){
// console.log("do idle");
console.log("do idle");
this.animator.play(this.idle_clip.name);
}
}
@@ -85,12 +85,12 @@ export class HeroSpine extends Component {
max(){
// console.log("do max");
this.animator.play(this.max_clip.name);
this.animator.play(this.max_clip.name);
}
move(){
if(!this.in_playing()){
// console.log("do move");
if(!this.animator.getState(this.move_clip.name).isPlaying) {
console.log("doing move");
this.animator.play(this.move_clip.name);
}
}

View File

@@ -100,7 +100,7 @@ export class HeroViewComp extends CCComp {
} /** 视图层逻辑代码分离演示 */
start () {
this.as.move()
this.as.idle()
/** 方向 */
this.node.setScale(this.scale,1);
this.node.getChildByName("top").setScale(this.scale,1);
@@ -219,15 +219,7 @@ export class HeroViewComp extends CCComp {
this.move(dt);
}
status_change(type:string){
if(this.status == type) return
this.status=type
if(type != "move"){
this.as.change_default("idle")
}else{
this.as.change_default("move")
}
}
change_anm(){
@@ -280,12 +272,20 @@ export class HeroViewComp extends CCComp {
}else{
this.is_atking=false
}
}
status_change(type:string){
this.status=type
if(type == "idle"){
this.as.idle()
this.as.change_default("idle")
}
if(type == "move"){
this.as.move()
this.as.change_default("move")
}
}
move(dt: number){
if(this.stop_cd > 0){
this.as.idle()
this.status_change("idle")
return
}
@@ -295,8 +295,9 @@ export class HeroViewComp extends CCComp {
if(this.scale===-1&&this.node.position.x <= -360){
return;
}
this.as.move()
this.status_change("move")
// if(this.enemy){
// return
// }

View File

@@ -57,7 +57,7 @@ export class Skill extends ecs.Entity {
// console.log(smc.skills[uuid].name+"angle:"+angle)
sv.s_uuid = uuid;
sv.atk = atk;
node.setScale(v3(node.scale.x*scale,node.scale.y))
// node.setScale(v3(node.scale.x*scale,node.scale.y))
sv.speed=smc.skills[uuid].speed;
sv.dis=smc.skills[uuid].dis+dis;

View File

@@ -38,8 +38,10 @@ export class SkillCom extends CCComp {
run_type:number = 0; // 0有目标 带方向1贝塞尔曲线 2 不动 ,3 直线
in_time:number = 0.3; // 不动技能持续时间
start() {
// console.log("skill start run_type",this.run_type)
console.log("skill start run_type",this.run_type)
if(this.node.parent.scale.x < 0){
this.t_pos.x=this.t_pos.x*-1
}
this.x_speed=Math.cos(this.angle * Math.PI / 180) * this.speed-30*this.scale;
this.y_speed=Math.sin(this.angle * Math.PI / 180) * this.speed;
this.node.active=true
@@ -70,6 +72,7 @@ export class SkillCom extends CCComp {
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)
console.log("skill tx:"+e_pos.x+" node :"+this.node.position.x)
this.node.getChildByName("skill").setRotationFromEuler(0,0,this.angle)
// console.log("skill ",this.node.getRotation())
tween(this.node).to( time,{ position: e_pos},

View File

@@ -8,6 +8,7 @@ export class dead extends Component {
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
onAnimationFinished(){
console.log("动画结束");
this.node.destroy();
}
update(deltaTime: number) {