防御最多抵消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

@@ -13,8 +13,8 @@ const { ccclass, property } = _decorator;
@ccclass('Main') @ccclass('Main')
export class Main extends Root { export class Main extends Root {
start() { start() {
if (DEBUG) profiler.showStats(); // if (DEBUG) profiler.showStats();
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// // | EPhysics2DDrawFlags.Pair // // | EPhysics2DDrawFlags.Pair
// |EPhysics2DDrawFlags.CenterOfMass // |EPhysics2DDrawFlags.CenterOfMass
// |EPhysics2DDrawFlags.Joint // |EPhysics2DDrawFlags.Joint

View File

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

View File

@@ -48,8 +48,8 @@ export class HCardComp extends CCComp {
this.node.getChildByName("bg").getComponent(Sprite).grayscale=false this.node.getChildByName("bg").getComponent(Sprite).grayscale=false
this.is_dead=false this.is_dead=false
} }
this.hp.string=this.heros[this.hi].HeroView.rhp_max this.hp.string=(this.heros[this.hi].HeroView.rhp_max).toFixed(0)
this.ap.string=this.heros[this.hi].HeroView.ap*(smc.vmdata.mission.ap+100)/100 this.ap.string=(this.heros[this.hi].HeroView.ap*(smc.vmdata.mission.ap+100)/100).toFixed(0)
this.life.progress=this.heros[this.hi].HeroView.hp/this.heros[this.hi].HeroView.rhp_max this.life.progress=this.heros[this.hi].HeroView.hp/this.heros[this.hi].HeroView.rhp_max
this.pw.progress=this.heros[this.hi].HeroView.pw/this.heros[this.hi].HeroView.pwm this.pw.progress=this.heros[this.hi].HeroView.pw/this.heros[this.hi].HeroView.pwm