358 【内政】红颜系统-服务端(增加专属信物ID字段,与解锁物品ID区分;)
| | |
| | | BYTE UnlockWay; //解锁方式
|
| | | DWORD UnlockValue; //解锁方式值
|
| | | BYTE UnlockNeedCnt; //解锁所需个数
|
| | | DWORD ExclusiveItemID; //专属信物ID
|
| | | list TalentAttrIDList; //天赋属性ID列表
|
| | | list TalentAttrValueList; //天赋属性初始值
|
| | | list TalentPerLVAddList; //天赋属性每级成长
|
| | |
| | | ("BYTE", "UnlockWay", 0),
|
| | | ("DWORD", "UnlockValue", 0),
|
| | | ("BYTE", "UnlockNeedCnt", 0),
|
| | | ("DWORD", "ExclusiveItemID", 0),
|
| | | ("list", "TalentAttrIDList", 0),
|
| | | ("list", "TalentAttrValueList", 0),
|
| | | ("list", "TalentPerLVAddList", 0),
|
| | |
| | | def GetUnlockWay(self): return self.attrTuple[2] # 解锁方式 BYTE
|
| | | def GetUnlockValue(self): return self.attrTuple[3] # 解锁方式值 DWORD
|
| | | def GetUnlockNeedCnt(self): return self.attrTuple[4] # 解锁所需个数 BYTE
|
| | | def GetTalentAttrIDList(self): return self.attrTuple[5] # 天赋属性ID列表 list
|
| | | def GetTalentAttrValueList(self): return self.attrTuple[6] # 天赋属性初始值 list
|
| | | def GetTalentPerLVAddList(self): return self.attrTuple[7] # 天赋属性每级成长 list
|
| | | def GetEffType(self): return self.attrTuple[8] # 天赋效果类型 BYTE
|
| | | def GetEffTypeValue(self): return self.attrTuple[9] # 效果类型值 BYTE
|
| | | def GetEffValue(self): return self.attrTuple[10] # 效果初始值 BYTE
|
| | | def GetEffPerLVAdd(self): return self.attrTuple[11] # 天赋效果每级成长 DWORD |
| | | def GetExclusiveItemID(self): return self.attrTuple[5] # 专属信物ID DWORD
|
| | | def GetTalentAttrIDList(self): return self.attrTuple[6] # 天赋属性ID列表 list
|
| | | def GetTalentAttrValueList(self): return self.attrTuple[7] # 天赋属性初始值 list
|
| | | def GetTalentPerLVAddList(self): return self.attrTuple[8] # 天赋属性每级成长 list
|
| | | def GetEffType(self): return self.attrTuple[9] # 天赋效果类型 BYTE
|
| | | def GetEffTypeValue(self): return self.attrTuple[10] # 效果类型值 BYTE
|
| | | def GetEffValue(self): return self.attrTuple[11] # 效果初始值 BYTE
|
| | | def GetEffPerLVAdd(self): return self.attrTuple[12] # 天赋效果每级成长 DWORD |
| | | |
| | | # 红颜品质升级表 |
| | | class IPY_BeautyQualityLV(): |
| | |
| | | quality = ipyData.GetBeautyQuality()
|
| | | curLV, curExp = GetBeautyLVInfo(curPlayer, beautyID)
|
| | |
|
| | | isCommItem = True # 是否使用的常规通用物品
|
| | | commItemIDList = IpyGameDataPY.GetFuncEvalCfg("BeautyLVUP", 1)
|
| | | commExpList = IpyGameDataPY.GetFuncEvalCfg("BeautyLVUP", 2)
|
| | | if itemID in commItemIDList:
|
| | | index = commItemIDList.index(itemID)
|
| | | perExp = commExpList[index] if len(commExpList) > index else 0
|
| | | else:
|
| | | isCommItem = False
|
| | | unlockWay = ipyData.GetUnlockWay()
|
| | | unlockValue = ipyData.GetUnlockValue()
|
| | | if unlockWay != UnlockWay_Item:
|
| | | GameWorld.DebugLog("非道具激活的不支持专属信物ID升级! beautyID=%s,unlockWay=%s" % (beautyID, unlockWay), playerID)
|
| | | return
|
| | | if itemID != unlockValue:
|
| | | GameWorld.DebugLog("非该红颜专属信物ID! beautyID=%s,itemID=%s != %s" % (beautyID, itemID, unlockValue), playerID)
|
| | | exclusiveItemID = ipyData.GetExclusiveItemID()
|
| | | if itemID != exclusiveItemID:
|
| | | GameWorld.DebugLog("非该红颜专属信物ID! beautyID=%s,itemID=%s != %s" % (beautyID, itemID, exclusiveItemID), playerID)
|
| | | return
|
| | | perExp = IpyGameDataPY.GetFuncCfg("BeautyLVUP", 3)
|
| | |
|
| | |
| | | if costItemCount < 1:
|
| | | return
|
| | |
|
| | | if isCommItem:
|
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, itemID, costItemCount)
|
| | | lackCnt = costItemCount - bindCnt - unBindCnt
|
| | | if lackCnt > 0:
|
| | | costItemCount -= lackCnt
|
| | | GameWorld.DebugLog("消耗道具不足,有多少消耗多少! itemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" |
| | | % (itemID, costItemCount, bindCnt, unBindCnt, lackCnt))
|
| | | # 扣除消耗
|
| | | if costItemCount > 0:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "Beauty")
|
| | | else:
|
| | | itemCount = ItemControler.GetItemCountByID(curPlayer, itemID)
|
| | | if itemCount < costItemCount:
|
| | | costItemCount = itemCount
|
| | | |
| | | if costItemCount > 0:
|
| | | ItemControler.SetItemCountByID(curPlayer, itemID, itemCount - costItemCount)
|
| | | |
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, itemID, costItemCount)
|
| | | lackCnt = costItemCount - bindCnt - unBindCnt
|
| | | if lackCnt > 0:
|
| | | costItemCount -= lackCnt
|
| | | GameWorld.DebugLog("消耗道具不足,有多少消耗多少! itemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" |
| | | % (itemID, costItemCount, bindCnt, unBindCnt, lackCnt))
|
| | | # 扣除消耗
|
| | | if costItemCount > 0:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "Beauty")
|
| | | |
| | | addExp = costItemCount * perExp
|
| | | updExp = curExp + addExp
|
| | | GameWorld.DebugLog("红颜加经验: beautyID=%s,quality=%s,curLV=%s,curExp=%s,addExp=%s,updExp=%s/%s,itemID=%s,costItemCount=%s,perExp=%s"
|