/* * @Author: dgflash * @Date: 2021-11-18 14:20:46 * @LastEditors: dgflash * @LastEditTime: 2022-08-04 15:46:16 */ import { VM } from "../../../../extensions/oops-plugin-framework/assets/libs/model-view/ViewModel"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { Initialize } from "../initialize/Initialize"; import { GameMap } from "../map/GameMap"; import { BoxSet } from "./config/BoxSet"; import { Role } from "../Role/Role"; import { v3 } from "cc"; import { Skill } from "../skills/Skill"; // import { Role } from "../role/Role"; // import { data } from "../data/data"; /** 游戏模块 */ @ecs.register('SingletonModule') export class SingletonModuleComp extends ecs.Comp { /** 游戏初始化模块 */ initialize: Initialize = null!; /** 游戏地图 */ map: GameMap = null!; cards: any = [ {uuid:9001,type:1},{uuid:9002,type:1},{uuid:9011,type:1},{uuid:9021,type:1},{uuid:9031,type:1},{uuid:9041,type:1} ]; item_list: any = [ {uuid:6005,type:2},{uuid:6006,type:2},{uuid:6101,type:2},{uuid:6102,type:2}, {uuid:6210,type:2},{uuid:6211,type:2},{uuid:6212,type:2}, // {uuid:6213,type:2},{uuid:6214,type:2},{uuid:6215,type:2}, // {uuid:6216,type:2},{uuid:6217,type:2},{uuid:6218,type:2} ]; items: any = [] player_skills: any = [ ]; player_buffs: any = [ {x:-BoxSet.CSKILL_X,y:BoxSet.CSKILL_Y,eid:0}, {x:-BoxSet.CSKILL_X+55,y:BoxSet.CSKILL_Y,eid:0}, {x:-BoxSet.CSKILL_X+110,y:BoxSet.CSKILL_Y,eid:0}, {x:-BoxSet.CSKILL_X,y:BoxSet.CSKILL_Y,eid:0}, {x:-BoxSet.CSKILL_X,y:BoxSet.CSKILL_Y+55,eid:0}, {x:-BoxSet.CSKILL_X+55,y:BoxSet.CSKILL_Y+55,eid:0}, {x:-BoxSet.CSKILL_X+110,y:BoxSet.CSKILL_Y+55,eid:0}, {x:-BoxSet.CSKILL_X+165,y:BoxSet.CSKILL_Y+55,eid:0}, ]; role_heros: any = [ {x:BoxSet.ROLE_FUX,y:50,eid:0}, {x:BoxSet.ROLE_FUX,y:0,eid:0}, {x:BoxSet.ROLE_FUX,y:-50,eid:0}, {x:BoxSet.ROLE_FUX+40,y:50,eid:0}, {x:BoxSet.ROLE_FUX+40,y:0,eid:0}, {x:BoxSet.ROLE_FUX+40,y:-50,eid:0}, {x:BoxSet.ROLE_BUX,y:50,eid:0}, {x:BoxSet.ROLE_BUX,y:0,eid:0}, {x:BoxSet.ROLE_BUX,y:-50,eid:0}, {x:BoxSet.ROLE_BUX-40,y:50,eid:0}, {x:BoxSet.ROLE_BUX-40,y:0,eid:0}, {x:BoxSet.ROLE_BUX-40,y:-50,eid:0}, ]; monster_buffs: any = []; /** 游戏主角 */ Role: Role = null; t_monster:any={eid:0,pos:v3(0,0,0)}; t_hero:any={eid:0,pos:v3(0,0,0)}; /** 游戏数据 */ // data:data = null!; /**怪物数据 数组 */ /**heros 数据 */ heros:any = []; monsters:any = []; skills:any = [] sk_info:any = [] monsters_dead:any = [] heros_dead:any = [] least_hp_monster_eid:number=0; least_hp_monster_hp:number=1000; least_hp_hero_eid:number=0; least_hp_hero_hp:number=1000; vm_data: any = { name : "纸片精灵大乱斗", game_over:false, /**宝石数量 */ gems: 4, unlock:5, game:{ t_damge:0, t_dps:0, h_dps:0, m_dps:0, g_level:1, g_time:0, }, role:{ hp:3000, hp_max:3000, speed:30, atk:10, buff_atk:0, mission_atk:0, atk_cd:1, atk_cd_up:0, mission_atk_cd_up:0, atk_range:400, lv:1, exp:0, next_exp:100, power:300, skill:8001, skills:{ 1:{uuid:8001,cd:2,alive:true }, 2:{uuid:9002,cd:2,alive:false}, 3:{uuid:9003,cd:2,alive:false}, 4:{uuid:9004,cd:2,alive:false}, 5:{uuid:9005,cd:2,alive:false}, } }, /** 当前等级 */ cards:{ level:1, level_max:4, eid:0, ref_cost:1, up_cost:4, }, gold: { min: 200, max: 200, max_limit:200, time:0, cd:1, }, shuaxin: { min: 0, max: 5, speed:1, }, item_box:{ hp:0, atk:0, atk_cd:0, power:0, name:"", skillcd:0, skillsd:0, shield:0, info:"", } }; vmAdd() { VM.add(this.vm_data, "data"); } reset() { for (var key in this.vm_data) { delete this.vm_data[key]; } } } export var smc: SingletonModuleComp = ecs.getSingleton(SingletonModuleComp);