|  |  |  | 
|---|
|  |  |  | import IpyGameDataPY | 
|---|
|  |  |  | import PlayerSuccess | 
|---|
|  |  |  | import PlayerMagicWeapon | 
|---|
|  |  |  | import IPY_GameWorld | 
|---|
|  |  |  |  | 
|---|
|  |  |  | g_runeLVExpDict = {} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | runeMaxLV = runeMaxLVDict.get(itemColor, 0) | 
|---|
|  |  |  | return runeMaxLV | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #// A5 13 解锁符印孔 #tagCMUnlockRuneHole | 
|---|
|  |  |  | # | 
|---|
|  |  |  | #struct    tagCMUnlockRuneHole | 
|---|
|  |  |  | #{ | 
|---|
|  |  |  | #    tagHead        Head; | 
|---|
|  |  |  | #    BYTE        HoleIndex; // 孔索引 | 
|---|
|  |  |  | #}; | 
|---|
|  |  |  | def OnUnlockRuneHole(index, clientData, tick): | 
|---|
|  |  |  | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) | 
|---|
|  |  |  | holeIndex = clientData.HoleIndex | 
|---|
|  |  |  | runeUnlockDict = IpyGameDataPY.GetFuncEvalCfg("RuneUnlock", 2, {}) | 
|---|
|  |  |  | if holeIndex not in runeUnlockDict: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | runeOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_HoleOpenState, 0) | 
|---|
|  |  |  | if runeOpenState & pow(2, holeIndex): | 
|---|
|  |  |  | return | 
|---|
|  |  |  | if curPlayer.GetLV() < IpyGameDataPY.GetFuncEvalCfg("RuneUnlock", 3, {}).get(holeIndex, 0): | 
|---|
|  |  |  | return | 
|---|
|  |  |  | costMoney = runeUnlockDict[holeIndex] | 
|---|
|  |  |  | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney, ChConfig.Def_Cost_RuneHole, {'holeIndex':holeIndex}): | 
|---|
|  |  |  | return | 
|---|
|  |  |  | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Rune_HoleOpenState, runeOpenState |pow(2, holeIndex)) | 
|---|
|  |  |  | Sync_RuneInfo(curPlayer) | 
|---|
|  |  |  | PlayerControl.WorldNotify(0, 'RuneSpecialHoleGet', [curPlayer.GetName(), costMoney]) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def DoUnlockRuneHole(curPlayer, isSycn=True): | 
|---|
|  |  |  | # 解锁符印孔, 符印塔过关时调用 | 
|---|
|  |  |  | runeUnlockList = IpyGameDataPY.GetFuncEvalCfg("RuneUnlock") | 
|---|
|  |  |  | 
|---|
|  |  |  | or (srcBackpack == ShareDefine.rptRune and desBackPack == ShareDefine.rptTempSwap)): | 
|---|
|  |  |  | return False | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | runeUnlockList = IpyGameDataPY.GetFuncEvalCfg("RuneUnlock") | 
|---|
|  |  |  | maxRuneHole = len(runeUnlockList) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | maxRuneHole = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4) | 
|---|
|  |  |  | # 穿 | 
|---|
|  |  |  | if desBackPack == ShareDefine.rptTempSwap: | 
|---|
|  |  |  | desRuneNum = destIndex + 1 | 
|---|
|  |  |  | 
|---|
|  |  |  | #清掉#镶嵌X枚X品质符印的成就信息 | 
|---|
|  |  |  | PlayerSuccess.ResetSuccessByType(curPlayer, ShareDefine.SuccType_InlayRune) | 
|---|
|  |  |  | totalLV = 0 | 
|---|
|  |  |  | runeUnlockList = IpyGameDataPY.GetFuncEvalCfg("RuneUnlock") | 
|---|
|  |  |  | for holeNum in xrange(1, len(runeUnlockList) + 1): | 
|---|
|  |  |  | runeHoleCnt = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4) | 
|---|
|  |  |  | for holeNum in xrange(1, runeHoleCnt + 1): | 
|---|
|  |  |  | runeData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_Data % holeNum, 0) | 
|---|
|  |  |  | if not runeData: | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | 
|---|
|  |  |  | ## 刷符印属性 | 
|---|
|  |  |  | def RefreshRuneAttr(curPlayer): | 
|---|
|  |  |  | allAttrList = [{} for _ in range(4)] | 
|---|
|  |  |  | runeUnlockList = IpyGameDataPY.GetFuncEvalCfg("RuneUnlock") | 
|---|
|  |  |  | for holeNum in xrange(1, len(runeUnlockList) + 1): | 
|---|
|  |  |  | runeHoleCnt = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4) | 
|---|
|  |  |  | for holeNum in xrange(1, runeHoleCnt + 1): | 
|---|
|  |  |  | runeData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_Data % holeNum, 0) | 
|---|
|  |  |  | if not runeData: | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ## 同步客户端 | 
|---|
|  |  |  | def Sync_RuneInfo(curPlayer): | 
|---|
|  |  |  | runeUnlockList = IpyGameDataPY.GetFuncEvalCfg("RuneUnlock") | 
|---|
|  |  |  | if not runeUnlockList: | 
|---|
|  |  |  | runeHoleCnt = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4) | 
|---|
|  |  |  | if not runeHoleCnt: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | RuneInfoPack = ChPyNetSendPack.tagMCRuneInfo() | 
|---|
|  |  |  | RuneInfoPack.Clear() | 
|---|
|  |  |  | RuneInfoPack.RuneHoleOpenState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_HoleOpenState, 0) | 
|---|
|  |  |  | RuneInfoPack.RuneDataList = [] | 
|---|
|  |  |  | for RuneNum in xrange(1, len(runeUnlockList) + 1): | 
|---|
|  |  |  | for RuneNum in xrange(1, runeHoleCnt + 1): | 
|---|
|  |  |  | RuneData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_Data % RuneNum, 0) | 
|---|
|  |  |  | RuneInfoPack.RuneDataList.append(RuneData) | 
|---|
|  |  |  | RuneInfoPack.Count = len(RuneInfoPack.RuneDataList) | 
|---|