| | |
| | | import PlayerSuccess
|
| | | import GameFuncComm
|
| | | import PyGameData
|
| | | import PlayerVip
|
| | | import GameObj
|
| | | import FBLogic
|
| | | import ChConfig
|
| | |
| | | def IsFBPass(curPlayer, mapID, lineID):
|
| | | ## 副本线路是否已过关
|
| | | passLineID = 0
|
| | | if mapID == ChConfig.Def_FBMapID_RealmTower:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RealmTowerFloor)
|
| | | elif mapID == ChConfig.Def_FBMapID_SkyTower:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_SkyTowerFloor)
|
| | | elif mapID == ChConfig.Def_FBMapID_TrialTower:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
|
| | | if mapID == ChConfig.Def_FBMapID_Main:
|
| | | return PlayerControl.IsMainLevelPass(curPlayer, lineID)
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('FBGeneralTrain', mapID, lineID)
|
| | | if ipyData:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | else:
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('FBGeneralTrain', mapID, lineID)
|
| | | if ipyData:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | else:
|
| | | grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
| | | if grade:
|
| | | return True
|
| | | grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
| | | if grade:
|
| | | return True
|
| | |
|
| | | if passLineID >= lineID:
|
| | | return True
|
| | |
| | | if not maxTimes:
|
| | | return True, ""
|
| | |
|
| | | # 首次进入免费
|
| | | if mapID in [ChConfig.Def_FBMapID_PersonalBoss]:
|
| | | curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
| | | if not curfbStar:
|
| | | GameWorld.DebugLog("OnEnterFBEvent 首次进入该副本线路免费!mapID=%s,lineID=%s" % (mapID, lineID))
|
| | | return True, ""
|
| | | |
| | | #playerID = curPlayer.GetPlayerID()
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | |
| | | gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMaxLV, maxLV)
|
| | | GameWorld.Log("NPC成长动态等级变更: isLeave=%s,totalLV=%s,playerCnt=%s,averageLV=%s,maxLV=%s"
|
| | | % (isLeave, totalLV, playerCnt, averageLV, maxLV), playerID)
|
| | | # 上古战场特殊处理
|
| | | if mapID == ChConfig.Def_FBMapID_ElderBattlefield:
|
| | | lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | lvLimitMin = 0 if not fbLineIpyData else fbLineIpyData.GetLVLimitMin()
|
| | | robotLVDiff = IpyGameDataPY.GetFuncCfg("ElderBattlefieldCfg", 5)
|
| | | robotLVMin, robotLVMax = averageLV - robotLVDiff, averageLV
|
| | | robotLVMin = max(lvLimitMin, robotLVMin)
|
| | | gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMaxLV, robotLVMax)
|
| | | gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMinLV, robotLVMin)
|
| | | GameWorld.Log(" 更新上古机器人等级范围: lineID=%s,robotLVDiff=%s,robotLV=(%s~%s)" % (lineID, robotLVDiff, robotLVMin, robotLVMax))
|
| | | return True
|
| | |
|
| | | def UpdFBLineNPCStrengthenPlayerCnt(playerID, isLeave):
|
| | |
| | | itemDict['ItemID'] = itemInfo[0]
|
| | | if infolen > 1:
|
| | | itemDict['Count'] = itemInfo[1]
|
| | | if infolen > 2:
|
| | | itemDict['IsAuctionItem'] = int(itemInfo[2])
|
| | | #if infolen > 2:
|
| | | # itemDict['IsAuctionItem'] = int(itemInfo[2])
|
| | | elif isinstance(itemInfo, int):
|
| | | itemDict['ItemID'] = itemInfo
|
| | | elif isinstance(itemInfo, dict):
|
| | |
| | | continue
|
| | | itemDict['ItemID'] = itemInfo.GetItemTypeID()
|
| | | itemDict['Count'] = itemInfo.GetCount()
|
| | | itemDict['IsAuctionItem'] = ItemControler.GetIsAuctionItem(itemInfo)
|
| | | #itemDict['IsAuctionItem'] = ItemControler.GetIsAuctionItem(itemInfo)
|
| | | #itemDict['IsSuite'] = int(itemInfo.GetIsSuite())
|
| | | itemDict['UserData'] = itemInfo.GetUserData()
|
| | | jsonItemList.append(itemDict)
|
| | |
| | |
|
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | | extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID)
|
| | | extraCnt = 0
|
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | maxTimes += mwAddCnt #法宝增加的次数加到基础次数里
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | | extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID)
|
| | | extraCnt = 0
|
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | |
| | |
|
| | | #未买次数
|
| | | buyTimesVIPPriID = fbIpyData.GetBuyTimesVIPPriID()
|
| | | canBuyCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
|
| | | canBuyCnt = 0
|
| | | noBuyCnt = max(0, canBuyCnt - buyCnt)
|
| | | return [[rCommonCnt, rRegainFbCnt, rExtraCnt, rBuyCnt, rItemAddCnt, noBuyCnt], [maxTimes, maxRegainFbCnt, extraCnt, canBuyCnt, 10000, canBuyCnt]]
|
| | |
|
| | |
| | | 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():
|
| | |
| | |
|
| | | GameWorld.DebugLog(" 重置:mapID=%s,dayTimes=%s,buyCnt=%s,recoverCnt=%s,itemAddCnt=%s,regainFBCnt=%s,maxCnt=%s,enterCnt=%s"
|
| | | % (mapID, dayTimes, buyCnt, recoverCnt, itemAddCnt, regainFBCnt, maxCnt, enterCnt))
|
| | | if mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
|
| | | if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_ZhuXianBoss):
|
| | | curCnt = min(maxCnt - enterCnt + IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg'), IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2))
|
| | | if curCnt > dayTimes:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, itemAddCntKey, curCnt - dayTimes)
|
| | | elif curCnt < dayTimes:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, dayTimes - curCnt)
|
| | | |
| | | |
| | | mapIDInfo.append(mapID)
|
| | |
|
| | | if mapIDInfo:
|
| | |
| | | if not ipyData:
|
| | | return
|
| | | canBuyCnt = 0
|
| | | buyTimesVIPPriID = ipyData.GetBuyTimesVIPPriID()
|
| | | if buyTimesVIPPriID:
|
| | | canBuyCnt += PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
|
| | | canBuyCnt += PlayerGoldInvest.GetAddFBBuyCnt(curPlayer, mapID)
|
| | | GameWorld.DebugLog("购买副本进入次数: mapID=%s,canBuyCnt=%s" % (mapID, canBuyCnt))
|
| | | if canBuyCnt <= 0:
|
| | |
| | | if mapID == ChConfig.Def_FBMapID_SealDemon and maxDayTimes and maxCnt - enterCnt >= maxDayTimes:
|
| | | GameWorld.DebugLog('当前次数已满,无需购买。。')
|
| | | return
|
| | | if mapID == ChConfig.Def_FBMapID_ZhuXianBoss and maxCnt - enterCnt >= IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2):
|
| | | return
|
| | |
|
| | | if hasBuyCnt >= canBuyCnt:
|
| | | GameWorld.DebugLog("购买次数已经用完mapID=%s,buyTimesVIPPriID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, buyTimesVIPPriID, hasBuyCnt, canBuyCnt))
|
| | | GameWorld.DebugLog("购买次数已经用完mapID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, hasBuyCnt, canBuyCnt))
|
| | | return
|
| | | costGoldDict = IpyGameDataPY.GetFuncEvalCfg('BuyFBCntCost', 1, {})
|
| | | costGold = costGoldDict.get(str(mapID), '0')
|
| | |
| | | paramList = [curPlayer.GetPlayerName()]
|
| | | PlayerControl.SendMailByKey("BuyLoveFBCntCoupleMail", [coupleID], addItemList, paramList)
|
| | | return
|
| | |
|
| | | def DoFuncOpen_RunDaily(curPlayer): return EventReport.WriteFuncCMEAcceptable(curPlayer, ShareDefine.GameFuncID_RunDaily)
|
| | | def DoFuncOpen_RunFamily(curPlayer): return EventReport.WriteFuncCMEAcceptable(curPlayer, ShareDefine.GameFuncID_RunFamily)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 副本开启提示(几分钟)
|
| | |
| | | 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:
|
| | | return
|
| | |
| | | totalZhenQi = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID)
|
| | | totalZhenQi += addZhenQi
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID, totalZhenQi)
|
| | | |
| | | if "TechPoint" in rewardFormatDict:
|
| | | addTechPoint = eval(rewardFormatDict["TechPoint"])
|
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addTechPoint, True, ShareDefine.Def_AddFAVReason_FamilyInvade, True)
|
| | | |
| | | techPoint = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetTechPoint%playerID)
|
| | | techPoint += addTechPoint
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetTechPoint%playerID, techPoint)
|
| | |
|
| | | #GameWorld.DebugLog(" 战场福利 倍区=%s,reLV=%s,reExp=%s,addExp=%s,addZQ=%s,totalExp=%s,totalZQ=%s"
|
| | | # % (multiple, reLV, reExp, addExp, addZhenQi, totalExp, totalZhenQi), playerID)
|