xdh
2018-12-20 12029a0ff02aab5a42041b93e756312d944e379d
5368 【后端】【1.4】聚魂功能开发
1个文件已修改
47 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGatherSoul.py 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGatherSoul.py
@@ -70,13 +70,13 @@
        qualityPerDict = IpyGameDataPY.GetFuncEvalCfg('GatherSoulLevelUp', 2, {})
        if itemColor in qualityPerDict:
            exp *= float(qualityPerDict[itemColor])
        soulGrade = ipyData.GetSoulGrade()
        exp *= float(IpyGameDataPY.GetFuncEvalCfg('GatherSoulLevelUp', 4, {}).get(soulGrade, 1))
            
        attrTypeCnt = len(ipyData.GetAttrType())
        specialPer = IpyGameDataPY.GetFuncEvalCfg('GatherSoulLevelUp', 3, {}).get(attrTypeCnt, 1)
        exp *= float(specialPer)
    soulGrade = ipyData.GetSoulGrade()
    exp *= float(IpyGameDataPY.GetFuncEvalCfg('GatherSoulLevelUp', 5, {}).get(soulGrade, 1))
    return exp
@@ -323,9 +323,9 @@
            curEff = itemData.GetEffectByIndex(0)
            soulDust = curEff.GetEffectValue(0)
        else:
            #先计算升级消耗的材料
            soulDust = 0
            for lv in xrange(GatherSoulItemPlusLV + 1):
            for lv in xrange(1, GatherSoulItemPlusLV + 1):
                soulDust += GetGatherSoulNeedExp(GatherSoulItemID, lv)
                    
            #多属性的先拆解成单属性的聚魂
@@ -333,7 +333,11 @@
            for itemID in soulidList:
                giveMaterialDict[itemID] = giveMaterialDict.get(itemID, 0) + 1
                needPackSpace += 1
            if not soulidList and not soulSplinters and not soulCore:
                #不能拆解的则要算0级的分解
                soulDust += GetGatherSoulNeedExp(GatherSoulItemID, 0)
        totalSoulSplinters += soulSplinters
        totalSoulCore += soulCore
        totalSoulDust += soulDust
@@ -357,14 +361,14 @@
        PlayerControl.NotifyCode(curPlayer, 'hwj_20170807_1', [totalSoulCore, ShareDefine.TYPE_Price_SoulCore])
        
    if giveMaterialDict:
        emptySpace = ItemCommon.GetItemPackSpace(curPlayer, ShareDefine.rptGatherSoul, 1)
        emptySpace = ItemCommon.GetItemPackSpace(curPlayer, ShareDefine.rptGatherSoul, needPackSpace)
        if emptySpace < needPackSpace:
            giveMaterialList = [[itemID, itemCnt, 1] for itemID, itemCnt in giveMaterialDict.items()]
            giveMaterialList = [[itemID, itemCnt, 0] for itemID, itemCnt in giveMaterialDict.items()]
            PlayerControl.SendMailByKey('JHBagFull1', [curPlayer.GetID()], giveMaterialList)
        else:
            for itemID, itemCnt in giveMaterialDict.items:
                ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 1, [ShareDefine.rptGatherSoul])
    GameWorld.DebugLog("聚魂分解: isAuto=%s,PlaceIndexList=%s, delPlaceDict=%s" % (isAuto, placeList, delPlaceDict))
            for itemID, itemCnt in giveMaterialDict.items():
                ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [ShareDefine.rptGatherSoul])
    GameWorld.DebugLog("聚魂分解: isAuto=%s,PlaceIndexList=%s, delPlaceDict=%s, giveMaterialDict=%s" % (isAuto, placeList, delPlaceDict, giveMaterialDict))
    return
@@ -376,11 +380,11 @@
        soulSplinters += compoundIpyData.GetNeedSoulSplinters()
        soulCore += compoundIpyData.GetNeedSoulCore()
        for itemID in materialList:
            soulIpyData = GetGatherSoulIpyData(itemID)
            if soulIpyData and len(soulIpyData.GetAttrType()) > 1:
                __GetGatherSoulSplitMaterial(itemID, soulidList, soulSplinters, soulCore)
            else:
                soulidList.append(itemID)
#            soulIpyData = GetGatherSoulIpyData(itemID)
#            if soulIpyData and len(soulIpyData.GetAttrType()) > 1:
#                __GetGatherSoulSplitMaterial(itemID, soulidList, soulSplinters, soulCore)
#            else:
            soulidList.append(itemID)
    return soulidList, soulSplinters, soulCore
@@ -439,14 +443,15 @@
            GameWorld.DebugLog('    聚魂合成 背包格子数量不足1个')
            return 
        
    costMoneyDict = {ShareDefine.TYPE_Price_SoulSplinters:ipyData.GeNeedSoulSplinters(),
                     ShareDefine.TYPE_Price_SoulCore:ipyData.GeNeedSoulSplinters(), }
    for moneyType, costMoney in costMoneyDict:
    costMoneyDict = {ShareDefine.TYPE_Price_SoulSplinters:ipyData.GetNeedSoulSplinters(),
                     ShareDefine.TYPE_Price_SoulCore:ipyData.GetNeedSoulCore(), }
    for moneyType, costMoney in costMoneyDict.items():
        if not PlayerControl.HaveMoney(curPlayer, moneyType, costMoney):
            GameWorld.DebugLog('聚魂合成钱不够 moneyType=%s, costMoney=%s'%(moneyType, costMoney))
            return
    
    infoDict = {"TagItemID":tagItemID}
    for moneyType, costMoney in costMoneyDict:
    for moneyType, costMoney in costMoneyDict.items():
        PlayerControl.PayMoney(curPlayer, moneyType, costMoney, ChConfig.Def_Cost_ItemProduce, infoDict)
     
    totalPoint = 0
@@ -488,7 +493,7 @@
    curItem.SetUserAttr(ShareDefine.Def_IudetGatherSoulLV, tagItemLV)
    PlayerItemControler = ItemControler.PlayerItemControler(curPlayer)
    PlayerItemControler.PutInItem(ShareDefine.rptGatherSoul, curItem, event=[ChConfig.ItemGive_ItemCompound, False, {'indexList1':indexList1, 'indexList2':indexList2, 'soulDust':totalPoint}])
    GameWorld.DebugLog('    聚魂合成 成功')
    curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitGatherSoulCompound, 1)
    return