mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
import { GOnHookPets } from "../../../extensions/ngame/assets/ngame/message/proto";
|
|
import { app } from "../App";
|
|
import { PlayerPetOV, RData, RProto } from "./API";
|
|
import { GActionType } from "./GActionType";
|
|
|
|
export interface ModeOnHookOV{
|
|
|
|
playerId:number; //玩家Id
|
|
onHookMap:number; //当前玩家所在的地图(配置表Id)
|
|
levelId:number; //当前关卡Id
|
|
|
|
}
|
|
|
|
export const GAPI = {
|
|
|
|
/************** 无限模式接口 ********************/
|
|
//获取模式信息
|
|
GOnHookInfo : async () => RData(await app.api.get(`/game/mode/onHook/info`)) as ModeOnHookOV,
|
|
//切换游戏
|
|
GOnHookSetMap : async (mapId) => RData(await app.api.post(`/game/mode/onHook/setMapId/${mapId}`)) as ModeOnHookOV,
|
|
//生成野怪
|
|
GOnHookSpawnCreeps : async () => RProto(await app.api.get(`/game/mode/onHook/onSpawnCreeps`,{responseType:'arraybuffer'},false),GActionType.GOnHookPets) as GOnHookPets,
|
|
//捕捉野怪
|
|
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`),true) as PlayerPetOV,
|
|
//出售野怪
|
|
GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`),true) as boolean,
|
|
//下一关
|
|
GOnHookNextLevel : async () => RData(await app.api.post(`/game/mode/onHook/nextLevel`)) as boolean,
|
|
|
|
} |