| | |
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import Operate_EquipStone
|
| | | import PlayerMagicWeapon
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import EventShell
|
| | |
| | | return True
|
| | | return False
|
| | |
|
| | | #物品属性判断------------------------------------------------------------------
|
| | | ## 使用物品检查是否满足属性
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curItem 当前物品
|
| | | # @return False or True
|
| | | def CheckItemAttrLimit(curPlayer, curItem):
|
| | | # 取消限制的物品
|
| | | if curItem.GetUserAttr(ShareDefine.Def_IudetCancelUseLimit) == 1:
|
| | | return True
|
| | | #智力为基础限制
|
| | | if curItem.GetLimitPNE() > curPlayer.GetPNE():
|
| | | return False
|
| | | |
| | | #由于可变属性强化表加载问题, 暂时不处理强化表的属性点限制,以物品表为主,如有需要再开启此判断 20151210 by hxp
|
| | | # 从强化表中获得数据,装备强化限制力量 敏捷
|
| | | # if curItem.GetType() in ReadChConfig.GetEvalChConfig("EquipPlus_EquipType"):
|
| | | # plusInfo = ...
|
| | | # |
| | | # if plusInfo is None:
|
| | | # GameWorld.ErrLog("tagItemPlus.txt can't find equip:%s" % curItem.GetItemTypeID())
|
| | | # return False
|
| | | # |
| | | # limitSTR, limitPHY = plusInfo.GetLimitSTR(), plusInfo.GetLimitPHY()
|
| | | # |
| | | # # 物品表中获得信息
|
| | | # else:
|
| | | limitSTR, limitPHY = curItem.GetLimitSTR(), curItem.GetLimitPHY()
|
| | | |
| | | if limitSTR > curPlayer.GetSTR() or limitPHY > curPlayer.GetPHY():
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | | #物品使用等级判断----------------------------------------------------------------
|
| | | ## 物品使用等级判断
|
| | | # @param curPlayer 玩家
|
| | |
| | | #等级检查
|
| | | if not CheckItemUseLV(curPlayer, curItem, needNotify):
|
| | | return False
|
| | |
|
| | | #使用物品检查是否满足属性
|
| | | if not CheckItemAttrLimit(curPlayer, curItem):
|
| | | if needNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "itemuse_andyshao_671654")
|
| | | return False
|
| | | |
| | | |
| | | #=======================================================================
|
| | | # #马匹检查
|
| | | # if curItem.GetType() == ChConfig.Def_Item_Type_Horse and not CheckCanEquipHorse(curPlayer):
|
| | |
| | | itemID = tagItem.GetItemTypeID()
|
| | | #激活成就的道具
|
| | | if tagItem.GetType() == ChConfig.Def_ItemType_SuccessItem:
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_GetSpecialItem, 1, [tagItem.GetEffectByIndex(0).GetEffectValue(0)])
|
| | | PlayerMagicWeapon.DoActiveMW(curPlayer, tagItem.GetEffectByIndex(0).GetEffectValue(0))
|
| | | tagItem.Clear()
|
| | | return True
|
| | | if itemID in ChConfig.Def_TransformItemIDList:
|
| | | # 直接转化为对应货币的物品仅在放入背包时直接转化,否则还是以真实物品的形式存在,但堆叠上限需要做特殊处理
|
| | |
| | | for itemID, itemCnt, isAuctionItem in itemList:
|
| | | GivePlayerItem(curPlayer, itemID, itemCnt, isAuctionItem, [IPY_GameWorld.rptItem], event=event)
|
| | | return
|
| | |
|