| | |
| | | Help_score = 'score' #已获得积分
|
| | | Help_grade = 'grade' #评级(5-S,4-A,3-B,2-C,1-D)
|
| | | Help_leaderID = 'leaderID' #渡劫玩家ID
|
| | | Help_isHelp = 'isHelp' #本次是否是助战
|
| | | Help_helpCount = 'helpCount' #该副本今日已助战次数
|
| | | Help_relation = 'relation' #该副本关系加成信息 [优先关系, 总加成]
|
| | |
|
| | | #副本结算信息通用key
|
| | | Over_dataMapID = 'dataMapID' #数据地图ID
|
| | |
| | | Over_extrScore = 'extrScore' #已获得额外积分
|
| | | Over_enterLV = 'enterLV' #进入时等级
|
| | | Over_leaderID = 'leaderID' #渡劫玩家ID
|
| | | Over_xianyuanCoin = 'xianyuanCoin' #获得仙缘币信息 [获得仙缘币数, 没有获得的原因] 原因: 1-达到助战次数上限,2-达到每日获得仙缘币上限
|
| | |
|
| | | #副本行为
|
| | | (
|
| | |
| | | return ShareDefine.EntFBAskRet_FBClose
|
| | |
|
| | | #进入次数判断
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | helpPoint = fbIpyData.GetHelpPoint()
|
| | | if maxTimes and not helpPoint and mapID not in ChConfig.Def_NoLimitEnterCntMap:
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | if enterCnt + reqEnterCnt > maxCnt:
|
| | | GameWorld.Log("已达到当日最大进入次数!mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_268121", [mapID])
|
| | | return ShareDefine.EntFBAskRet_NoEnterCnt
|
| | | |
| | | # 周今日次数暂不做,待扩展...
|
| | | canEnter, notifyMark = __CheckCanEnterFBByTime(curPlayer, mapID, fbIpyData, reqEnterCnt, isTeamAsk)
|
| | | if not canEnter:
|
| | | if notifyMark:
|
| | | PlayerControl.NotifyCode(curPlayer, notifyMark, [mapID])
|
| | | return ShareDefine.EntFBAskRet_NoEnterCnt
|
| | | |
| | | #进入CD判断
|
| | | if CheckIsEnterCD(curPlayer, mapID):
|
| | | if isNotify:
|
| | |
| | | return ShareDefine.EntFBAskRet_NoTicket
|
| | |
|
| | | return ShareDefine.EntFBAskRet_OK
|
| | |
|
| | | def __CheckCanEnterFBByTime(curPlayer, mapID, fbIpyData, reqEnterCnt, isTeamAsk):
|
| | | #进入次数判断
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | if not maxTimes:
|
| | | return True, ""
|
| | | |
| | | #playerID = curPlayer.GetPlayerID()
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | if enterCnt + reqEnterCnt <= maxCnt:
|
| | | return True, ""
|
| | | |
| | | ### 以下是到达次数上限后的处理
|
| | | fbType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID)
|
| | | |
| | | # 单人副本达到次数后不可再进入
|
| | | if fbType == IPY_GameWorld.fbtSingle:
|
| | | #GameWorld.Log("已达到当日最大进入次数!单人副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "GeRen_chenxin_268121"
|
| | | |
| | | # 组队副本
|
| | | if fbType == IPY_GameWorld.fbtTeam:
|
| | | # 无助战的不可再进入
|
| | | if not fbIpyData.GetHelpPoint():
|
| | | #GameWorld.Log("已达到当日最大进入次数!组队副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "GeRen_chenxin_268121"
|
| | | |
| | | # 可助战的不可单人进入助战,可发起匹配
|
| | | if not isTeamAsk and (not curPlayer.GetTeamID() or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamMemCount) <= 1):
|
| | | #GameWorld.Log("已达到当日最大进入次数!组队副本不可单人助战! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "TeamSingleEnter"
|
| | | |
| | | elif mapID not in ChConfig.Def_NoLimitEnterCntMap:
|
| | | #GameWorld.Log("已达到当日最大进入次数! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "GeRen_chenxin_268121"
|
| | | |
| | | # 周进入次数暂不做,待扩展...
|
| | | |
| | | return True, ""
|
| | |
|
| | | ## 获取副本进入门票信息
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | ##获取是否助战
|
| | | 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')
|
| | | # 每日活动
|
| | | 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)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, curDayPoint+addHelpPoint)
|
| | | 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)
|
| | | |
| | | return
|
| | |
|
| | | ## 玩家通用副本登录处理
|
| | |
| | | #判断副本里离线超过一定时间则退出副本
|
| | | CheckFBPlayerOffine(curPlayer)
|
| | | 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
|
| | |
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_BuyFbCntDay % mapID, hasBuyCnt + 1)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, [mapID])
|
| | | |
| | | 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)
|
| | |
| | | ## 副本行为 - 鼓舞buff
|
| | | # @param curPlayer 玩家
|
| | | # @param key 副本玩家字典key
|
| | | # @param encourageType 1-铜钱 2-消耗绑玉或仙玉
|
| | | # @param encourageType 金钱类型
|
| | | # @param tick 当前时间
|
| | | # @param isMaxlv 是否直接满级
|
| | | # @return None
|
| | |
| | | encourageLV = gameFB.GetPlayerGameFBDictByKey(curPlayerID, key)
|
| | | encourageCntKey = 'FbEncourageCnt_%s' % encourageType
|
| | | encourageCnt = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey)
|
| | | if encourageLV >= 10:
|
| | | maxLV = IpyGameDataPY.GetFuncEvalCfg('FBEncourageBuff', 2, {}).get(curMapID, 0)
|
| | | if encourageLV >= maxLV:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_93643")
|
| | | return
|
| | | if encourageCnt >= maxCnt:
|
| | | if encourageType == 1:
|
| | | if encourageType == IPY_GameWorld.TYPE_Price_Silver_Money:
|
| | | PlayerControl.NotifyCode(curPlayer, "Xjmj_CopperInspireFull")
|
| | | else:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_93643")
|
| | | return
|
| | |
|
| | | encourageCost = ipyData.GetMoneyCount()
|
| | | if encourageType == 1:
|
| | | costMoneyList = [[IPY_GameWorld.TYPE_Price_Silver_Money, encourageCost]]
|
| | | else:
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, encourageCost)
|
| | | 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:
|
| | | return
|
| | |
|
| | |
| | | gameFB.SetPlayerGameFBDict(curPlayerID, key, encourageLV+1)
|
| | | gameFB.SetPlayerGameFBDict(curPlayerID, encourageCntKey, encourageCnt+1)
|
| | | #GameWorld.Log("FbEncourageBuff encourage nextLV=%s success" % encourageLV)
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_628920", [(encourageLV+1)*10])
|
| | | addHurtNum = IpyGameDataPY.GetFuncEvalCfg('FBEncourageBuff', 3, {}).get(curMapID, 0)
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_628920", [(encourageLV+1)*addHurtNum])
|
| | | SendFBEncourageInfo(curPlayer, encourageLV+1)
|
| | | #成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FBEncourage, 1, [curMapID])
|
| | |
| | | # @return None
|
| | | def SendFBEncourageInfo(curPlayer, lv):
|
| | | #//A3 0A 副本鼓舞信息通知 #tagMCFBEncourageInfo
|
| | | curMapID = curPlayer.GetMapID()
|
| | | curMapID = GetRecordMapID(curMapID)
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('FbEncourage', {'DataMapID':curMapID}, True)
|
| | | if not ipyDataList:
|
| | | return
|
| | | encourageInfo = ChPyNetSendPack.tagMCFBEncourageInfo()
|
| | | encourageInfo.Clear()
|
| | | #encourageInfo.LV = lv
|
| | | encourageInfo.InfoList = []
|
| | | encourageCntKey = 'FbEncourageCnt_%s'
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | curPlayerID = curPlayer.GetID()
|
| | | encourageInfo.Cnt1 = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey%1)
|
| | | encourageInfo.Cnt2 = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey%2)
|
| | | NetPackCommon.SendFakePack(curPlayer, encourageInfo) |
| | | for ipyData in ipyDataList:
|
| | | inspireType = ipyData.GetInspireType()
|
| | | packData = ChPyNetSendPack.tagMCFBEncourageCnt()
|
| | | packData.MoneyType = inspireType
|
| | | packData.EncourageCnt = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey % inspireType)
|
| | | encourageInfo.InfoList.append(packData)
|
| | | encourageInfo.Cnt = len(encourageInfo.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, encourageInfo)
|
| | | return
|
| | |
|
| | | ## 获取玩家所在副本区域福利倍值
|
| | |
| | |
|
| | | if mapID not in enterCDDict:
|
| | | return 0
|
| | | |
| | | lvLimitDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 3)
|
| | | if mapID in lvLimitDict:
|
| | | if curPlayer.GetLV() >= lvLimitDict[mapID]:
|
| | | return 0
|
| | | cdTick = enterCDDict[mapID]
|
| | | lastEnterTick = GetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID)
|
| | | if not lastEnterTick:
|
| | |
| | | enterTickObj = ChPyNetSendPack.tagMCFBEnterTick()
|
| | | enterTickObj.Clear()
|
| | | enterTickObj.MapID = mapID
|
| | | enterTickObj.LastEnterTick = max(enterCDDict.get(mapID) - (timeNum - lastEnterTick), 0)
|
| | | enterTickObj.LastEnterTick = lastEnterTick#max(enterCDDict.get(mapID) - (timeNum - lastEnterTick), 0)
|
| | | enterList.EnterTickList.append(enterTickObj)
|
| | |
|
| | | enterList.Cnt = len(enterList.EnterTickList)
|
| | |
| | | rewardFormatDict = IpyGameDataPY.GetFuncEvalCfg(cfgKeyName)
|
| | | getCntLimit = IpyGameDataPY.GetFuncCfg(cfgKeyName, 3)
|
| | | lastAwardTick = gameFB.GetGameFBDictByKey(ChConfig.Map_FBDict_LastAreaRewardTick)
|
| | | if tick - lastAwardTick < rewardInterval * 1000:
|
| | | if tick - lastAwardTick < rewardInterval:
|
| | | return
|
| | | gameFB.SetGameFBDict(ChConfig.Map_FBDict_LastAreaRewardTick, tick)
|
| | |
|