| | |
| | | import ReadChConfig
|
| | | import OperControlManager
|
| | | import ShareDefine
|
| | | import PlayerAttrFruit
|
| | | import DataRecordPack
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | |
| | | mapItemCount = singItem.GetCount()
|
| | | singItemGUID = singItem.GetGUID()
|
| | | curEffID = singItem.GetEffectByIndex(0).GetEffectID()
|
| | | playerTeam = curPlayer.GetTeam()
|
| | | #isTeamNotify = (ownerType == ChConfig.Def_NPCHurtTypeTeam and playerTeam != None)
|
| | | isTeamNotify = False
|
| | | # 拾取金钱
|
| | | if mapItemType == ChConfig.Def_ItemType_Money:
|
| | |
| | | ChConfig.Def_GiveMoney_Pickup, {}, not isTeamNotify):
|
| | | return
|
| | |
|
| | | # 提示获得金钱数量
|
| | | if isTeamNotify:
|
| | | PlayerControl.TeamNotify(playerTeam.GetTeamID(), "GeRen_lhs_295695", [curPlayer.GetName(),
|
| | | mapItemCount])
|
| | | # 副本拾取金钱
|
| | | FBLogic.OnFBPickUpItem(curPlayer, singItem, tick)
|
| | | singItem.Clear()
|
| | |
| | | def __DoLogic_PlayerUseItemSelf(curPlayer, useItemIndex, tick, useCnt=1, exData=0):
|
| | |
|
| | | #使用物品行为状态, 判断客户端限制
|
| | | if not OperControlManager.IsObjCanDoAction(
|
| | | curPlayer, |
| | | ChConfig.Def_Obj_ActState_ClientAct, |
| | | IPY_GameWorld.oalUseItem
|
| | | ):
|
| | | return False
|
| | | #if not OperControlManager.IsObjCanDoAction(
|
| | | # curPlayer, |
| | | # ChConfig.Def_Obj_ActState_ClientAct, |
| | | # IPY_GameWorld.oalUseItem
|
| | | # ):
|
| | | # return False
|
| | |
|
| | | #------------------封包参数 获得 玩家物品
|
| | | backPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | |
| | | # @return None or True
|
| | | # @remarks 函数详细说明.
|
| | | def __DealWith_SpecialItem(curPlayer, curItem, tick, useCnt, exData):
|
| | | #果实物品
|
| | | useFruitResult = PlayerAttrFruit.DoPlayerEatFruitItem(curPlayer, curItem, useCnt)
|
| | | if useFruitResult != -1:
|
| | | return useFruitResult
|
| | |
|
| | | #------------------------获得物品相关属性
|
| | | itemTypeID = curItem.GetItemTypeID() #物品类型id
|
| | |
| | | # @return 布尔值
|
| | | # @remarks 检查使用物品的玩家属性.
|
| | | def CheckUseItemSelf_Player(curPlayer):
|
| | | if GameObj.GetHP(curPlayer) <= 0 :
|
| | | return False
|
| | | #if GameObj.GetHP(curPlayer) <= 0 :
|
| | | # return False
|
| | |
|
| | | # #眩晕时, 不可使用物品
|
| | | # if curPlayer.GetAbnormalState() == IPY_GameWorld.sctFaint:
|
| | | # return False
|
| | |
|
| | | #使用物品行为状态, 判断服务端限制
|
| | | if not OperControlManager.IsObjCanDoAction(
|
| | | curPlayer, |
| | | ChConfig.Def_Obj_ActState_ServerAct, |
| | | IPY_GameWorld.oalUseItem
|
| | | ):
|
| | | return False
|
| | | #if not OperControlManager.IsObjCanDoAction(
|
| | | # curPlayer, |
| | | # ChConfig.Def_Obj_ActState_ServerAct, |
| | | # IPY_GameWorld.oalUseItem
|
| | | # ):
|
| | | # return False
|
| | |
|
| | | #交易状态, 不可使用物品
|
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paTrade:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_372238")
|
| | | return False
|
| | | #if curPlayer.GetPlayerAction() == IPY_GameWorld.paTrade:
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_372238")
|
| | | # return False
|
| | |
|
| | | # #GM禁止使用
|
| | | # if GameWorld.IsGM(curPlayer):
|