8341 【恺英】【后端】强化进化系统优化(强化支持消耗材料)
| | |
| | | list AttrType; //属性类型
|
| | | list AttrValue; //属性值
|
| | | DWORD CostCount; //消耗铜钱
|
| | | list CostItemInfo; //消耗物品材料及个数 [itemID, itemCount]
|
| | | DWORD AddExp; //提升熟练度值
|
| | | DWORD TotalExp; //升级所需熟练度总值
|
| | | };
|
| | |
| | | ItemDel_CoatDecompose, # 时装分解
|
| | | ItemDel_EquipEvolve, # 装备进阶
|
| | | ItemDel_EquipStarUp, # 装备升星
|
| | | ItemDel_EquipPlusEvolve, # 装备强化进化
|
| | | ItemDel_EquipPlus, # 装备强化进化
|
| | | ItemDel_LingQiEquipBreak, # 灵器突破
|
| | | ItemDel_HorsePetAwake, # 骑宠觉醒
|
| | | ) = range(2000, 2000 + 42)
|
| | |
| | | ItemDel_CoatDecompose:"CoatDecompose",
|
| | | ItemDel_EquipEvolve:"EquipEvolve",
|
| | | ItemDel_EquipStarUp:"EquipStarUp",
|
| | | ItemDel_EquipPlusEvolve:"EquipPlusEvolve",
|
| | | ItemDel_EquipPlus:"EquipPlus",
|
| | | ItemDel_LingQiEquipBreak:"LingQiEquipBreak",
|
| | | ItemDel_HorsePetAwake:"HorsePetAwake",
|
| | | }
|
| | |
| | | if not plusIpyData:
|
| | | return
|
| | | costSilver = plusIpyData.GetCostCount()
|
| | | if not costSilver:
|
| | | costItemInfo = plusIpyData.GetCostItemInfo()
|
| | | if not costSilver and not costItemInfo:
|
| | | #GameWorld.DebugLog("已到强化最大等级! curPartPlusLV=%s" % curPartPlusLV, playerID)
|
| | | return
|
| | |
|
| | |
| | | % (curPartPlusLV, maxPlusLV, curEvolveLV), playerID)
|
| | | return
|
| | |
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver, isNotify=False):
|
| | | if costSilver and not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver):
|
| | | GameWorld.DebugLog("铜钱不足,无法强化! costSilver=%s" % costSilver)
|
| | | return
|
| | |
|
| | | totalExp = plusIpyData.GetTotalExp()
|
| | | curExp = ChEquip.GetEquipPartProficiency(curPlayer, packType, index) + plusIpyData.GetAddExp()
|
| | | costItemID, costItemCount = 0, 0
|
| | | if costItemInfo:
|
| | | costItemID, costItemCount = costItemInfo
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemIndexList = ItemCommon.GetItem_FromPack_ByID(costItemID, itemPack, costItemCount)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("材料不足,无法强化! costItemID=%s, costItemCount=%s" % (costItemID, costItemCount))
|
| | | return
|
| | | |
| | | if costSilver:
|
| | | PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver, isNotify=False)
|
| | |
|
| | | if curExp >= totalExp:
|
| | | #升级
|
| | | if costItemID:
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, costItemCount, True, ChConfig.ItemDel_EquipPlus)
|
| | | |
| | | isLVUp = False
|
| | | curExp = 0
|
| | | addExp = plusIpyData.GetAddExp()
|
| | | totalExp = plusIpyData.GetTotalExp()
|
| | | if addExp and totalExp:
|
| | | curExp = ChEquip.GetEquipPartProficiency(curPlayer, packType, index) + addExp
|
| | | if curExp >= totalExp:
|
| | | curExp = curExp - totalExp
|
| | | isLVUp = True
|
| | | else:
|
| | | isLVUp = True
|
| | | |
| | | if isLVUp:
|
| | | curPartPlusLV += 1
|
| | | curExp = curExp - totalExp
|
| | | __EquipMayaPlusChange(curPlayer, packType, curEquip, index, curPartPlusLV)
|
| | |
|
| | | DataRecordPack.DR_UpStarLVSuccess(curPlayer, curExp, curPartPlusLV)
|
| | |
| | | return
|
| | | delItemDict[tuple(indexList)] = itemCnt
|
| | | for itemIndexList, delCnt in delItemDict.items():
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, delCnt, True, ChConfig.ItemDel_EquipPlusEvolve)
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, delCnt, True, ChConfig.ItemDel_EquipPlus)
|
| | |
|
| | | ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, equipPackindex, nextEvolveLV)
|
| | | DoLogic_OnEquipPartStarLVChange(curPlayer, packType, ItemCommon.GetItemClassLV(curEquip))
|
| | |
| | | ("list", "AttrType", 0),
|
| | | ("list", "AttrValue", 0),
|
| | | ("DWORD", "CostCount", 0),
|
| | | ("list", "CostItemInfo", 0),
|
| | | ("DWORD", "AddExp", 0),
|
| | | ("DWORD", "TotalExp", 0),
|
| | | ),
|
| | |
| | | self.AttrType = []
|
| | | self.AttrValue = []
|
| | | self.CostCount = 0
|
| | | self.CostItemInfo = []
|
| | | self.AddExp = 0
|
| | | self.TotalExp = 0 |
| | | return |
| | |
| | | def GetAttrType(self): return self.AttrType # 属性类型
|
| | | def GetAttrValue(self): return self.AttrValue # 属性值
|
| | | def GetCostCount(self): return self.CostCount # 消耗铜钱
|
| | | def GetCostItemInfo(self): return self.CostItemInfo # 消耗物品材料及个数 [itemID, itemCount]
|
| | | def GetAddExp(self): return self.AddExp # 提升熟练度值
|
| | | def GetTotalExp(self): return self.TotalExp # 升级所需熟练度总值 |
| | | |