再次清理英雄,切换到像素
This commit is contained in:
@@ -228,8 +228,16 @@ export class HeroViewComp extends CCComp {
|
||||
this.in_stop(dt);
|
||||
// 处理伤害队列
|
||||
this.processDamageQueue();
|
||||
|
||||
}
|
||||
hp_show(){
|
||||
// if(this.node.getComponent(HeroViewComp).fac == 0) return
|
||||
let hp=this.currentHp;
|
||||
let hp_max=this.currentHpMax;
|
||||
let hp_progress= hp/hp_max;
|
||||
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar).progress = hp_progress;
|
||||
// this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
get isActive() {
|
||||
@@ -343,17 +351,15 @@ export class HeroViewComp extends CCComp {
|
||||
switch(buff){
|
||||
case BuffAttr.ATK:
|
||||
this.ap=this.check_atrr(BuffAttr.ATK)
|
||||
|
||||
break
|
||||
case BuffAttr.ATK_CD:
|
||||
this.cd=this.check_atrr(BuffAttr.ATK_CD)
|
||||
|
||||
break
|
||||
case BuffAttr.HP:
|
||||
let diff=this.check_atrr(BuffAttr.HP)-this.currentHpMax
|
||||
this.currentHpMax=this.check_atrr(BuffAttr.HP)
|
||||
this.currentHp+=diff
|
||||
|
||||
let diff=this.check_atrr(BuffAttr.HP)-this.currentHpMax
|
||||
this.currentHpMax=this.check_atrr(BuffAttr.HP)
|
||||
this.currentHp+=diff
|
||||
this.hp_show()
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -409,6 +415,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.currentHp+=real_hp;
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.health,real_hp.toFixed(0));
|
||||
}
|
||||
this.hp_show()
|
||||
// this.update_vm
|
||||
}
|
||||
|
||||
@@ -636,13 +643,28 @@ export class HeroViewComp extends CCComp {
|
||||
}else{
|
||||
this.ent.destroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// this.update_vm
|
||||
this.back()
|
||||
this.showDamage(damage, is_crit,atked_anm);
|
||||
|
||||
}
|
||||
//后退
|
||||
back(){
|
||||
if(this.fac==FacSet.MON) {
|
||||
let tx=this.node.position.x+5
|
||||
if(tx > 320) tx=320
|
||||
tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start()
|
||||
}
|
||||
if(this.fac==FacSet.HERO) {
|
||||
let tx=this.node.position.x-5
|
||||
if(tx < -320) tx=-320
|
||||
tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start()
|
||||
}
|
||||
}
|
||||
//伤害计算 debuff 易伤
|
||||
count_damage(remainingDamage:number){
|
||||
let damage = 0;
|
||||
@@ -840,7 +862,8 @@ export class HeroViewComp extends CCComp {
|
||||
/** 立即显示伤害效果 */
|
||||
private showDamageImmediate(damage: number, isCrit: boolean,anm:string="atked") {
|
||||
// this.as.atked()
|
||||
this.BUFFCOMP.in_atked(anm)
|
||||
this.hp_show()
|
||||
this.BUFFCOMP.in_atked(anm,this.fac==FacSet.HERO?1:-1)
|
||||
this.atked_count++;
|
||||
if (isCrit) {
|
||||
this.BUFFCOMP.hp_tip(TooltipTypes.crit, damage.toFixed(0), damage);
|
||||
|
||||
Reference in New Issue
Block a user