10156 副本功能玩法关联回合战斗表现(个人boss改为回合战斗,奖励改为固定产出,区分首次击杀跟扫荡奖励;)
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | {
 | 
 |  |  |     DWORD        NPCID;    //ID
 | 
 |  |  |     DWORD        _FuncLineID;    //可挑战等级
 | 
 |  |  |     list        FirstAwardItemList;    //首杀奖励列表[[物品ID,个数,是否拍品], ...]
 | 
 |  |  |     list        SweepAwardItemList;    //扫荡奖励列表[[物品ID,个数,是否拍品], ...]
 | 
 |  |  | };
 | 
 |  |  | 
 | 
 |  |  | //仙盟活跃表
 | 
 
 |  |  | 
 |  |  |     NotifyFBCntRegainInfo(curPlayer, [mapID])
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def OnFBJoin(curPlayer, mapID, funcLineID):
 | 
 |  |  | def OnFBJoin(curPlayer, mapID, funcLineID, joinCount=1):
 | 
 |  |  |     ## 副本参与通用逻辑
 | 
 |  |  |     PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_FBChallenge, 1, [mapID])
 | 
 |  |  |     PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_FBChallenge, joinCount, [mapID])
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def OnFBPass(curPlayer, mapID, funcLineID, awardItemList=None):
 | 
 |  |  | def OnFBPass(curPlayer, mapID, funcLineID, awardItemList=None, passCount=1):
 | 
 |  |  |     ## 副本过关通用逻辑
 | 
 |  |  |     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBPassLineID % mapID, funcLineID)
 | 
 |  |  |     Sync_FBPlayerFBInfoData(curPlayer, mapID)
 | 
 |  |  |      | 
 |  |  |     passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
 | 
 |  |  |     if funcLineID > passLineID:
 | 
 |  |  |         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBPassLineID % mapID, funcLineID)
 | 
 |  |  |         Sync_FBPlayerFBInfoData(curPlayer, mapID)
 | 
 |  |  |         PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_FBPass)
 | 
 |  |  |          | 
 |  |  |     if awardItemList:
 | 
 |  |  |         GameWorld.DebugLog("给奖励物品: %s" % awardItemList)
 | 
 |  |  |         ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["FBPass_%s" % mapID, False, {"mapID":mapID, "funcLineID":funcLineID}])
 | 
 |  |  |         
 | 
 |  |  |     PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_FBPass)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def RegainFBCntProcess(curPlayer):
 | 
 
 |  |  | 
 |  |  | 
 | 
 |  |  | import FBCommon
 | 
 |  |  | import GameWorld
 | 
 |  |  | import EventReport
 | 
 |  |  | import PlayerBossReborn
 | 
 |  |  | import PlayerNewFairyCeremony
 | 
 |  |  | import PlayerActGarbageSorting
 | 
 |  |  | import PlayerFairyCeremony
 | 
 |  |  | import PlayerFeastTravel
 | 
 |  |  | import IpyGameDataPY
 | 
 |  |  | import EventShell
 | 
 |  |  | import NPCCommon
 | 
 |  |  | import ChConfig
 | 
 |  |  | 
 | 
 |  |  | ## 是否能够通过活动查询进入
 | 
 |  |  | def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
 | 
 |  |  |     return True
 | 
 |  |  | 
 | 
 |  |  | ## 是否需要做进入副本通用检查条件逻辑,默认需要检查
 | 
 |  |  | def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
 | 
 |  |  |     ## 进行中的不需要重复检查,防止断线重连被禁止进入
 | 
 |  |  |     if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) == ChConfig.CustomMapStep_Fight:
 | 
 |  |  |         GameWorld.DebugLog("VIPBoss已经在进行中,本次进入不需要重新检查!")
 | 
 |  |  |         return False
 | 
 |  |  |     return True
 | 
 |  |  | 
 | 
 |  |  | ## 客户端进入自定义场景
 | 
 |  |  | def OnEnterCustomScene(curPlayer, mapID, lineID):
 | 
 |  |  | def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
 | 
 |  |  |     ## 回合战斗请求 - 地图验证
 | 
 |  |  |     
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ## 判断可否召唤木桩怪
 | 
 |  |  | def OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count):
 | 
 |  |  |      | 
 |  |  |     if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
 | 
 |  |  |         FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Fight)
 | 
 |  |  |         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_PersonalBoss, 0, ChConfig.CME_Log_Start)
 | 
 |  |  |          | 
 |  |  |         # 开始计时
 | 
 |  |  |         tick = GameWorld.GetGameWorld().GetTick()
 | 
 |  |  |         curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick, tick)
 | 
 |  |  |         FBCommon.UpdateCustomFBGrade(curPlayer, tick, FBCommon.GetFBLineGrade(mapID, lineID))
 | 
 |  |  |          | 
 |  |  |     return True
 | 
 |  |  | 
 | 
 |  |  | def OnCustomSceneProcess(curPlayer, mapID, lineID, tick):
 | 
 |  |  |      | 
 |  |  |     if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) == ChConfig.CustomMapStep_Fight:
 | 
 |  |  |         FBCommon.UpdateCustomFBGrade(curPlayer, tick, FBCommon.GetFBLineGrade(mapID, lineID))
 | 
 |  |  |          | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ## 自定义场景副本击杀NPC
 | 
 |  |  | def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID):
 | 
 |  |  |      | 
 |  |  |     npcID = curNPC.GetNPCID()
 | 
 |  |  |     bossID = __GetPersonalBossID(lineID)
 | 
 |  |  |     GameWorld.DebugLog("个人boss场景击杀NPC: npcID=%s,bossID=%s" % (npcID, bossID), curPlayer.GetPlayerID())
 | 
 |  |  |     if npcID != bossID:
 | 
 |  |  |     # 只能一关关挑战
 | 
 |  |  |     passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
 | 
 |  |  |     if funcLineID != passLineID + 1:
 | 
 |  |  |         GameWorld.ErrLog("只能挑战下一关! mapID=%s,funcLineID=%s,passLineID=%s,nextLineID=%s"  | 
 |  |  |                          % (mapID, funcLineID, passLineID, passLineID + 1), curPlayer.GetPlayerID())
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
 | 
 |  |  |     ipyData = IpyGameDataPY.GetIpyGameData("PersonalBoss", funcLineID)
 | 
 |  |  |     if not ipyData:
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     grade = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneGrade)
 | 
 |  |  |     costTime = GameWorld.GetGameWorld().GetTick() - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick)
 | 
 |  |  |     GameWorld.DebugLog("个人boss过关: grade=%s,costTime=%s" % (grade, costTime))
 | 
 |  |  |     isFree = False
 | 
 |  |  |     curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
 | 
 |  |  |     # 首次过关不扣次数
 | 
 |  |  |     if not curfbStar:
 | 
 |  |  |         isFree = True
 | 
 |  |  |         GameWorld.DebugLog("    首次过关!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
 | 
 |  |  |     bossID = ipyData.GetNPCID()
 | 
 |  |  |     if tagID != bossID or tagType != ChConfig.TurnBattle_TagType_NPC:
 | 
 |  |  |         GameWorld.ErrLog("目标bossID错误,无法挑战! mapID=%s,funcLineID=%s,bossID=%s,tagType=%s,tagID=%s"  | 
 |  |  |                          % (mapID, funcLineID, bossID, tagType, tagID), curPlayer.GetPlayerID())
 | 
 |  |  |         return
 | 
 |  |  |      | 
 |  |  |     return True
 | 
 |  |  | 
 | 
 |  |  | def OnTurnFightOver(curPlayer, mapID, funcLineID, tagType, tagID, valueList, fightRet):
 | 
 |  |  |     ## 回合战斗结束
 | 
 |  |  |     # @return: 是否需要同步GameServer, 奖励列表, 同步结果信息
 | 
 |  |  |     needSendGameServer = False
 | 
 |  |  |     overInfoEx = {}
 | 
 |  |  |     isWin = fightRet[0]
 | 
 |  |  |      | 
 |  |  |     GameWorld.DebugLog("副本结算: mapID=%s,funcLineID=%s,isWin=%s" % (mapID, funcLineID, isWin))
 | 
 |  |  |      | 
 |  |  |     ipyData = IpyGameDataPY.GetIpyGameData("PersonalBoss", funcLineID)
 | 
 |  |  |     if not ipyData:
 | 
 |  |  |         return
 | 
 |  |  |      | 
 |  |  |     OnFBJoin(curPlayer, mapID, funcLineID)
 | 
 |  |  |      | 
 |  |  |     if not isWin:
 | 
 |  |  |         return
 | 
 |  |  |     awardItemList = ipyData.GetFirstAwardItemList()
 | 
 |  |  |         
 | 
 |  |  |     if curfbStar < grade:
 | 
 |  |  |         GameWorld.DebugLog("    更新评级!curfbStar=%s < grade=%s" % (curfbStar, grade), curPlayer.GetPlayerID())
 | 
 |  |  |         GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, grade, False, [mapID])
 | 
 |  |  |         FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # 同步信息
 | 
 |  |  |          | 
 |  |  |     isFree = True
 | 
 |  |  |     #增加进入次数
 | 
 |  |  |     FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_PersonalBoss, isFree=isFree)
 | 
 |  |  |     
 | 
 |  |  |     FBCommon.DelFBEnterTicket(curPlayer, ChConfig.Def_FBMapID_PersonalBoss)
 | 
 |  |  |     PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_VIPBOSS, 1)
 | 
 |  |  |     PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, 1)
 | 
 |  |  |     PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, 1)
 | 
 |  |  |     PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_VIPBoss, 1)
 | 
 |  |  |     PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_KillBoss)
 | 
 |  |  |      | 
 |  |  |     EventShell.EventRespons_FBEvent(curPlayer, 'passvipboss')
 | 
 |  |  |      | 
 |  |  |     npcCountDict = {bossID:1}
 | 
 |  |  |     dropItemMapInfo = [0, 0]
 | 
 |  |  |     jsonItemList = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, dropItemMapInfo=dropItemMapInfo, curGrade=grade, isVirtualDrop=True)[0]
 | 
 |  |  |     FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Over)
 | 
 |  |  |     isPass = 1
 | 
 |  |  |     overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_grade:grade, FBCommon.Over_costTime:costTime}
 | 
 |  |  |     FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def __GetPersonalBossID(lineID):
 | 
 |  |  |     ## VIPbossID
 | 
 |  |  |     ipyData = IpyGameDataPY.GetIpyGameData('PersonalBoss', lineID)
 | 
 |  |  |     if not ipyData:
 | 
 |  |  |         return 0
 | 
 |  |  |     return ipyData.GetNPCID()
 | 
 |  |  |     #设置星级,兼容就逻辑
 | 
 |  |  |     grade = 5
 | 
 |  |  |     GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, funcLineID, grade, False, [mapID])
 | 
 |  |  |     OnFBPass(curPlayer, mapID, funcLineID, awardItemList)
 | 
 |  |  |     return needSendGameServer, awardItemList, overInfoEx
 | 
 |  |  | 
 | 
 |  |  | ## 可否扫荡
 | 
 |  |  | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
 | 
 |  |  |     if mapID != ChConfig.Def_FBMapID_PersonalBoss:
 | 
 |  |  |         return
 | 
 |  |  |     curGrade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
 | 
 |  |  |     if curGrade < 5:
 | 
 |  |  |         GameWorld.DebugLog("没有S级不能扫荡! curGrade=%s" % curGrade)
 | 
 |  |  |     passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
 | 
 |  |  |     if passLineID < lineID:
 | 
 |  |  |         GameWorld.DebugLog("未击杀不能扫荡! mapID=%s,lineID=%s > passLineID(%s)" % (mapID, lineID, passLineID))
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     return True
 | 
 |  |  | 
 |  |  | ## 扫荡结果
 | 
 |  |  | def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
 | 
 |  |  |     
 | 
 |  |  |     bossID = __GetPersonalBossID(lineID)
 | 
 |  |  |     grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
 | 
 |  |  |     GameWorld.DebugLog("扫荡: mapID=%s,lineID=%s,sweepCnt=%s" % (mapID, lineID, sweepCnt), curPlayer.GetPlayerID())
 | 
 |  |  |     ipyData = IpyGameDataPY.GetIpyGameData("PersonalBoss", lineID)
 | 
 |  |  |     if not ipyData:
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     GameWorld.DebugLog("个人boss扫荡: lineID=%s,bossID=%s,grade=%s,sweepCnt=%s"  | 
 |  |  |                        % (lineID, bossID, grade, sweepCnt), curPlayer.GetPlayerID())
 | 
 |  |  |      | 
 |  |  |     PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_VIPBOSS, sweepCnt)
 | 
 |  |  |     PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, sweepCnt)
 | 
 |  |  |     PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, sweepCnt)
 | 
 |  |  |     PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_VIPBoss, sweepCnt)
 | 
 |  |  |     PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_KillBoss)
 | 
 |  |  |      | 
 |  |  |     EventShell.EventRespons_FBEvent(curPlayer, 'passvipboss')
 | 
 |  |  |      | 
 |  |  |     npcCountDict = {bossID:sweepCnt}
 | 
 |  |  |     jsonItemList = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, curGrade=grade)[0]
 | 
 |  |  |     isPass = 1
 | 
 |  |  |     overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_isSweep:1}
 | 
 |  |  |     FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
 | 
 |  |  |     awardItemList = []
 | 
 |  |  |     for itemID, itemCount, isAuctionItem in ipyData.GetSweepAwardItemList():
 | 
 |  |  |         awardItemList.append([itemID, itemCount * sweepCnt, isAuctionItem])
 | 
 |  |  |          | 
 |  |  |     OnFBJoin(curPlayer, mapID, lineID, sweepCnt)
 | 
 |  |  |     OnFBPass(curPlayer, mapID, lineID, awardItemList, sweepCnt, True)
 | 
 |  |  |     return True
 | 
 |  |  | 
 | 
 |  |  | def OnFBJoin(curPlayer, mapID, funcLineID, joinCount=1):
 | 
 |  |  |     ## 副本参与
 | 
 |  |  |     FBCommon.OnFBJoin(curPlayer, mapID, funcLineID, joinCount)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def OnFBPass(curPlayer, mapID, funcLineID, awardItemList=None, passCount=1, isSweep=False):
 | 
 |  |  |     ## 副本过关
 | 
 |  |  |     FBCommon.OnFBPass(curPlayer, mapID, funcLineID, awardItemList, passCount)
 | 
 |  |  |      | 
 |  |  |     PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_VIPBOSS, passCount)
 | 
 |  |  |     PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, passCount)
 | 
 |  |  |     PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, passCount)
 | 
 |  |  |     PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_VIPBoss, passCount)
 | 
 |  |  |     PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_KillBoss, passCount)
 | 
 |  |  |      | 
 |  |  |     isPass = 1
 | 
 |  |  |     overDict = {FBCommon.Over_itemInfo:awardItemList}
 | 
 |  |  |     if isSweep:
 | 
 |  |  |         overDict.update({FBCommon.Over_isSweep:1})
 | 
 |  |  |     FBCommon.NotifyFBOver(curPlayer, mapID, funcLineID, isPass, overDict)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 
 |  |  | 
 |  |  |                 "PersonalBoss":(
 | 
 |  |  |                         ("DWORD", "NPCID", 0),
 | 
 |  |  |                         ("DWORD", "FuncLineID", 1),
 | 
 |  |  |                         ("list", "FirstAwardItemList", 0),
 | 
 |  |  |                         ("list", "SweepAwardItemList", 0),
 | 
 |  |  |                         ),
 | 
 |  |  | 
 | 
 |  |  |                 "FamilyActivity":(
 | 
 |  |  | 
 |  |  |         return | 
 |  |  |          | 
 |  |  |     def GetNPCID(self): return self.attrTuple[0] # ID DWORD
 | 
 |  |  |     def GetFuncLineID(self): return self.attrTuple[1] # 可挑战等级 DWORD | 
 |  |  |     def GetFuncLineID(self): return self.attrTuple[1] # 可挑战等级 DWORD
 | 
 |  |  |     def GetFirstAwardItemList(self): return self.attrTuple[2] # 首杀奖励列表[[物品ID,个数,是否拍品], ...] list
 | 
 |  |  |     def GetSweepAwardItemList(self): return self.attrTuple[3] # 扫荡奖励列表[[物品ID,个数,是否拍品], ...] list | 
 |  |  |  | 
 |  |  | # 仙盟活跃表 | 
 |  |  | class IPY_FamilyActivity(): |