| | |
| | | import FBCommon
|
| | | import GameWorld
|
| | | import IPY_GameWorld
|
| | | import GameWorldProcess
|
| | | import IpyGameDataPY
|
| | | import ChConfig
|
| | | import PyGameData
|
| | | import PlayerControl
|
| | | import NPCCommon
|
| | | import ItemCommon
|
| | | import ChPyNetSendPack
|
| | | import ShareDefine
|
| | | import EventShell
|
| | | import NPCCustomRefresh
|
| | | import PlayerSuccess
|
| | | import PlayerActivity
|
| | | import NetPackCommon
|
| | | import PlayerVip
|
| | | import GameObj
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | |
| | | import PlayerWeekParty
|
| | | import PlayerActLogin
|
| | | import EventReport
|
| | | import PlayerTeam
|
| | | import NPCHurtManager
|
| | | import GameWorldProcess
|
| | | import PetControl
|
| | | import AttackCommon
|
| | |
|
| | | #当前副本地图的状态
|
| | | (
|
| | | FB_Step_Open, # 副本开启
|
| | | FB_Step_Fighting, # 副本进行中
|
| | | FB_Step_Over, # 副本结束
|
| | | FB_Step_Close, # 关闭状态
|
| | | ) = range(4)
|
| | |
|
| | | FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV' # 鼓舞等级
|
| | | FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
|
| | |
|
| | | FBPlayerDict_Rank = "FBPlayerDict_Rank" # 玩家排名
|
| | |
|
| | | g_npcHurtDict = {}
|
| | |
|
| | |
|
| | | def OnFBPlayerOnLogin(curPlayer):
|
| | | NotifyFMTDouble(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 是否能够通过活动查询进入
|
| | | # @param curPlayer 玩家实例
|
| | | # @param mapID 地图ID
|
| | | # @param lineID 线路id
|
| | | # @param tick 时间戳
|
| | | # @return 布尔值
|
| | | def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
|
| | | IsDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble)
|
| | | #newbielineList = IpyGameDataPY.GetFuncEvalCfg('SealDemonNewbieLine')
|
| | | if IsDouble:# and lineID not in newbielineList:
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % ChConfig.Def_FBMapID_SealDemon)
|
| | | maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, ChConfig.Def_FBMapID_SealDemon)
|
| | | if enterCnt + 2 > maxCnt:
|
| | | return False
|
| | | # 新手副本修改为也可以重复进
|
| | | # if lineID in newbielineList:
|
| | | # hasEnter = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False,
|
| | | # [ChConfig.Def_FBMapID_SealDemon])
|
| | | # if hasEnter:
|
| | | # GameWorld.DebugLog(" 已进入过该新手线路 %s" % lineID)
|
| | | # return False
|
| | | return True
|
| | |
|
| | |
|
| | | ##副本玩家进入点
|
| | | # @param curPlayer 玩家实例
|
| | | # @param mapID 地图ID
|
| | | # @param lineId 分线ID
|
| | | # @param ipyEnterPosInfo 功能线路IPY配置坐标信息
|
| | | # @param tick 时间戳
|
| | | # @return posX, posY, 随机半径(可选)
|
| | | def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
|
| | | return ipyEnterPosInfo
|
| | |
|
| | | ### 查询地图是否开启
|
| | | ## @param tick 时间戳
|
| | | ## @return 布尔值
|
| | | ## 查询地图是否开启
|
| | | #def OnCanOpen(tick):
|
| | | # return True
|
| | |
|
| | | ##查询是否可以进入地图
|
| | | # @param ask:请求结构体(IPY_BMChangeMapAsk)
|
| | | # @param tick:时间戳
|
| | | # @return IPY_GameWorld.cme 枚举
|
| | | def OnChangeMapAsk(ask, tick):
|
| | | return IPY_GameWorld.cmeAccept
|
| | |
|
| | | ##开启副本
|
| | | # @param tick 时间戳
|
| | | # @return 返回值无意义
|
| | | # @remarks 开启副本
|
| | | def OnOpenFB(tick):
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemonEx:
|
| | | return
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | |
|
| | | refreshIDList = FBCommon.GetFBLineRefreshNPC(ChConfig.Def_FBMapID_SealDemon, lineID)
|
| | | if refreshIDList:
|
| | | for refreshID in refreshIDList:
|
| | | NPCCustomRefresh.SetNPCRefreshByID(refreshID)
|
| | | |
| | | |
| | | FBCommon.SetFBStep(FB_Step_Fighting, tick)
|
| | | return
|
| | |
|
| | | ## 进副本
|
| | | # @param curPlayer
|
| | | # @param tick
|
| | | # @return None
|
| | | def DoEnterFB(curPlayer, tick):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemonEx:
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | | FBCommon.SetFBPropertyMark(lineID)
|
| | | else:
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()
|
| | | GameWorld.DebugLog("DoEnterFB...playerCnt=%s,lineID=%s" % (playerCnt, lineID), playerID)
|
| | | overTick = gameFB.GetGameFBDictByKey(FBDict_IsOver)
|
| | | if lineID < 0 or overTick:
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | if gameFB.GetFBStep() != FB_Step_Fighting:
|
| | | PlayerControl.PlayerLeaveFB(curPlayer)
|
| | | return
|
| | | |
| | | hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
|
| | | if not hadDelTicket:
|
| | | FBCommon.SetHadDelTicket(curPlayer)
|
| | |
| | | posX, posY = IpyGameDataPY.GetFuncEvalCfg('SealDemonFirstPos')
|
| | | GameWorld.ResetPlayerPos(curPlayer, posX, posY)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_SealDemon, 0, ChConfig.CME_Log_Start)
|
| | | newbielineList = IpyGameDataPY.GetFuncEvalCfg('SealDemonNewbieLine')
|
| | | if lineID not in newbielineList:
|
| | | pass
|
| | | # FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_SealDemon)
|
| | | # # 每日活动
|
| | | # PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_SealDemon)
|
| | | else:
|
| | | hasEnter = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [ChConfig.Def_FBMapID_SealDemon])
|
| | | if hasEnter:
|
| | | GameWorld.DebugLog(" 已进入过该新手线路 %s" % lineID, playerID)
|
| | | PlayerControl.PlayerLeaveFB(curPlayer)
|
| | | return
|
| | | UpdateHurtInfo(curPlayer, 0, True)
|
| | | |
| | |
|
| | | # 上鼓舞buff
|
| | | encourageLV = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EncourageLV)
|
| | |
| | | else:
|
| | | FBCommon.SendFBEncourageInfo(curPlayer, encourageLV)
|
| | |
|
| | | DoFBHelp(curPlayer, tick)
|
| | | return
|
| | |
|
| | | ##关闭副本
|
| | | # @param tick 时间戳
|
| | | # @return 无意义
|
| | | # @remarks |
| | | def OnCloseFB(tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | |
|
| | | gameWorld.SetPropertyID(0)
|
| | | #GameWorld.GetGameWorld().SetPropertyID(0)
|
| | | return
|
| | |
|
| | | ##玩家退出副本
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|
| | | # @return 无意义
|
| | | def DoExitFB(curPlayer, tick):
|
| | | global g_npcHurtDict
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | # 清除鼓舞buff
|
| | | FBCommon.ClearEncourageBuff(curPlayer, tick)
|
| | | #最后一人
|
| | | if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | if mapID != ChConfig.Def_FBMapID_SealDemonEx:#单人的不管
|
| | | lineID = gameWorld.GetPropertyID() - 1
|
| | | PyGameData.g_sealDemonPlayerHurtDict[lineID] = {}
|
| | | g_npcHurtDict[lineID] = {}
|
| | | GameWorld.GetGameFB().ClearGameFBDict()
|
| | | GameWorldProcess.CloseFB(tick)
|
| | | return
|
| | | |
| | | return
|
| | |
|
| | | ##玩家主动离开副本.
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|
| | | # @return 返回值无意义
|
| | | def DoPlayerLeaveFB(curPlayer, tick):
|
| | | FBCommon.SetHadDelTicket(curPlayer, 0)
|
| | | #主动退出的去掉排行榜信息
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | playerHurtDict = PyGameData.g_sealDemonPlayerHurtDict.get(lineID, {})
|
| | | playerHurtDict.pop(curPlayer.GetPlayerID(), 0)
|
| | | PyGameData.g_sealDemonPlayerHurtDict[lineID] = playerHurtDict
|
| | | |
| | | #最后一人
|
| | | if GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount() == 1:
|
| | | GameWorldProcess.CloseFB(tick)
|
| | | |
| | | return
|
| | |
|
| | | ##玩家切换地图
|
| | |
| | | return
|
| | |
|
| | | ## 是否副本复活
|
| | | # @param None
|
| | | # @return 是否副本复活
|
| | | def OnPlayerReborn():
|
| | | return True
|
| | |
|
| | |
|
| | | ## 获得副本帮助信息
|
| | | # @param curPlayer 当前玩家(被通知对象)
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def DoFBHelp(curPlayer, tick):
|
| | | #伤害排行信息
|
| | | hurtInfo = []
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | playerHurtList = PyGameData.g_sealDemonPlayerHurtDict.get(lineID, {}).items()
|
| | | npcHurtList = g_npcHurtDict.get(lineID, {}).items()
|
| | | |
| | | syncHurtList = (playerHurtList + npcHurtList)[:5]
|
| | | syncHurtList.sort(key=lambda asd:asd[1][1], reverse=True)
|
| | | |
| | | for i, info in enumerate(syncHurtList, 1):
|
| | | playerName, hurt = info[1]
|
| | | hurtDict = {}
|
| | | hurtDict["rank"] = i
|
| | | hurtDict["playerName"] = playerName
|
| | | hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
|
| | | hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
|
| | | hurtInfo.append(hurtDict)
|
| | | myRank = __GetSelfHurtRank(curPlayer)
|
| | | if myRank and myRank > 5:
|
| | | hurtDict = {}
|
| | | hurtDict["rank"] = myRank
|
| | | info = playerHurtList[myRank - 1]
|
| | | playerName, hurt = info[1]
|
| | | hurtDict["playerName"] = playerName
|
| | | hurtDict["hurt"] = hurt % ChConfig.Def_PerPointValue
|
| | | hurtDict["hurtEx"] = hurt / ChConfig.Def_PerPointValue
|
| | | hurtInfo.append(hurtDict)
|
| | | |
| | |
|
| | | fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo}
|
| | | GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
|
| | | FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
|
| | | return
|
| | |
|
| | | def __GetSelfHurtRank(curPlayer):
|
| | | #获取自己的排名
|
| | | playerName = curPlayer.GetName()
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | playerHurtList = __GetSortHurtList(lineID)
|
| | | myRank = 0
|
| | | for i, info in enumerate(playerHurtList):
|
| | | if playerName == info[1][0]:
|
| | | myRank = i + 1
|
| | | break
|
| | | return myRank
|
| | |
|
| | | ## 副本行为
|
| | | # @param curPlayer 玩家
|
| | | # @param actionType 行为类型
|
| | | # @param actionInfo 行为信息
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def DoFBAction(curPlayer, actionType, actionInfo, tick):
|
| | | if actionType == 0:
|
| | | FBCommon.FbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, actionInfo, tick)
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | | ## 玩家对NPC造成伤害
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curNPC |
| | | # @param hurtHP |
| | | # @return None
|
| | | def DoFB_Player_HurtNPC(curPlayer, curNPC, hurtHP):
|
| | | UpdateHurtInfo(curPlayer, hurtHP)
|
| | | return
|
| | | #
|
| | | def UpdateHurtInfo(curPlayer, hurtHP, isAdd=False):
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemonEx:
|
| | | return
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | |
| | | playerName = curPlayer.GetName() |
| | | playerID = curPlayer.GetPlayerID()
|
| | | playerHurtDict = PyGameData.g_sealDemonPlayerHurtDict.get(lineID, {})
|
| | | if playerID not in playerHurtDict:
|
| | | if not isAdd:
|
| | | return
|
| | | playerHurtDict[playerID] = [playerName, hurtHP]
|
| | | else:
|
| | | playerHurtDict[playerID][1] += hurtHP
|
| | | PyGameData.g_sealDemonPlayerHurtDict[lineID] = playerHurtDict
|
| | | return
|
| | |
|
| | | ## 玩家对NPC造成伤害
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curNPC |
| | | # @param hurtHP |
| | | # @return None
|
| | | def DoFB_NPC_HurtNPC(curNPC, tagNPC, hurtHP):
|
| | | global g_npcHurtDict
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | npcID = curNPC.GetNPCID()
|
| | | guardNPCIDList = __GetGuardNPCIDList(lineID)
|
| | | |
| | | if npcID not in guardNPCIDList:
|
| | | return
|
| | | npcHurtDict = g_npcHurtDict.get(lineID, {})
|
| | | if npcID not in npcHurtDict:
|
| | | npcName = curNPC.GetName().decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding())
|
| | | npcHurtDict[npcID] = [npcName, hurtHP]
|
| | | else:
|
| | | npcHurtDict[npcID][1] += hurtHP
|
| | | g_npcHurtDict[lineID] = npcHurtDict
|
| | | return
|
| | |
|
| | | def __GetGuardNPCIDList(lineID):
|
| | | guardNPCIDList = []
|
| | | refreshIDList = FBCommon.GetFBLineRefreshNPC(ChConfig.Def_FBMapID_SealDemon, lineID)
|
| | | if refreshIDList:
|
| | | for refreshID in refreshIDList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("NPCCustomRefresh", refreshID)
|
| | | if not ipyData:
|
| | | continue
|
| | | npcID = ipyData.GetRefreshNPCID()
|
| | | guardNPCIDList.append(npcID)
|
| | | return guardNPCIDList
|
| | |
|
| | | ##---副本总逻辑计时器---
|
| | | # @param tick:时间戳
|
| | | # @return 无意义
|
| | | # @remarks 副本总逻辑计时器
|
| | | ## 副本总逻辑计时器
|
| | | def OnProcess(tick):
|
| | | |
| | | fbStep = GameWorld.GetGameFB().GetFBStep()
|
| | | # 副本结束
|
| | | if fbStep == FB_Step_Over:
|
| | | __DoLogic_FB_Over(tick)
|
| | | |
| | | return
|
| | |
|
| | | def __DoLogic_FB_Over(tick):
|
| | | |
| | | # 间隔未到
|
| | | if tick - GameWorld.GetGameFB().GetFBStepTick() < ChConfig.Def_FBPickupItemTime:
|
| | | return
|
| | | |
| | | #副本关闭
|
| | | GameWorldProcess.CloseFB(tick)
|
| | | FBCommon.SetFBStep(FB_Step_Close, tick)
|
| | | return
|
| | |
|
| | | ## 检查是否可攻击, 主判定不可攻击的情况,其他逻辑由外层决定
|
| | | # @param attacker 攻击方
|
| | | # @param defender 防守方
|
| | | # @return bool
|
| | | def CheckCanAttackTagObjInFB(attacker, defender):
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | overTick = gameFB.GetGameFBDictByKey(FBDict_IsOver)
|
| | | # 结算20秒后强制关闭副本, 防止玩家不捡东西导致不结算,强关后地板上的东西会邮件发放给玩家
|
| | | if overTick and tick - overTick >= ChConfig.Def_FBPickupItemTime:
|
| | | GameWorld.Log("强制踢出玩家关闭副本: overTick=%s,tick=%s" % (overTick, tick))
|
| | | FBCommon.DoLogic_FBKickAllPlayer()
|
| | | return
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemonEx:
|
| | | return
|
| | | if gameFB.GetFBStep() != FB_Step_Fighting:
|
| | | return False
|
| | | |
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | if lineID <0:
|
| | | return
|
| | | if defender.GetGameObjType() == IPY_GameWorld.gotNPC and defender.GetNPCID() == CurFBLineBOSSID(lineID):
|
| | | atkObjType = attacker.GetGameObjType()
|
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | return NPCHurtManager.CheckPlayerCanAttackFBNPC(attacker, defender, ChConfig.Def_FBMapID_SealDemon, True)
|
| | |
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
|
| | | elif atkObjType == IPY_GameWorld.gotNPC:
|
| | | if PetControl.IsPet(attacker) or attacker.GetGameNPCObjType()== IPY_GameWorld.gnotSummon:
|
| | | ownerPlayer = AttackCommon.GetAttackPlayer(attacker)[0]
|
| | | if not ownerPlayer:
|
| | | return False
|
| | | return NPCHurtManager.CheckPlayerCanAttackFBNPC(ownerPlayer, defender, ChConfig.Def_FBMapID_SealDemon)
|
| | |
|
| | | return
|
| | | return True
|
| | |
|
| | | def DoFB_Npc_KillNPC(attacker, curNPC, tick):
|
| | | __FBNPCOnKilled(curNPC, tick)
|
| | |
| | | bossID = CurFBLineBOSSID(lineID)
|
| | | if curNPC.GetNPCID() != bossID:
|
| | | return
|
| | | FBCommon.SetFBStep(FB_Step_Over, tick)
|
| | |
|
| | | dropPosX, dropPosY = curNPC.GetPosX(), curNPC.GetPosY()
|
| | |
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
|
| | | GameWorld.DebugLog('结束 设置BOSS死亡 lineID=%s' % lineID)
|
| | | newbielineList = IpyGameDataPY.GetFuncEvalCfg('SealDemonNewbieLine')
|
| | | isNewbieLine = lineID in newbielineList
|
| | | if not isNewbieLine:
|
| | | playerHurtList = __GetSortHurtList(lineID)
|
| | | if playerHurtList:
|
| | | killerName, hurtValue = playerHurtList[0][1]
|
| | | NPCCommon.GameServer_KillGameWorldBoss(bossID, killerName, hurtValue)
|
| | |
|
| | | NPCCommon.GameServe_GameWorldBossState(bossID, 0)
|
| | |
|
| | | __DoLogicSealDemonOver(1, tick, dropPosX, dropPosY)
|
| | | GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)
|
| | | npcHurtList = NPCHurtManager.GetPlayerHurtList(curNPC)
|
| | | if not npcHurtList:
|
| | | GameWorld.ErrLog("没有伤血列表!lineID=%s,bossID=%s" % (lineID, bossID))
|
| | | return
|
| | |
|
| | |
|
| | | def __GetSortHurtList(lineID):
|
| | | playerHurtDict = PyGameData.g_sealDemonPlayerHurtDict.get(lineID, {})
|
| | | playerHurtList = sorted(playerHurtDict.iteritems(), key=lambda asd:asd[1][1], reverse=True)
|
| | | return playerHurtList
|
| | |
|
| | | def __DoLogicSealDemonOver(isPass, tick, dropPosX, dropPosY):
|
| | | #结算
|
| | | isPass = 1
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | leaveTick = FBCommon.GetFBLineStepTime(mapID, lineID) * 1000
|
| | | playerHurtList = __GetSortHurtList(lineID)
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for rank, hurtInfo in enumerate(playerHurtList, 1):
|
| | | playerID = hurtInfo[0]
|
| | | curPlayer = playerManager.FindPlayerByID(playerID)
|
| | | copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(npcHurtList.GetHurtCount()):
|
| | | hurtObj = npcHurtList.GetHurtAt(index)
|
| | | hurtID = hurtObj.GetValueID()
|
| | | hurtType = hurtObj.GetValueType()
|
| | |
|
| | | if curPlayer:
|
| | | playerIDList = []
|
| | | if hurtType == ChConfig.Def_NPCHurtTypePlayer:
|
| | | playerIDList = [hurtID]
|
| | | |
| | | elif hurtType == ChConfig.Def_NPCHurtTypeTeam:
|
| | | teamID = hurtID
|
| | | mapTeamPlayerIDList = PlayerTeam.GetMapTeamPlayerIDList(teamID)
|
| | | for teamPlayerID in mapTeamPlayerIDList:
|
| | | if not npcHurtList.IsNoAssistPlayer(teamPlayerID):
|
| | | continue
|
| | | playerIDList.append(teamPlayerID)
|
| | | else:
|
| | | continue
|
| | | |
| | | rank = index + 1
|
| | | if rank == 1:
|
| | | NPCCommon.GameServer_KillGameWorldBoss(bossID, hurtObj.GetHurtName(), hurtObj.GetHurtValue())
|
| | | |
| | | for playerID in playerIDList:
|
| | | curPlayer = copyMapPlayerManager.FindPlayerByID(playerID)
|
| | | if curPlayer == None:
|
| | | continue
|
| | | |
| | | gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_Rank, rank)
|
| | | if not dropPosX or not dropPosY:
|
| | | dropPosX, dropPosY = curPlayer.GetPosX(), curPlayer.GetPosY()
|
| | |
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_SealDemon, lineID, isPass, overDict)
|
| | | else:
|
| | | curPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, ChConfig.Def_FBPickupItemTime, True)
|
| | | else:
|
| | | leaveTick = PlayerControl.GetPlayerLeaveServerTick(playerID)
|
| | | if not leaveTick:
|
| | | continue
|
| | | if tick - leaveTick > ChConfig.Def_PlayerOfflineProtectTime:
|
| | | #离线超过3分钟的不给奖励
|
| | | continue
|
| | | msgStr = str([playerID, lineID, rank])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'SealDemonOver', msgStr, len(msgStr))
|
| | | |
| | | return
|
| | |
|
| | | def GiveSealDemonAward(curPlayer, lineID, rank, isMail=False, isClientSend=False, dropItemMapInfo=[]):
|
| | |
| | | else:
|
| | | #prizeMultiple = 2 if rank == 1 else 1 # 第一名执行双倍掉落奖励,其他一次
|
| | | prizeMultiple = 1 # 去除第一名双倍逻辑,改为放在额外奖励产出
|
| | | isDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble)
|
| | | if isDouble:
|
| | | addCnt = 2
|
| | | |
| | | equipList = []
|
| | | prizeItemDict ={}
|
| | | bossID = CurFBLineBOSSID(lineID)
|
| | | extraItemList = sealDemonIpyData.GetOwnerAwardItemEx() * addCnt if rank == 1 else []
|
| | | #for _ in xrange(addCnt):
|
| | | jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, ChConfig.Def_FBMapID_SealDemon, {bossID:addCnt},
|
| | | mailTypeKey="SealDemonMail", isMail=isMail, extraItemList=extraItemList, prizeMultiple=prizeMultiple,
|
| | | dropItemMapInfo=dropItemMapInfo,isVirtualDrop=isClientSend)
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillSpecificNPC, addCnt, [bossID])
|
| | |
|
| | | #新手线路的更新进去记录
|
| | | newbielineList = IpyGameDataPY.GetFuncEvalCfg('SealDemonNewbieLine')
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, 1, False, [ChConfig.Def_FBMapID_SealDemon])
|
| | | if isNewbieLine:
|
| | | # 未过关不扣次数
|
| | |
| | | def DoPlayerDead(curPlayer):
|
| | | return
|
| | |
|
| | |
|
| | | #// B1 03 设置封魔坛多倍击杀 #tagCMSetFMTDouble
|
| | | #
|
| | | #struct tagCMSetFMTDouble
|
| | |
| | | # BYTE IsDouble; //是否双倍
|
| | | #};
|
| | | def SetFMTDouble(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_SealDemon:
|
| | | return
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTOldDouble) and not PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_FMTDouble):
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FMTDouble, clientData.IsDouble)
|
| | | NotifyFMTDouble(curPlayer)
|
| | | return
|
| | |
|
| | | def NotifyFMTDouble(curPlayer):
|
| | | packData = ChPyNetSendPack.tagMCFMTDoubleState()
|
| | | packData.IsDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble)
|
| | | packData.OldDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTOldDouble)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|