| | |
| | | GubaoEffType_CrossRealmPK,
|
| | | ]
|
| | |
|
| | | # 古宝灵根点特殊效果列表
|
| | | GubaoEffFreePointTypeList = [54, 55, 56]
|
| | |
|
| | | # 需要记录EffValue的EffType列表
|
| | | NeedGubaoItemEffValueTypeList = GubaoEffAttrIypeList + GubaoEffTtemIypeList + GubaoEffFreePointTypeList
|
| | |
|
| | | def GetGubaoLVInfo(curPlayer, gubaoID):
|
| | | lvInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoLVInfo % gubaoID)
|
| | | lv = lvInfo / 100
|
| | |
| | | return
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | DoGubaoAddFreePoint(curPlayer) # 上线检查一下,修改配置可生效
|
| | | Sync_GubaoInfo(curPlayer)
|
| | | Sync_GubaoItemEffInfo(curPlayer)
|
| | | Sync_GubaoPieceInfo(curPlayer)
|
| | |
| | | lv, star = 1, 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, lv, star)
|
| | | GameWorld.Log("古宝激活成功! gubaoID=%s" % gubaoID, playerID)
|
| | | DoGubaoAddFreePoint(curPlayer, gubaoID)
|
| | |
|
| | | RefreshGubaoAttr(curPlayer)
|
| | | Sync_GubaoInfo(curPlayer, [gubaoID])
|
| | |
| | | updStar = star + 1
|
| | | SetGubaoLVInfo(curPlayer, gubaoID, lv, updStar)
|
| | | GameWorld.Log("古宝升星: gubaoID=%s,updStar=%s" % (gubaoID, updStar), playerID)
|
| | | DoGubaoAddFreePoint(curPlayer, gubaoID)
|
| | | RefreshGubaoAttr(curPlayer)
|
| | | Sync_GubaoInfo(curPlayer, [gubaoID])
|
| | |
|
| | | PlayerActGubao.OnGubaoCost(curPlayer, needPieceInfo, realNeedItemList)
|
| | | return
|
| | |
|
| | | def DoGubaoAddFreePoint(curPlayer, gubaoID=0):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | effPointDict = {}
|
| | | if gubaoID:
|
| | | __calcStarEffAddFreePoint(curPlayer, gubaoID, effPointDict)
|
| | | else:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetGubaoCount()):
|
| | | ipyData = ipyDataMgr.GetGubaoByIndex(index)
|
| | | gubaoID = ipyData.GetGubaoID()
|
| | | __calcStarEffAddFreePoint(curPlayer, gubaoID, effPointDict)
|
| | | |
| | | if not effPointDict:
|
| | | return
|
| | | |
| | | unAddFreePointTotal = 0
|
| | | for effKey, addFreePointTotal in effPointDict.items():
|
| | | gubaoID, star, effType = effKey |
| | | # 已增加的点数
|
| | | addFreePointAlready = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType))
|
| | | unAddFreePoint = max(0, addFreePointTotal - addFreePointAlready)
|
| | | unAddFreePointTotal += unAddFreePoint
|
| | | GameWorld.DebugLog("古宝星级增加灵根点: gubaoID=%s,star=%s,addFreePointTotal=%s,addFreePointAlready=%s,unAddFreePoint=%s,total=%s" |
| | | % (gubaoID, star, addFreePointTotal, addFreePointAlready, unAddFreePoint, unAddFreePointTotal), playerID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GubaoItemEffValue % (gubaoID, effType), addFreePointTotal)
|
| | | if unAddFreePoint:
|
| | | Sync_GubaoItemEffInfo(curPlayer, gubaoID, effType, True)
|
| | | |
| | | if unAddFreePointTotal <= 0:
|
| | | return
|
| | | freePoint = curPlayer.GetFreePoint()
|
| | | updFreePoint = freePoint + unAddFreePointTotal
|
| | | curPlayer.SetFreePoint(updFreePoint)
|
| | | return
|
| | |
|
| | | def __calcStarEffAddFreePoint(curPlayer, gubaoID, effPointDict):
|
| | | _, star = GetGubaoLVInfo(curPlayer, gubaoID)
|
| | | if not star:
|
| | | return
|
| | | starIpyData = IpyGameDataPY.GetIpyGameData("GubaoStar", gubaoID, star)
|
| | | if not starIpyData:
|
| | | return
|
| | | starEffIDList = starIpyData.GetStarEffIDList()
|
| | | for effID in starEffIDList:
|
| | | effIpyData = IpyGameDataPY.GetIpyGameData("GubaoEffAttr", effID)
|
| | | if not effIpyData:
|
| | | continue
|
| | | effType = effIpyData.GetGubaoEffType()
|
| | | effCond = effIpyData.GetEffCond()
|
| | | effAttrValue = effIpyData.GetEffAttrValue()
|
| | | |
| | | effKey = (gubaoID, star, effType)
|
| | | if effType == 54: # 增加x点灵根
|
| | | addFreePointTotal = effIpyData.GetEffAttrValue()
|
| | | effPointDict[effKey] = effPointDict.get(effKey, 0) + addFreePointTotal
|
| | | elif effType == 55: # 境界每级增加X点灵根
|
| | | realmLV = curPlayer.GetOfficialRank()
|
| | | addFreePointTotal = int(realmLV / effCond * effAttrValue)
|
| | | effPointDict[effKey] = effPointDict.get(effKey, 0) + addFreePointTotal
|
| | | elif effType == 56: # 等级每级增加X点灵根
|
| | | playerLV = curPlayer.GetLV()
|
| | | addFreePointTotal = int(playerLV / effCond * effAttrValue)
|
| | | effPointDict[effKey] = effPointDict.get(effKey, 0) + addFreePointTotal
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | #// B2 18 古宝升级 #tagCMGubaoLVUp
|
| | | #
|
| | |
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | |
|
| | | #57 坐骑基础属性提升x%
|
| | | elif effType == 57:
|
| | | customAttrDict = PlayerControl.GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Horse)[2]
|
| | | horseBaseAttrInfo = customAttrDict.get("horseBaseAttrInfo", {})
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,horseBaseAttrInfo=%s,effAttrInfo=%s" % (effID, effType, horseBaseAttrInfo, effAttrInfo))
|
| | | __addStarEffFuncAttr(ipyData, effAttrInfo, horseBaseAttrInfo, effAttrValue)
|
| | | |
| | | #58 坐骑每x级+xx属性 x级
|
| | | elif effType == 58:
|
| | | horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
|
| | | addAttrValue = int(horseLV / effCond * effAttrValue)
|
| | | #GameWorld.DebugLog(" effID=%s,effType=%s,effCond=%s,horseLV=%s,attrID=%s,addAttrValue=%s" % (effID, effType, effCond, horseLV, attrID, addAttrValue))
|
| | | if attrID > 0 and addAttrValue > 0:
|
| | | effAttrInfo[attrID] = effAttrInfo.get(attrID, 0) + addAttrValue
|
| | | |
| | | return
|
| | |
|
| | | def __addStarEffFuncAttr(ipyData, effAttrInfo, funcAttrInfo, effAttrValue):
|
| | |
| | | else:
|
| | | syncIDList = [gubaoID]
|
| | |
|
| | | syncEffTypeList = [effType] if effType else GubaoEffTtemIypeList
|
| | | syncEffTypeList = [effType] if effType else NeedGubaoItemEffValueTypeList
|
| | |
|
| | | itemEffInfoList = []
|
| | | for gubaoID in syncIDList:
|