伤害系统有问题,打算放弃

This commit is contained in:
2025-02-03 15:03:45 +08:00
parent 8f2612bda2
commit 060046a6a6
18 changed files with 549 additions and 112 deletions

View File

@@ -193,7 +193,7 @@ export class HeroViewComp extends CCComp {
}
this.hp_less(l_hp,is_crit);
}
hp_less(hp: number,is_crit:boolean=false){
hp_less(hp: number,is_crit:boolean=false,delay:number=0){
if(this.is_dead) return
hp=Math.floor(hp)
this.hp -= hp
@@ -211,17 +211,7 @@ export class HeroViewComp extends CCComp {
this.is_dead = true;
}
}
check_less(ap:number,is_crit:boolean,crit_add:number=0){
let d=this.def/ap
if(d > 1) d = 1
let l_hp=ap*(1-d*GameSet.DEF_RATE) //防御最高减免伤害比率计算
if(is_crit){
l_hp = l_hp * (150+crit_add)/100
}
let luck = RandomManager.instance.getRandomInt(-10,10)
l_hp=l_hp*(100+luck)/100
return Math.ceil(l_hp)
}
/**
* 检查并处理英雄受到的减益效果debuff
* 根据技能的不同减益类型,执行相应的逻辑,如冰冻、燃烧等。