WaterControl/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js
2024-07-19 18:25:37 +08:00

289 lines
8.9 KiB
JavaScript

"use strict";
cc._RF.push(module, 'c5692vnhwNF5J9nI7VNKQNW', 'GameConfig');
// Script/module/Config/GameConfig.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameConfig = void 0;
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var GameConfig = /** @class */ (function () {
function GameConfig() {
}
GameConfig_1 = GameConfig;
Object.defineProperty(GameConfig, "Instance", {
//游戏内信息
get: function () {
if (this._instance == null) {
this._instance = new GameConfig_1();
}
return this._instance;
},
enumerable: false,
configurable: true
});
//getSeedRandom
GameConfig.init = function (Authentication) {
this.CLICK_init();
this.LEVEL_INFO_init();
this.GM_INFO_init();
var self = this;
// cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => {
// if (err) {
// return;
// }
// let jsonData: object = res.json!;
// self.CLICK_DATA = jsonData["data"];
// })
// cc.resources.load('Json/LEVEL_INFO', (err: any, res: cc.JsonAsset) => {
// if (err) {
// return;
// }
// let jsonData: object = res.json!;
// self.LEVEL_INFO = jsonData["data"];
// })
// cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {
// if (err) {
// if(!Authentication) self.Authentication();
// return;
// }
// let jsonData: object = res.json!;
// self.GM_INFO = jsonData["data"];
// cc.fx.GameTool.getCustom(false);
// if(!Authentication) self.Authentication();
// })
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
this.GAME_DATA = [];
this.CUSTOM_INFO = [
//第一难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第二难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第三难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第四难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第五难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第六难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第七难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第八难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第九难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
},
//第十难度
{
moveSpeed: 0,
waitTime: 20,
fastPath: 5 //最短路径
}
];
};
//数据备用
GameConfig.GM_INFO_init = function () {
this.GM_INFO = {
// isEnd: false,
mean_Time: 0,
total: 0,
currSeed: 200000,
gameId: "100010",
userId: 200139,
guide: true,
url: "https://api.sparkus.cn",
success: false,
matchId: null,
custom: 0,
level: 0,
stepTimeList: 0,
successList: [],
gameTime: 5,
igniteCount: 0,
};
};
GameConfig.GM_INFO_SET = function (key, value) {
this.GM_INFO[key] = value;
};
GameConfig.CLICK_init = function () {
this.CLICK_DATA =
{
type: 1,
success: false,
round: 0,
choice: 0,
rightChoice: 0,
item: "",
roundType: 0,
stepTime: 0,
levelConfig: 0,
ignite: false,
igniteCount: 0,
};
};
GameConfig.CLICK_SET = function (key, value) {
this.CLICK_DATA[key] = value;
};
GameConfig.LEVEL_INFO_init = function () {
/*
moveSpeed: 0, //洪峰移动速度
waitTime: 20, //洪峰冲击倒计时
fastPath: 5 //最短路径
*/
this.LEVEL_INFO = [
[
{
"id": 1001,
"map": [
[0, 0, 0, 0, 0, 4],
[0, 0, 0, 0, 0, 0],
[0, 0, 3, 0, 3, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 3, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 2, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0]
]
},
{
"id": 1002,
"map": [
[0, 0, 0, 0, 0, 0, 0, 0, 4],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 0, 0]
]
},
{
"id": 1003,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1004,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1005,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1006,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1007,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1008,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1009,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
},
{
"id": 1010,
"map": [
[1, 0, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 6]
]
}
],
];
};
GameConfig.Authentication = function () {
cc.fx.GameTool.Authentication();
};
var GameConfig_1;
//所有控制信息都通过GameAppStart内控制
GameConfig._instance = null;
GameConfig = GameConfig_1 = __decorate([
ccclass('GameConfig')
], GameConfig);
return GameConfig;
}());
exports.GameConfig = GameConfig;
cc._RF.pop();