| | |
| | | if not ipyData:
|
| | | return
|
| | |
|
| | | activateState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
|
| | | updSkinEndTime = 0
|
| | | validTime = ipyData.GetSkinValidTime()
|
| | | if validTime:
|
| | |
| | | else:
|
| | | updSkinEndTime = skinEndTime + validTime
|
| | | else:
|
| | | if activateState & pow(2, activateID):
|
| | | GameWorld.DebugLog("该坐骑已幻化!activateState=%s,activateID=%s" % (activateState, activateID))
|
| | | if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, activateID):
|
| | | GameWorld.DebugLog("该坐骑已幻化! activateID=%s" % activateID)
|
| | | return
|
| | |
|
| | | needItemID = ipyData.GetUnlockItemID()
|
| | |
| | | GameWorld.DebugLog("坐骑幻化时效 activateID=%s,updSkinEndTime=%s(%s)" % (activateID, updSkinEndTime, GameWorld.ChangeTimeNumToStr(updSkinEndTime)), playerID)
|
| | |
|
| | | #时效及非时效该状态均设置激活
|
| | | updActivateState = activateState|pow(2, activateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, updActivateState)
|
| | | activateState, updActivateState = GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, activateID, 1)
|
| | |
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
|
| | |
| | | paramList = [skinItemID]
|
| | | PlayerControl.SendMailByKey("HorseSkinInvalidNotify", [playerID], addItemList, paramList)
|
| | |
|
| | | activateState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
|
| | | updActivateState = GameWorld.SetBitValue(activateState, skinID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, updActivateState)
|
| | | activateState, updActivateState = GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, skinID, 0)
|
| | | GameWorld.Log("坐骑幻化过期更新状态! skinID=%s,activateState=%s,updActivateState=%s" % (skinID, activateState, updActivateState), playerID)
|
| | | Sync_HorseClassData(curPlayer)
|
| | | return False
|
| | | else:
|
| | | activateState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
|
| | | if not activateState & pow(2, skinID):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, skinID):
|
| | | #GameWorld.DebugLog("坐骑幻化未激活! skinID=%s,activateState=%s" % (skinID, activateState), curPlayer.GetPlayerID())
|
| | | return False
|
| | | return True
|
| | |
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserLV, horseLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserEatItemCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, 0)
|
| | | for trainType in xrange(1, GetHorseTrainTypes() + 1):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserTrainLV % trainType, 1)
|
| | |
|
| | |
| | | skinPlusIpyData = ipyDataMgr.GetHorseSkinPlusByIndex(index)
|
| | | skinID = skinPlusIpyData.GetID()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinEndTime % skinID, 0)
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, skinID, 0)
|
| | |
|
| | | horseID = ipyData.GetHorseSkinID()
|
| | | if not ItemCommon.FindItemInPackByItemID(curPlayer, horseID, IPY_GameWorld.rptEquip):
|
| | |
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
|
| | | return
|
| | |
|
| | | # 坐骑幻化状态多值支持修改,线上版本做旧值转移
|
| | | oldVerSkinStateKey = "HorserSkinPlusState"
|
| | | oldVerSkinStateValue = curPlayer.NomalDictGetProperty(oldVerSkinStateKey)
|
| | | if oldVerSkinStateValue:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState % 0, oldVerSkinStateValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, oldVerSkinStateKey, 0)
|
| | | GameWorld.Log("线上版本转移坐骑幻化状态记录字典值! oldVerSkinStateValue=%s" % (oldVerSkinStateValue), curPlayer.GetPlayerID())
|
| | | |
| | | # 培养是后面加的功能,每次登录补检查一下功能开始时设置为培养1级
|
| | | for trainType in xrange(1, GetHorseTrainTypes() + 1):
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserTrainLV % trainType) == 0:
|
| | |
| | | horseData.TrainLVList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserTrainLV % trainType))
|
| | | horseData.TrainItemCountList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserTrainItemCount % trainType))
|
| | | horseData.TrainTypes = len(horseData.TrainLVList)
|
| | | horseData.SkinPlusStateList = GetHorseSkinPlusStateList(curPlayer)
|
| | | horseData.SkinPlusStateCount = len(horseData.SkinPlusStateList)
|
| | | NetPackCommon.SendFakePack(curPlayer, horseData)
|
| | | return
|
| | |
|
| | | def GetHorseSkinPlusStateList(curPlayer):
|
| | | maxSkinID = 0
|
| | | skinPlusStateList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | skinCnt = ipyDataMgr.GetHorseSkinPlusCount()
|
| | | for index in xrange(skinCnt):
|
| | | maxSkinID = max(maxSkinID, ipyDataMgr.GetHorseSkinPlusByIndex(index).GetID())
|
| | | for index in xrange(maxSkinID / 31+1):
|
| | | skinPlusStateList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState % index))
|
| | | return skinPlusStateList
|
| | |
|
| | | def GetHorseSumLV(curPlayer):
|
| | | ## 坐骑总等级
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
|