This commit is contained in:
2024-09-23 08:14:39 +08:00
parent 96c96da552
commit 618a6e3f7b
65 changed files with 38950 additions and 8530 deletions

View File

@@ -67,7 +67,8 @@ export class HeroViewComp extends CCComp {
atk_cd: number = 1.3; /**攻击速度 攻击间隔 */
atk_dis: number = 80;
atk_time: number = 0; /** 冷却时间 */
st_boncus: number = 1; //技能持续时间加成
s_boncus: number = 1; //技能效果加成
speed: number = 100; /** 角色移动速度 */
ospeed: number = 100; /** 角色初始速度 */
Tpos: Vec3 = v3(0,-60,0);
@@ -173,6 +174,9 @@ export class HeroViewComp extends CCComp {
update(dt: number){
if(smc.vm_data.game_over||smc.vm_data.game_pause){
return
}
if (this.timer.update(dt)) {
this.power_change(this.power_speed)
}
@@ -194,7 +198,9 @@ export class HeroViewComp extends CCComp {
}
check_enemy_alive(){
let dir = 320
this.enemy = v3(720,this.node.position.y)
for (let i = 0; i < GameSet.ATK_LINES; i++) {
let mon:any = smc.enemy_pos[i];
let x=Math.abs(mon.x-this.node.position.x)
let y = Math.abs(mon.y-this.node.position.y)
@@ -211,6 +217,7 @@ export class HeroViewComp extends CCComp {
}else{
this.is_atking=false
}
}
move(dt: number){
if(this.stop_cd > 0){
@@ -295,15 +302,14 @@ export class HeroViewComp extends CCComp {
let {pos,t_pos}=this.get_hero_pos(hero)
skill.load(pos,BoxSet.HERO,this.node,this.max_skill_uuid,atk,t_pos);
if(smc.skills[s_uuid].hp > 0){ //buff加血
hero.HeroView.add_hp(smc.skills[s_uuid].hp)
hero.HeroView.add_hp(smc.skills[s_uuid].hp*this.atk*this.s_boncus)
}
if(smc.skills[s_uuid].atk > 0){ //buff加攻击
hero.HeroView.add_atk(smc.skills[s_uuid].atk,smc.skills[s_uuid].bsd)
hero.HeroView.add_atk(smc.skills[s_uuid].atk*this.atk*this.s_boncus,smc.skills[s_uuid].bsd*this.st_boncus)
}
if(smc.skills[s_uuid].shield > 0){ //buff护盾
hero.HeroView.add_shield(smc.skills[s_uuid].shield,smc.skills[s_uuid].bsd)
hero.HeroView.add_shield(smc.skills[s_uuid].shield*this.atk*this.s_boncus,smc.skills[s_uuid].bsd*this.st_boncus)
}
}
push_least_buff(skill:number){
let heros:any = ecs.query(ecs.allOf(HeroModelComp));
@@ -393,6 +399,12 @@ export class HeroViewComp extends CCComp {
heathed(){
this.node.getChildByName("heathed").active=true
// var path = "game/skills/heathed";
// var prefab: Prefab = oops.res.get(path, Prefab)!;
// var node = instantiate(prefab);
// let pos = v3(0,0)
// node.setPosition(pos)
// node.parent = this.node;
}
add_hp(hp: number=0){
this.heathed();