去掉smc.heros
This commit is contained in:
@@ -47,11 +47,6 @@ export class Hero extends ecs.Entity {
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_call:boolean=false,lv:number=1){
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||
let role =smc.heros[uuid]
|
||||
if(is_call){
|
||||
role={slv:0,lv:lv}
|
||||
}
|
||||
let talents=Talents;
|
||||
hv.scale = scale;
|
||||
hv.fac = 0;
|
||||
hv.type = hero.type;
|
||||
@@ -68,20 +63,14 @@ export class Hero extends ecs.Entity {
|
||||
hv.cpw=hero.cpw;
|
||||
hv.dpw=hero.dpw;
|
||||
hv.dopw=hero.dopw;
|
||||
hv.lv = role.lv;
|
||||
let slv= Math.floor(( hv.lv) / 5);
|
||||
hv.hp= hv.hp_max =(hero.hp+hero.hp_up*hv.lv)*(1+hero.shp_up/100*slv) ;
|
||||
hv.ap = (hero.ap+hero.ap_up*hv.lv) *(1+hero.sap_up/100*slv);
|
||||
hv.def= (hero.def+hero.def_up*hv.lv)*(1+hero.sdef_up/100*slv);
|
||||
hv.hp= hv.hp_max =hero.hp;
|
||||
hv.ap = hero.ap;
|
||||
hv.def= hero.def;
|
||||
hv.cd = hero.a_cd
|
||||
hv.crit = hero.crit; //暴击率
|
||||
hv.crit_add = hero.crit_add;//暴击伤害加成
|
||||
hv.dodge = hero.dodge; //闪避率
|
||||
hv.aexp=hero.aexp;
|
||||
hv.uaexp=hero.uaexp;
|
||||
hv.cexp=hero.cexp
|
||||
hv.doexp=hero.doexp
|
||||
hv.dexp=hero.dexp;
|
||||
this.add(hv);
|
||||
|
||||
// 初始化多个技能组件
|
||||
|
||||
@@ -298,26 +298,8 @@ export class HeroViewComp extends CCComp {
|
||||
let Drops = getMonsterDrops(1, MonsterType.Normal, 1.2);
|
||||
if(this.is_boss) Drops =getMonsterDrops(1, MonsterType.Elite, 1.2);
|
||||
if(this.is_big_boss) Drops =getMonsterDrops(1, MonsterType.Boss, 1.2);
|
||||
// console.log("掉落物品:",Drops);
|
||||
//根据掉落类型和uuid 写入用户数据文件SingletonModuleComp =smc,英雄碎片对应smc.heros[uuid].num,smc.heros[uuid].x1 记录本局掉落的数量,也需要添加对应值
|
||||
//金币uuid=9001 对应smc.vmdata.gold.num,宝箱uuid1003,对应smc.vmdata.box.num ,smc.itmes[9001].x1,smc.itmes[1003].x1 记录本局
|
||||
for (let i = 0; i < Drops.length; i++) {
|
||||
const drop = Drops[i];
|
||||
if(drop.type == 1 ){ //英雄碎片
|
||||
smc.heros[drop.uuid].num += drop.num
|
||||
smc.heros[drop.uuid].x1 += drop.num
|
||||
}
|
||||
if(drop.type==2){
|
||||
if(drop.uuid == 9001){
|
||||
smc.vmdata.gold.num+=drop.num
|
||||
smc.items[9001].x1+=drop.num
|
||||
}
|
||||
if(drop.uuid == 1003){
|
||||
smc.vmdata.box.num+=drop.num
|
||||
smc.items[1003].x1+=drop.num
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//进入墓地
|
||||
|
||||
@@ -11,9 +11,7 @@ import { AsyncQueue, NextFunction } from "../../../../extensions/oops-plugin-fra
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { LoadingViewComp } from "./view/LoadingViewComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { MonSet, HeroInfo } from "../common/config/heroSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
|
||||
|
||||
// import {data} from "../data/data";
|
||||
/**
|
||||
@@ -85,7 +83,6 @@ export class Initialize extends ecs.Entity {
|
||||
/** 加载完成进入游戏内容加载界面 */
|
||||
private onComplete(queue: AsyncQueue) {
|
||||
queue.complete = () => {
|
||||
// console.log("加载完成!",smc.heros);
|
||||
var uic: UICallbacks = {
|
||||
onAdded: (node: Node, params: any) => {
|
||||
var comp = node.getComponent(LoadingViewComp) as ecs.Comp;
|
||||
|
||||
@@ -31,82 +31,19 @@ export class VictoryComp extends CCComp {
|
||||
|
||||
}
|
||||
open(){
|
||||
var parent = this.node.getChildByName("items")
|
||||
for (let i in smc.items) {
|
||||
if(smc.items[i].x1 > 0){
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
item.load(smc.items[i].uuid,smc.items[i].x1,parent)
|
||||
}
|
||||
}
|
||||
for (let i in smc.heros) {
|
||||
if(smc.heros[i].x1 > 0){
|
||||
let path = "game/gui/hchip";
|
||||
let prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let node = instantiate(prefab);
|
||||
node.parent=parent
|
||||
let hc= node.getComponent(HChipComp)
|
||||
hc.update_data(smc.heros[i].uuid,smc.heros[i].x1)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
do_x10(){
|
||||
// for (let i in smc.items) {
|
||||
// if(smc.items[i].uuid == 9001){
|
||||
// smc.vmdata.gold.num+=smc.items[i].x1*10
|
||||
// }
|
||||
// if(smc.items[i].uuid == 9003){
|
||||
// smc.vmdata.exp.num+=smc.items[i].x1*10
|
||||
// }
|
||||
// if(smc.items[i].uuid == 1003){
|
||||
// smc.vmdata.box.num+=smc.items[i].x1*10
|
||||
// }
|
||||
// if(smc.items[i].uuid < 9000){
|
||||
// smc.items[i].num+=smc.items[i].x1*10
|
||||
|
||||
// }
|
||||
// }
|
||||
// for (let i in smc.heros) {
|
||||
// smc.heros[i].num+=smc.heros[i].x1*10
|
||||
// }
|
||||
this.clear_x1()
|
||||
|
||||
}
|
||||
do_x1(){
|
||||
// for (let i in smc.items) {
|
||||
// if(smc.items[i].uuid == 9001){
|
||||
// smc.vmdata.gold.num+=smc.items[i].x1
|
||||
// }
|
||||
// if(smc.items[i].uuid == 9003){
|
||||
// smc.vmdata.exp.num+=smc.items[i].x1
|
||||
// }
|
||||
// if(smc.items[i].uuid == 1003){
|
||||
// smc.vmdata.box.num+=smc.items[i].x1
|
||||
// }
|
||||
// if(smc.items[i].uuid < 9000){
|
||||
// smc.items[i].num+=smc.items[i].x1
|
||||
|
||||
// }
|
||||
// }
|
||||
// for (let i in smc.heros) {
|
||||
// smc.heros[i].num+=smc.heros[i].x1
|
||||
// }
|
||||
this.clear_x1()
|
||||
}
|
||||
clear_x1(){
|
||||
for (let i in smc.items) {
|
||||
smc.items[i].x1=0
|
||||
}
|
||||
// for (let i in smc.skills) {
|
||||
// smc.skills[i].x1=0
|
||||
// }
|
||||
for (let i in smc.heros) {
|
||||
smc.heros[i].x1=0
|
||||
}
|
||||
let children = this.node.getChildByName("items").children
|
||||
console.log("children",children)
|
||||
for (let i in children) {
|
||||
children[i].destroy()
|
||||
}
|
||||
|
||||
this.node.parent.getComponent(MissionComp).to_mission_home()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user