Exemplo n.º 1
0
        public void RequestEnterMap(uint nmapId, uint cost = 0)
        {
            if (nmapId == mapID)
            {
                Client.ITipsManager tips = m_ClientGlobal.GetTipsManager();
                if (tips != null)
                {
                    tips.ShowTipsById(514);
                }
                return;
            }

            if (m_ClientGlobal.netService != null)
            {
                // 请求传送地图 先让主角停止
                if (m_ClientGlobal.MainPlayer != null)
                {
                    m_ClientGlobal.MainPlayer.SendMessage(EntityMessage.EntityCommand_StopMove, m_ClientGlobal.MainPlayer.GetPos());
                }

                m_ClientGlobal.netService.Send(new GameCmd.stChangeMapScreenUserCmd_CS()
                {
                    map_id = nmapId,
                    type   = cost,
                });
            }
        }
Exemplo n.º 2
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("背包空间不足");
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void OnResume(bool bShowTip)
        {
            if (m_status == CombatRobotStatus.RUNNING)
            {
                return;
            }

            IPlayer mainPlayer = ControllerSystem.m_ClientGlobal.MainPlayer;

            if (mainPlayer == null)
            {
                return;
            }


            //如果挂机打指定怪的时候跑到别的地方 找不到指定怪则不打指定怪了
            if (m_nTargetID != 0)
            {
                IEntitySystem es  = ControllerSystem.m_ClientGlobal.GetEntitySystem();
                INPC          npc = es.FindNPCByBaseId(m_nTargetID);
                if (npc == null)
                {
                    m_nTargetID = 0;
                }
            }

            ChangeStatus(CombatRobotStatus.RUNNING);
            ChangeRoleAction(RoleAction.NONE);
            if (bShowTip)
            {
                Client.ITipsManager tip = ControllerSystem.m_ClientGlobal.GetTipsManager();
                if (tip != null)
                {
                    tip.ShowTipsById(702);
                }
            }

            m_centerPos = mainPlayer.GetPos();
            m_fStopTime = 0;

            AddEventListener(GameEventID.SKILLINFO_REFRESH);
            AddEventListener(GameEventID.SKILLNONESTATE_ENTER);
            AddEventListener(GameEventID.ROBOTCOMBAT_NEXTCMD);

            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.ROBOTCOMBAT_START, null);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 玩家现在是否是变身状态
        /// </summary>
        /// <returns></returns>
        bool IsChangeBody()
        {
            IPlayer mainPlayer = ControllerSystem.m_ClientGlobal.MainPlayer;

            if (mainPlayer != null)
            {
                bool isChangeBody = (bool)mainPlayer.SendMessage(Client.EntityMessage.EntityCommand_IsChange, null);

                if (isChangeBody)
                {
                    Client.ITipsManager tip = ControllerSystem.m_ClientGlobal.GetTipsManager();
                    if (tip != null)
                    {
                        tip.ShowTips("变身后不可使用技能");
                    }
                }

                return(isChangeBody);
            }
            return(false);
        }
Exemplo n.º 5
0
        private void OnPause(bool bShowTip)
        {
            if (m_status == CombatRobotStatus.PAUSE)
            {
                return;
            }

            ChangeStatus(CombatRobotStatus.PAUSE);
            ChangeRoleAction(RoleAction.NONE);
            if (bShowTip)
            {
                Client.ITipsManager tip = ControllerSystem.m_ClientGlobal.GetTipsManager();
                if (tip != null)
                {
                    tip.ShowTipsById(701);
                }
            }
            CmdManager.Instance().Clear();//清空指令
            RemoveListener(GameEventID.SKILLINFO_REFRESH);
            RemoveListener(GameEventID.SKILLNONESTATE_ENTER);
            RemoveListener(GameEventID.ROBOTCOMBAT_NEXTCMD);
        }
Exemplo n.º 6
0
        private void OnStart(bool bShowTip)
        {
            IPlayer mainPlayer = ControllerSystem.m_ClientGlobal.MainPlayer;

            if (mainPlayer == null)
            {
                return;
            }
            m_ActiveCtrl = ControllerSystem.m_ClientGlobal.GetControllerSystem().GetActiveCtrl();

            m_centerPos = mainPlayer.GetPos();

            if (m_status == CombatRobotStatus.PAUSE)
            {
                OnResume(false);
                return;
            }
            if (m_status != CombatRobotStatus.STOP)
            {
                return;
            }
            if (Engine.RareEngine.Instance().Root != null && m_CombatRobotMono == null)
            {
                m_CombatRobotMono = Engine.RareEngine.Instance().Root.AddComponent <CombatRobotMono>();
            }

            InitSkill();
            //如果在移动 立即停止
            StopMove();

            AddEventListener(GameEventID.SKILLNONESTATE_ENTER);      //播放完技能
            AddEventListener(GameEventID.ROBOTCOMBAT_NEXTCMD);       //技能连招
            AddEventListener(GameEventID.SKILLGUIDE_PROGRESSBREAK);  //技能使用失败
            AddEventListener(GameEventID.JOYSTICK_UNPRESS);          //摇杆松开
            AddEventListener(GameEventID.JOYSTICK_PRESS);            //摇杆按下
            AddEventListener(GameEventID.ENTITYSYSTEM_REMOVEENTITY); //物品拾取
            AddEventListener(GameEventID.ENTITYSYSTEM_CREATEENTITY); //物品拾取


            AddEventListener(GameEventID.SKILLSYSTEM_ADDSKILL);//技能刷新
            AddEventListener(GameEventID.SKILLSYSTEM_SKILLLISTCHANE);
            AddEventListener(GameEventID.NETWORK_CONNECTE_CLOSE);
            AddEventListener(GameEventID.RECONNECT_SUCESS);
            AddEventListener(GameEventID.SKILLSYSTEM_STIFFTIMEOVER);
            Client.ITipsManager tip = ControllerSystem.m_ClientGlobal.GetTipsManager();
            if (tip != null && bShowTip)
            {
                tip.ShowTips("开始挂机!!!");
            }

            ChangeStatus(CombatRobotStatus.RUNNING);
            ChangeRoleAction(RoleAction.NONE);

            //DoNextCMD();

            SetTimer(COMBAT_TIMEID, COMBAT_TIME_INTERVAL);

            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.ROBOTCOMBAT_START, null);

            UnityEngine.Debug.Log("start....");
        }