复活完成
This commit is contained in:
@@ -10,7 +10,6 @@ import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { HeroPos } from "../common/config/heroSet";
|
||||
import { FightSet } from "../common/config/Mission";
|
||||
import { FriendModelComp } from "../hero/FriendModel";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -23,7 +22,7 @@ export class MissionHeroCompComp extends CCComp {
|
||||
current_hero_uuid:number=0
|
||||
onLoad(){
|
||||
this.on(GameEvent.UseHeroCard,this.call_friend,this)
|
||||
this.on(GameEvent.ChangeATK_FRIEND_LIVE_CD,this.change_friend_alive_cd,this)
|
||||
this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_equip_qpecial_attr,this)
|
||||
this.on(GameEvent.FightReady,this.fight_ready,this)
|
||||
|
||||
}
|
||||
@@ -44,31 +43,34 @@ export class MissionHeroCompComp extends CCComp {
|
||||
|
||||
}
|
||||
|
||||
change_friend_alive_cd(e:GameEvent,data:any){
|
||||
console.log("change_friend_alive_cd",data)
|
||||
this.Friend_alive_cd=new Timer(FightSet.FRIEND_LIVE_CD-data)
|
||||
change_equip_qpecial_attr(e:GameEvent,data:any){
|
||||
|
||||
}
|
||||
|
||||
private call_friend(event: string, args: any,freind_pos:number=0){
|
||||
console.log("call_hero addHero",args.uuid)
|
||||
up_friend_alive_cd(less:number){
|
||||
|
||||
}
|
||||
|
||||
private call_friend(event: string, args: any,freind_pos:number=1){
|
||||
console.log("[MissionHeroComp]:call_hero addHero",args.uuid)
|
||||
let info:any={ap:0,hp:0,lv:0}
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
let pos:Vec3 = HeroPos[freind_pos].pos;
|
||||
hero.load(pos,scale,args.uuid,info,freind_pos);
|
||||
console.log("call_friend",hero)
|
||||
}
|
||||
|
||||
alive_friend(){
|
||||
this.Friend_is_dead=false
|
||||
let heros = ecs.query(ecs.allOf(FriendModelComp))
|
||||
let heros=ecs.query(ecs.allOf(HeroViewComp))
|
||||
for(let hero of heros){
|
||||
let hv = hero.get(HeroViewComp)
|
||||
if(hv.is_dead){
|
||||
hv.to_alive()
|
||||
if(hv.fight_pos==freind_pos){
|
||||
freind_pos=2
|
||||
break
|
||||
}
|
||||
}
|
||||
console.log("[MissionHeroComp]:call_friend",heros)
|
||||
let pos:Vec3 = HeroPos[freind_pos].pos;
|
||||
hero.load(pos,scale,args.uuid,info,freind_pos);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// show_heros_pos(event: string, args: any){
|
||||
// console.log("show_heros_pos",args)
|
||||
|
||||
Reference in New Issue
Block a user