去掉smc.heros

This commit is contained in:
panw
2025-03-18 09:39:02 +08:00
parent eb20011f07
commit b0d35b6ff5
4 changed files with 10 additions and 105 deletions

View File

@@ -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);
// 初始化多个技能组件

View File

@@ -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
}
}
}
}
//进入墓地