hxp
2019-01-24 050d498578914bf03e6e8acec7fd68c29dce79c4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianTower.py
@@ -50,6 +50,7 @@
FBDict_LastHurtTick = 'FBDict_LastHurtTick'  #上次伤害时间
FBDict_HasGiveAward = 'FBDict_HasGiveAward'  # 是否有给奖励
# 副本通用配置
(
Def_PrepareTime,  # 每关准备时间,秒
@@ -119,21 +120,22 @@
## 检查可否进行挑战
def __CheckCanChallenge(curPlayer):
    #判断次数
    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianTower)
    if enterCnt >= FBCommon.GetEnterFBMaxCnt(curPlayer, ChConfig.Def_FBMapID_ZhuXianTower):
        GameWorld.Log('进入次数不足!!')
        return 0
    curFloor = __GetZhuXianTowerCurPassLV(curPlayer)
    ipyMgr = IpyGameDataPY.IPY_Data()
    maxFloor = ipyMgr.GetZhuXianTowerByIndex(ipyMgr.GetZhuXianTowerCount() - 1).GetID()
    if curFloor >= maxFloor:
    if curFloor >= maxFloor: #已经最后层时,判断次数
        enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_ZhuXianTower)
        if enterCnt >= FBCommon.GetEnterFBMaxCnt(curPlayer, ChConfig.Def_FBMapID_ZhuXianTower):
            GameWorld.Log('进入次数不足!!')
            return 0
        return maxFloor
    return curFloor + 1
    
##玩家切换地图
def DoPlayerChangeMapLogic(curPlayer):
    FBCommon.UpdateFBEnterTick(curPlayer)
    curStar = GameWorld.GetGameFB().GetGameFBDictByKey(FBDict_FBStar)
    if curStar != Def_MaxStar:
        FBCommon.UpdateFBEnterTick(curPlayer)
    return
##副本玩家进入点
@@ -191,7 +193,14 @@
# @remarks 玩家主动离开副本.
def DoExitFB(curPlayer, tick):
    # 玩家退出默认关闭副本
    #GameWorldProcess.CloseFB(tick)
    gameFB = GameWorld.GetGameFB()
    fbStep = gameFB.GetFBStep()
    if fbStep == FB_State_FreeTime:
        #退出时,若s级则补发奖励
        curStar = gameFB.GetGameFBDictByKey(FBDict_FBStar)
        if curStar == Def_MaxStar:
            __GiveFBPassPrize(curPlayer)
        GameWorldProcess.CloseFB(tick)
    return
@@ -317,6 +326,12 @@
    gameFB.SetGameFBDict(FBDict_BossTotalHP, totalHP * 1000)
    gameFB.SetGameFBDict(FBDict_Speed, 1000)  #速度默认1000
    gameFB.SetGameFBDict(FBDict_RemainHP, totalHP * 1000)
    gameFB.SetGameFBDict(FBDict_IsReduceing, 0)
    gameFB.SetGameFBDict(FBDict_LastHurtTick, 0)
    gameFB.SetGameFBDict(FBDict_HasGiveAward, 0)
    gameFB.SetGameFBDict(FBDict_StartTick, 0)
    gameFB.SetGameFBDict(FBDict_FBStar, 0)
    prepareTick = __GetZhuXianCfg()[Def_PrepareTime] * 1000
    FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttAddUpTime, prepareTick)
    FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttWaitStart, prepareTick)
@@ -388,26 +403,28 @@
        return
    # 记录过关
    #EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ZhuXianTower, 0, ChConfig.CME_Log_End, 0, 1)
    unLockEquipPlace = ipyData.GetUnLockEquipPlace()
    if unLockEquipPlace:
        PlayerControl.WorldNotify(0, 'KillGodTowerInfo_1', [curPlayer.GetPlayerName(), fbLevel, unLockEquipPlace])
    ipyMgr = IpyGameDataPY.IPY_Data()
    maxFloor = ipyMgr.GetZhuXianTowerByIndex(ipyMgr.GetZhuXianTowerCount() - 1).GetID()
    # 过关时间
    costTime = tick - GameWorld.GetGameFB().GetFBStepTick()
    curStar = gameFB.GetGameFBDictByKey(FBDict_FBStar)
    isFirstS = 0
    if fbLevel < maxFloor and curStar == Def_MaxStar:
    if fbLevel != __GetZhuXianTowerCurPassLV(curPlayer) and curStar == Def_MaxStar:
        #更新关卡
        SetZhuXianTowerCurPassLV(curPlayer, fbLevel)
        #更新诛仙塔排行榜
        PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_ZhuXianTower, fbLevel, 10000-costTime/1000)
        isFirstS = 1  #是否首次S通关
    gameFB.SetGameFBDict(FBDict_isFirstS, isFirstS)
    unLockEquipPlace = ipyData.GetUnLockEquipPlace()
    if isFirstS and unLockEquipPlace:
        PlayerControl.WorldNotify(0, 'KillGodTowerInfo_1', [curPlayer.GetPlayerName(), fbLevel, unLockEquipPlace])
    # 给过关奖励
    prizeItemList = __GiveFBPassPrize(curPlayer, False)
    
    prizeDict = {FBCommon.Over_costTime:costTime, FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(prizeItemList)}
    prizeDict = {FBCommon.Over_costTime:costTime, FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(prizeItemList),
                 FBCommon.Over_grade:curStar}
    __SendZhuXianTowerOverInfo(curPlayer, fbLevel, True if prizeItemList else False, prizeDict)
    
    #任务
@@ -463,11 +480,12 @@
        for itemID, itemCnt, isBind in prizeItemList:
            ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem],
                                            event=["ZhuXianTower", False, {}])
    FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_ZhuXianTower, 1)
    #首次S级不扣次数,非S级给奖励扣次数,非首次S扣次数
    if not isFirstPass:
        FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_ZhuXianTower, 1)
        
    gameFB.SetGameFBDict(FBDict_HasGiveAward, 1)
    return
@@ -562,7 +580,7 @@
        #领取奖励
        if fbStep != FB_State_FreeTime:
            return
        __GiveFBPassPrize(curPlayer, False)
        __GiveFBPassPrize(curPlayer)
    return