| | |
| | | Over_extrScore = 'extrScore' #已获得额外积分
|
| | | Over_enterLV = 'enterLV' #进入时等级
|
| | | Over_leaderID = 'leaderID' #渡劫玩家ID
|
| | | Over_xianyuanCoin = 'xianyuanCoin' #获得仙缘币信息 [获得仙缘币数, 没有获得的原因] 原因: 1-达到助战次数上限,2-达到每日获得仙缘币上限
|
| | |
|
| | | #副本行为
|
| | | (
|
| | |
| | | ##获取是否助战
|
| | | return GameWorld.GetGameFB().GetPlayerGameFBDictByKey(curPlayer.GetID(), ChConfig.FBPlayerDict_IsHelpFight)
|
| | |
|
| | |
|
| | | def AddFBHelpPoint(curPlayer, mapID, addFBCnt=1):
|
| | | ##增加副本助战积分
|
| | | PlayerControl.NotifyCode(curPlayer, 'TodayNoDungeonReward')
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | helpPoint = fbIpyData.GetHelpPoint()
|
| | | if not helpPoint:
|
| | | return 0
|
| | | #任务
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp')
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp_%s'%mapID)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FBHelp)
|
| | | addHelpPoint = helpPoint * addFBCnt
|
| | | dayMaxPoint = IpyGameDataPY.GetFuncCfg('DungeonIntegral')
|
| | | curDayPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBHelpPointCntDay)
|
| | | if curDayPoint >= dayMaxPoint:
|
| | | PlayerControl.NotifyCode(curPlayer, 'AssistantIntegralFull')
|
| | | return 0
|
| | | addHelpPoint = min(addHelpPoint, dayMaxPoint-curDayPoint)
|
| | | updHelpPoint = curDayPoint+addHelpPoint
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, updHelpPoint)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FBHelpPoint, updHelpPoint, False)
|
| | | |
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FBHelpPoint, addHelpPoint, isSysHint=False)
|
| | | PlayerControl.NotifyCode(curPlayer, 'AssistantIntegral', [addHelpPoint])
|
| | | GameWorld.DebugLog(" 增加副本助战积分!mapID=%s, addHelpPoint=%s"%(mapID, addHelpPoint), curPlayer.GetID())
|
| | | return addHelpPoint
|
| | |
|
| | | def FBOnWeek(curPlayer, onWeekType):
|
| | |
|
| | | mapIDInfo = []
|
| | |
| | | for i in xrange(ipyDataMgr.GetFBFuncCount()):
|
| | | ipyData = ipyDataMgr.GetFBFuncByIndex(i)
|
| | | mapID = ipyData.GetDataMapID()
|
| | | |
| | | # 有真实助战次数奖励限制的
|
| | | if ipyData.GetDayHelpCountMax():
|
| | | helpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FBRealHelpCount % mapID)
|
| | | if helpCount:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FBRealHelpCount % mapID, 0)
|
| | | GameWorld.DebugLog("重置日助战奖励次数限制!mapID=%s" % mapID)
|
| | | |
| | | dayTimes = ipyData.GetDayTimes()
|
| | | # 没有日次数限制的不处理
|
| | | if not dayTimes and not ipyData.GetBuyTimesVIPPriID() and not ipyData.GetExtraTimesVIPPriID() and not ipyData.GetExtraTimesMWPriID():
|
| | |
| | | Sync_FBPlayerFBInfoData(curPlayer, mapIDInfo)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, mapIDInfo)
|
| | |
|
| | | #重置每日获得的助战积分
|
| | | if onDayType ==ShareDefine.Def_OnEventTypeEx:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, 0)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FBHelpPoint, 0, False)
|
| | | return
|
| | |
|
| | | ## 玩家通用副本登录处理
|
| | |
| | | NotifyFBCntRegainInfo(curPlayer)
|
| | | #判断副本里离线超过一定时间则退出副本
|
| | | CheckFBPlayerOffine(curPlayer)
|
| | | #通知助战点数
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FBHelpPoint, 0, False)
|
| | | return
|
| | |
|
| | | def CheckFBPlayerOffine(curPlayer):
|
| | | mapid = curPlayer.GetMapID()
|
| | |
|
| | |
| | | canBuyCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
|
| | |
|
| | | hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | |
| | | maxDayTimes = ipyData.GetDayTimes()
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | enterCnt = GetEnterFBCount(curPlayer, mapID)
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemon and maxDayTimes and maxCnt - enterCnt >= maxDayTimes:
|
| | | GameWorld.DebugLog('当前次数已满,无需购买。。')
|
| | | return
|
| | | if hasBuyCnt >= canBuyCnt:
|
| | | GameWorld.DebugLog("购买次数已经用完mapID=%s"%mapID)
|
| | | return
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID])
|
| | | lastRegainTime= curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
|
| | | if lastRegainTime:
|
| | | maxDayTimes = ipyData.GetDayTimes()
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | enterCnt = GetEnterFBCount(curPlayer, mapID)
|
| | | if maxCnt - enterCnt == maxDayTimes:
|
| | | curTime = int(time.time())
|
| | | needTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID)
|
| | |
| | | return
|
| | |
|
| | | encourageCost = eval(ipyData.GetMoneyCount())
|
| | | if curMapID == ChConfig.Def_FBMapID_SealDemon:
|
| | | isDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble)
|
| | | if isDouble: #封魔坛双倍挑战则鼓舞双倍花费
|
| | | encourageCost *= 2
|
| | |
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, encourageType, encourageCost)
|
| | | if not costMoneyList:
|