#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#---------------------------------------------------------------------
|
##@package Func_6
|
#²Ö¿â¹ÜÀíÔ± Âß¼´¦Àí
|
#
|
# @author PanWei
|
# @date 2010-5-13ÏÂÎç03:41:28
|
# @version 1.3
|
#
|
# @change: "2013-05-07 15:30" wdb ²Ö¿âÐÞ¸Ä
|
# @change: "2013-12-12 15:30" hxp ÐÞ¸Ämark
|
# @change: "2016-07-20 14:30" hxp È¥³ý×êʯ´æÈ¡; Íæ¼Ò»õ±Ò´æ´¢¸üÐÂͳһ½Ó¿Ú
|
#---------------------------------------------------------------------
|
#"""Version = 2016-07-20 14:30"""
|
#---------------------------------------------------------------------
|
import IPY_GameWorld
|
import ItemControler
|
import ChConfig
|
import GameWorld
|
import EventShell
|
import PlayerControl
|
import DataRecordPack
|
import ChPyNetSendPack
|
import NetPackCommon
|
#---------------------------------------------------------------------
|
#//²Ö¿â״̬
|
#enum TWarehouseState
|
#{
|
# wsNull = 0, //ûÓпªÊ¼²Ö¿â
|
# wsEnterPsw, //ÊäÈëÃÜÂë״̬
|
# wsWarehouse, //Ǯׯ´æÈ¡ÖÐ
|
# wsChangePsw, //ÐÞ¸ÄÃÜÂë״̬
|
# wsSetPsw, //ÉèÖÃÃÜÂë״̬
|
#};
|
|
#---------------------------------------------------------------------
|
##ÊÇ·ñ¿ÉÒÔµ¯³ö²Ö¿âÃÜÂë´°¿Ú
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return ·µ»ØÖµ, ÊÇ·ñÐèÒªÊäÈë
|
# @remarks Íæ¼ÒÊÇ·ñÐèÒªµ¯³öÐèÒªÊäÈë²Ö¿âÃÜÂëµÄ´°¿Ú
|
def NeedOpenWarehousePswWnd(curPlayer):
|
if curPlayer.GetHaveWarehousePsw() == 0:
|
#ûÓÐÉ趨²Ö¿âÃÜÂë
|
return False
|
|
elif curPlayer.GetWarehouseLocked() == 0:
|
#²Ö¿âÓÐËø
|
return False
|
|
return True
|
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 01 ±³°üÎïÆ··ÅÈë²Ö¿â#tagCPutItemInWarehouse
|
# tagCPutItemInWarehouse * GettagCPutItemInWarehouse();
|
#
|
# class IPY_CPutItemInWarehouse
|
# {
|
# public:
|
# //±³°üλÖÃ
|
# int GetItemIndex();
|
# //·ÅÈëλÖÃ
|
# int GetWarehouseIndex();
|
# //·ÅÈëÊýÁ¿
|
# int GetCount();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 01 ±³°üÎïÆ··ÅÈë²Ö¿â#tagCPutItemInWarehouse
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 01 ±³°üÎïÆ··ÅÈë²Ö¿â#tagCPutItemInWarehouse
|
def PutItemInWarehouse(curPlayer, tick):
|
|
#»ñµÃ·â°ü
|
sendPack = IPY_GameWorld.IPY_CPutItemInWarehouse()
|
#±³°üλÖÃ
|
bagIndex = sendPack.GetItemIndex()
|
#µÃµ½Íæ¼ÒµÄ±³°ü
|
bagPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
#µÃµ½µ±Ç°ÎïÆ·
|
curItem = bagPack.GetAt(bagIndex)
|
|
if not curItem or curItem.IsEmpty():
|
return
|
|
#·ÅÈëλÖÃ
|
putIndex = sendPack.GetWarehouseIndex()
|
#·ÅÈëÊýÁ¿
|
putCount = sendPack.GetCount()
|
itemControl = ItemControler.PlayerItemControler(curPlayer)
|
curItemTypeID = curItem.GetItemTypeID()
|
curItemGUID = curItem.GetGUID()
|
|
if not itemControl.CanPutInItem(IPY_GameWorld.rptWarehouse, curItemTypeID, putCount, curItem.GetIsBind()):
|
PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [IPY_GameWorld.rptWarehouse])
|
return
|
|
DataRecordPack.DR_ChangePackItem(curPlayer, curItemTypeID, putCount, curItemGUID,
|
IPY_GameWorld.rptItem, IPY_GameWorld.rptWarehouse)
|
|
#±³°üÎïÆ··ÅÈë²Ö¿â
|
ItemControler.DragItem(curPlayer, IPY_GameWorld.rptItem, bagIndex, IPY_GameWorld.rptWarehouse, putIndex, putCount)
|
return
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 02 È¡³ö²Ö¿âÎïÆ·#tagCGetItemInWarehouse
|
# tagCGetItemInWarehouse * GettagCGetItemInWarehouse();
|
#
|
# class IPY_CGetItemInWarehouse
|
# {
|
# public:
|
# //²Ö¿âλÖÃ
|
# int GetWarehouseIndex();
|
# //ÎïÆ·Î»ÖÃ
|
# int GetItemIndex();
|
# //È¡³öÊýÁ¿
|
# int GetCount();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 02 È¡³ö²Ö¿âÎïÆ·#tagCGetItemInWarehouse
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 02 È¡³ö²Ö¿âÎïÆ·#tagCGetItemInWarehouse
|
def GetItemInWarehouse(curPlayer, tick):
|
|
#»ñµÃ·â°ü
|
sendPack = IPY_GameWorld.IPY_CGetItemInWarehouse()
|
#²Ö¿âλÖÃ
|
warehouseIndex = sendPack.GetWarehouseIndex()
|
#µÃµ½Íæ¼ÒµÄ²Ö¿â
|
warehousePack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptWarehouse)
|
#µÃµ½µ±Ç°ÎïÆ·
|
curItem = warehousePack.GetAt(warehouseIndex)
|
if not curItem or curItem.IsEmpty():
|
return
|
|
#·ÅÈë±³°üλÖÃ
|
putIndex = sendPack.GetItemIndex()
|
#·ÅÈëÊýÁ¿
|
putCount = sendPack.GetCount()
|
itemControl = ItemControler.PlayerItemControler(curPlayer)
|
curItemTypeID = curItem.GetItemTypeID()
|
curItemGUID = curItem.GetGUID()
|
|
if not itemControl.CanPutInItem(IPY_GameWorld.rptItem, curItemTypeID, putCount, curItem.GetIsBind()):
|
PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [IPY_GameWorld.rptItem])
|
return False
|
|
DataRecordPack.DR_ChangePackItem(curPlayer, curItemTypeID, putCount, curItemGUID,
|
IPY_GameWorld.rptWarehouse, IPY_GameWorld.rptItem)
|
#²Ö¿âÎïÆ··ÅÈë±³°ü
|
ItemControler.DragItem(curPlayer, IPY_GameWorld.rptWarehouse, warehouseIndex, IPY_GameWorld.rptItem, putIndex, putCount)
|
return
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 03 ²Ö¿âÈ¡³ö½ðÇ®#tagCGetMoneyInWarehouse
|
# tagCGetMoneyInWarehouse * GettagCGetMoneyInWarehouse();
|
#
|
# class IPY_CGetMoneyInWarehouse
|
# {
|
# public:
|
# //½ðÇ®ÀàÐÍ
|
# int GetMoneyType();
|
# //Ç®
|
# int GetMoney();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 03 ²Ö¿âÈ¡³ö½ðÇ®#tagCGetMoneyInWarehouse
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 03 ²Ö¿âÈ¡³ö½ðÇ®#tagCGetMoneyInWarehouse
|
def GetMoneyInWarehouse(curPlayer, tick):
|
#Íæ¼Òµ±Ç°×´Ì¬²»ÊÇǮׯ´æÈ¡×´Ì¬
|
if curPlayer.GetWarehouseState() != IPY_GameWorld.wsWarehouse:
|
return
|
|
#È¡³ö½ðÇ®·â°ü
|
sendPack = IPY_GameWorld.IPY_CGetMoneyInWarehouse()
|
|
#½ðÇ®ÀàÐÍ
|
moneyType = sendPack.GetMoneyType()
|
|
#½ðÇ®ÊýÁ¿
|
getMoney = sendPack.GetMoney()
|
|
if getMoney <= 0:
|
#ûÊäÈëÇ®,²»´¦Àí
|
return
|
|
if moneyType not in [IPY_GameWorld.TYPE_Price_Silver_Money]:
|
return
|
|
#´¦ÀíÒø×Ó
|
if moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:
|
curMoney = PlayerControl.GetSilver(curPlayer)
|
curWarehouseMoney = curPlayer.GetWarehouseSilver()
|
moneyCount = curMoney + getMoney
|
|
if moneyCount > ChConfig.Def_PlayerTotalMoney_Silver:
|
#³¬¹ý½ðÇ®ÉÏÏÞ
|
PlayerControl.NotifyCode(curPlayer,"GeRen_chenxin_609765")
|
return
|
|
if getMoney > curWarehouseMoney:
|
PlayerControl.NotifyCode(curPlayer,"TakeMoneyLack")
|
return
|
|
curPlayer.SetWarehouseSilver(curWarehouseMoney - getMoney)
|
addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Get"}
|
PlayerControl.GiveMoney(curPlayer, moneyType, getMoney, ChConfig.Def_GiveMoney_Warehouse, addDataDict)
|
|
|
DataRecordPack.DR_GetMoneyInWarehouse(curPlayer, moneyType, getMoney)
|
return
|
|
|
#===============================================================================
|
# //0C 04 ²Ö¿â·ÅÈë½ðÇ®#tagCPutMoneyInWarehouse
|
# tagCPutMoneyInWarehouse * GettagCPutMoneyInWarehouse();
|
#
|
# class IPY_CPutMoneyInWarehouse
|
# {
|
# public:
|
# //½ðÇ®ÀàÐÍ
|
# int GetMoneyType();
|
# //½ðÇ®
|
# int GetMoney();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 04 ²Ö¿â·ÅÈë½ðÇ®#tagCPutMoneyInWarehouse
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 04 ²Ö¿â·ÅÈë½ðÇ®#tagCPutMoneyInWarehouse
|
def PutMoneyInWarehouse(curPlayer, tick):
|
#Íæ¼Òµ±Ç°×´Ì¬²»ÊÇǮׯ´æÈ¡×´Ì¬
|
if curPlayer.GetWarehouseState() != IPY_GameWorld.wsWarehouse:
|
return
|
|
#·ÅÈë½ðÇ®·â°ü
|
sendPack = IPY_GameWorld.IPY_CPutMoneyInWarehouse()
|
#½ðÇ®ÊýÁ¿
|
putMoney = sendPack.GetMoney()
|
|
if putMoney <= 0:
|
#ûÊäÈë½ðÇ®,²»´¦Àí
|
return
|
|
moneyType = sendPack.GetMoneyType()
|
|
if moneyType not in [IPY_GameWorld.TYPE_Price_Silver_Money]:
|
return
|
|
#´¦ÀíÒø×Ó
|
if moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:
|
curMoney = PlayerControl.GetSilver(curPlayer)
|
curWarehouseMoney = curPlayer.GetWarehouseSilver()
|
moneyCount = curWarehouseMoney + putMoney
|
|
if moneyCount > ChConfig.Def_PlayerTotalMoney_Silver:
|
#³¬¹ý½ðÇ®ÉÏÏÞ
|
PlayerControl.NotifyCode(curPlayer,"GeRen_chenxin_766742")
|
return
|
|
if putMoney > curMoney:
|
#SilverErr ¶Ô²»Æð,ÄúµÄÒø×ÓÊýÁ¿²»×ã
|
PlayerControl.NotifyCode(curPlayer,"SilverErr")
|
return
|
|
PlayerControl.PayMoney(curPlayer, moneyType, putMoney, ChConfig.Def_Cost_Warehouse, {ChConfig.Def_Cost_Reason_SonKey:"PutIn"})
|
curPlayer.SetWarehouseSilver(moneyCount)
|
|
DataRecordPack.DR_SetMoneyInWarehouse(curPlayer, moneyType, putMoney)
|
return True
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 05 ÉèÖòֿâÃÜÂë#tagCSetWarehousePsw
|
# tagCSetWarehousePsw * GettagCSetWarehousePsw();
|
#
|
# class IPY_CSetWarehousePsw
|
# {
|
# public:
|
# //µ±Ç°ÃÜÂë(¿Õ±íʾûÓÐÃÜÂë)
|
# char * GetPsw();
|
# //¾ÉÃÜÂë
|
# char * GetOldPsw();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 05 ÉèÖòֿâÃÜÂë#tagCSetWarehousePsw
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 05 ÉèÖòֿâÃÜÂë#tagCSetWarehousePsw
|
def SetWarehousePsw(curPlayer, tick):
|
#Íæ¼Òµ±Ç°×´Ì¬²»ÊÇÐÞ¸ÄÃÜÂë״̬
|
if curPlayer.GetWarehouseState() != IPY_GameWorld.wsWarehouse:
|
return
|
|
# ²Ö¿âÓÐËø£¬ÏȽâËø
|
if curPlayer.GetWarehouseLocked():
|
return
|
|
sendPack = IPY_GameWorld.IPY_CSetWarehousePsw()
|
#µ±Ç°²Ö¿âÃÜÂë
|
currentPsw = curPlayer.GetWarehousePsw()
|
#ÐÂÃÜÂë
|
newPsw = sendPack.GetPsw()
|
#ÕâÀïÊǵ÷ÓÃc++µÄ¹ýÂ˿ոñ,¿ÉÒÔ¹ýÂËÈ«½Ç¿Õ¸ñ, python²»ÄÜ
|
newPsw = GameWorld.GetGameWorld().GetCharTrim(newPsw)
|
if newPsw == "":
|
return
|
|
curPlayer.SetWarehousePsw(newPsw)
|
DataRecordPack.DR_SetWarehousePsw(curPlayer, currentPsw, newPsw)
|
|
#curPlayer.Frm_WarehouseMsg(IPY_GameWorld.whmSetPswOK)
|
PlayerControl.NotifyCode(curPlayer, "GeRen_pan_106532")
|
|
#ÓÐÉèÖòֿâÃÜÂë£¬Ëø¶¨
|
curPlayer.SetHaveWarehousePsw(1)
|
# ÉèÖòֿâËø¶¨×´Ì¬
|
SetLockState(curPlayer, 1)
|
return
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 06 Ëø¶¨²Ö¿â#tagCSetWarehouseLock
|
# tagCSetWarehouseLock * GettagCSetWarehouseLock();
|
#
|
# class IPY_CSetWarehouseLock
|
# {
|
# public:
|
# //0: ½âËø 1:Ëø¶¨
|
# int GetIsLock();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 06 Ëø¶¨²Ö¿â#tagCSetWarehouseLock
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
def SetWarehouseLock(curPlayer, tick):
|
#Íæ¼Òµ±Ç°×´Ì¬²»ÊÇǮׯ´æÈ¡×´Ì¬
|
if curPlayer.GetWarehouseState() != IPY_GameWorld.wsWarehouse:
|
return
|
|
#»ñµÃ¿Í»§¶ËËø¶¨·â°ü
|
sendPack = IPY_GameWorld.IPY_CSetWarehouseLock()
|
setLockState = sendPack.GetIsLock()
|
|
# ÕâÀïÖ»ÓÃÓÚ½âËø
|
if setLockState != 0:
|
return
|
|
if curPlayer.GetWarehouseLocked() == setLockState:
|
return
|
|
# ÉèÖòֿâËø¶¨×´Ì¬
|
SetLockState(curPlayer, setLockState)
|
return
|
|
## ÉèÖòֿâËø¶¨×´Ì¬
|
# @param curPlayer
|
# @param setLockState
|
# @return
|
def SetLockState(curPlayer, setLockState):
|
|
curPlayer.SetWarehouseLocked(setLockState)
|
|
packLockState = ChPyNetSendPack.tagMCWarehorseLock()
|
packLockState.Clear()
|
packLockState.LockState = setLockState
|
NetPackCommon.SendFakePack(curPlayer, packLockState)
|
return
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 07 ¿Í»§¶Ë·¢ËͲֿâÃÜÂë#tagSendWarehousePsw
|
# tagSendWarehousePsw * GettagSendWarehousePsw();
|
#
|
# class IPY_SendWarehousePsw
|
# {
|
# public:
|
#
|
# char * GetPsw();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 07 ¿Í»§¶Ë·¢ËͲֿâÃÜÂë#tagSendWarehousePsw
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 07 ¿Í»§¶Ë·¢ËͲֿâÃÜÂë#tagSendWarehousePsw
|
def SendWarehousePsw(curPlayer, tick):
|
#===========================================================================
|
# #Íæ¼Òµ±Ç°×´Ì¬²»ÊÇÊäÈëÃÜÂë״̬
|
# if curPlayer.GetWarehouseState() != IPY_GameWorld.wsEnterPsw:
|
# return
|
#
|
# #»ñµÃ¿Í»§¶Ë·â°ü
|
# sendPack = IPY_GameWorld.IPY_SendWarehousePsw()
|
# curPsw = sendPack.GetPsw()
|
# oldPsw = curPlayer.GetWarehousePsw()
|
#
|
# #ÕâÀïÊǵ÷ÓÃc++µÄ¹ýÂ˿ոñ,¿ÉÒÔ¹ýÂËÈ«½Ç¿Õ¸ñ, python²»ÄÜ
|
# curPsw = GameWorld.GetGameWorld().GetCharTrim(curPsw)
|
#
|
# #ÃÜÂë²»ÕýÈ·
|
# if curPsw != oldPsw:
|
# curPlayer.Frm_WarehouseMsg(IPY_GameWorld.whmPswError)
|
# EventShell.DoExitEvent(curPlayer)
|
#
|
# PlayerControl.NotifyCode(curPlayer, "GeRen_pan_59781")
|
# return
|
#
|
# #ÃÜÂëÕýÈ·
|
# ShowWarehouse(curPlayer)
|
#===========================================================================
|
return
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 08 µÚÒ»´Î´ò¿ª²Ö¿â#tagCInitWarehousePsw
|
# tagCInitWarehousePsw * GettagCInitWarehousePsw();
|
#
|
# class IPY_CInitWarehousePsw
|
# {
|
# public:
|
# //ÃÜÂë
|
# char * GetPsw();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 08 µÚÒ»´Î´ò¿ª²Ö¿â#tagCInitWarehousePsw
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 08 µÚÒ»´Î´ò¿ª²Ö¿â#tagCInitWarehousePsw
|
def InitWarehousePsw(curPlayer, tick):
|
# #Íæ¼Òµ±Ç°×´Ì¬²»ÊÇÉèÖÃÃÜÂë״̬
|
# if curPlayer.GetWarehouseState() != IPY_GameWorld.wsSetPsw:
|
# return
|
#
|
# sendPack = IPY_GameWorld.IPY_CInitWarehousePsw()
|
# #ÃÜÂë
|
# curPsw = sendPack.GetPsw()
|
# #ºÏÀíÐÔ¼ì²é, Èç¹ûÃÜÂëΪ¿Õ, Ôò±íʾ²»ÐèÒªÊäÈëÃÜÂë(°Ñ ÊÇ·ñÐèҪǮׯÃÜÂë ×Ö¶ÎÉèÖÃΪ0)
|
# curPlayer.Frm_WarehouseMsg(IPY_GameWorld.whmSetPswOK)
|
#
|
# PlayerControl.NotifyCode(curPlayer, "GeRen_pan_106532")
|
#
|
# #ÕâÀïÊǵ÷ÓÃc++µÄ¹ýÂ˿ոñ,¿ÉÒÔ¹ýÂËÈ«½Ç¿Õ¸ñ, python²»ÄÜ
|
# curPsw = GameWorld.GetGameWorld().GetCharTrim(curPsw)
|
#
|
# if curPsw == "":
|
# curPlayer.SetHaveWarehousePsw(0)
|
# return
|
#
|
# #ÉèÖòֿâÃÜÂë
|
# curPlayer.SetWarehousePsw(curPsw)
|
# DataRecordPack.DR_SetWarehousePsw(curPlayer, "", curPsw)
|
#
|
# #°Ñ ÊÇ·ñÐèҪǮׯÃÜÂë ×Ö¶ÎÉèÖÃΪ1
|
# curPlayer.SetHaveWarehousePsw(1)
|
return
|
|
#---------------------------------------------------------------------
|
#===============================================================================
|
# //0C 09 ²Ö¿âÍ϶¯ÎïÆ·#tagMoveItemInWarehouse
|
# tagMoveItemInWarehouse * GettagMoveItemInWarehouse();
|
#
|
# class IPY_MoveItemInWarehouse
|
# {
|
# public:
|
# //ÆðʼλÖÃ
|
# int GetSrcIndex();
|
# //Ä¿±êλÖÃ
|
# int GetDestIndex();
|
#
|
# int GetCount();
|
# };
|
#===============================================================================
|
##¿Í»§¶Ë·â°üÏìÓ¦ //0C 09 ²Ö¿âÍ϶¯ÎïÆ·#tagMoveItemInWarehouse
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ¿Í»§¶Ë·â°üÏìÓ¦ //0C 09 ²Ö¿âÍ϶¯ÎïÆ·#tagMoveItemInWarehouse
|
def MoveItemInWarehouse(curPlayer, tick):
|
#Íæ¼Òµ±Ç°×´Ì¬²»ÊÇǮׯ´æÈ¡×´Ì¬
|
if curPlayer.GetWarehouseState() != IPY_GameWorld.wsWarehouse:
|
return
|
|
#»ñµÃ·â°ü
|
sendPack = IPY_GameWorld.IPY_MoveItemInWarehouse()
|
#ÎïÆ·ÊýÁ¿
|
putCount = sendPack.GetCount()
|
#²Ö¿âÎïÆ··ÅÈë±³°ü
|
ItemControler.DragItem(curPlayer, IPY_GameWorld.rptWarehouse, sendPack.GetSrcIndex(), IPY_GameWorld.rptWarehouse, sendPack.GetDestIndex(), putCount)
|
return
|
|
#===============================================================================
|
# ´Ë½Ó¿Ú·ÏÆú, ±³°üÕûÀí·â°üÐÞ¸Ä
|
# #---------------------------------------------------------------------
|
# ##ÖØÕû²Ö¿â
|
# # @param index Íæ¼ÒË÷Òý
|
# # @param tick ʱ¼ä´Á
|
# # @return ·µ»ØÖµÎÞÒâÒå
|
# # @remarks ÈÎÎñµ÷ÓÃ, ÖØÕû²Ö¿â fc_ResetWarehouseItem
|
# def ResetWarehouseItem(curPlayer, tick):
|
# #Íæ¼Òµ±Ç°×´Ì¬²»ÊÇǮׯ´æÈ¡×´Ì¬
|
# if curPlayer.GetWarehouseState() != IPY_GameWorld.wsWarehouse:
|
# return
|
#
|
# ItemControler.ResetItem(curPlayer, IPY_GameWorld.rptWarehouse, tick)
|
# return
|
#===============================================================================
|
#---------------------------------------------------------------------
|
##ÐèÒª¸ü¸Ä²Ö¿âÃÜÂë
|
# @param index Íæ¼ÒË÷Òý
|
# @param tick ʱ¼ä´Á
|
# @return ·µ»ØÖµÎÞÒâÒå
|
# @remarks ÈÎÎñµ÷ÓÃ, ÐèÒª¸ü¸Ä²Ö¿âÃÜÂë, fc_WarehousePsw
|
def WarehousePsw(curPlayer, tick):
|
|
# #ÊÇ·ñÒѾÉèÖÃÃÜÂë
|
# haveWarehousePsw = curPlayer.GetHaveWarehousePsw()
|
#
|
# #ÔÏÈÒѾÉèÖòֿâÃÜÂëµÄÇé¿ö
|
# if haveWarehousePsw:
|
# #Ìø³ö¸ü¸ÄÃÜÂë´°¿Ú
|
# curPlayer.Frm_ChangeWarehousePsw()
|
# #ÉèÖÃÍæ¼Òµ±Ç°×´Ì¬ÎªÐÞ¸ÄÃÜÂë״̬
|
# curPlayer.SetWarehouseState(IPY_GameWorld.wsChangePsw)
|
# #ÔÏÈûÓÐÉèÖòֿâÃÜÂëµÄÇé¿ö
|
# else:
|
# #Ìø³öÉèÖÃÃÜÂë´°¿Ú
|
# curPlayer.Frm_SetWarehousePsw()
|
# #ÉèÖÃÍæ¼Òµ±Ç°×´Ì¬ÎªÉèÖÃÃÜÂë״̬
|
# curPlayer.SetWarehouseState(IPY_GameWorld.wsSetPsw)
|
#
|
# return
|
|
return
|
|
|
|
|
|