战斗等级显示需要完善

This commit is contained in:
2025-05-26 16:38:59 +08:00
parent 85856ccc28
commit 3efbf21a14
8 changed files with 159 additions and 109 deletions

View File

@@ -44,7 +44,7 @@ export class BuffComp extends Component {
update(deltaTime: number) {
if(smc.mission.pause) return
this.hp_show()
// this.hp_show()
if(this.wind_cd > 0 ) this.wind_cd -= deltaTime;
if(this.wind_cd <= 0 && this.node.getChildByName("wind").active){
this.node.getChildByName("wind").active = false;
@@ -59,12 +59,18 @@ export class BuffComp extends Component {
}
hp_show(){
let hp=this.node.getComponent(HeroViewComp).hp;
let hp_max=this.node.getComponent(HeroViewComp).hp_max;
let hp_progress= hp/hp_max;
this.top_node.getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.node.getComponent(HeroViewComp).is_boss) return
this.top_node.getChildByName("hp").active = (hp == hp_max) ? false : true;
if(this.node.getComponent(HeroViewComp).fac == 0) {
this.update_info_hp()
}else{
let hp=this.node.getComponent(HeroViewComp).hp;
let hp_max=this.node.getComponent(HeroViewComp).hp_max;
let hp_progress= hp/hp_max;
this.top_node.getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.node.getComponent(HeroViewComp).is_boss) return
this.top_node.getChildByName("hp").active = (hp == hp_max) ? false : true;
}
}
show_shield(val:boolean){
this.node.getChildByName("shielded").active=val