137 lines
4.3 KiB
TypeScript
137 lines
4.3 KiB
TypeScript
/*
|
|
* @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 { v3 } from "cc";
|
|
import { Skill } from "../skills/Skill";
|
|
import { dead } from "../skills/oncend";
|
|
|
|
// 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!;
|
|
mission:any={
|
|
play:false,
|
|
pause:false,
|
|
is_victory:false,
|
|
is_defeat:false,
|
|
is_battle:false,
|
|
lv:1,
|
|
victory:0,
|
|
mskill:1001,
|
|
mmskill:1002,
|
|
|
|
};
|
|
skills: any = {
|
|
1001:{uuid:1001,slv:0,num:4,x1:1,x10:0},
|
|
1002:{uuid:1002,slv:0,num:3,x1:2,x10:0},
|
|
1003:{uuid:1003,slv:0,num:0,x1:0,x10:0},
|
|
1004:{uuid:1004,slv:0,num:0,x1:0,x10:0},
|
|
1005:{uuid:1005,slv:0,num:0,x1:0,x10:0},
|
|
1006:{uuid:1006,slv:0,num:0,x1:0,x10:0},
|
|
1007:{uuid:1007,slv:0,num:0,x1:0,x10:0},
|
|
1008:{uuid:1008,slv:0,num:0,x1:0,x10:0},
|
|
1009:{uuid:1009,slv:0,num:0,x1:0,x10:0},
|
|
};
|
|
/** 游戏主角 */
|
|
heros:any={
|
|
9001:{uuid:9001,lv:1,exp:0,slv:0,stone:0,num:100,x1:1,x10:0},
|
|
9002:{uuid:9002,lv:2,exp:0,slv:1,stone:0,num:80,x1:2,x10:0},
|
|
9003:{uuid:9003,lv:3,exp:0,slv:2,stone:0,num:90,x1:3,x10:0},
|
|
};
|
|
goods:any={
|
|
free: [ {uuid:9001,num:100000}, {uuid:9002,num:10}, {uuid:9003,num:10}],
|
|
goods1:[ {uuid:1001,num:100}, {uuid:9002,num:1} ],
|
|
herochips:[ {uuid:9001,num:2}, {uuid:9002,num:1} ],
|
|
skillchips:[ {uuid:1001,num:100}, {uuid:1002,num:1} ],
|
|
goods4:[ {uuid:9001,num:100}, {uuid:9002,num:1} ],
|
|
};
|
|
items:any={
|
|
1001:{uuid:1001,num:1000,x1:1,x10:0},
|
|
1002:{uuid:1002,num:1000,x1:0,x10:0},
|
|
1003:{uuid:1003,num:1000,x1:0,x10:0},
|
|
1004:{uuid:1004,num:1000,x1:0,x10:0},
|
|
1005:{uuid:1005,num:1000,x1:0,x10:0},
|
|
1006:{uuid:1006,num:1000,x1:0,x10:0},
|
|
1007:{uuid:1007,num:1000,x1:0,x10:0},
|
|
1008:{uuid:1008,num:1000,x1:0,x10:0},
|
|
1009:{uuid:1009,num:1000,x1:0,x10:0},
|
|
1010:{uuid:1010,num:1000,x1:0,x10:0},
|
|
1011:{uuid:1011,num:1000,x1:0,x10:0},
|
|
1012:{uuid:1012,num:1000,x1:0,x10:0},
|
|
1013:{uuid:1013,num:1000,x1:0,x10:0},
|
|
1014:{uuid:1014,num:1000,x1:0,x10:0},
|
|
1015:{uuid:1015,num:1000,x1:0,x10:0},
|
|
1016:{uuid:1016,num:1000,x1:0,x10:0},
|
|
};
|
|
fight_heros=[9001,9002]
|
|
mheros:any = [];
|
|
monsters:any = [];
|
|
sk_info:any = []
|
|
monsters_dead:any = []
|
|
heros_dead:any = []
|
|
hero_pos:any=[]
|
|
enemy_pos:any =[]
|
|
vmdata: any = {
|
|
name : "纸片精灵大乱斗",
|
|
game_over:false,
|
|
game_pause:false,
|
|
mission:{
|
|
once:6, //每波刷新怪物数量
|
|
total:1, //总怪物数
|
|
exp:0,
|
|
exp_max:100,
|
|
mexp:0,
|
|
mexp_max:100,
|
|
hp:0,
|
|
ap:0,
|
|
def:0,
|
|
crit:0,
|
|
dodge:0,
|
|
dead:0,
|
|
mhp:0,
|
|
map:0,
|
|
mdef:0,
|
|
mcrit:0,
|
|
mdodge:0,
|
|
mdead:0,
|
|
|
|
reward_num:0, //怪物死亡数
|
|
reward_gold:0,
|
|
reward_exp:0,
|
|
},
|
|
gold:{num:9999999,x1:1,x10:0},
|
|
exp:{num:1000,x1:1,x10:0},
|
|
skp:{num:2000,x1:1,x10:0}, //技能升级点数
|
|
energy:{num:10,x1:1,x10:0},
|
|
|
|
free:{ cost:0,num:3,buy:3,},
|
|
goods1:{ cost:2000,num:3,buy:3,},
|
|
herochips:{ cost:3000,num:4,buy:3,},
|
|
skillchips:{ cost:4000,num:5,buy:3,},
|
|
|
|
};
|
|
vmAdd() {
|
|
VM.add(this.vmdata, "data");
|
|
|
|
}
|
|
reset() {
|
|
for (var key in this.vmdata) {
|
|
delete this.vmdata[key];
|
|
}
|
|
}
|
|
}
|
|
|
|
export var smc: SingletonModuleComp = ecs.getSingleton(SingletonModuleComp); |