| | |
| | | import PlayerMagicWeapon
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import PlayerActLogin
|
| | | import EventReport
|
| | |
|
| | | FBDict_StartTick = 'FBDict_StartTick%s' #开始时间
|
| | |
| | | FBPlayerDict_Rank = "FBPlayerDict_Rank" # 玩家排名
|
| | |
|
| | | g_npcHurtDict = {}
|
| | |
|
| | |
|
| | | def OnFBPlayerOnLogin(curPlayer):
|
| | | NotifyFMTDouble(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 是否能够通过活动查询进入
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | def DoExitFB(curPlayer, tick):
|
| | | global g_npcHurtDict
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | # 清除鼓舞buff
|
| | | FBCommon.ClearEncourageBuff(curPlayer, tick)
|
| | | #最后一人
|
| | | if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | |
| | | gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, 0)
|
| | | GameWorld.GetGameFB().ClearGameFBDict()
|
| | | GameWorldProcess.CloseFB(tick)
|
| | | |
| | | return
|
| | |
|
| | | UpdateHPReduceSpeed(tick, True)
|
| | | # 清除鼓舞buff
|
| | | FBCommon.ClearEncourageBuff(curPlayer, tick)
|
| | | |
| | | return
|
| | |
|
| | | ##玩家主动离开副本.
|
| | |
| | | curSpeed = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_Speed % lineID)
|
| | | remainHP = GetBossRemainHP(lineID, tick)
|
| | | totalHP = __GetBossTotalHP()
|
| | | |
| | | fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':curSpeed * 10000 / totalHP, 'remainHPPer':min(100, remainHP * 100 / totalHP)}
|
| | | hpReduceSpeed = curSpeed * 10000 / totalHP if totalHP else 0
|
| | | remainHPPer = min(1000000, remainHP * 1000000 / totalHP) if totalHP else 0
|
| | | fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed, 'remainHPPer':remainHPPer}
|
| | | GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
|
| | | FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
|
| | | return
|
| | |
| | | if playerHurtList:
|
| | | killerName, hurtValue = playerHurtList[0][1]
|
| | | NPCCommon.GameServer_KillGameWorldBoss(bossID, killerName, hurtValue)
|
| | | |
| | | msgList = [bossID, 0]
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GameWorldBossState',
|
| | | '%s' % (msgList), len(str(msgList)))
|
| | | bosskey = ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(bosskey, 0)
|
| | | |
| | | NPCCommon.GameServe_GameWorldBossState(bossID, 0)
|
| | |
|
| | | __DoLogicSealDemonOver(1, tick, dropPosX, dropPosY)
|
| | | gameFB.SetGameFBDict(FBDict_IsOver, tick)
|
| | |
| | | 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
|
| | |
| | | if rank == 1 and lineID >= 4:
|
| | | EventShell.EventRespons_SealDemon(curPlayer)
|
| | |
|
| | | PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_SealDemonAddAttr, addCnt, True)
|
| | | |
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_FMT, addCnt)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FMT, addCnt)
|
| | | PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FMT, addCnt)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_FMT, addCnt)
|
| | | PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_FMT, addCnt)
|
| | | return prizeItemList
|
| | |
|
| | | def OnPickUpItem(curPlayer, curItem, tick):
|
| | |
| | | return
|
| | | playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()
|
| | | playerCnt = playerCnt - 1 if isExit else playerCnt
|
| | | if not playerCnt:
|
| | | if playerCnt <=0:
|
| | | return
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | if lineID < 0:
|
| | | return
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
|
| | | lastSpeed = gameWorld.GetGameWorldDictByKey(FBDict_Speed % lineID)
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_SealDemon:
|
| | | return
|
| | | if not PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_FMTDouble):
|
| | | 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)
|
| | |
| | | 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
|
| | |
|