解决修改后的bug

This commit is contained in:
2025-07-22 17:06:28 +08:00
parent a5ed2f5784
commit cde7da64ad
5 changed files with 9 additions and 6 deletions

View File

@@ -89,8 +89,9 @@ export class Hero extends ecs.Entity {
hv.speed =hv.ospeed = hero.speed;
hv.dis = hero.dis;
hv.cd = hero.cd
hv.hp= hv.hp_max =hero.hp+info.hp
hv.hp= hv.hp_max = hv.hp_base=hero.hp+info.hp
hv.ap = hero.ap+info.ap;
hv.ap_base=hero.ap+info.ap;
hero.buff.forEach((buff:any)=>{
switch(buff.buff_type){
case BuffAttr.CRITICAL:

View File

@@ -31,6 +31,7 @@ export class HeroConCompComp extends CCComp {
let equip=EquipInfo[data.uuid]
let buffs=equip.buff
let special_attr=equip.special_attr
console.log("[HeroConCompComp]:equip_add",buffs)
for(let i=0;i<buffs.length;i++){
let buff=buffs[i]
if(buff.target==EquipAttrTarget.HERO){

View File

@@ -223,11 +223,11 @@ export class HeroViewComp extends CCComp {
// this.BUFFCOMP.tooltip(TooltipTypes.speedup,speed.toFixed(0));
}
add_ap(ap: number,is_num:boolean=true){
//console.log("[HeroViewComp]:add_ap add:",ap,this.ap)
console.log("[HeroViewComp]:add_ap add:",ap,this.ap)
if(is_num){
this.ap_base += Math.floor(ap);
}else{
this.buff_ap += Math.floor(ap/100*this.ap);
this.buff_ap += Math.floor(ap);
}
let diff=Math.floor(this.ap_base*(100+this.buff_ap)/100)-this.ap
this.ap = Math.floor(this.ap_base*(100+this.buff_ap)/100)
@@ -256,6 +256,7 @@ export class HeroViewComp extends CCComp {
}
add_hp_max(hp: number=0,is_num:boolean=false){
console.log("[HeroViewComp]:add_hp_max add:",hp,this.hp_max)
if(is_num){
this.hp_base += Math.floor(hp) ;
}else{

View File

@@ -82,7 +82,7 @@ export class Monster extends ecs.Entity {
hv.hp = hv.hp_max = levelHp;
hv.ap = levelAp;
hv.ap_base=levelAp
console.log(`[Monster]: 怪物${hero.name}(等级${lv}) - 基础HP:${baseHp}->等级HP:${levelHp}, 基础AP:${baseAp}->等级AP:${levelAp}`);
hv.cd = hero.cd