Пример #1
0
    // 寻路找怪处理
    void FindEnamyTick()
    {
        if (m_bNotEnamyNpcFlag != 0)
        {
            return;
        }
        //如果有目标名字则寻找该目标,进行交互
        if (m_Path.AutoSearchTargetName != "")
        {
            Obj_Character obj = Singleton <ObjManager> .GetInstance().FindObjCharacterInSceneByName(m_Path.AutoSearchTargetName);

            if (obj && obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_NPC)
            {
                Obj_NPC objNpc = obj as Obj_NPC;
                //根据目标NPC的势力确认是对话还是攻击
                if (Reputation.IsEnemy(objNpc) || Reputation.IsNeutral(objNpc))
                {
                    Singleton <ObjManager> .GetInstance().MainPlayer.StopMove();

                    m_Path.AutoSearchPosCache.Clear();
                    m_Path.ResetPath();
                    IsAutoSearching = false;
                    m_EndPointCache.Clean();

                    //如果是地方NPC,则开始攻击
                    Singleton <ObjManager> .GetInstance().MainPlayer.OnSelectTarget(objNpc.gameObject);

                    Singleton <ObjManager> .GetInstance().MainPlayer.OnEnterCombat(objNpc.GetComponent <Obj_Character>());

                    m_bNotEnamyNpcFlag = 1;

                    // 杀怪任务寻路结束,如果没在自动战斗状态,则进入自动战斗
                    Obj_MainPlayer mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

                    if (null != mainPlayer && !mainPlayer.GetAutoCombatState() && Singleton <ObjManager> .Instance.MainPlayer.IsOpenCabalAuto)
                    {
                        mainPlayer.EnterAutoCombat();
                        GameManager.gameManager.MissionManager.MissionAutoCombat = true;
                    }
                }
                else
                {
                    m_bNotEnamyNpcFlag = 2;
                    return;
                }
            }
        }
    }
Пример #2
0
    /*
     * public void OpenWindow()
     * {
     *  if (Singleton<ObjManager>.GetInstance().MainPlayer.Controller)
     *  {
     *      m_AutoFightOpenToggle.value = Singleton<ObjManager>.GetInstance().MainPlayer.Controller.CombatFlag;
     *  }
     * }
     */
    public void AutoFightOK()
    {
        //LogModule.DebugLog("AutoFightOK:"+m_AutoFightOpenToggle.value);
        Obj_MainPlayer User = Singleton <ObjManager> .Instance.MainPlayer;

        if (User)   //更新信息
        {
            if (VipData.GetVipLv() >= m_viplimit && User.BaseAttr.Level >= GlobeVar.MAX_AUTOEQUIT_LIVE)
            {
                User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP1, m_AutoFightBaiSe.value);
                User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP2, m_AutoFightYouXiu.value);
                User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP3, m_AutoFightJingLiang.value);
                // User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP4, m_AutoFightShiShi.value);
                //  User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP5, m_AutoFightChuanQi.value);
                //  User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_STUFF, m_AutoFightZhengQi.value);
                // User.SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_OTHER, m_AutoFightQiTa.value);
            }
            User.AutoInviteTeamAccept = m_AutoFightTeam.value;
            User.AutoActivityAccept   = m_AutoActivity.value;
            User.AutoJoinTeamAccept   = m_AutoFightReqTeam.value;
            User.AutoHpPercent        = m_AutoFightInfoHpSlider.value;
            User.AutoMpPercent        = m_AutoFightInfoMppSlider.value;
            //User.AutoRadius = (int)(m_AutoFightInfoSearchSlider.value * 100);
            // User.AutoBuyDrug = m_AutoFightDrug.value;

            User.ServerAutoInfo();

            if (m_IsAutoFight == true)
            {
                User.EnterAutoCombat();
            }
            else
            {
                User.LeveAutoCombat();
            }


            if (null != FunctionButtonLogic.Instance())
            {
                FunctionButtonLogic.Instance().UpdateAutoFightBtnState();
            }
        }
    }
Пример #3
0
    public void OnOpenAFK()
    {
        if (m_bOpening)
        {
            return;
        }

        Obj_MainPlayer mainPalyer = Singleton <ObjManager> .Instance.MainPlayer;

        if (null == mainPalyer)
        {
            return;
        }
        if (mainPalyer.IsOpenAutoCombat)
        {
            mainPalyer.LeveAutoCombat();
        }
        else
        {
            mainPalyer.EnterAutoCombat();
        }
    }