| | |
| | | import ItemCommon
|
| | | import ChConfig
|
| | | import ChEquip
|
| | | import EventShell
|
| | |
|
| | | import random
|
| | |
|
| | |
| | | return
|
| | |
|
| | | maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex)
|
| | | GameWorld.DebugLog("装备洗练: classLV=%s,equipPlace=%s,checkUseGoldAttr=%s,washType=%s,washLV=%s,maxWashLV=%s"
|
| | | % (classLV, equipPlace, checkUseGoldAttr, washType, washLV, maxWashLV), playerID)
|
| | |
|
| | | if maxWashLV < 1:
|
| | | if maxWashLV < washLV:
|
| | | return
|
| | |
|
| | | washData = GetEquipWashData(washType, washLV)
|
| | |
| | | return
|
| | |
|
| | | preWashData = None # 上一洗练等级数据
|
| | | if washLV > 1:
|
| | | if washLV > 0:
|
| | | preWashData = GetEquipWashData(washType, washLV - 1)
|
| | | if not preWashData:
|
| | | GameWorld.ErrLog("找不到上一级洗练数据,无法洗练!preWashLV=%s" % (washLV - 1))
|
| | |
| | | return
|
| | | equipPlace = ipyData.GetEquipPlace()
|
| | | classLV = ipyData.GetClassLV()
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex) + 1
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex)
|
| | | maxWashLV = GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
|
| | | GameWorld.DebugLog("确认洗练结果: classLV=%s, equipPlace=%s,isSave=%s,washLV=%s,maxWashLV=%s"
|
| | | % (classLV, equipPlace, isSave, washLV, maxWashLV), playerID)
|
| | |
| | | washType = GetEquipWashType(equipPlace)
|
| | | if washType is None:
|
| | | return
|
| | | if maxWashLV < 1:
|
| | | if maxWashLV < 0:
|
| | | return
|
| | | washData = GetEquipWashData(washType, washLV)
|
| | | if not washData:
|
| | |
| | | if tempValue < getattr(washData, "GetAttrMax%s" % attrNum)():
|
| | | return
|
| | | washLV += 1
|
| | | # 字典存储的从0开始,0代表1级,所以实际存进去的值需减1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV - 1)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV)
|
| | | GameWorld.DebugLog("装备洗练等级升级: equipPackindex=%s,washLV=%s" % (equipPackindex, washLV), curPlayer.GetPlayerID())
|
| | |
|
| | | # 洗练广播
|
| | |
| | | for place in syncPlaceList:
|
| | | equipPart = ChPyNetSendPack.tagMCEquipPartXLAttr()
|
| | | equipPart.EquipPlace = place
|
| | | equipPart.XLAttrLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % place) + 1
|
| | | equipPart.XLAttrLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % place)
|
| | | equipPart.XLAttrList = []
|
| | | for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
|
| | | washValue = ChPyNetSendPack.tagMCEquipPartXLAttrValue()
|
| | |
| | |
|
| | | def CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, allAttrList):
|
| | | ## 装备位洗练属性
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipIndex) + 1
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipIndex)
|
| | | maxWashLV = GetEquipWashMaxLV(curPlayer, equipIndex, equipPlace)
|
| | | washLV = min(washLV, maxWashLV)
|
| | | washType = GetEquipWashType(equipPlace)
|
| | |
| | | # washTypeLV = 999
|
| | | # placeList = GetEquipWashPlaceList(washType)
|
| | | # for equipPlace in placeList:
|
| | | # washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace) + 1
|
| | | # washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace)
|
| | | # washTypeLV = min(washTypeLV, washLV)
|
| | | #
|
| | | # if not washTypeLV:
|
| | |
| | | allIndexList = Operate_EquipWash.GetAllEquipWashPlace()
|
| | | syncPlace = -1
|
| | | if len(cmdList) == 1 and cmdList[0] == 0:
|
| | | for place in allIndexList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (place), 0)
|
| | | for index in allIndexList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (index), 0)
|
| | | for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (place, attrNum), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (place, attrNum), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (index, attrNum), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (index, attrNum), 0)
|
| | | GameWorld.DebugLog("重置所有洗练数据")
|
| | |
|
| | | elif len(cmdList) == 2:
|
| | |
| | | continue
|
| | | equipPlace = ipyData.GetEquipPlace()
|
| | | maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, equipPackindex, equipPlace)
|
| | | if maxWashLV < 1:
|
| | | continue
|
| | | #if maxWashLV < 1:
|
| | | # continue
|
| | | __SetEquipPlaceWashLV(curPlayer, equipPackindex, equipPlace, washLV, attrPer, maxWashLV)
|
| | | isSync = True
|
| | | if not isSync:
|
| | |
| | | gridIndex = ipyData.GetGridIndex()
|
| | | syncPlace = gridIndex
|
| | | maxWashLV = Operate_EquipWash.GetEquipWashMaxLV(curPlayer, gridIndex, place)
|
| | | if maxWashLV < 1:
|
| | | return
|
| | | #if maxWashLV < 1:
|
| | | # return
|
| | | __SetEquipPlaceWashLV(curPlayer, gridIndex, place, washLV, attrPer, maxWashLV)
|
| | |
|
| | | else:
|
| | |
| | |
|
| | | washType = Operate_EquipWash.GetEquipWashType(place)
|
| | | washData = Operate_EquipWash.GetEquipWashData(washType, washLV)
|
| | | preWashData = None if washLV <= 1 else Operate_EquipWash.GetEquipWashData(washType, washLV - 1)
|
| | | preWashData = None if washLV <= 0 else Operate_EquipWash.GetEquipWashData(washType, washLV - 1)
|
| | |
|
| | | #GameWorld.DebugLog("设置洗练: place=%s,washType=%s,washLV=%s,attrPer=%s" % (place, washType, washLV, attrPer))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV - 1)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashLV % (equipPackindex), washLV)
|
| | | for attrNum in range(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | preMaxValue = 0 if not preWashData else getattr(preWashData, "GetAttrMax%s" % attrNum)()
|
| | | curMaxValue = getattr(washData, "GetAttrMax%s" % attrNum)()
|
| | |
| | | itemDict["Stone"] = stoneIDList
|
| | |
|
| | | #部位洗练数据
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex) + 1
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex)
|
| | | valueList = []
|
| | | for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (packIndex, attrNum))
|
| | |
| | | itemDict["Stone"] = stoneIDList
|
| | |
|
| | | #部位洗练数据
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index) + 1
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index)
|
| | | valueList = []
|
| | | for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (index, attrNum))
|