掉血独立

This commit is contained in:
2025-07-31 15:46:25 +08:00
parent db2acbf52e
commit d56b4293d7
2 changed files with 9 additions and 2 deletions

View File

@@ -225,6 +225,13 @@ export class BuffComp extends Component {
pos.y=pos.y+y; pos.y=pos.y+y;
tip.load(pos,type,value,s_uuid,this.node); tip.load(pos,type,value,s_uuid,this.node);
} }
hp_tip(type:number=1,value:string="",s_uuid:number=1001,y:number=90){
let tip =ecs.getEntity<Tooltip>(Tooltip);
let x=this.node.position.x;
let ny=this.node.getComponent(UITransform).height-20;
let pos = v3(x,ny,0);
tip.load(pos,type,value,s_uuid,this.node.parent);
}
heathed(){ heathed(){
var path = "game/skills/heathed"; var path = "game/skills/heathed";
var prefab: Prefab = oops.res.get(path, Prefab)!; var prefab: Prefab = oops.res.get(path, Prefab)!;

View File

@@ -842,10 +842,10 @@ export class HeroViewComp extends CCComp {
// this.BUFFCOMP.in_atked() // this.BUFFCOMP.in_atked()
this.atked_count++; this.atked_count++;
if (isCrit) { if (isCrit) {
this.BUFFCOMP.tooltip(TooltipTypes.crit, damage.toFixed(0), damage); this.BUFFCOMP.hp_tip(TooltipTypes.crit, damage.toFixed(0), damage);
// //console.log("暴击伤害:" + damage); // //console.log("暴击伤害:" + damage);
} else { } else {
this.BUFFCOMP.tooltip(TooltipTypes.life, damage.toFixed(0), damage); this.BUFFCOMP.hp_tip(TooltipTypes.life, damage.toFixed(0), damage);
// //console.log("普通伤害:" + damage); // //console.log("普通伤害:" + damage);
} }
} }