From b0d35b6ff59268f207593c44cebe29b989aab6b1 Mon Sep 17 00:00:00 2001 From: panw Date: Tue, 18 Mar 2025 09:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89smc.heros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/game/hero/Hero.ts | 17 +---- assets/script/game/hero/HeroViewComp.ts | 22 +------ assets/script/game/initialize/Initialize.ts | 5 +- assets/script/game/map/VictoryComp.ts | 71 ++------------------- 4 files changed, 10 insertions(+), 105 deletions(-) diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index ca833c89..6eb17554 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -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); // 初始化多个技能组件 diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 9dd87350..1f891a4f 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -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 - } - } - } + + } //进入墓地 diff --git a/assets/script/game/initialize/Initialize.ts b/assets/script/game/initialize/Initialize.ts index f989da43..f0553f39 100644 --- a/assets/script/game/initialize/Initialize.ts +++ b/assets/script/game/initialize/Initialize.ts @@ -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; diff --git a/assets/script/game/map/VictoryComp.ts b/assets/script/game/map/VictoryComp.ts index fae1ce27..25ae5710 100644 --- a/assets/script/game/map/VictoryComp.ts +++ b/assets/script/game/map/VictoryComp.ts @@ -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.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() }