加血技能完成 怪物动画减少
This commit is contained in:
@@ -175,7 +175,7 @@ export class MonViewComp extends CCComp {
|
||||
if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START){
|
||||
return;
|
||||
}
|
||||
this.set_diry()
|
||||
// this.set_diry()
|
||||
this.node.setPosition(this.node.position.x+dt*this.speed*this.scale, this.node.position.y+dt*this.dir_y, this.node.position.z);
|
||||
}
|
||||
set_diry(){
|
||||
@@ -200,26 +200,21 @@ export class MonViewComp extends CCComp {
|
||||
// let power_progress= this.power/this.power_max;
|
||||
// this.node.getChildByName("top").getChildByName("power").getComponent(ProgressBar)!.progress = power_progress;
|
||||
}
|
||||
shoot(skill_uuid:number){
|
||||
shoot(skill_uuid:number,y:number=0,x:number=0){
|
||||
// console.log("mon shoot");
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let scale = this.scale
|
||||
let speed =smc.skills[skill_uuid].speed;
|
||||
let dis = smc.skills[skill_uuid].dis;
|
||||
let atk = smc.skills[skill_uuid].atk+this.atk;
|
||||
let {pos,angle,t_pos}=this.get_enemy_pos()
|
||||
skill.load(pos,speed,dis,scale,this.node,skill_uuid,atk,angle,t_pos);
|
||||
pos.y=pos.y + y
|
||||
pos.x=pos.x + x
|
||||
skill.load(pos,BoxSet.MONSTER,this.node,skill_uuid,atk,t_pos);
|
||||
// this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid);
|
||||
}
|
||||
//使用max_skill
|
||||
do_max_skill(){
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let scale = this.scale
|
||||
let speed =smc.skills[this.max_skill_uuid].speed;
|
||||
let dis = smc.skills[this.max_skill_uuid].dis;
|
||||
let atk = smc.skills[this.max_skill_uuid].atk+this.atk;
|
||||
let {pos,angle,t_pos}=this.get_enemy_pos()
|
||||
skill.load(pos,speed,dis,scale,this.node,this.max_skill_uuid,atk,angle,t_pos);
|
||||
for(let i=0;i<smc.skills[this.max_skill_uuid].count;i++){
|
||||
this.shoot(this.max_skill_uuid)
|
||||
}
|
||||
}
|
||||
to_speek(words:string,time:number=0.5){
|
||||
this.speek_time=0.5
|
||||
@@ -247,12 +242,8 @@ export class MonViewComp extends CCComp {
|
||||
return
|
||||
}
|
||||
t_pos = v3(this.enemy.position.x-(this.node.position.x+pos.x)*1.1,(this.enemy.position.y-(this.node.position.y+pos.y)+BoxSet.ATK_Y)*1.1)
|
||||
angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
|
||||
if(this.scale == -1){
|
||||
angle = angle +180
|
||||
}
|
||||
}else{
|
||||
t_pos=null
|
||||
t_pos=v3(-720,BoxSet.GAME_LINE)
|
||||
}
|
||||
return {pos,t_pos,angle}
|
||||
}
|
||||
@@ -261,7 +252,8 @@ export class MonViewComp extends CCComp {
|
||||
if(!this.enemy.isValid){
|
||||
return false
|
||||
}
|
||||
return true
|
||||
if(Math.abs(this.enemy.position.x-this.node.position.x) < this.atk_dis) return true;
|
||||
return false
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user