魔法盾改为伤害减免
This commit is contained in:
@@ -312,18 +312,21 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
//受伤判断
|
||||
check_uatk(skill:any){
|
||||
if(this.shield > 0){
|
||||
this.shield -= 1
|
||||
if(this.shield <= 0){
|
||||
this.shield = 0
|
||||
this.node.getChildByName("shielded").active = false
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if(this.check_dodge()) return
|
||||
this.in_atked();
|
||||
let l_hp=this.check_less(skill.ap,skill.is_crit,skill.crit_add)
|
||||
this.check_debuff(skill,l_hp*skill.derate)
|
||||
if(this.shield > 0){
|
||||
let l_shield=this.shield-l_hp
|
||||
if(l_shield < 0){
|
||||
this.shield = 0
|
||||
l_hp = Math.abs(l_shield)
|
||||
}else{
|
||||
this.shield = l_shield
|
||||
l_hp = 0
|
||||
}
|
||||
}
|
||||
this.hp_less(l_hp,skill.is_crit);
|
||||
}
|
||||
check_less(ap:number,is_crit:boolean,crit_add:number=0){
|
||||
@@ -730,7 +733,6 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
add_shield(shield:number){
|
||||
this.shield =shield
|
||||
console.log("shield:",shield);
|
||||
}
|
||||
add_hp(hp: number=0){
|
||||
this.BUFFCOMP.heathed();
|
||||
|
||||
Reference in New Issue
Block a user