| | |
| | | return
|
| | | equipPlace = ipyData.GetEquipPlace()
|
| | | classLV = ipyData.GetClassLV()
|
| | | funcPlusMinClassInfo = IpyGameDataPY.GetFuncEvalCfg("EquipPlusByFuncID", 1, {})
|
| | | funcID = ShareDefine.GameFuncID_EquipWash
|
| | | if str(funcID) in funcPlusMinClassInfo:
|
| | | funcMinClassLV = funcPlusMinClassInfo[str(funcID)]
|
| | | if classLV < funcMinClassLV:
|
| | | GameWorld.Log("该装备阶无法洗练! classLV=%s < funcMinClassLV=%s" % (classLV, funcMinClassLV), playerID)
|
| | | return
|
| | | washType = GetEquipWashType(equipPlace)
|
| | | if washType is None:
|
| | | GameWorld.Log("该装备位无法洗练! equipPlace=%s" % (equipPlace), playerID)
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackindex})
|
| | | if not ipyData:
|
| | | return
|
| | | curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | curEquip = curPack.GetAt(equipPackindex)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | GameWorld.DebugLog("OnEquipWashAttrChangeOK() equip is empty")
|
| | | return
|
| | | equipPlace = ipyData.GetEquipPlace()
|
| | | classLV = ipyData.GetClassLV()
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPackindex)
|
| | |
| | | if washLV >= maxWashLV:
|
| | | GameWorld.DebugLog("已达到最大洗练等级,不可升级!", playerID)
|
| | | return
|
| | | if CheckEquipWashLVUp(curPlayer, equipPackindex, classLV, equipPlace, washLV, washData):
|
| | | if CheckEquipWashLVUp(curPlayer, curEquip, equipPackindex, washLV, washData):
|
| | | RefreshEquipWashAttr(curPlayer, classLV)
|
| | | Sycn_EquipWashInfo(curPlayer, equipPackindex)
|
| | | EquipWashSuccess(curPlayer)
|
| | | EquipWashSuccess(curPlayer, classLV)
|
| | | else:
|
| | | GameWorld.DebugLog("升级失败,有属性未达到最大值,无法升级!", playerID)
|
| | | return
|
| | |
| | | Sycn_EquipWashInfo(curPlayer, equipPackindex)
|
| | | return
|
| | |
|
| | | def CheckEquipWashLVUp(curPlayer, equipPackindex, classLV, equipPlace, washLV, washData):
|
| | | def CheckEquipWashLVUp(curPlayer, curEquip, equipPackindex, washLV, washData):
|
| | | # 检查洗练类型升级
|
| | |
|
| | | for attrNum in range(1, Def_EquipWashMaxAttrCount + 1):
|
| | |
| | | SetEquipWashLV(curPlayer, equipPackindex, washLV)
|
| | |
|
| | | # 洗练广播
|
| | | PlayerControl.WorldNotify(0, "WashCongratulation", [curPlayer.GetPlayerName(), curPlayer.GetPlayerID(), classLV, equipPlace, washLV])
|
| | | itemID = curEquip.GetItemTypeID()
|
| | | userData = curEquip.GetUserData()
|
| | | guid = ItemCommon.CacheNotifyEquipDetailInfo(curPlayer, curEquip)
|
| | | msgParamList = [curPlayer.GetPlayerName(), itemID, userData, guid, washLV]
|
| | | PlayerControl.WorldNotify(0, "WashCongratulation", msgParamList)
|
| | | return True
|
| | |
|
| | | def SetEquipWashLV(curPlayer, index, setWashLV):
|
| | |
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | return
|
| | |
|
| | | def EquipWashSuccess(curPlayer):
|
| | | # succList = [ShareDefine.SuccType_EquipWashLV1,ShareDefine.SuccType_EquipWashLV2,ShareDefine.SuccType_EquipWashLV3]
|
| | | # for washType in range(1, Def_EquipWashMaxType + 1):
|
| | | # washTypeLV = 999
|
| | | # placeList = GetEquipWashPlaceList(washType)
|
| | | # for equipPlace in placeList:
|
| | | # washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % equipPlace)
|
| | | # washTypeLV = min(washTypeLV, washLV)
|
| | | # |
| | | # if not washTypeLV:
|
| | | # continue
|
| | | # PlayerSuccess.DoAddSuccessProgress(curPlayer, succList[washType-1], 1, [washTypeLV])
|
| | | def EquipWashSuccess(curPlayer, classLV):
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'ClassLV':classLV}, True)
|
| | | if not ipyDataList:
|
| | | return
|
| | | |
| | | washLVCountDict = {}
|
| | | for ipyData in ipyDataList:
|
| | | index = ipyData.GetGridIndex()
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index)
|
| | | if not washLV:
|
| | | continue
|
| | | conditionKey = (classLV, washLV)
|
| | | washLVCountDict[conditionKey] = washLVCountDict.get(conditionKey, 0) + 1
|
| | | |
| | | #GameWorld.DebugLog("洗练成就数据: classLV=%s,washLVCountDict=%s" % (classLV, washLVCountDict))
|
| | | PlayerSuccess.UpdateSuccessProgressByConditions(curPlayer, ShareDefine.SuccType_EquipWash, washLVCountDict)
|
| | | return
|
| | |
|