| | |
| | | if gameWorld.GetCloseFBTick() > 0:
|
| | | #不可进入
|
| | | return False
|
| | |
|
| | | |
| | | if askStruct.GetTeamLV() == IPY_GameWorld.tmlLeader:
|
| | | '''原因: |
| | | 队长退出组队副本,其他队员还在里面,此时副本不会被关闭
|
| | | 队长在队伍ID不变的情况下又组了其他人,然后又想进去该副本,那么这时会进入之前队员还在的那条队伍分线,导致队伍线路错乱
|
| | | 所以此处不允许该队长进入,并提示其等待或重新建队进入
|
| | | |
| | | FBinCantEnter 副本清理中,请等待关闭或重新创建队伍进入
|
| | | '''
|
| | | return False, "FBinCantEnter"
|
| | | |
| | | #副本在等待关闭状态不允许玩家进入
|
| | | return (gameWorld.GetOpenState() != IPY_GameWorld.fbosWaitForClose)
|
| | |
|
| | |
| | | #根据副本需求, 过滤NPC
|
| | | for curNPC in gameNPCList:
|
| | | #尸体不处理
|
| | | if curNPC.GetHP() <= 0:
|
| | | if GameObj.GetHP(curNPC) <= 0:
|
| | | continue
|
| | |
|
| | | #召唤兽特殊判断
|
| | |
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID()
|
| | | wmpIpyData = PlayerMagicWeapon.GetMagicWeaponPrivilege(curPlayer, MWPrivilegeID)
|
| | | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | | extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID)
|
| | |
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID()
|
| | | wmpIpyData = PlayerMagicWeapon.GetMagicWeaponPrivilege(curPlayer, MWPrivilegeID)
|
| | | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | maxTimes += mwAddCnt #法宝增加的次数加到基础次数里
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | |
| | | return 0
|
| | | #任务
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp')
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp_%s'%mapID)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FBHelp)
|
| | | addHelpPoint = helpPoint * addFBCnt
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, 'AssistantIntegralFull')
|
| | | return 0
|
| | | addHelpPoint = min(addHelpPoint, dayMaxPoint-curDayPoint)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, curDayPoint+addHelpPoint)
|
| | | updHelpPoint = curDayPoint+addHelpPoint
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, updHelpPoint)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DayFBHelpPoint, 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())
|
| | |
| | | #重置每日获得的助战积分
|
| | | if onDayType ==ShareDefine.Def_OnEventTypeEx:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, 0)
|
| | | |
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DayFBHelpPoint, 0, False)
|
| | | return
|
| | |
|
| | | ## 玩家通用副本登录处理
|
| | |
| | | NotifyFBCntRegainInfo(curPlayer)
|
| | | #判断副本里离线超过一定时间则退出副本
|
| | | CheckFBPlayerOffine(curPlayer)
|
| | | #通知助战点数
|
| | | curDayPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBHelpPointCntDay)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DayFBHelpPoint, curDayPoint, False)
|
| | | return
|
| | | def CheckFBPlayerOffine(curPlayer):
|
| | | mapid = curPlayer.GetMapID()
|
| | |
| | | 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()
|
| | |
| | | ## 副本行为 - 鼓舞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)
|
| | |
|