Esempio n. 1
0
        /// <summary>
        /// 背包已满提示
        /// </summary>
        /// <param name="itemId"></param>
        void ShowBoxTips(uint itemId)
        {
            Client.IEntitySystem es = ControllerSystem.m_ClientGlobal.GetEntitySystem();
            IBox box = es.FindBox(itemId);

            if (box == null)
            {
                return;
            }


            Client.IControllerHelper controllerhelper = GetControllerHelper();
            if (controllerhelper != null)
            {
                int itemBaseId = box.GetProp((int)EntityProp.BaseID);
                int itemNum    = box.GetProp((int)BoxProp.Number);

                //1、捡到的item  为金币
                if (itemBaseId == 60001)
                {
                    return;
                }

                //2、不可放入背包
                if (false == controllerhelper.CanPutInKanpsack((uint)itemBaseId, (uint)itemNum))
                {
                    Client.ITipsManager tip = ControllerSystem.m_ClientGlobal.GetTipsManager();
                    if (tip != null)
                    {
                        tip.ShowTips("背包空间不足");
                    }
                }
            }
        }
Esempio n. 2
0
 public PlayerDistanceCondition(PLAYERPKMODEL pkmodel, Vector3 playerPos, float dis)
 {
     m_playerPos        = playerPos;
     m_dis              = dis;
     m_pkmodel          = pkmodel;
     m_mainPlayer       = ControllerSystem.m_ClientGlobal.MainPlayer;
     m_controllerhelper = ControllerSystem.m_ClientGlobal.GetControllerSystem().GetControllerHelper();
 }
Esempio n. 3
0
 void UseAtOnceMedice()
 {
     Client.IControllerHelper controllerhelper = GetControllerHelper();
     if (controllerhelper == null)
     {
         return;
     }
     controllerhelper.UseAtOnceMedicine();
 }
Esempio n. 4
0
 void OnUseMedecal()
 {
     Client.IControllerHelper controllerhelper = GetControllerHelper();
     if (controllerhelper == null)
     {
         return;
     }
     controllerhelper.CheckUseMedicine();
 }
Esempio n. 5
0
        public bool CanAutoPick()
        {
            if (EntitySystem.m_ClientGlobal.gameOption == null)
            {
                return(false);
            }
            int canPickUp = EntitySystem.m_ClientGlobal.gameOption.GetInt("Pick", "PickMedecal", 1);

            if (canPickUp != 1)
            {
                return(false);
            }
            int pickLevel  = EntitySystem.m_ClientGlobal.gameOption.GetInt("Pick", "EquipLevel", 1);
            int nID        = GetProp((int)EntityProp.BaseID);
            var table_data = GameTableManager.Instance.GetTableItem <table.ItemDataBase>((uint)nID);

            if (table_data == null)
            {
                return(false);
            }

            if (table_data.grade < pickLevel)
            {
                return(false);
            }

            Client.IControllerSystem cs = EntitySystem.m_ClientGlobal.GetControllerSystem();
            if (cs != null)
            {
                Client.IControllerHelper controllerhelper = cs.GetControllerHelper();
                if (controllerhelper != null)
                {
                    int itemId  = GetProp((int)EntityProp.BaseID);
                    int itemNum = GetProp((int)BoxProp.Number);

                    //1、捡到的item  不为金币(金币不进背包,不做背包检测)
                    if (itemId != 60001)
                    {
                        //2、不可放入背包
                        if (false == cs.GetControllerHelper().CanPutInKanpsack((uint)itemId, (uint)itemNum))
                        {
                            return(false);
                        }
                    }
                }
            }

            return(CanPick());
        }
Esempio n. 6
0
        public bool CanPick()
        {
            GameCmd.SceneItemOwnerType ownerType = (GameCmd.SceneItemOwnerType)GetProp((int)Client.BoxProp.OwnerType);
            //int owernId = (int)GetProp((int)Client.BoxProp.Owner);

            uint owernIdLow  = (uint)GetProp((int)Client.BoxProp.OwnerLow);
            uint owernIdHigh = (uint)GetProp((int)Client.BoxProp.OwnerHigh);
            uint owernId     = (owernIdHigh << 16) | owernIdLow;

            if (ownerType == GameCmd.SceneItemOwnerType.SceneItemOwnerType_Null)
            {
                return(true);
            }
            else if (ownerType == GameCmd.SceneItemOwnerType.SceneItemOwnerType_User)
            {
                return(owernId == (int)EntitySystem.m_ClientGlobal.MainPlayer.GetID());
            }
            else if (ownerType == GameCmd.SceneItemOwnerType.SceneItemOwnerType_Clan)
            {
                Client.IControllerSystem cs = EntitySystem.m_ClientGlobal.GetControllerSystem();
                if (cs != null)
                {
                    Client.IControllerHelper controllerhelper = cs.GetControllerHelper();
                    if (controllerhelper != null)
                    {
                        return(owernId == controllerhelper.GetMainPlayerClanId());
                    }
                }
            }
            else if (ownerType == GameCmd.SceneItemOwnerType.SceneItemOwnerType_Team)
            {
                Client.IControllerSystem cs = EntitySystem.m_ClientGlobal.GetControllerSystem();
                if (cs != null)
                {
                    return(cs.GetControllerHelper().IsTeamerCanPick((uint)owernId));
                }
            }
            return(false);
        }