This commit is contained in:
2025-06-25 23:57:19 +08:00
parent 7363952dae
commit 862777a9c7
6 changed files with 4486 additions and 4792 deletions

View File

@@ -214,7 +214,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap += Math.floor(ap/100*this.ap);
}
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.vmdata_update()
}
@@ -225,7 +224,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap -= Math.floor(ap/100*this.ap);
}
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.vmdata_update()
}
update_hp(e:GameEvent,data:any){
@@ -234,8 +232,8 @@ export class HeroViewComp extends CCComp {
this.buff_hp += data.hp
if(data.hp > 0){
this.hp += this.hp_max*data.hp/100
if(this.hp > this.hp_max*(100+this.buff_hp/100)){
this.hp=this.hp_max*(100+this.buff_hp/100)
if(this.hp > this.hp_max*(100+this.buff_hp)/100){
this.hp=this.hp_max*(100+this.buff_hp)/100
}
}
}
@@ -243,14 +241,13 @@ export class HeroViewComp extends CCComp {
add_hp_max(hp: number=0,is_num:boolean=true){
this.hp_max += Math.floor(hp) ;
this.hp += Math.floor(hp*(100+this.buff_hp)/100) ;
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
}
de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过buff_hp处理
console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
this.hp_max -= Math.floor(hp) ;
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
}
@@ -410,7 +407,6 @@ export class HeroViewComp extends CCComp {
this.ent.destroy();
}
}
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
this.showDamage(damage, is_crit);
@@ -525,7 +521,7 @@ export class HeroViewComp extends CCComp {
to_alive(){
this.is_dead=false
this.hp=this.hp_max*(100+this.buff_hp)/100
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
this.node.setPosition(HeroPos[this.fight_pos].pos)
this.BUFFCOMP.heathed()
}