| | |
| | | import IpyGameDataPY
|
| | | import GameFuncComm
|
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import GameWorld
|
| | | import ObjPool
|
| | |
|
| | |
| | | # 有升级额外处理
|
| | | if updHorseLV > horseLV:
|
| | | RefreshHorseAttr(curPlayer)
|
| | | |
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HorseLVUP, costItemCount)
|
| | | return
|
| | |
|
| | | #// B2 02 坐骑进阶 #tagCSHorseClassUP
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("HorseSkin", horseSkinID)
|
| | | if not ipyData:
|
| | | return
|
| | | if ipyData.GetUnlockWay() != 2:
|
| | | GameWorld.DebugLog("非道具激活的不用添加: horseSkinID=%s" % (horseSkinID), playerID)
|
| | | return
|
| | | if not isFree:
|
| | | itemID = ipyData.GetUnlockValue()
|
| | | itemCount = ipyData.GetUnlockNeedCnt()
|
| | | if not itemID or not itemCount:
|
| | | return
|
| | | needItemList = [[itemID, itemCount]]
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("激活所需物品不足! horseSkinID=%s,lackItemDict=%s" % (horseSkinID, lackItemDict), playerID)
|
| | | return
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "AddHorseSkin")
|
| | | unlockWay = ipyData.GetUnlockWay()
|
| | | if unlockWay == 1:
|
| | | classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
|
| | | if classLV < ipyData.GetUnlockValue():
|
| | | GameWorld.DebugLog("坐骑阶级不足无法解锁! classLV=%s < %s" % (classLV, ipyData.GetUnlockValue()), playerID)
|
| | | return
|
| | | elif unlockWay == 2:
|
| | | itemID = ipyData.GetUnlockValue()
|
| | | itemCount = ipyData.GetUnlockNeedCnt()
|
| | | if not itemID or not itemCount:
|
| | | return
|
| | | needItemList = [[itemID, itemCount]]
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("激活所需物品不足! horseSkinID=%s,lackItemDict=%s" % (horseSkinID, lackItemDict), playerID)
|
| | | return
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "AddHorseSkin")
|
| | |
|
| | | ipyExpireSeconds = ipyData.GetExpireMinutes() * 60
|
| | |
|
| | |
| | | for index in range(ipyDataMgr.GetHorseSkinCount()):
|
| | | ipyData = ipyDataMgr.GetHorseSkinByIndex(index)
|
| | | horseSkinID = ipyData.GetSkinID()
|
| | | if horseSkinID <= 0:
|
| | | continue
|
| | | if ipyData.GetUnlockWay() != 1:
|
| | | continue
|
| | | if ipyData.GetUnlockValue() > 0:
|
| | |
| | | if ipyData:
|
| | | unlockWay = ipyData.GetUnlockWay()
|
| | | if unlockWay == 1:
|
| | | classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
|
| | | if classLV >= ipyData.GetUnlockValue():
|
| | | if not ipyData.GetUnlockValue():
|
| | | return True
|
| | | #classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
|
| | | #if classLV >= ipyData.GetUnlockValue():
|
| | | # return True
|
| | |
|
| | | return False
|
| | |
|