添加免伤

This commit is contained in:
pan
2024-10-22 16:41:38 +08:00
parent 46fd88d75a
commit 6dc379f5c3
2 changed files with 14 additions and 3 deletions

View File

@@ -73,6 +73,11 @@ export class HeroViewComp extends CCComp {
ospeed: number = 100; /** 角色初始速度 */
Tpos: Vec3 = v3(0,-60,0);
stop_cd: number = 0.5; /*停止倒计时*/
//暴击
crit: number = 1.5;
crit_rate: number = 0;
//免伤
dodge_rate: number = 0;
shield:number = 0; //护盾量
shield_max:number = 200;
@@ -139,7 +144,8 @@ export class HeroViewComp extends CCComp {
if(this.hp <= 0 ){
return
}
this.hp_change(skill.atk);
let loss_hp=skill.atk*(100-this.dodge_rate)/100
this.hp_change(loss_hp);
}
}