| | |
| | | import PyGameData
|
| | | import PlayerTask
|
| | | import FBCommon
|
| | | import ObjPool
|
| | |
|
| | | # 红颜解锁方式
|
| | | (
|
| | |
| | | if unlockWay == UnlockWay_Item:
|
| | | needItemID = unlockValue
|
| | | needItemCnt = unlockNeedCnt
|
| | | itemCount = ItemControler.GetItemCountByID(curPlayer, needItemID)
|
| | | if itemCount < needItemCnt:
|
| | | GameWorld.DebugLog("激活红颜物品不足! beautyID=%s,needItemID=%s,itemCount=%s < %s" % (beautyID, needItemID, itemCount, needItemCnt), playerID)
|
| | | |
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, needItemID, needItemCnt)
|
| | | lackCnt = needItemCnt - bindCnt - unBindCnt
|
| | | if lackCnt > 0:
|
| | | GameWorld.DebugLog("激活红颜物品不足! beautyID=%s,needItemID=%s,needItemCnt=%s,lackCnt=%s" % (beautyID, needItemID, needItemCnt, lackCnt), playerID)
|
| | | return
|
| | | ItemControler.DelItemCountByID(curPlayer, needItemID, needItemCnt)
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, needItemCnt, "Beauty")
|
| | |
|
| | | elif unlockWay == UnlockWay_TaskID:
|
| | | taskID = unlockValue
|
| | |
| | | RefreshBeautyAttr(curPlayer)
|
| | | SyncBeautyInfo(curPlayer, [beautyID])
|
| | | return
|
| | |
|
| | | def GetBeautyActCnt(curPlayer):
|
| | | ## 红颜已激活总数
|
| | | actCnt = 0
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetBeautyCount()):
|
| | | ipyData = ipyDataMgr.GetBeautyByIndex(index)
|
| | | beautyID = ipyData.GetBeautyID()
|
| | | if not GetBeautyState(curPlayer, beautyID):
|
| | | continue
|
| | | actCnt += 1
|
| | | return actCnt
|
| | |
|
| | | #// B2 20 红颜好感度升级 #tagCSBeautyLVUP
|
| | | #
|
| | |
| | | SyncBeautyInfo(curPlayer, [beautyID])
|
| | |
|
| | | # 有升级额外处理
|
| | | if updLV > updLV:
|
| | | if updLV > curLV:
|
| | | RefreshBeautyAttr(curPlayer)
|
| | |
|
| | | return
|
| | |
| | | effPerLVAdd = ipyData.GetEffPerLVAdd()
|
| | | if effType:
|
| | | effValue = effValue + effPerLVAdd * talentLV
|
| | | effTypeDict[effType] = [effValue, effTypeValue]
|
| | | if effType not in effTypeDict:
|
| | | effTypeDict[effType] = [0, effTypeValue]
|
| | | effTypeDict[effType][0] = effTypeDict[effType][0] + effValue
|
| | | #GameWorld.DebugLog("红颜特殊效果: beautyID=%s,effType=%s,talentLV=%s,%s" % (beautyID, effType, talentLV, effTypeDict), playerID)
|
| | |
|
| | | # ʱװ
|
| | |
| | | if not state and beautyIDList == None:
|
| | | continue
|
| | | lv, exp = GetBeautyLVInfo(curPlayer, beautyID)
|
| | | beauty = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeauty)
|
| | | beauty = ChPyNetSendPack.tagSCBeauty()
|
| | | beauty.BeautyID = beautyID
|
| | | beauty.State = state
|
| | | beauty.LV = lv
|
| | |
| | | else:
|
| | | if not skinInfo:
|
| | | continue
|
| | | beautySkin = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeautySkin)
|
| | | beautySkin = ChPyNetSendPack.tagSCBeautySkin()
|
| | | beautySkin.SkinID = skinID
|
| | | beautySkin.State = 1 if IsBeautySkinCanUse(curPlayer, beautyID, skinID, ipyData) else 0
|
| | | beautySkin.Used = GetBeautySkinUsed(curPlayer, skinID)
|
| | |
| | | if not beautyList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeautyInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCBeautyInfo()
|
| | | clientPack.BeautyList = beautyList
|
| | | clientPack.Count = len(clientPack.BeautyList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|