| | |
| | | changeItemStoneCnt = 0 #curItem.GetUseStoneCount()
|
| | | changeItemHoleCnt = 0 #curItem.GetCanPlaceStoneCount()
|
| | | changeItemUseData = curItem.GetUserData()
|
| | | itemQuality = curItem.GetItemQuality()
|
| | | suiteID = curItem.GetSuiteID()
|
| | | endureReduceType = curItem.GetEndureReduceType()
|
| | | #changeItemIsHorse = (curItem.GetType() == ChConfig.Def_Item_Type_Horse)
|
| | |
|
| | |
| | | if equipPackIndex in PlayerControl.GetFaceEquipIndexList(curPlayer) or equipPlace in ChConfig.Def_SyncEquipStateByIndex:
|
| | | #通知客户端交换物品
|
| | | curPlayer.ChangeEquip(changeItemID, equipPackIndex, changeItemStarLV, changeItemHoleCnt, changeItemStoneCnt, changeItemUseData)
|
| | | if suiteID and itemClassLV == GetEquipFacadeClassLV(curPlayer):
|
| | | #穿当前外观阶的套装
|
| | | ChangeEquipfacadeByClassLV(curPlayer, itemClassLV)
|
| | |
|
| | | if not endureReduceType:
|
| | | EventShell.EventRespons_EquipByPlace(curPlayer, itemClassLV, equipPlace)
|
| | |
| | |
|
| | | ##特殊装备 , 不需要冲刷属性
|
| | | if equipPlace in ChConfig.EquipItemNoRefreshState:
|
| | | curPlayer.Sync_UnEquipItem(equipID, equipPackIndex)
|
| | | return
|
| | |
|
| | | #先刷装备BUFF 再计算属性
|
| | |
| | | #刷新所有属性
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | |
| | | if equipPackIndex in PlayerControl.GetFaceEquipIndexList(curPlayer) or equipPlace in ChConfig.Def_SyncEquipStateByIndex:
|
| | | curPlayer.Sync_UnEquipItem(equipID, equipPackIndex)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | #没有到刷新间隔,54外挂,不给提示
|
| | | # GameWorld.ErrLog('请求装备显隐, 没有到刷新间隔')
|
| | | return
|
| | | |
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_RequestEquipShowHide, tick)
|
| | | sendPack = IPY_GameWorld.IPY_CRequestEquipShowHide()
|
| | | updEquipShowSwitch = sendPack.GetEquipShowSwitch()
|
| | | oldEquipShowSwitch = curPlayer.GetEquipShowSwitch()
|
| | | if updEquipShowSwitch == oldEquipShowSwitch:
|
| | | classLV = sendPack.GetEquipShowSwitch()
|
| | | if not ChangeEquipfacadeByClassLV(curPlayer, classLV):
|
| | | return
|
| | | classLV, isSuite = updEquipShowSwitch/10, updEquipShowSwitch%10
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | #验证套装
|
| | | realSuit=True
|
| | | for place in ChConfig.Def_SuitEquipPlaceList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
|
| | | if not ipyData:
|
| | | realSuit = False
|
| | | break
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | realSuit = False
|
| | | break
|
| | | if not curEquip.GetSuiteID():
|
| | | realSuit = False
|
| | | break
|
| | | if realSuit != isSuite:
|
| | | GameWorld.DebugLog('SetEquipShowSwitch 前端发的isSuite 和实际不一致!')
|
| | | if curPlayer.GetEquipShowSwitch()/10 == classLV:
|
| | | return
|
| | |
|
| | | #通知外观装备
|
| | |
| | | updFaceEquipIndex = updFaceEquipIndex * 1000 + gridIndex
|
| | | equipIndexList.append(gridIndex)
|
| | | PlayerControl.SetFaceEquipIndex(curPlayer, updFaceEquipIndex)
|
| | | |
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for equipPackIndex in equipIndexList:
|
| | | curEquip = equipPack.GetAt(equipPackIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | |
| | | changeItemUseData = curEquip.GetUserData()
|
| | | curPlayer.ChangeEquip(changeItemID, equipPackIndex, changeItemStarLV, changeItemHoleCnt, changeItemStoneCnt, changeItemUseData)
|
| | |
|
| | | curPlayer.SetEquipShowSwitch(updEquipShowSwitch)
|
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_RequestEquipShowHide, tick)
|
| | | return
|
| | |
|
| | | def ChangeEquipfacadeByClassLV(curPlayer, classLV):
|
| | | ##变更第X套装备外观
|
| | | oldEquipShowSwitch = curPlayer.GetEquipShowSwitch()
|
| | | realSuit=1
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for place in ChConfig.Def_SuitEquipPlaceList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
|
| | | if not ipyData:
|
| | | realSuit = 0
|
| | | break
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | realSuit = 0
|
| | | break
|
| | | if not curEquip.GetSuiteID():
|
| | | realSuit = 0
|
| | | break
|
| | | updEquipShowSwitch = classLV*10+realSuit
|
| | | if oldEquipShowSwitch == updEquipShowSwitch:
|
| | | return
|
| | | curPlayer.SetEquipShowSwitch(updEquipShowSwitch)
|
| | | return True
|
| | | #获取当前是第几套装备外观
|
| | | def GetEquipFacadeClassLV(curPlayer):return curPlayer.GetEquipShowSwitch()/10
|
| | |
|
| | | ## 获取公共部位强化熟练度
|
| | | def GetEquipPartProficiency(curPlayer, packType, index):
|