| | |
| | | #------------------------------------------------------------------------------
|
| | | import IPY_GameWorld
|
| | | import GameWorld
|
| | | import ItemControler
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | | import ItemCommon
|
| | | import ShareDefine
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import OpenServerCampaign
|
| | | import FormulaControl
|
| | | import PlayerOnline
|
| | |
|
| | | def RefreshRoleEquipAttr(curPlayer):
|
| | |
| | | PlayerOnline.GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_MainEquip, mainEquipAttrDict)
|
| | | return
|
| | |
|
| | | ## 刷新装备对人物属性的改变
|
| | | # @param self 类实例
|
| | | # @return 返回值无意义
|
| | | # @remarks 刷新装备对人物属性的改变
|
| | | def RefreshPlayerEquipAttribute(curPlayer, classLV=0):
|
| | | return
|
| | |
|
| | | #// A3 18 灵器突破 #tagCMLingQiEquipBreak
|
| | | #
|
| | | #struct tagCMLingQiEquipBreak
|
| | |
| | | # DWORD ItemID; //突破的物品ID
|
| | | #};
|
| | | def OnLingQiEquipBreak(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | breakItemID = clientData.ItemID
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('LingQiAttr', breakItemID)
|
| | | if not ipyData:
|
| | | return
|
| | | nextItemID = ipyData.GetNextItemID() #突破后的物品ID
|
| | | if not IpyGameDataPY.GetIpyGameData('LingQiAttr', nextItemID):
|
| | | return
|
| | | breakItemData = GameWorld.GetGameData().GetItemByTypeID(breakItemID)
|
| | | nextItemData = GameWorld.GetGameData().GetItemByTypeID(nextItemID)
|
| | | if not breakItemData or not nextItemData:
|
| | | return
|
| | | equipIndex = ItemCommon.GetEquipPackIndex(breakItemData)
|
| | | if equipIndex != ItemCommon.GetEquipPackIndex(nextItemData):
|
| | | GameWorld.DebugLog("突破的物品和突破后的物品不是同个装备位!breakItemID=%s,nextItemID=%s" |
| | | % (breakItemID, nextItemID))
|
| | | return
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | GameWorld.DebugLog("突破的物品未穿戴!breakItemID=%s" |
| | | % (breakItemID))
|
| | | return
|
| | | if curEquip.GetEndureReduceType():
|
| | | GameWorld.DebugLog("突破的物品是时效物品!breakItemID=%s" |
| | | % (breakItemID))
|
| | | return
|
| | | if curEquip.GetItemTypeID() != breakItemID:
|
| | | GameWorld.DebugLog("突破的物品未穿戴!breakItemID=%s" |
| | | % (breakItemID))
|
| | | return
|
| | | |
| | | |
| | | costItemDict = ipyData.GetUpCostItem()
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(costItemDict, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("突破消耗物品不足!breakItemID=%s,costItemDict=%s,lackItemDict=%s" |
| | | % (breakItemID, costItemDict, lackItemDict))
|
| | | return
|
| | | |
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, 'LingQiEquipBreak')
|
| | | ItemCommon.DelItem(curPlayer, curEquip, 1, False, ChConfig.ItemDel_LingQiEquipBreak, {}, True)
|
| | | #给突破后灵器
|
| | | if not ItemControler.PutItemInTempSwap(curPlayer, nextItemID):
|
| | | GameWorld.Log("灵器突破后ID(%s)放入临时交换背包失败!" % (nextItemID), curPlayer.GetID())
|
| | | return
|
| | | ItemCommon.DoLogicSwitchItemEx(curPlayer, ShareDefine.rptTempSwap, IPY_GameWorld.rptEquip, 0, equipIndex)
|
| | |
|
| | | changeItemStarLV = 0 #curItem.GetItemStarLV()
|
| | | changeItemStoneCnt = 0 #curItem.GetUseStoneCount()
|
| | | changeItemHoleCnt = 0 #curItem.GetCanPlaceStoneCount()
|
| | | changeItemUseData = ''
|
| | | curPlayer.ChangeEquip(nextItemID, equipIndex, changeItemStarLV, changeItemHoleCnt, changeItemStoneCnt, changeItemUseData)
|
| | | #刷属性
|
| | | RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | #通知结果
|
| | | resultPack = ChPyNetSendPack.tagMCLingQiEquipBreakResult()
|
| | | resultPack.Clear()
|
| | | resultPack.MakeItemID = nextItemID
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | PlayerControl.WorldNotify(0, 'SpiritOrgan', [curPlayer.GetName(), breakItemID, nextItemID])
|
| | | return
|
| | |
|
| | | #// A3 27 灵器培养 #tagCMLingQiTrain
|
| | |
| | | # WORD UseItemCnt; //消耗材料个数
|
| | | #};
|
| | | def OnLingQiTrain(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | |
| | | equipPlace = clientData.EquipPlace # 灵器装备位
|
| | | trainType = clientData.TrainType # 培养类型
|
| | | costItemCount = clientData.UseItemCnt # 消耗材料个数
|
| | | |
| | | trainLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LingQiTrainLV % (equipPlace, trainType))
|
| | | curEatItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LingQiTrainItemCount % (equipPlace, trainType))
|
| | | GameWorld.DebugLog("灵器培养: equipPlace=%s,trainType=%s,trainLV=%s,costItemCount=%s,curEatItemCount=%s" |
| | | % (equipPlace, trainType, trainLV, costItemCount, curEatItemCount))
|
| | | |
| | | if equipPlace not in ChConfig.EquipPlace_LingQi:
|
| | | return
|
| | | |
| | | if trainType <= 0 or trainType > GetLingQiTrainTypes(equipPlace):
|
| | | return
|
| | | |
| | | if trainLV <= 0:
|
| | | GameWorld.DebugLog(" 培养未激活 trainType=%s" % trainType)
|
| | | return
|
| | | |
| | | trainIpyData = IpyGameDataPY.GetIpyGameData("LingQiTrain", equipPlace, trainType, trainLV)
|
| | | if not trainIpyData:
|
| | | return
|
| | | |
| | | needRealmLV = trainIpyData.GetNeedRealmLV()
|
| | | curRealmLV = PlayerControl.GetTrainRealmLVReal(curPlayer, 3)
|
| | | if curRealmLV < needRealmLV:
|
| | | GameWorld.DebugLog(" 境界不足,无法培养! curRealmLV(%s) < needRealmLV(%s)" % (curRealmLV, needRealmLV))
|
| | | return
|
| | | |
| | | needEatCountTotal = trainIpyData.GetEatCntTotal()
|
| | | if not needEatCountTotal:
|
| | | GameWorld.DebugLog(" 该培养已满级!")
|
| | | return
|
| | | |
| | | costItemIDList = IpyGameDataPY.GetFuncEvalCfg("LingQiTrain", 1, {}).get(str(equipPlace), [])
|
| | | costItemID = costItemIDList[trainType - 1]
|
| | | if not costItemID or not costItemCount:
|
| | | return
|
| | | |
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
|
| | | lackCnt = costItemCount - bindCnt - unBindCnt
|
| | | if lackCnt > 0:
|
| | | GameWorld.DebugLog(" 消耗道具不足,无法培养!costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" |
| | | % (costItemID, costItemCount, bindCnt, unBindCnt, lackCnt))
|
| | | return
|
| | | |
| | | delCnt = costItemCount
|
| | | |
| | | # 扣除消耗
|
| | | if delCnt:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delCnt, "LingQiTrain")
|
| | | |
| | | updClassLV = trainLV
|
| | | updEatItemCount = curEatItemCount + costItemCount
|
| | | GameWorld.DebugLog(" updEatItemCount=%s,needEatCountTotal=%s" % (updEatItemCount, needEatCountTotal))
|
| | | |
| | | if updEatItemCount >= needEatCountTotal:
|
| | | updClassLV += 1
|
| | | updEatItemCount -= needEatCountTotal
|
| | | GameWorld.DebugLog(" 进阶: updClassLV=%s,updEatItemCount=%s" % (updClassLV, updEatItemCount))
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LingQiTrainLV % (equipPlace, trainType), updClassLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LingQiTrainItemCount % (equipPlace, trainType), updEatItemCount)
|
| | | |
| | | # 升阶
|
| | | if updClassLV > trainLV:
|
| | | pass
|
| | | |
| | | Sync_LingQiTrainData(curPlayer, equipPlace)
|
| | | # 刷属性
|
| | | RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def GetLingQiTrainTypes(equipPlace):
|
| | | return len(IpyGameDataPY.GetFuncEvalCfg("LingQiTrain", 1, {}).get(str(equipPlace), []))
|
| | |
|
| | | def Sync_LingQiTrainData(curPlayer, equipPlace):
|
| | | clientPack = ChPyNetSendPack.tagMCLingQiTrainInfo()
|
| | | clientPack.EquipPlace = equipPlace
|
| | | clientPack.TrainLVList = []
|
| | | clientPack.TrainItemCountList = []
|
| | | for trainType in xrange(1, GetLingQiTrainTypes(equipPlace) + 1):
|
| | | trainLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LingQiTrainLV % (equipPlace, trainType))
|
| | | if trainLV == 0:
|
| | | trainLV = 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LingQiTrainLV % (equipPlace, trainType), trainLV)
|
| | | clientPack.TrainLVList.append(trainLV)
|
| | | clientPack.TrainItemCountList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LingQiTrainItemCount % (equipPlace, trainType)))
|
| | | clientPack.TrainTypes = len(clientPack.TrainLVList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def RefreshPlayerLingQiEquipAttr(curPlayer):
|
| | | ''' 刷新玩家灵器装备属性
|
| | | '''
|
| | | return
|
| | | classLV = 0 # 灵器阶默认为0
|
| | | allAttrList = [{} for _ in range(4)]
|
| | | lingQiAttrList = [{} for _ in range(4)]
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | equipScoreTotal = 0
|
| | | lv = curPlayer.GetLV()
|
| | | lqAttrFormatDict = IpyGameDataPY.GetFuncEvalCfg("OutOfPrintValue", 2, {})
|
| | | |
| | | for equipPlace in ChConfig.EquipPlace_LingQi:
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | |
| | | equipIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | continue
|
| | | |
| | | if not ItemCommon.CheckItemCanUseByExpireTime(curEquip):
|
| | | # 过期
|
| | | continue
|
| | | |
| | | equipScoreTotal += ItemCommon.GetEquipGearScore(curEquip)
|
| | | |
| | | itemID = curEquip.GetItemTypeID()
|
| | | #基础属性效果
|
| | | for effIndex in xrange(curEquip.GetEffectCount()):
|
| | | curEff = curEquip.GetEffectByIndex(effIndex)
|
| | | effID = curEff.GetEffectID()
|
| | | if effID == 0:
|
| | | break
|
| | | PlayerControl.CalcAttrDict_Type(effID, curEff.GetEffectValue(0), lingQiAttrList)
|
| | | |
| | | #灵器属性
|
| | | lingQiIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LingQiAttr", itemID)
|
| | | if lingQiIpyData:
|
| | | lingQiAttrIDList = lingQiIpyData.GetLingQiAttrID()
|
| | | lingQiAttrValueList = lingQiIpyData.GetLingQiAttrValue()
|
| | | for lqIndex, lqAttrID in enumerate(lingQiAttrIDList):
|
| | | if str(lqAttrID) in lqAttrFormatDict:
|
| | | attrFormat = lqAttrFormatDict[str(lqAttrID)]
|
| | | maxOOPValue = lingQiAttrValueList[lqIndex]
|
| | | lqAttrValue = eval(FormulaControl.GetCompileFormula("LingQiAttrFormat_%s" % lqAttrID, attrFormat))
|
| | | else:
|
| | | lqAttrValue = lingQiAttrValueList[lqIndex]
|
| | | |
| | | PlayerControl.CalcAttrDict_Type(lqAttrID, lqAttrValue, lingQiAttrList)
|
| | | |
| | | # 新培养属性
|
| | | guardTrainAttrList = [{} for _ in range(4)]
|
| | | wingTrainAttrList = [{} for _ in range(4)]
|
| | | peerlessWeaponTrainAttrList = [{} for _ in range(4)]
|
| | | peerlessWeapon2TrainAttrList = [{} for _ in range(4)]
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetLingQiTrainCount()):
|
| | | trainIpyData = ipyDataMgr.GetLingQiTrainByIndex(index)
|
| | | equipPlace = trainIpyData.GetEquipPlace()
|
| | | trainType = trainIpyData.GetTrainType()
|
| | | dataTrainLV = trainIpyData.GetTrainLV()
|
| | | |
| | | if equipPlace == ShareDefine.retGuard1:
|
| | | lingQiTrainAttrList = guardTrainAttrList
|
| | | elif equipPlace == ShareDefine.retWing:
|
| | | lingQiTrainAttrList = wingTrainAttrList
|
| | | elif equipPlace == ShareDefine.retPeerlessWeapon:
|
| | | lingQiTrainAttrList = peerlessWeaponTrainAttrList
|
| | | elif equipPlace == ShareDefine.retPeerlessWeapon2:
|
| | | lingQiTrainAttrList = peerlessWeapon2TrainAttrList
|
| | | else:
|
| | | continue
|
| | | |
| | | trainLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LingQiTrainLV % (equipPlace, trainType))
|
| | | |
| | | if dataTrainLV > trainLV:
|
| | | continue
|
| | | elif dataTrainLV == trainLV:
|
| | | trainItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LingQiTrainItemCount % (equipPlace, trainType))
|
| | | else:
|
| | | trainItemCount = trainIpyData.GetEatCntTotal()
|
| | | |
| | | # 等阶额外属性
|
| | | lvAttrTypeList = trainIpyData.GetLVAttrTypeList()
|
| | | lvAttrValueList = trainIpyData.GetLVAttrValueList()
|
| | | for i, attrID in enumerate(lvAttrTypeList):
|
| | | attrValue = lvAttrValueList[i]
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, lingQiTrainAttrList)
|
| | | |
| | | # 培养丹增加属性
|
| | | eatCntEverytime = trainIpyData.GetEatCntEverytime()
|
| | | if trainItemCount and eatCntEverytime:
|
| | | eatItemAttrTypeList = trainIpyData.GetEatItemAttrTypeList()
|
| | | eatItemAttrValueList = trainIpyData.GetEatItemAttrValueList()
|
| | | attrMultiple = trainItemCount / eatCntEverytime
|
| | | for i, attrID in enumerate(eatItemAttrTypeList):
|
| | | attrValue = eatItemAttrValueList[i]
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue * attrMultiple, lingQiTrainAttrList)
|
| | | |
| | | #GameWorld.DebugLog("守护培养属性: %s" % guardTrainAttrList)
|
| | | #GameWorld.DebugLog("翅膀培养属性: %s" % wingTrainAttrList)
|
| | | #GameWorld.DebugLog("灭世培养属性: %s" % peerlessWeaponTrainAttrList)
|
| | | #GameWorld.DebugLog("噬魂培养属性: %s" % peerlessWeapon2TrainAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_GuardTarin, guardTrainAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_WingTarin, wingTrainAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PeerlessWeaponTrain, peerlessWeaponTrainAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PeerlessWeapon2Train, peerlessWeapon2TrainAttrList)
|
| | | |
| | | lqFightPowerEx = eval(IpyGameDataPY.GetFuncCompileCfg("FightpowerFormula", 2))
|
| | | PlayerControl.SetMFPExFightPower(curPlayer, ShareDefine.Def_MFPType_LingQi, lqFightPowerEx)
|
| | | |
| | | #GameWorld.DebugLog("灵器属性1: %s" % allAttrList)
|
| | | #GameWorld.DebugLog("灵器属性2: %s" % lingQiAttrList)
|
| | | #GameWorld.DebugLog("灵器评分战力: equipScoreTotal=%s, %s" % (equipScoreTotal, lqFightPowerEx))
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingQi, allAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingQiAttr, lingQiAttrList)
|
| | | return
|
| | |
|
| | | def CalcAttr_LegendAttr(curPlayer, curEquip, allAttrListEquip, legendAttrDict={}):
|
| | |
| | | # BYTE Star; // 星数
|
| | | #};
|
| | | def OnEquipPartSuiteActivate(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | classLV = clientData.ClassLV
|
| | | suiteID = clientData.SuiteID
|
| | | suiteCount = clientData.SuiteCount
|
| | | star = clientData.Star
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList('EquipSuitAttr', suiteID)
|
| | | if not ipyDataList:
|
| | | return
|
| | | |
| | | actIpyData = None
|
| | | for ipyData in ipyDataList:
|
| | | needCount = ipyData.GetSuiteCnt()
|
| | | needStar = ipyData.GetStar()
|
| | | if suiteCount == needCount and star == needStar:
|
| | | actIpyData = ipyData
|
| | | break
|
| | | |
| | | if not actIpyData:
|
| | | return
|
| | | activateIndex = actIpyData.GetActivateIndex()
|
| | | # 这里就不判断是否满足件数、星数条件了,算属性的时候本身也是条件之一,是否激活只是附加条件,这里只处理激活状态变更,能否激活前端判断即可
|
| | | isActivate = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteActivate, activateIndex)
|
| | | if isActivate:
|
| | | return
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteActivate, activateIndex, 1)
|
| | | Sync_EquipPartSuiteActivateInfo(curPlayer)
|
| | | |
| | | #广播
|
| | | notifyMark = actIpyData.GetIsNotify()
|
| | | if notifyMark:
|
| | | PlayerControl.WorldNotify(0, 'AllStarLevelUp' if needStar else 'AllStarLevelUp2', [curPlayer.GetPlayerName(), suiteID, suiteCount, star])
|
| | | |
| | | RefreshPlayerEquipAttribute(curPlayer, classLV)
|
| | | #刷新所有属性
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def Sync_EquipPartSuiteActivateInfo(curPlayer):
|
| | | ## 同步装备位星级套装激活状态信息
|
| | | #keyCount = 10
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | dataCount = ipyDataMgr.GetEquipSuitAttrCount()
|
| | | if not dataCount:
|
| | | return
|
| | | lastIpyData = ipyDataMgr.GetEquipSuitAttrByIndex(dataCount - 1)
|
| | | if not lastIpyData:
|
| | | return
|
| | | keyCount = 1 + lastIpyData.GetActivateIndex() / 31
|
| | | activateStateList = []
|
| | | for i in xrange(keyCount):
|
| | | activateStateList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartSuiteActivate % i))
|
| | | if activateStateList.count(0) == keyCount:
|
| | | return
|
| | | activateInfo = ChPyNetSendPack.tagMCEquipPartSuiteActivateInfo()
|
| | | activateInfo.SuiteActivateStateInfo = activateStateList
|
| | | activateInfo.Count = len(activateInfo.SuiteActivateStateInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, activateInfo)
|
| | | return
|
| | |
|
| | | def ChangeEquipEffectByPlusMaster(curPlayer, classLV):
|
| | | # 强化大师特效
|
| | | if (classLV != GetEquipFacadeClassLV(curPlayer)):
|
| | | return
|
| | | |
| | | masterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
|
| | | ## 强化大师影响角色外观显示 强化大师等级 * 1000+第几套*10+是否有套装
|
| | | oldEquipShowSwitch = curPlayer.GetEquipShowSwitch()
|
| | | updEquipShowSwitch = oldEquipShowSwitch % 1000 + oldEquipShowSwitch / 1000000 * 1000000+ 1000 * masterPlusLV
|
| | | GameWorld.DebugLog('强化大师影变化影响角色外观显示,oldEquipShowSwitch=%s,updEquipShowSwitch=%s'%
|
| | | (oldEquipShowSwitch, updEquipShowSwitch))
|
| | | if oldEquipShowSwitch != updEquipShowSwitch:
|
| | | curPlayer.SetEquipShowSwitch(updEquipShowSwitch)
|
| | | return
|
| | |
|
| | |
|
| | | def ChangeEquipfacadeByHorsePetSkin(curPlayer, skinType, skinIndex):
|
| | | ##骑宠觉醒外观变更 灵宠外观索引*10000000+坐骑外观索引*1000000+灵根特效表key * 1000+第几套*10+是否有套装
|
| | |
| | |
|
| | | return 0
|
| | |
|
| | | #获取当前是第几套装备外观
|
| | | def GetEquipFacadeClassLV(curPlayer):return curPlayer.GetEquipShowSwitch()%1000/10
|
| | |
|
| | | ## 获取公共部位强化熟练度
|
| | | def GetEquipPartProficiency(curPlayer, packType, index):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartProficiency % (packType, index))
|
| | |
|
| | | ## 设置公共部位强化熟练度
|
| | | def SetEquipPartProficiency(curPlayer, packType, index, value):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartProficiency % (packType, index), value)
|
| | | return
|
| | |
|
| | | ## 获取公共部位强化等级
|
| | | def GetEquipPartPlusLV(curPlayer, packType, index):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusLV % (packType, index))
|
| | |
|
| | | ## 设置公共部位强化等级
|
| | | def SetEquipPartPlusLV(curPlayer, packType, index, curEquip, setPlusLV):
|
| | | befPlusLV = GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | if befPlusLV == setPlusLV:
|
| | | return
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusLV % (packType, index), setPlusLV)
|
| | | #===========================================================================
|
| | | # if curEquip and not curEquip.IsEmpty():
|
| | | # curEquip.SetItemStarLV(starLV)
|
| | | #===========================================================================
|
| | | |
| | | # 同步更新强化总等级
|
| | | befTotalPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusLV)
|
| | | updTotalPlusLV = max(0, befTotalPlusLV + setPlusLV - befPlusLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusLV, updTotalPlusLV)
|
| | | GameWorld.DebugLog("设置强化等级: index=%s,befPlusLV=%s,setPlusLV=%s,befTotalPlusLV=%s,updTotalPlusLV=%s" |
| | | % (index, befPlusLV, setPlusLV, befTotalPlusLV, updTotalPlusLV))
|
| | | return
|
| | |
|
| | | ## 获取公共部位强化进化等级
|
| | | def GetEquipPartPlusEvolveLV(curPlayer, packType, index):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index))
|
| | |
|
| | |
|
| | | ## 设置公共部位强化进化等级
|
| | | def SetEquipPartPlusEvolveLV(curPlayer, packType, index, setEvolveLV):
|
| | | befEvolveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index))
|
| | | if befEvolveLV == setEvolveLV:
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index), setEvolveLV)
|
| | | |
| | | # 同步更新进化总等级
|
| | | befTotalPlusEvolveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusEvolveLV)
|
| | | updTotalPlusEvolveLV = max(0, befTotalPlusEvolveLV + setEvolveLV - befEvolveLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusEvolveLV, updTotalPlusEvolveLV)
|
| | | GameWorld.DebugLog("设置进化等级: index=%s,befEvolveLV=%s,setEvolveLV=%s,befTotalPlusEvolveLV=%s,updTotalPlusEvolveLV=%s" |
| | | % (index, befEvolveLV, setEvolveLV, befTotalPlusEvolveLV, updTotalPlusEvolveLV))
|
| | | return
|
| | |
|
| | | ## 通知公共部位强化等级
|
| | | def NotifyEquipPartPlusLV(curPlayer, packType=IPY_GameWorld.rptEquip, index=None):
|
| | | ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartPlusInfo()
|
| | | ePartStarLVPack.Clear()
|
| | | ePartStarLVPack.InfoList = []
|
| | | |
| | | syncIndexList = []
|
| | | if index == None:
|
| | | equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
|
| | | for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(packType, []):
|
| | | for classlv in xrange(1, equipMaxClasslv+1):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
|
| | | if not ipyData:
|
| | | continue |
| | | syncIndexList.append(ipyData.GetGridIndex())
|
| | | else:
|
| | | syncIndexList = [index]
|
| | | |
| | | for i in syncIndexList:
|
| | | ePartStarLV = ChPyNetSendPack.tagMCEquipPartPlusLV()
|
| | | ePartStarLV.Clear()
|
| | | ePartStarLV.PackType = packType
|
| | | ePartStarLV.EquipIndex = i
|
| | | ePartStarLV.EquipPartStarLV = GetEquipPartPlusLV(curPlayer, packType, i)
|
| | | ePartStarLV.Proficiency = GetEquipPartProficiency(curPlayer, packType, i)
|
| | | ePartStarLV.EvolveLV = GetEquipPartPlusEvolveLV(curPlayer, packType, i)
|
| | | ePartStarLVPack.InfoList.append(ePartStarLV)
|
| | | |
| | | ePartStarLVPack.Count = len(ePartStarLVPack.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, ePartStarLVPack)
|
| | | return
|
| | |
|
| | |
|
| | | ## 全身强化等级
|
| | | def GetTotalPlusLV(curPlayer, isActive=True):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusLV)
|
| | |
|
| | | ## 全身进化等级
|
| | | def GetTotalPlusEvolveLV(curPlayer):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusEvolveLV)
|
| | |
|
| | | ## 全身橙装及以上装备数
|
| | | def GetEquipOrangeCount(curPlayer):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_EquipOrangeCount)
|
| | |
|
| | |
|
| | | # 获取装备的强化类型
|
| | | def GetEquipPlusType(curEquip):
|
| | | equipPlace = curEquip.GetEquipPlace()
|
| | | plusTypeDict = IpyGameDataPY.GetFuncEvalCfg("StrengthenLevelLimit", 1)
|
| | | if not plusTypeDict:
|
| | | GameWorld.ErrLog("没有强化类型映射表")
|
| | | return
|
| | | |
| | | return plusTypeDict.get(equipPlace)
|
| | |
|
| | |
|
| | | # 获取满套装化的最低阶数,如5件套,4件5级,1件3级,则返回3
|
| | | def GetEquipSuitsLVByType(curPlayer, suitType, groupType):
|
| | | return 0
|
| | | # suiteLV = 999
|
| | | # equipSuitTypeDict = IpyGameDataPY.GetFuncEvalCfg('EquipSuitType')
|
| | | # if groupType not in equipSuitTypeDict:
|
| | | # return 0
|
| | | # maxCnt = len(equipSuitTypeDict[groupType])
|
| | | # cnt = 0
|
| | | # for equipPlace in equipSuitTypeDict[groupType]:
|
| | | # curSuiteLV = GetEquipPartSuiteLV(curPlayer, equipPlace, suitType)
|
| | | # if curSuiteLV > 0:
|
| | | # cnt += 1
|
| | | # suiteLV = min(curSuiteLV, suiteLV)
|
| | | # |
| | | # if cnt != maxCnt:
|
| | | # return 0
|
| | | # return 0 if suiteLV == 999 else suiteLV
|
| | |
|
| | |
|
| | |
|
| | | def SetEquipPartStar(curPlayer, index, setStarLV):
|
| | | #设置公共部位星数
|
| | | |
| | | befStarLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartStar % index)
|
| | | if befStarLV == setStarLV:
|
| | | return |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStar % index, setStarLV)
|
| | | |
| | | # 同步更新星级总等级
|
| | | befTotalStarLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipStar)
|
| | | updTotalStarLV = max(0, befTotalStarLV + setStarLV - befStarLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipStar, updTotalStarLV)
|
| | | # 开服活动数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_StarLV, updTotalStarLV)
|
| | | GameWorld.DebugLog("设置部位星级: index=%s,befStarLV=%s,setStarLV=%s,befTotalStarLV=%s,updTotalStarLV=%s" |
| | | % (index, befStarLV, setStarLV, befTotalStarLV, updTotalStarLV))
|
| | | return
|
| | |
|
| | |
|
| | | def GetEquipPartStar(curPlayer, equipPackindex):
|
| | | #获取公共部位星数
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartStar % equipPackindex)
|
| | |
|
| | |
|
| | | ## 获取公共部位生效的星数, 因装备的最高可到星数影响,用于算当前装备属性使用, 不影响全身星级
|
| | | def GetEquipPartStarByRank(curPlayer, equipPackindex, curEquip):
|
| | | maxStarLV = ItemCommon.GetItemMaxStar(curEquip)
|
| | | return min(GetEquipPartStar(curPlayer, equipPackindex), maxStarLV)
|
| | |
|
| | | def GetTotalEquipStars(curPlayer):
|
| | | ##获取部位总星数
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipStar)
|
| | |
|
| | | ## 通知公共部位星数
|
| | | def NotifyEquipPartStar(curPlayer, index=None):
|
| | | ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartStarInfo()
|
| | | ePartStarLVPack.Clear()
|
| | | ePartStarLVPack.InfoList = []
|
| | | syncIndexList = []
|
| | | if index == None:
|
| | | equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
|
| | | for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
|
| | | for classlv in xrange(1, equipMaxClasslv+1):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
|
| | | if not ipyData:
|
| | | continue |
| | | syncIndexList.append(ipyData.GetGridIndex())
|
| | | else:
|
| | | syncIndexList = [index]
|
| | | |
| | | for index in syncIndexList:
|
| | | ePartStarLV = ChPyNetSendPack.tagMCEquipPartStar()
|
| | | ePartStarLV.Clear()
|
| | | ePartStarLV.EquipPackIndex = index
|
| | | ePartStarLV.Star = GetEquipPartStar(curPlayer, index)
|
| | | ePartStarLVPack.InfoList.append(ePartStarLV)
|
| | | |
| | | ePartStarLVPack.Count = len(ePartStarLVPack.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, ePartStarLVPack)
|
| | | return
|
| | |
|