| | |
| | | import ShareDefine
|
| | | import PlayerActivity
|
| | | import NPCCustomRefresh
|
| | | import ItemControler
|
| | | import PlayerWeekParty
|
| | | import EventReport
|
| | | import NPCCommon
|
| | | import GameObj
|
| | |
| | |
|
| | | FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV' # 鼓舞等级
|
| | | FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
|
| | | Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
|
| | |
|
| | | (
|
| | | Def_BossTime, #BOSS时间
|
| | | Def_LeaveTime, #离开时间
|
| | | Def_HPSpeed, #掉血速度公式
|
| | | ) = range(3)
|
| | | ) = range(2)
|
| | |
|
| | | #当前副本地图的状态
|
| | | (
|
| | |
| | | if mapID != ChConfig.Def_FBMapID_HorsePetBoss:
|
| | | return
|
| | | GameWorld.DebugLog(' 骑宠BOSS活动状态变更 state=%s' % state)
|
| | |
|
| | | if not state:
|
| | | |
| | | if state:
|
| | | if not GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick):
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, tick)
|
| | | else:
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, 0)
|
| | | if GameWorld.GetGameFB().GetFBStep() == FB_Step_Fighting:
|
| | | GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)
|
| | | __DoLogicHorsePetBossOver(0, tick, 0, 0)
|
| | | return
|
| | |
|
| | | def __GetRemainTick(tick):
|
| | | ##活动剩余毫秒
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | startTick = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick)
|
| | | closeFB_RemainTick = max(0, FBCommon.GetFBLineStepTime(mapID)[Def_BossTime] * 1000 - (tick - startTick))
|
| | | return closeFB_RemainTick
|
| | |
|
| | | ## 进副本
|
| | | # @param curPlayer
|
| | |
| | | if not hadDelTicket:
|
| | | FBCommon.SetHadDelTicket(curPlayer)
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_HorsePetBoss, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_HorsePetBoss, 1)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_HorsePetBoss, 0, ChConfig.CME_Log_Start)
|
| | | EventShell.EventRespons_HorsePetBoss(curPlayer)
|
| | | if fbStep == FB_Step_Open:
|
| | |
| | | FBCommon.AddFbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, tick)
|
| | | else:
|
| | | FBCommon.SendFBEncourageInfo(curPlayer, encourageLV)
|
| | | |
| | | |
| | | closeFB_RemainTick = __GetRemainTick(tick)
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, closeFB_RemainTick, True) |
| | | DoFBHelp(curPlayer, tick)
|
| | | return
|
| | |
|
| | |
| | | auctionItemList, itemList = __GetHorsePetBossAward(lineID, rank, worldLV)
|
| | | else:
|
| | | auctionItemList, itemList = [], []
|
| | | GameWorld.Log('auctionItemList=%s,itemList=%s'%(auctionItemList, itemList))
|
| | | GameWorld.Log('auctionItemList=%s,itemList=%s, rank=%s'%(auctionItemList, itemList, rank), playerID)
|
| | | giveItemList = auctionItemList+itemList
|
| | | player = playerManager.FindPlayerByID(playerID)
|
| | | if player:
|
| | |
| | | if len(itemInfo) != 3:
|
| | | GameWorld.ErrLog('骑宠Boss奖励表 配置错误 itemInfo=%s' % itemInfo)
|
| | | continue
|
| | | if not itemInfo[0]:
|
| | | continue
|
| | | if itemInfo[2]:
|
| | | auctionItemList.append(itemInfo)
|
| | | else:
|
| | | itemList.append(itemInfo)
|
| | |
|
| | | for doCnt, awardPieRateList in awardPieRateDict.items():
|
| | | for _ in xrange(doCnt):
|
| | | resultItem = GameWorld.GetResultByRandomList(awardPieRateList)
|
| | | if len(resultItem) != 3:
|
| | | GameWorld.ErrLog('骑宠Boss奖励表配置错误 itemInfo=%s' % resultItem)
|
| | | continue
|
| | | if resultItem[2]:
|
| | | auctionItemList.append(resultItem)
|
| | | else:
|
| | | itemList.append(resultItem)
|
| | | for awardPieRateList in awardPieRateDict:
|
| | | resultItem = GameWorld.GetResultByRandomList(awardPieRateList)
|
| | | if len(resultItem) != 3:
|
| | | GameWorld.ErrLog('骑宠Boss奖励表配置错误 itemInfo=%s' % resultItem)
|
| | | continue
|
| | | if not resultItem[0]:
|
| | | continue
|
| | | if resultItem[2]:
|
| | | auctionItemList.append(resultItem)
|
| | | else:
|
| | | itemList.append(resultItem)
|
| | | return auctionItemList, itemList
|
| | |
|
| | |
|