|
@@ -18,6 +18,7 @@ import MonsterVO from "../vo/MonsterVO";
|
|
|
import PlayerVO from "../vo/PlayerVO";
|
|
import PlayerVO from "../vo/PlayerVO";
|
|
|
import Prop from "../vo/Prop";
|
|
import Prop from "../vo/Prop";
|
|
|
import SkillVO from "../vo/SkillVO";
|
|
import SkillVO from "../vo/SkillVO";
|
|
|
|
|
+import TaskVO from "../vo/TaskVO";
|
|
|
import { GENERALPROP, GENERALSTATUS, ITEMTYPE, PLAYERPROP } from "./GameDefinition";
|
|
import { GENERALPROP, GENERALSTATUS, ITEMTYPE, PLAYERPROP } from "./GameDefinition";
|
|
|
|
|
|
|
|
const { ccclass } = cc._decorator;
|
|
const { ccclass } = cc._decorator;
|
|
@@ -57,6 +58,7 @@ export default class GameData {
|
|
|
help_data: any;
|
|
help_data: any;
|
|
|
server_data: any;
|
|
server_data: any;
|
|
|
commanderskill_data: any;
|
|
commanderskill_data: any;
|
|
|
|
|
+ private task_data: any;
|
|
|
|
|
|
|
|
fullskillId: number[];
|
|
fullskillId: number[];
|
|
|
|
|
|
|
@@ -79,23 +81,24 @@ export default class GameData {
|
|
|
this.server_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/serverConfig_data.json?v=' + new Date().getTime());
|
|
this.server_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/serverConfig_data.json?v=' + new Date().getTime());
|
|
|
this.help_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/help_data.json?v=' + new Date().getTime());
|
|
this.help_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/help_data.json?v=' + new Date().getTime());
|
|
|
this.commanderskill_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/commanderskill_data.json?v=' + new Date().getTime());
|
|
this.commanderskill_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/commanderskill_data.json?v=' + new Date().getTime());
|
|
|
|
|
+ this.task_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/task_data.json?v=' + new Date().getTime());
|
|
|
turntableModel.Instance.turntable_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/turntable_data.json?v=' + new Date().getTime());
|
|
turntableModel.Instance.turntable_data = await GameController.resM.loadRemoteJson('https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/h5game/tower_sanguo/data/turntable_data.json?v=' + new Date().getTime());
|
|
|
|
|
|
|
|
- this.db_data = cc.loader.getRes("data/db_data", cc.JsonAsset).json;
|
|
|
|
|
- this.server_data = cc.loader.getRes("data/serverConfig_data", cc.JsonAsset).json;
|
|
|
|
|
- this.fetter_data = cc.loader.getRes("data/fetter_data", cc.JsonAsset).json;
|
|
|
|
|
- this.buff_data = cc.loader.getRes("data/buff_data", cc.JsonAsset).json;
|
|
|
|
|
- this.skill_data = cc.loader.getRes("data/skill_data", cc.JsonAsset).json;
|
|
|
|
|
- this.general_data = cc.loader.getRes("data/general_data", cc.JsonAsset).json;
|
|
|
|
|
- this.monster_data = cc.loader.getRes("data/monster_data", cc.JsonAsset).json;
|
|
|
|
|
- this.mission_data = cc.loader.getRes("data/mission_data", cc.JsonAsset).json;
|
|
|
|
|
- this.item_data = cc.loader.getRes("data/item_data", cc.JsonAsset).json;
|
|
|
|
|
- this.barrack_json = cc.loader.getRes("data/barrack_data", cc.JsonAsset).json;
|
|
|
|
|
- this.star_data = cc.loader.getRes("data/star_data", cc.JsonAsset).json;
|
|
|
|
|
- this.help_data = cc.loader.getRes("data/help_data", cc.JsonAsset).json;
|
|
|
|
|
- this.commanderskill_data = cc.loader.getRes("data/commanderskill_data", cc.JsonAsset).json;
|
|
|
|
|
- turntableModel.Instance.turntable_data = cc.loader.getRes("data/turntable_data", cc.JsonAsset).json;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // this.db_data = cc.loader.getRes("data/db_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.server_data = cc.loader.getRes("data/serverConfig_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.fetter_data = cc.loader.getRes("data/fetter_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.buff_data = cc.loader.getRes("data/buff_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.skill_data = cc.loader.getRes("data/skill_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.general_data = cc.loader.getRes("data/general_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.monster_data = cc.loader.getRes("data/monster_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.mission_data = cc.loader.getRes("data/mission_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.item_data = cc.loader.getRes("data/item_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.barrack_json = cc.loader.getRes("data/barrack_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.star_data = cc.loader.getRes("data/star_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.help_data = cc.loader.getRes("data/help_data", cc.JsonAsset).json;
|
|
|
|
|
+ // this.commanderskill_data = cc.loader.getRes("data/commanderskill_data", cc.JsonAsset).json;
|
|
|
|
|
+ this.task_data = cc.loader.getRes("data/task_data", cc.JsonAsset).json;
|
|
|
|
|
+ // turntableModel.Instance.turntable_data = cc.loader.getRes("data/turntable_data", cc.JsonAsset).json;
|
|
|
this.initJsonData();
|
|
this.initJsonData();
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -337,21 +340,37 @@ export default class GameData {
|
|
|
let o = this.commanderskill_data[i];
|
|
let o = this.commanderskill_data[i];
|
|
|
let csvo = new CommanderSkillVO();
|
|
let csvo = new CommanderSkillVO();
|
|
|
csvo.id = o.id;
|
|
csvo.id = o.id;
|
|
|
- let tempstars=o.starcount.split(":");
|
|
|
|
|
- for(let i=0;i<tempstars.length;i++){
|
|
|
|
|
|
|
+ let tempstars = o.starcount.split(":");
|
|
|
|
|
+ for (let i = 0; i < tempstars.length; i++) {
|
|
|
csvo.unlockstarcount.push(parseInt(tempstars[i]));
|
|
csvo.unlockstarcount.push(parseInt(tempstars[i]));
|
|
|
}
|
|
}
|
|
|
this.commanderskill_data[i] = csvo;
|
|
this.commanderskill_data[i] = csvo;
|
|
|
- console.log("index: "+i+" d: ",o);
|
|
|
|
|
|
|
+ console.log("index: " + i + " d: ", o);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- console.log("commanderskill_data: ",this.commanderskill_data);
|
|
|
|
|
- console.log("skill_data: ",this.skill_data);
|
|
|
|
|
|
|
+ console.log("commanderskill_data: ", this.commanderskill_data);
|
|
|
|
|
+ console.log("skill_data: ", this.skill_data);
|
|
|
|
|
|
|
|
|
|
+ // 任务
|
|
|
|
|
+ this.initTaskData();
|
|
|
|
|
|
|
|
GameController.initSDK();
|
|
GameController.initSDK();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /** 初始化任务 */
|
|
|
|
|
+ private initTaskData() {
|
|
|
|
|
+ for (let i in this.task_data) {
|
|
|
|
|
+ let o = this.task_data[i];
|
|
|
|
|
+ let vo = new TaskVO();
|
|
|
|
|
+ vo.id = o.id;
|
|
|
|
|
+ vo.description = o.description;
|
|
|
|
|
+ vo.count1 = o.count1;
|
|
|
|
|
+ vo.activevalue1 = o.activevalue1;
|
|
|
|
|
+ vo.count2 = o.count2;
|
|
|
|
|
+ vo.activevalue2 = o.activevalue2;
|
|
|
|
|
+ this.task_data[i] = vo;
|
|
|
|
|
+ }
|
|
|
|
|
+ cc.log(this.task_data)
|
|
|
|
|
+ }
|
|
|
getAllGeneral() {
|
|
getAllGeneral() {
|
|
|
return this.general_data;
|
|
return this.general_data;
|
|
|
}
|
|
}
|