| | |
| | | import PlayerSuccess
|
| | | import PlayerWeekParty
|
| | | import ShareDefine
|
| | | import EquipZhuXian
|
| | | #import EquipZhuXian
|
| | |
|
| | | g_stoneCanPlaceList = [] #可镶嵌的位置
|
| | |
|
| | |
| | |
|
| | | def SetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex, changeStoneID, isBind):
|
| | | ### 保存装备位孔位宝石ID和绑定信息
|
| | | isBind = 0 #现绑定无用,默认存0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStoneID % (equipIndex, holeIndex),
|
| | | changeStoneID * ChConfig.Def_Stone_SaveStoneInfoXNumber + isBind)
|
| | | return
|
| | |
| | | itemPack = curPlayer.GetItemManager().GetPack(stonePackType)
|
| | | curStone = itemPack.GetAt(stoneIndex)
|
| | |
|
| | | if not ItemCommon.CheckItemCanUse(curStone):
|
| | | if not ItemCommon.CheckItemCanUse(curStone) or ItemControler.GetIsAuctionItem(curStone):
|
| | | GameWorld.Log("目标宝石为空或不可用,无法镶嵌!", playerID)
|
| | | return
|
| | |
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackIndex})
|
| | | if not ipyData:
|
| | | return
|
| | | classLV = ipyData.GetClassLV()
|
| | | if ipyData.GetEquipPlace() not in stoneCanPlaceList:
|
| | | GameWorld.Log("该宝石不可镶嵌在该装备位!stoneItemID=%s,stoneEffType=%s,stoneCanPlaceList=%s,equipPackIndex=%s"
|
| | | % (stoneItemID, stoneEffType, stoneCanPlaceList, equipPackIndex), playerID)
|
| | |
| | | # ItemControler.SetItemIsBind(curEquip, True)
|
| | |
|
| | | # 刷新属性
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, True)
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, True, classLV)
|
| | |
|
| | | #同步客户端
|
| | | Sycn_StoneHoleInfo(curPlayer, [equipPackIndex])
|
| | |
| | | GameWorld.DebugLog("孔为空或不存在宝石!")
|
| | | return
|
| | |
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackIndex})
|
| | | if not ipyData:
|
| | | return
|
| | | classLV = ipyData.GetClassLV()
|
| | | |
| | | __DoChangeEquipHoleStone(curPlayer, equipPackIndex, holeIndex, 0, 0, "StonePick", True)
|
| | |
|
| | | # 刷新属性
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, False)
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, False, classLV)
|
| | |
|
| | | #同步客户端
|
| | | Sycn_StoneHoleInfo(curPlayer, [equipPackIndex])
|
| | |
| | | needCount = IpyGameDataPY.GetFuncCfg("GemUpCostFormula", 2) # 合成下一级所需宝石个数
|
| | | if not needCount:
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':equipPackIndex})
|
| | | if not ipyData:
|
| | | return
|
| | | classLV = ipyData.GetClassLV()
|
| | | if upWay == 0: #仙玉
|
| | | stoneTypeItemIDDict = IpyGameDataPY.GetFuncEvalCfg("GemUpCostFormula", 1)
|
| | | if stoneEffType not in stoneTypeItemIDDict:
|
| | |
| | | __DoChangeEquipHoleStone(curPlayer, equipPackIndex, holeIndex, upgradeStoneID, stoneIsBind, "StoneUpgrade", False)
|
| | |
|
| | | # 刷新属性
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, False)
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, False, classLV)
|
| | |
|
| | | #同步客户端
|
| | | Sycn_StoneHoleInfo(curPlayer, [equipPackIndex])
|
| | |
| | | return
|
| | |
|
| | |
|
| | | def RefreshAttrByStoneAction(curPlayer, packType, isNeedNotify):
|
| | | def RefreshAttrByStoneAction(curPlayer, packType, isNeedNotify, classLV):
|
| | | ## 宝石刷新属性
|
| | | # 装备等级改变,判断是否为玩家身上的装备,如果是的话刷新玩家属性
|
| | | if packType in [IPY_GameWorld.rptEquip]:
|
| | | #先刷装备BUFF 再计算属性
|
| | | if isNeedNotify:
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Stone)
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer)
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer, classLV)
|
| | |
|
| | | #刷新所有属性
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | elif packType == ShareDefine.rptZhuXianEquip:
|
| | | EquipZhuXian.RefreshZhuXianAttr(curPlayer)
|
| | | #elif packType == ShareDefine.rptZhuXianEquip:
|
| | | # EquipZhuXian.RefreshZhuXianAttr(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | def OnVIPTimeOut(curPlayer):
|
| | | ## VIP到期处理
|
| | | #过期一样有效,屏蔽该逻辑
|
| | | #===============================================================================================
|
| | | # #获得vip等级孔信息
|
| | | # gemOpenVipList = IpyGameDataPY.GetFuncEvalCfg("GemOpenVip", 1)
|
| | | # maxVipHoleCnt = len(gemOpenVipList)# 最大Vip开放孔数
|
| | | # |
| | | # #获得所有可镶嵌宝石装备位
|
| | | # stoneCanPlaceList = GetAllStoneEquipIndexList()
|
| | | # #需要拆卸宝石的孔列表
|
| | | # pickoffHoleList = []
|
| | | # for equipIndex in stoneCanPlaceList:
|
| | | # for holeIndex in xrange(ChConfig.Def_Stone_VipHole, ChConfig.Def_Stone_VipHole + maxVipHoleCnt):
|
| | | # stoneInfo = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)
|
| | | # if not stoneInfo[0]:
|
| | | # continue
|
| | | # pickoffHoleList.append([equipIndex, holeIndex])
|
| | | # |
| | | # __DoSysPickoffEquipStone(curPlayer, pickoffHoleList, "VIPChange", True)
|
| | | #===============================================================================================
|
| | | return
|
| | |
|
| | | def __DoSysPickoffEquipStone(curPlayer, equipPackType, stonePackType, pickoffHoleList, eventName, isRefreshAttr):
|
| | |
| | | equipIndexList.append(equipIndex)
|
| | | PlayerControl.SendMailByKey("GemToPlayer", [curPlayer.GetPlayerID()], mailItemInfoList)
|
| | |
|
| | | if isRefreshAttr:
|
| | | RefreshAttrByStoneAction(curPlayer, equipPackType, False)
|
| | | #目前只有脱装备会触发,暂时屏蔽,由脱装备触发刷属性
|
| | | #if isRefreshAttr:
|
| | | # RefreshAttrByStoneAction(curPlayer, equipPackType, False)
|
| | |
|
| | | if equipIndexList:
|
| | | Sycn_StoneHoleInfo(curPlayer, equipIndexList)
|