接下来 优化技能

This commit is contained in:
2024-09-13 10:41:38 +08:00
parent c8fe4a6ebe
commit 489b045982
40 changed files with 2010 additions and 22670 deletions

View File

@@ -179,11 +179,7 @@ export class HeroViewComp extends CCComp {
if(this.stop_cd > 0){
return
}
if (this.scale === 1 && this.node.position.x >= BoxSet.MONSTER_START-this.atk_dis) {
return;
}
if(this.scale===-1&&this.node.position.x <= BoxSet.HERO_START-this.atk_cd){
if (this.scale === 1 && this.node.position.x >= BoxSet.MONSTER_START-150) {
return;
}
if(this.enemy){
@@ -193,7 +189,7 @@ export class HeroViewComp extends CCComp {
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(){
this.dir_y=-(this.node.position.y-BoxSet.GAME_LINE)/60
this.dir_y=-(this.node.position.y-BoxSet.GAME_LINE)/20
}
move_to(){
var move = this.ent.get(MoveToComp) || this.ent.add(MoveToComp);
@@ -227,21 +223,8 @@ export class HeroViewComp extends CCComp {
// this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid);
}
//使用max_skill
do_max_skill(){
if(this.max_skill_uuid==this.skill_uuid){
this.shoot(this.max_skill_uuid,10)
this.shoot(this.max_skill_uuid,0)
this.shoot(this.max_skill_uuid,-10)
return
}
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);
do_max_skill(){
this.shoot(this.max_skill_uuid)
}
to_speek(words:string,time:number=0.5){
this.speek_time=0.5