伙伴复活时间减少完善
This commit is contained in:
@@ -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})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user