| | |
| | | #
|
| | | ##@package Event.EventSrc.Operate_EquipPlus
|
| | | #
|
| | | # @todo:部位星级公共模式强化
|
| | | # @todo:部位强化公共模式强化
|
| | | # @author hxp
|
| | | # @date 2015-12-15
|
| | | # @version 1.2
|
| | | #
|
| | | # 详细描述: 部位星级公共模式强化
|
| | | # 详细描述: 部位强化公共模式强化
|
| | | #
|
| | | # @change: "2016-06-30 21:30" hxp 强化达人开服活动
|
| | | # @change: "2016-10-08 18:00" hxp 自动购买物品价格统一取商城物品价格
|
| | |
| | | import PlayerActivity
|
| | | import PlayerSuccess
|
| | | import IpyGameDataPY
|
| | | import PlayerActLogin
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ChEquip
|
| | | import EventShell
|
| | | #-------------------------------------------------------------------------------------------
|
| | |
|
| | | #===============================================================================
|
| | |
| | | if packType not in ChConfig.Pack_EquipPart_CanPlusStar:
|
| | | GameWorld.DebugLog("packType not in ChConfig.Pack_EquipPart_CanPlusStar", playerID)
|
| | | return
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':index})
|
| | | if not ipyData:
|
| | | return
|
| | | equipPlace = ipyData.GetEquipPlace()
|
| | | indexList = ChConfig.Pack_EquipPart_CanPlusStar[packType]
|
| | | if index not in indexList:
|
| | | if equipPlace not in indexList:
|
| | | GameWorld.Log(" index not in ChConfig.Pack_EquipPart_CanPlusStar", playerID)
|
| | | return
|
| | |
|
| | |
| | | GameWorld.DebugLog("OnEquipMayaPlus() equip is empty")
|
| | | return
|
| | |
|
| | | maxStarLV = ItemCommon.GetItemMaxStarLV(curEquip)
|
| | | curPartStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, index)
|
| | | if curPartStarLV >= maxStarLV:
|
| | | GameWorld.Log("OnEquipMayaPlus:curPartStarLV(%s) >= maxStarLV(%s)" % (curPartStarLV, maxStarLV), playerID)
|
| | | maxPlusLV = ItemCommon.GetItemMaxPlusLV(curPlayer, index, curEquip)
|
| | | curPartPlusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | if curPartPlusLV >= maxPlusLV:
|
| | | GameWorld.Log("OnEquipMayaPlus:curPartPlusLV(%s) >= maxPlusLV(%s)" % (curPartPlusLV, maxPlusLV), playerID)
|
| | | return
|
| | |
|
| | | # 强化处理
|
| | | result = DoLogic_EquipMayaPlus(curPlayer, curEquip, packType, index)
|
| | |
|
| | | updPartStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, index)
|
| | | #GameWorld.Log(" result=%s,curStarLV=%s,updStarLV=%s" % (result, curPartStarLV, updPartStarLV), playerID)
|
| | | updPartPlusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | #GameWorld.Log(" result=%s,curStarLV=%s,updStarLV=%s" % (result, curPartPlusLV, updPartStarLV), playerID)
|
| | | if result == ChConfig.Def_ComposeState_None:
|
| | | return
|
| | |
|
| | |
| | |
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_EquipPlus)
|
| | | PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_EquipPlus, 1)
|
| | | #===========================================================================
|
| | |
|
| | |
|
| | | # 星级变更时处理
|
| | | if curPartStarLV != updPartStarLV:
|
| | | DoLogic_OnEquipPartStarLVChange(curPlayer, packType)
|
| | | # 强化变更时处理
|
| | | if curPartPlusLV != updPartPlusLV:
|
| | | DoLogic_OnEquipPartStarLVChange(curPlayer, packType, ItemCommon.GetItemClassLV(curEquip))
|
| | | # 增加强化成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipPlus, 1)
|
| | | EventShell.EventRespons_EquipPlus(curPlayer, ipyData.GetClassLV(), updPartPlusLV)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | if findType == -1:
|
| | | return result
|
| | |
|
| | | curPartStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, index)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ItemPlus", findType, curPartStarLV)
|
| | | curPartPlusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ItemPlus", findType, curPartPlusLV)
|
| | | if not ipyData:
|
| | | return
|
| | | costSilver = ipyData.GetCostCount()
|
| | |
| | |
|
| | | if curExp >= totalExp:
|
| | | #升级
|
| | | curPartStarLV = __EquipMayaPlusChange(curPlayer, packType, curEquip, index)
|
| | | curPartPlusLV = __EquipMayaPlusChange(curPlayer, packType, curEquip, index)
|
| | | curExp = curExp - totalExp
|
| | |
|
| | | ChEquip.SetEquipPartProficiency(curPlayer, packType, index, curExp)
|
| | | ChEquip.NotifyEquipPartStarLV(curPlayer, packType, index)
|
| | | ChEquip.NotifyEquipPartPlusLV(curPlayer, packType, index)
|
| | | # 支付金币
|
| | | PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver, isNotify=False)
|
| | |
|
| | | DataRecordPack.DR_UpStarLVSuccess(curPlayer, curExp, curPartStarLV)
|
| | | DataRecordPack.DR_UpStarLVSuccess(curPlayer, curExp, curPartPlusLV)
|
| | | return ChConfig.Def_ComposeState_Sucess
|
| | |
|
| | |
|
| | |
| | | # @param packType: 背包类型
|
| | | # @param curEquip: 当前装备
|
| | | # @param succeedRate: 成功率
|
| | | # @param failStarLV: 失败时的星级数
|
| | | # @param failStarLV: 失败时的强化数
|
| | | # @return
|
| | | def __EquipMayaPlusChange(curPlayer, packType, curEquip, index):
|
| | | curPlusLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, index)
|
| | | curPlusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | updPlusLV = curPlusLV + 1
|
| | | ChEquip.SetEquipPartStarLV(curPlayer, packType, index, curEquip, updPlusLV)
|
| | | ChEquip.SetEquipPartPlusLV(curPlayer, packType, index, curEquip, updPlusLV)
|
| | |
|
| | | broadCastLVList = IpyGameDataPY.GetFuncEvalCfg("StrengthenLevelBroadCast", 1)
|
| | | #GameWorld.DebugLog("PlusLVChange index=%s,updPlusLV=%s,broadCastLVList=%s" % (index, updPlusLV, broadCastLVList))
|
| | | if updPlusLV in broadCastLVList:
|
| | | msgParamList = [curPlayer.GetPlayerName()] + ItemCommon.GetNotifySuperItemInfo(curPlayer, curEquip, index) + [updPlusLV]
|
| | | itemID = curEquip.GetItemTypeID()
|
| | | userData = curEquip.GetUserData()
|
| | | guid = ItemCommon.CacheNotifyEquipDetailInfo(curPlayer, curEquip)
|
| | | msgParamList = [curPlayer.GetPlayerName(), itemID, userData, guid, updPlusLV]
|
| | | PlayerControl.WorldNotify(0, "StrengthenCongratulation", msgParamList)
|
| | |
|
| | | # 成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipPlusLV, 1, [updPlusLV])
|
| | | |
| | | |
| | | |
| | | #任务触发
|
| | | #EventShell.EventRespons_OnEquipPartStarUp(curPlayer, setLV)
|
| | | #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipPlusLV, 1, [updPlusLV])
|
| | |
|
| | | # 开服活动数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PlusLV, ChEquip.GetTotalPlusLV(curPlayer))
|
| | | return updPlusLV
|
| | |
|
| | |
|
| | | def DoLogic_OnEquipPartStarLVChange(curPlayer, packType):
|
| | | def DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV):
|
| | | #先刷装备BUFF 再计算属性
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Plus)
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer)
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer, classLV)
|
| | |
|
| | | #刷新所有属性
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | |
|
| | | ## 全身12部位强化等级最低的一件强化等级
|
| | | #def GetMinPlusLV(curPlayer):
|
| | | # packType = IPY_GameWorld.rptEquip
|
| | | # minPlusLV = GetMaxEquipPartStarLV()
|
| | | # equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar.get(packType, [])
|
| | | # for i in equipPartIndexList:
|
| | | # partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, i)
|
| | | # if partStarLV < minPlusLV:
|
| | | # minPlusLV = partStarLV
|
| | | # return minPlusLV
|
| | | #// A3 16 装备强化进化 #tagCMEquipPlusEvolve
|
| | | #struct tagCMEquipPlusEvolve
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD ItemIndex; //装备在背包中索引
|
| | | #};
|
| | | def OnEquipPlusEvolve(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | |
| | | equipPackindex = clientData.ItemIndex
|
| | | |
| | | packType = IPY_GameWorld.rptEquip
|
| | | curPack = curPlayer.GetItemManager().GetPack(packType)
|
| | | curEquip = curPack.GetAt(equipPackindex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | return
|
| | | curEvolveLV = ChEquip.GetEquipPartPlusEvolveLV(curPlayer, packType, equipPackindex)
|
| | | maxEvolveLV = ItemCommon.GetItemMaxPlusEvolveLV(curPlayer, equipPackindex, curEquip)
|
| | | if curEvolveLV >= maxEvolveLV:
|
| | | GameWorld.DebugLog('装备强化进化, 已达最大进化等级equipPackindex=%s, maxEvolveLV=%s'%(equipPackindex, maxEvolveLV))
|
| | | return
|
| | | nextEvolveLV = curEvolveLV + 1
|
| | | equipPlace = curEquip.GetEquipPlace()
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlusEvolve', equipPlace, nextEvolveLV)
|
| | | if not ipyData:
|
| | | return
|
| | | costItemDict = ipyData.GetCostItem()
|
| | | delItemDict = {}
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | for itemID, itemCnt in costItemDict.items():
|
| | | hasEnough, indexList, findItemIsBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(itemID, itemPack, itemCnt)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog('装备强化进化 材料不足itemID= %s,itemCnt=%s'%(itemID, itemCnt))
|
| | | return
|
| | | delItemDict[tuple(indexList)] = itemCnt
|
| | | for itemIndexList, delCnt in delItemDict.items():
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, delCnt, True, ChConfig.ItemDel_EquipPlusEvolve)
|
| | | |
| | | ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, equipPackindex, nextEvolveLV)
|
| | | DoLogic_OnEquipPartStarLVChange(curPlayer, packType, ItemCommon.GetItemClassLV(curEquip))
|
| | | ChEquip.NotifyEquipPartPlusLV(curPlayer, packType, equipPackindex)
|
| | | EventShell.EventRespons_EquipPlusEvolve(curPlayer, nextEvolveLV)
|
| | | return
|