| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import PlayerFamily
|
| | | import PlayerControl
|
| | | import IPY_GameWorld
|
| | | import ChPyNetSendPack
|
| | |
| | | import PlayerHero
|
| | | import PlayerHJG
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | randFace = random.choice(defaultFaceIDList) if defaultFaceIDList else 0
|
| | | curPlayer.SetFace(randFace)
|
| | | GameWorld.DebugLog("玩家佩戴的头像被删除,随机重置默认头像! randFace=%s" % randFace, playerID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | |
|
| | | if isRefreshAttr:
|
| | | RefreshFaceAttr(curPlayer)
|
| | |
| | | return
|
| | | GameWorld.DebugLog("头像幻化! faceID=%s" % (faceID), playerID)
|
| | | curPlayer.SetFace(faceID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | | return
|
| | |
|
| | | def OnFaceStarUP(curPlayer, faceID):
|
| | |
| | | if ipyData.GetUnlockWay() != 2:
|
| | | return
|
| | | itemID = ipyData.GetUnlockValue()
|
| | | itemCount = ipyData.GetUnlockNeedCnt()
|
| | | itemCount = ipyData.GetUpNeedCnt()
|
| | | if not itemID or not itemCount:
|
| | | return
|
| | | needItemList = [[itemID, itemCount]]
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_FaceState, faceID)
|
| | | if not state and faceIDList == None:
|
| | | continue
|
| | | face = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFace)
|
| | | face = ChPyNetSendPack.tagMCFace()
|
| | | face.FaceID = faceID
|
| | | face.State = state
|
| | | face.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FaceEndTime % faceID)
|
| | |
| | | if not faceList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFaceInfo)
|
| | | clientPack = ChPyNetSendPack.tagMCFaceInfo()
|
| | | clientPack.FaceList = faceList
|
| | | clientPack.Count = len(clientPack.FaceList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | randFacePic = random.choice(defaultFacePicIDList) if defaultFacePicIDList else 0
|
| | | curPlayer.SetFacePic(randFacePic)
|
| | | GameWorld.DebugLog("玩家佩戴的头像框过期,随机重置默认头像框! randFacePic=%s" % randFacePic, playerID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | |
|
| | | if isRefreshAttr:
|
| | | RefreshFacePicAttr(curPlayer)
|
| | |
| | | return
|
| | | GameWorld.DebugLog("头像框幻化! facePicID=%s" % (facePicID), playerID)
|
| | | curPlayer.SetFacePic(facePicID)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | | return
|
| | |
|
| | | def OnFacePicStarUP(curPlayer, facePicID):
|
| | |
| | | if ipyData.GetUnlockWay() != 2:
|
| | | return
|
| | | itemID = ipyData.GetUnlockValue()
|
| | | itemCount = ipyData.GetUnlockNeedCnt()
|
| | | itemCount = ipyData.GetUpNeedCnt()
|
| | | if not itemID or not itemCount:
|
| | | return
|
| | | needItemList = [[itemID, itemCount]]
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_FacePicState, facePicID)
|
| | | if not state and facePicIDList == None:
|
| | | continue
|
| | | facePic = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFacePic)
|
| | | facePic = ChPyNetSendPack.tagMCFacePic()
|
| | | facePic.FacePicID = facePicID
|
| | | facePic.State = state
|
| | | facePic.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FacePicEndTime % facePicID)
|
| | |
| | | if not facePicList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFacePicInfo)
|
| | | clientPack = ChPyNetSendPack.tagMCFacePicInfo()
|
| | | clientPack.FacePicList = facePicList
|
| | | clientPack.Count = len(clientPack.FacePicList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|