mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -2,6 +2,7 @@ import { app } from "../App";
|
||||
import GBattleData, { GBattleDataInfo } from "../battle/base/values/GAttributeData";
|
||||
import { API } from "../consts/API";
|
||||
import { GAPI, ModeOnHookOV } from "../consts/GAPI";
|
||||
import GOnHookManager from "../manager/battle/mode/GOnHookManager";
|
||||
import { GUI } from "../ui/UIConfig";
|
||||
import BaseData from "./BaseData";
|
||||
|
||||
@@ -17,7 +18,7 @@ export default class GOnHookData extends BaseData{
|
||||
//是否允许下一关
|
||||
get isNextLevel(){
|
||||
if(!this.info) return false;
|
||||
return this.info.hookInfo.mapStates[this.info.onHookMap] == 1;
|
||||
return this.info.hookInfo.mapStates[this.info.onHookMap] >= 4;
|
||||
}
|
||||
|
||||
async onInit() {
|
||||
@@ -35,21 +36,25 @@ export default class GOnHookData extends BaseData{
|
||||
//切换地图
|
||||
async setMap(mapId:number){
|
||||
|
||||
this.info = await GAPI.GOnHookSetMap(mapId);
|
||||
this.info = await GAPI.GOnHookSetMap(mapId,GOnHookManager.getIns().getKillSreepsIds());
|
||||
app.layer.Open(GUI.Tips,{text:"切换地图成功"});
|
||||
|
||||
}
|
||||
|
||||
//下一关
|
||||
async onNextLevel(){
|
||||
let info = await GAPI.GOnHookNextLevel();
|
||||
if(info) this.onUpdateInfo(info);
|
||||
return !!info;
|
||||
let info = await GAPI.GOnHookNextLevel(GOnHookManager.getIns().getKillSreepsIds());
|
||||
this.onUpdateInfo(info);
|
||||
}
|
||||
|
||||
//战胜当前关卡
|
||||
async onWinLevel(){
|
||||
this.onUpdateInfo(await GAPI.GOnHookWinLevel());
|
||||
this.onUpdateInfo(await GAPI.GOnHookWinLevel())
|
||||
}
|
||||
|
||||
//返回当前进度
|
||||
getProgress(){
|
||||
return this.info.hookInfo.mapStates[this.info.onHookMap] || 0
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -52,6 +52,11 @@ export default class ResourceData extends BaseData{
|
||||
|
||||
}
|
||||
|
||||
//获取所有资源Id
|
||||
getIds():number[]{
|
||||
return Object.keys(this.data).map(id => parseInt(id));
|
||||
}
|
||||
|
||||
//获取指定资源的数量
|
||||
getValue(type:ResourceType){
|
||||
return this.data[type] || 0;
|
||||
|
Reference in New Issue
Block a user