| | |
| | | import ChConfig
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerBossReborn
|
| | | import ShareDefine
|
| | | import GameWorld
|
| | | import GameLogic_CrossGrassland
|
| | |
| | | AdventuresType4,
|
| | | ) = range(1, 5)
|
| | |
|
| | | #事件副本类型
|
| | | (
|
| | | FDEventFBType_Client, #前端本0
|
| | | FDEventFBType_Server, #本服本1
|
| | | FDEventFBType_CrossServer, #跨服本2
|
| | | ) = range(3)
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | NotifyVisitFairyDomainInfo(curPlayer)
|
| | |
| | | if fairyDomainState != 2 and not PlayerActivity.AddDailyActionFinishCnt(curPlayer, dailyID):
|
| | | GameWorld.DebugLog(" 寻访仙域次数不足!")
|
| | | return
|
| | | |
| | |
|
| | | #随机事件 重置事件状态
|
| | | visitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
|
| | | appointIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog('FairyDomainAppoint', visitCnt + 1)
|
| | |
| | | fdEventIDList.append(appointIpyData.GetEventID())
|
| | | else:
|
| | | fdEventTypeDict = {}
|
| | | #先随机奇遇事件
|
| | | fortuitousEventRate = IpyGameDataPY.GetFuncCfg('ImmortalDomain')
|
| | | if GameWorld.CanHappen(fortuitousEventRate):
|
| | | fdEventTypeDict[FDEventType0] = 1
|
| | | #先随机独立事件
|
| | | singleEventRateDict = IpyGameDataPY.GetFuncCfg('ImmortalDomain')
|
| | | for eventType, rate in singleEventRateDict.items():
|
| | | if GameWorld.CanHappen(rate):
|
| | | fdEventTypeDict[eventType] = 1
|
| | |
|
| | | otherCnt = GameWorld.GetResultByRandomList(otherCntRateList, 0)
|
| | | if otherCnt:
|
| | |
| | | #֪ͨ
|
| | | NotifyVisitFairyDomainInfo(curPlayer, fdEventIDList)
|
| | | NotifyFairyAdventuresInfo(curPlayer)
|
| | |
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_FairyDomain, 1)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | return
|
| | | if curState == state:
|
| | | return True
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData('FairyDomain', fdeventID)
|
| | | if not ipyData:
|
| | | return
|
| | | if state == FDEventState_Visiting:
|
| | | if curState != FDEventState_CanVisit:
|
| | | GameWorld.DebugLog('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FairyDomain', fdeventID)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | costEnergy = ipyData.GetCostEnergy()
|
| | | curEnergy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEnergy)
|
| | | if curEnergy < costEnergy:
|
| | |
| | | # if curState != FDEventState_Visiting:
|
| | | # GameWorld.Log('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
|
| | | # return
|
| | | EventShell.EventRespons_FairyDomain(curPlayer)
|
| | | EventShell.EventRespons_FairyDomain(curPlayer, ipyData.GetEventType())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdeventID, state)
|
| | | NotifyVisitFairyDomainInfo(curPlayer, [fdeventID], 0)
|
| | | return True
|
| | |
|
| | |
|
| | | def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=[], isAll=1):
|
| | | def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=None, isAll=1):
|
| | | if not fdEventList:
|
| | | syncFDEventList = []
|
| | | otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
|