伙伴复活时间减少完善

This commit is contained in:
2025-06-17 14:49:26 +08:00
parent d02482a591
commit 0a1e2b7813
6 changed files with 67 additions and 61 deletions

View File

@@ -53,8 +53,6 @@ export class Hero extends ecs.Entity {
hv.ap = hero.ap;
hv.lv=1
hv.cd = hero.a_cd
hv.ap_u=hero.ap_u
hv.ap_ur=hero.ap_ur
hv.hp_up=hero.hp_up
hv.atk_skill=hero.skills[0]
console.log(hv.hero_name+"dis=>"+hv.dis)
@@ -87,8 +85,6 @@ export class Hero extends ecs.Entity {
hv.ap = hero.ap+info.ap;
hv.lv=info.lv+1
hv.cd = hero.a_cd
hv.ap_u=hero.ap_u
hv.ap_ur=hero.ap_ur
hv.hp_up=hero.hp_up
hv.atk_skill=hero.skills[0]
this.add(hv);

View File

@@ -77,7 +77,6 @@ export class HeroViewComp extends CCComp {
speek_time:number = 0;
is_stop_temp:boolean = false;i
Friend_alive_cd:Timer=new Timer(10)
private damageQueue: Array<{
damage: number,
isCrit: boolean,
@@ -91,9 +90,8 @@ export class HeroViewComp extends CCComp {
onLoad() {
this.as = this.getComponent(HeroSpine);
this.FIGHTCON=this.node.parent.getComponent(FightConComp);
console.log("hero view comp ",this.FIGHTCON)
console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
this.on(GameEvent.ChangeATK,this.change_atk,this)
this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_equip_special_attr,this)
// let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
}
@@ -110,7 +108,6 @@ export class HeroViewComp extends CCComp {
}
/* 显示角色血量 */
this.node.getChildByName("top").getChildByName("hp").active = true;
this.Friend_alive_cd=new Timer(FightSet.FRIEND_LIVE_CD)
}
update(dt: number){
if(!smc.mission.play||smc.mission.pause) return
@@ -119,8 +116,9 @@ export class HeroViewComp extends CCComp {
// return
// }
if(this.is_dead) {
console.log("[HeroViewComp]:alive friend cd",this.Friend_alive_cd ,this.Friend_alive_cd.elapsedTime)
if(this.Friend_alive_cd.update(dt)){
console.log("alive friend")
this.to_alive()
}
}
@@ -140,14 +138,7 @@ export class HeroViewComp extends CCComp {
this.processDamageQueue();
}
change_equip_special_attr(e:GameEvent,data:any){
console.log("change_equip_special_attr",data)
this.up_friend_alive_cd(data.friend_live_cd_less)
}
up_friend_alive_cd(less:number){
this.Friend_alive_cd=new Timer(FightSet.FRIEND_LIVE_CD-less)
}
change_atk(e:GameEvent,data:any){
switch(data){
@@ -275,9 +266,10 @@ export class HeroViewComp extends CCComp {
do_dead(){
console.log("角色死亡",this.hero_uuid)
this.Friend_alive_cd=new Timer(this.FIGHTCON.Friend_alive_cd)
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
if(this.is_master){
console.log("英雄死亡")
console.log("[HeroViewComp]:英雄死亡")
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
}
}