#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package GM.Commands.MainLevel # # @todo:Ö÷Ï߹ؿ¨ # @author hxp # @date 2025-07-02 # @version 1.0 # # ÏêϸÃèÊö: Ö÷Ï߹ؿ¨ # #------------------------------------------------------------------------------- #"""Version = 2025-07-02 17:30""" #------------------------------------------------------------------------------- import GameWorld import PlayerControl import IpyGameDataPY def OnExec(curPlayer, gmList): if not gmList: GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÖ÷Ïß: MainLevel 0") GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÖ÷Ïß: MainLevel ÕÂ½Ú ¹Ø¿¨ ²¨") return value = gmList[0] if value <= 0: nowValue = PlayerControl.SetMainLevelNowInfo(curPlayer, 1, 1, 1) passValue = PlayerControl.SetMainLevelPassInfo(curPlayer, 0, 0, 0) GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÖ÷Ïß:now=%s,pass=%s" % (nowValue, passValue)) return chapterID = value levelNum = gmList[1] if len(gmList) > 1 else 1 wave = gmList[2] if len(gmList) > 2 else 1 levelIpyData = IpyGameDataPY.GetIpyGameData("MainLevel", chapterID, levelNum) if not levelIpyData: GameWorld.DebugAnswer(curPlayer, "Õ½ڹؿ¨²»´æÔÚ: Õ¹Ø=%s-%s" % (chapterID, levelNum)) return # ±¾¹Ø¿¨×î´ó²¨Êý£¬ÔÝʱ֧³Ö×î´ó6²¨ waveMax = 10 while waveMax >= 1 and (not hasattr(levelIpyData, "GetWaveLineupIDList%s" % waveMax) or not getattr(levelIpyData, "GetWaveLineupIDList%s" % waveMax)()): waveMax -= 1 if wave > waveMax: wave = waveMax nowValue = PlayerControl.SetMainLevelNowInfo(curPlayer, chapterID, levelNum, wave) passValue = PlayerControl.SetMainLevelPassInfo(curPlayer, chapterID, levelNum, wave) GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÖ÷Ïß:Õ¹Ø=%s-%s,²¨=%s,%s,%s" % (chapterID, levelNum, wave, nowValue, passValue)) return