2023-11-17 18:29:39 +08:00
|
|
|
import { GOnHookPets } from "../../../extensions/ngame/assets/ngame/message/proto";
|
|
|
|
import { app } from "../App";
|
|
|
|
import { PlayerPetOV, RData, RProto } from "./API";
|
|
|
|
import { GActionType } from "./GActionType";
|
|
|
|
|
2023-12-02 02:13:22 +08:00
|
|
|
export interface ModeOnHookOV{
|
|
|
|
|
|
|
|
playerId:number; //玩家Id
|
|
|
|
onHookMap:number; //当前玩家所在的地图(配置表Id)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-11-17 18:29:39 +08:00
|
|
|
export const GAPI = {
|
|
|
|
|
|
|
|
/************** 无限模式接口 ********************/
|
2023-12-02 02:13:22 +08:00
|
|
|
//获取模式信息
|
|
|
|
GOnHookInfo : async () => RData(await app.api.get(`/game/mode/onHook/info`)) as ModeOnHookOV,
|
2023-12-03 03:31:19 +08:00
|
|
|
//切换游戏
|
|
|
|
GOnHookSetMap : async (mapId) => RData(await app.api.post(`/game/mode/onHook/setMapId/${mapId}`)) as ModeOnHookOV,
|
2023-11-17 18:29:39 +08:00
|
|
|
//生成野怪
|
|
|
|
GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'}),GActionType.GOnHookPets) as GOnHookPets,
|
|
|
|
//捕捉野怪
|
|
|
|
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`)) as PlayerPetOV,
|
2023-11-20 03:47:00 +08:00
|
|
|
//出售野怪
|
2023-11-20 18:25:50 +08:00
|
|
|
GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`)) as boolean,
|
2023-11-17 18:29:39 +08:00
|
|
|
|
|
|
|
}
|