防御最多抵消50%伤害

This commit is contained in:
2024-12-26 16:54:04 +08:00
parent 295dcbda33
commit 8805666492
3 changed files with 8 additions and 8 deletions

View File

@@ -352,13 +352,13 @@ export class HeroViewComp extends CCComp {
}
if(this.check_dodge()) return
this.in_atked();
let l_hp=(skill.ap-this.def)*-1
let d=this.def/skill.ap
if(d > 1) d = 1
let l_hp=skill.ap*(1-d*0.5)
if(skill.is_crit){
l_hp = l_hp * (150+skill.crit_add)/100
}
if(l_hp >= 0){
l_hp=-1 //最低1点伤害
}
l_hp=-1*Math.ceil(l_hp)
this.hp_change(l_hp,skill.is_crit);
}
//能量判断