英雄普通攻击改变

This commit is contained in:
2025-06-16 10:53:02 +08:00
parent e7efaa9d1e
commit d9b7b6c966
6 changed files with 64 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ import { BuffComp } from "./BuffComp";
import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
import { FightConComp } from "../map/FightConComp";
import { EquipSpecialAttr } from "../common/config/Equips";
const { ccclass, property } = _decorator;
@@ -88,6 +89,7 @@ export class HeroViewComp extends CCComp {
this.as = this.getComponent(HeroSpine);
this.FIGHTCON=this.node.parent.getComponent(FightConComp);
console.log("hero view comp ",this.FIGHTCON)
this.on(GameEvent.ChangeATK,this.change_atk,this)
// let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
// 注册单个碰撞体的回调函数
@@ -146,6 +148,22 @@ export class HeroViewComp extends CCComp {
// 处理伤害队列
this.processDamageQueue();
}
change_atk(e:GameEvent,data:any){
switch(data){
case EquipSpecialAttr.ICE:
this.atk_skill=6001
break
case EquipSpecialAttr.FIRE:
this.atk_skill=6002
break
case EquipSpecialAttr.WIND:
this.atk_skill=6003
break
default:
this.atk_skill=6001
break
}
}
get isActive() {
return this.ent.has(HeroViewComp) && this.node?.isValid;
}