From 86227d696b4f15c4940a15d4b28a0dc3335ea98f Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 02 七月 2019 16:55:45 +0800 Subject: [PATCH] 7690 【2.0.200】【后端】取消拍卖行获得拍品的广播和邮件 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py | 184 +++++++++++++++++++++++++++------------------- 1 files changed, 108 insertions(+), 76 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py index 2eb05d4..2a47654 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py @@ -32,6 +32,9 @@ import EventReport import ChPlayer import FBHelpBattle +import IpyGameDataPY +import PlayerWeekParty +import PlayerActLogin #阶段时间 @@ -92,7 +95,12 @@ GameWorld.DebugLog("上一层非最大评级过关,无法挑战下一层!lineID=%s,preLineID=%s,preLineGrade=%s,maxGrade=%s" % (lineId, preLineID, preLineGrade, maxGrade), curPlayer.GetPlayerID()) return False - + #判断战力是否满足本层要求 + helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, lineId) + if helpIpyData: + if curPlayer.GetFightPower() < helpIpyData.GetFightPowerMin(): + GameWorld.DebugLog("战力不足%s,无法挑战本层!lineID=%s" % (helpIpyData.GetFightPowerMin(), lineId), curPlayer.GetPlayerID()) + return False return True ## 进入传送点 @@ -136,7 +144,7 @@ def DoEnterFB(curPlayer, tick): playerID = curPlayer.GetPlayerID() GameWorld.DebugLog("DoEnterFB...", playerID) - + gameFB = GameWorld.GetGameFB() if not FBCommon.GetHadDelTicket(curPlayer): @@ -190,6 +198,13 @@ fbLineTime = FBCommon.GetFBLineStepTime(ChConfig.Def_FBMapID_QueenRelics, lineID) curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, fbLineTime[Def_PrepareTime] * 1000, True) EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_QueenRelics, lineID, ChConfig.CME_Log_Start) + + helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", ChConfig.Def_FBMapID_QueenRelics, lineID) + if helpIpyData: + gameFB.SetGameFBDict(ChConfig.FBPD_HelpBattleFBBaseHurt, helpIpyData.GetRobotBaseHurt()) + gameFB.SetGameFBDict(ChConfig.FBPD_HelpBattleFBFightPower, helpIpyData.GetFightPowerMin()) + GameWorld.DebugLog(" 更新副本助战机器人基础伤害: lineID=%s,RobotBaseHurt=%s,fbFightPower=%s" + % (lineID, helpIpyData.GetRobotBaseHurt(), helpIpyData.GetFightPowerMin())) return ##副本总逻辑计时器 @@ -457,101 +472,115 @@ fbLineTime = FBCommon.GetFBLineStepTime(ChConfig.Def_FBMapID_QueenRelics, lineID) rewardRateList = FBCommon.GetFBGradeRewardRateList(mapID) maxGrade = len(rewardRateList) - + curPlayer = FBCommon.GetCurSingleFBPlayer() + if not curPlayer: + return nextLineID = 0 # 最高评级过关,可挑战下一关 if isPass and grade >= maxGrade: nextLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID + 1, False) nextLineID = 0 if not nextLineIpyData else (lineID + 1) # 找不到想下一层数据代表通关 - + if nextLineID: + helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, nextLineID) + if helpIpyData and curPlayer.GetFightPower() < helpIpyData.GetFightPowerMin(): + nextLineID = 0 #战力不足,则不可挑战下一关 + + gameFB = GameWorld.GetGameFB() gameFB.SetGameFBDict(FBKey_NextLineID, nextLineID) GameWorld.DebugLog("开始过关结算: lineID=%s,grade=%s,isPass=%s,nextLineID=%s" % (lineID, grade, isPass, nextLineID)) - playerManager = GameWorld.GetMapCopyPlayerManager() - for index in xrange(playerManager.GetPlayerCount()): - curPlayer = playerManager.GetPlayerByIndex(index) - if not curPlayer: - continue - DoFBHelp(curPlayer, tick) +# playerManager = GameWorld.GetMapCopyPlayerManager() +# for index in xrange(playerManager.GetPlayerCount()): +# curPlayer = playerManager.GetPlayerByIndex(index) +# if not curPlayer: +# continue + DoFBHelp(curPlayer, tick) + + playerID = curPlayer.GetPlayerID() + rewardLine = lineID #gameFB.GetPlayerGameFBDictByKey(playerID, FBPKey_RewardLine) 改成只给本层奖励 + needSyncFBData = False + overDict = {} + if isPass: + overDict = {FBCommon.Over_costTime:costTime, FBCommon.Over_grade:grade} + curGrade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [dataMapID]) + if curGrade < grade: + GameWorld.DebugLog(" 更新过关评级: dataMapID=%s,lineID=%s,curGrade=%s,rewardGrade=%s" + % (dataMapID, lineID, curGrade, grade), curPlayer.GetPlayerID()) + GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, grade, False, [dataMapID]) + needSyncFBData = True + if grade >= maxGrade: #首次S级奖励 + lineReward = FBCommon.GetFBLineReward(dataMapID, lineID) + firstrewardItemList = [[itemID,itemCnt,0] for itemID,itemCnt in lineReward[0]] + ItemControler.GivePlayerItemOrMail(curPlayer, firstrewardItemList, 'QueenRelicsMail', event=["QueenRelics", False, {}]) + overDict[FBCommon.Over_firstPassItem] = FBCommon.GetJsonItemList(firstrewardItemList) - playerID = curPlayer.GetPlayerID() - rewardLine = gameFB.GetPlayerGameFBDictByKey(playerID, FBPKey_RewardLine) - needSyncFBData = False - overDict = {} - if isPass: - overDict = {FBCommon.Over_costTime:costTime, FBCommon.Over_grade:grade} + + if not nextLineID:#没有下一层则给奖励!! rewardRet = __GivePlayerQueenRelicsReward(curPlayer, dataMapID, rewardLine - 1, lineID, grade, maxGrade, rewardRateList) if rewardRet: - needSyncFBData, startRewardLineID, totalSP, rewardItemList = rewardRet - overDict.update({FBCommon.Over_sp:totalSP, FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(rewardItemList), + startRewardLineID, rewardItemList = rewardRet + overDict.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(rewardItemList), "startRewardLineID":startRewardLineID}) - if lineID+1 > curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBHistoryMaxLine % dataMapID): - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHistoryMaxLine % dataMapID, lineID+1) - #成就 - if grade >= maxGrade: - PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelics, 1, [lineID+1]) - - EventShell.EventRespons_PassQueenRelecs(curPlayer, lineID, grade) - #任务 - EventShell.EventRespons_FBEvent(curPlayer, "queenrelics_pass") + if lineID+1 > curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBHistoryMaxLine % dataMapID): + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHistoryMaxLine % dataMapID, lineID+1) + #成就 + if grade >= maxGrade: + PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelics, 1, [lineID+1]) - # 记录结算到的线路层,记录值+1 - updRewardLine = lineID + 1 - gameFB.SetPlayerGameFBDict(playerID, FBPKey_RewardLine, updRewardLine) - - if isPass and not rewardLine: - isInFBOnDay = gameFB.GetPlayerGameFBDictByKey(playerID, FBPKey_IsInFBOnDay) - if not isInFBOnDay: - GameWorld.DebugLog("首次结算奖励,增加挑战次数!", playerID) - needSyncFBData = True - FBCommon.AddEnterFBCount(curPlayer, dataMapID) - addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, lineID) - overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason] - else: - GameWorld.DebugLog("副本中过天,不增加挑战次数!", playerID) - PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelicsEx, 1) - # 不可再挑战下一关了 - if not nextLineID: - curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, fbLineTime[Def_LeaveTime] * 1000, True) + EventShell.EventRespons_PassQueenRelecs(curPlayer, lineID, grade) + #任务 + EventShell.EventRespons_FBEvent(curPlayer, "queenrelics_pass") + + # 记录结算到的线路层,记录值+1 + updRewardLine = lineID + 1 + gameFB.SetPlayerGameFBDict(playerID, FBPKey_RewardLine, updRewardLine) + + if isPass and not nextLineID: + isInFBOnDay = gameFB.GetPlayerGameFBDictByKey(playerID, FBPKey_IsInFBOnDay) + if not isInFBOnDay: + GameWorld.DebugLog("首次结算奖励,增加挑战次数!", playerID) + needSyncFBData = False + FBCommon.AddEnterFBCount(curPlayer, dataMapID) + addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, lineID) + overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason] else: - curPlayer.Sync_TimeTick(IPY_GameWorld.tttFBAddTime, 0, fbLineTime[Def_LeaveTime] * 1000, True) - GameWorld.DebugLog(" 可进入下一关: updRewardLine=%s,nextLineID=%s" % (updRewardLine, nextLineID), playerID) - - if needSyncFBData: - FBCommon.Sync_FBPlayerFBInfoData(curPlayer, dataMapID) # 同步信息 - - FBCommon.NotifyFBOver(curPlayer, dataMapID, lineID, isPass, overDict) + GameWorld.DebugLog("副本中过天,不增加挑战次数!", playerID) + PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelicsEx, 1) + PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_QueenRelices, 1) + PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_QueenRelices, 1) + # 不可再挑战下一关了 + if not nextLineID: + curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, fbLineTime[Def_LeaveTime] * 1000, True) + else: + curPlayer.Sync_TimeTick(IPY_GameWorld.tttFBAddTime, 0, fbLineTime[Def_LeaveTime] * 1000, True) + GameWorld.DebugLog(" 可进入下一关: updRewardLine=%s,nextLineID=%s" % (updRewardLine, nextLineID), playerID) + + if needSyncFBData: + FBCommon.Sync_FBPlayerFBInfoData(curPlayer, dataMapID) # 同步信息 + + FBCommon.NotifyFBOver(curPlayer, dataMapID, lineID, isPass, overDict) return def __GivePlayerQueenRelicsReward(curPlayer, dataMapID, rewardLineID, curLineID, passGrade, maxGrade, rewardRateList): ## 给玩家过关奖励 - totalSP = 0 totalItemCountDict = {} - # 一般是不可能,这里做个理论数值防范 if rewardLineID >= curLineID: GameWorld.ErrLog("玩家重复结算娲皇过关奖励!rewardLineID=%s >= curLineID=%s" % (rewardLineID, curLineID), curPlayer.GetPlayerID()) return startRewardLineID = rewardLineID + 1 - needSyncFBData = False + # 统计奖励,本关卡之前的都给最高级奖励, 当前层以本次评级为准 for giveLineID in xrange(startRewardLineID, curLineID + 1): rewardGrade = maxGrade if giveLineID < curLineID else passGrade - curGrade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, giveLineID, False, [dataMapID]) - if curGrade < rewardGrade: - GameWorld.DebugLog(" 更新过关评级: dataMapID=%s,giveLineID=%s,curGrade=%s,rewardGrade=%s" - % (dataMapID, giveLineID, curGrade, rewardGrade), curPlayer.GetPlayerID()) - GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, giveLineID, rewardGrade, False, [dataMapID]) - needSyncFBData = True - + lineReward = FBCommon.GetFBLineReward(dataMapID, giveLineID) - rewardSP = lineReward[0] - rewardItemList = lineReward[1:] + rewardItemList = lineReward[1] rewardRateIndex = 0 if rewardGrade >= maxGrade else maxGrade - rewardGrade if rewardRateIndex < 0 or rewardRateIndex >= len(rewardRateList): GameWorld.ErrLog(" 评级对应奖励比例索引异常: giveLineID=%s,rewardGrade=%s,rewardRateList=%s,maxGrade=%s,rewardRateIndex=%s" @@ -560,39 +589,36 @@ rewardRate = rewardRateList[rewardRateIndex] if rewardRate < 100: - addSP = int(round(rewardSP * rewardRate / 100.0)) giveItemList = [] for itemID, itemCount in rewardItemList: rewardCount = max(1, int(round(itemCount * rewardRate / 100.0))) # 确保至少1个 giveItemList.append([itemID, rewardCount]) else: - addSP = rewardSP giveItemList = rewardItemList - GameWorld.DebugLog(" 给关卡奖励: giveLineID=%s,rewardGrade=%s,rewardRateList=%s,rewardRate=%s,addSP=%s,giveItemList=%s" - % (giveLineID, rewardGrade, rewardRateList, rewardRate, addSP, giveItemList), curPlayer.GetPlayerID()) + GameWorld.DebugLog(" 给关卡奖励: giveLineID=%s,rewardGrade=%s,rewardRateList=%s,rewardRate=%s,giveItemList=%s" + % (giveLineID, rewardGrade, rewardRateList, rewardRate, giveItemList), curPlayer.GetPlayerID()) - totalSP += addSP + for itemID, itemCount in giveItemList: totalItemCountDict[itemID] = totalItemCountDict.get(itemID, 0) + itemCount + # 给奖励 - PlayerControl.PlayerAddZhenQi(curPlayer, totalSP, eventName="QueenRelics") - rewardItemList = [] for itemID, itemCount in totalItemCountDict.items(): - rewardItemList.append([itemID, itemCount, 1]) - + rewardItemList.append([itemID, itemCount, 0]) + needSpace = len(rewardItemList) emptySpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace) if emptySpace < needSpace: PlayerControl.SendMailByKey("QueenRelicsMail", [curPlayer.GetPlayerID()], rewardItemList) else: for itemID, itemCount, isBind in rewardItemList: - ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], event=["QueenRelics", False, {}]) + ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem], event=["QueenRelics", False, {}]) - GameWorld.DebugLog(" 总奖励:totalSP=%s,rewardItemList=%s" % (totalSP, rewardItemList), curPlayer.GetPlayerID()) - return needSyncFBData, startRewardLineID, totalSP, rewardItemList + GameWorld.DebugLog(" 总奖励:rewardItemList=%s" % (rewardItemList), curPlayer.GetPlayerID()) + return startRewardLineID, rewardItemList ## 副本行为 @@ -633,6 +659,12 @@ if not toLineIpyData: GameWorld.ErrLog("没有目标功能线路!toLineID=%s" % toLineID) return + #判断战力是否满足本层要求 + helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, toLineID) + if helpIpyData: + if curPlayer.GetFightPower() < helpIpyData.GetFightPowerMin(): + GameWorld.DebugLog("战力不足%s,无法挑战下一层!toLineID=%s" % (helpIpyData.GetFightPowerMin(), toLineID), curPlayer.GetPlayerID()) + return if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie: GameWorld.Log("进入下一层时玩家是死亡状态,先复活!", curPlayer.GetPlayerID()) -- Gitblit v1.8.0