dd
This commit is contained in:
@@ -52,29 +52,29 @@ export class Monster extends ecs.Entity {
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite);
|
||||
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].path);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(smc.heros[uuid].path);
|
||||
});
|
||||
this.hero_init(uuid,node)
|
||||
oops.message.dispatchEvent("monster_load",this)
|
||||
}
|
||||
hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
|
||||
var mv = node.getComponent(MonsterViewComp)!;
|
||||
mv.speed =mv.ospeed = CardSet[uuid].speed;
|
||||
mv.hero_name= CardSet[uuid].name;
|
||||
mv.hp= mv.hp_max = CardSet[uuid].hp;
|
||||
mv.level = CardSet[uuid].level;
|
||||
mv.atk = CardSet[uuid].atk;
|
||||
mv.atk_cd = CardSet[uuid].atk_cd;
|
||||
mv.power = CardSet[uuid].power;
|
||||
mv.type = CardSet[uuid].type;
|
||||
mv.speed =mv.ospeed = smc.heros[uuid].speed;
|
||||
mv.hero_name= smc.heros[uuid].name;
|
||||
mv.hp= mv.hp_max = smc.heros[uuid].hp;
|
||||
mv.level = smc.heros[uuid].level;
|
||||
mv.atk = smc.heros[uuid].atk;
|
||||
mv.atk_cd = smc.heros[uuid].atk_cd;
|
||||
mv.power = smc.heros[uuid].power;
|
||||
mv.type = smc.heros[uuid].type;
|
||||
mv.camp = -1;
|
||||
mv.Tpos = v3(0,0,0);
|
||||
mv.change_name(CardSet[uuid].name,-1)
|
||||
mv.change_name(smc.heros[uuid].name,-1)
|
||||
this.add(mv);
|
||||
this.push_monsters_in(uuid,mv.ent.eid)
|
||||
}
|
||||
push_monsters_in(uuid:number=1001,eid:number=0){
|
||||
smc.monsters_in.push({name:CardSet[uuid].name,eid:eid})
|
||||
smc.monsters_in.push({name:smc.heros[uuid].name,eid:eid})
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user