Exemplo n.º 1
0
        private void FollowMaster()
        {
            Vector3 pos = GetDistination();

            if (Mathf.Abs(pos.x - transform.position.x + pos.y - transform.position.y) > MaxDistance - 0.1f)
            {
                MeController.MoveTo(pos.x, pos.y);
            }
        }
Exemplo n.º 2
0
        void Update()
        {
            if (AttackList.Count > 0 && (MeController.StatuController.CurrentStatu == Status.IDLE || MeController.StatuController.CurrentStatu == Status.RUN))
            {
                CurVo = AttackList[0];
                AttackList.RemoveAt(0);
                switch (CurVo.ActionType)
                {
                case Actions.RUN:
                    MeController.MoveTo(CurVo.RunDestination.x, CurVo.RunDestination.y);
                    break;

                case Actions.DEATH:
                    MeController.StatuController.SetStatu(Status.DEATH);
                    break;

                case Actions.ATTACK:
                    if (Math.Abs(CurVo.TargetPoint.x) > 0)
                    {
                        int dir = CurVo.TargetPoint.x < MeController.Me.GoBase.transform.position.x ? Directions.Left : Directions.Right;
                        MeController.Me.ChangeDire(dir);
                    }
                    MeController.SkillController.RequestUseSkill(SkillController.Attack1);
                    //宠物暂时只做一次攻击

                    /*if (MeController.StatuController.CurrentCombStatu == Status.COMB_0 || MeController.StatuController.CurrentCombStatu == Status.COMB_2)
                     * {
                     *  MeController.SkillController.RequestUseSkill(SkillController.Attack1);
                     * }
                     * else if (MeController.StatuController.CurrentCombStatu == Status.COMB_1)
                     * {
                     *  MeController.SkillController.RequestUseSkill(SkillController.Attack2);
                     * }*/
                    break;
                }
            }
            if (AttackList.Count > 0 && (MeController.StatuController.CurrentStatu == Status.HURT1 || MeController.StatuController.CurrentStatu == Status.HURT2 ||
                                         MeController.StatuController.CurrentStatu == Status.HURT3))
            {
                CurVo = AttackList[0];
                if (CurVo.ActionType == Actions.DEATH)
                {
                    AttackList.Clear();
                    MeController.StatuController.SetStatu(Status.DEATH);
                }
            }
            if (AttackList.Count > 0 && MeController.StatuController.CurrentStatu == Status.HURTDOWN)
            {
                CurVo = AttackList[0];
                if (CurVo.ActionType == Actions.DEATH)
                {
                    AttackList.Clear();
                    Invoke("Death", 0.3f);
                }
            }
        }
        private void Update()
        {
            if (MapMode.StartAutoMove || MeController.StatuController.CurrentStatu == Status.DEATH)
            {
                AttackList.Clear(); //切图的过程中情况攻击列表
            }

            if ((MeController.StatuController.CurrentCombStatu >= MeController.StatuController.MaxComb &&
                 MeController.StatuController.MaxComb > 1) || MeController.StatuController.CurrentStatu == Status.Win)
            {
                if (NeedClear())
                {
                    AttackList.Clear();
                }
            }
            if (AttackList.Count > 0 &&
                (MeController.StatuController.CurrentStatu == Status.IDLE ||
                 MeController.StatuController.CurrentStatu == Status.RUN) &&
                MeController.SkillController.SkillList.Count == 0)
            {
                CurVo = AttackList[0];
                AttackList.RemoveAt(0);
                switch (CurVo.ActionType)
                {
                case Actions.RUN:
                    MeController.MoveTo(CurVo.RunDestination.x, CurVo.RunDestination.y);
                    break;

                case Actions.DEATH:
                    MeController.StatuController.SetStatu(Status.DEATH);
                    break;

                case Actions.ATTACK:
                    if (MeController.StatuController.CurrentCombStatu == Status.COMB_0 ||
                        (MeController.StatuController.CurrentCombStatu == MeController.StatuController.MaxComb))
                    {
                        MeController.SkillController.RequestUseSkill(SkillController.Attack1);
                    }
                    else if (MeController.StatuController.CurrentCombStatu == Status.COMB_1)
                    {
                        MeController.SkillController.RequestUseSkill(SkillController.Attack2);
                    }
                    else if (MeController.StatuController.CurrentCombStatu == Status.COMB_2)
                    {
                        MeController.SkillController.RequestUseSkill(SkillController.Attack3);
                    }
                    else if (MeController.StatuController.CurrentCombStatu == Status.COMB_3)
                    {
                        MeController.SkillController.RequestUseSkill(SkillController.Attack4);
                    }
                    break;
                }
            }
        }
Exemplo n.º 4
0
        private void DoIdleLogic()
        {
            int mapType = AppMap.Instance.mapParser.MapVo.type;

            if (mapType == MapTypeConst.CITY_MAP)
            {
                FollowMaster();
            }
            else if (mapType == MapTypeConst.COPY_MAP && _idleTime > 1)
            {
                _idleTime = 0;
                var destination = GetMoveDestination();
                MeController.MoveTo(destination.x, destination.y);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        ///     移动到攻击范围内
        /// </summary>
        /// <param name="enemyDisplay"></param>
        private void MoveToAttackRange(ActionDisplay enemyDisplay)
        {
            Vector3 mePoint = _meTransform.position;
            var     pos     = enemyDisplay.Controller.transform.position;

            if (mePoint.x < pos.x)
            {
                pos.x = pos.x - _talentSkillVo.cover_width * 0.001f + 0.1f;
            }
            else
            {
                pos.x = pos.x + _talentSkillVo.cover_width * 0.001f - 0.1f;
            }
            MeController.MoveTo(pos.x, pos.y);
        }
Exemplo n.º 6
0
 public void OnTriggerEnter(Collider other)
 {
     if ("MeDisplay(Clone)" == other.collider.gameObject.name)
     {
         State.KEEP_IDLE = true;
         if (true == State.ON_JUMP)  //在跳的过程中
         {
             Vector3 v = (ToolsFunction.EqualFloat(other.transform.eulerAngles.y, 90) == true ? new Vector3(73, 2.3f, 57) : new Vector3(25, 2.3f, 11));
             MeController.MoveTo(other.gameObject, v, 2f);
             other.gameObject.GetComponent <Animation>().Play(State.ANIM_HANDS_UP);
             ToolsFunction.AddScore(DataConst.SCORE_LINE);//加分
         }
         else
         {
             other.transform.position -= 0.1f * ToolsFunction.Toward(other.gameObject); //现在人就是往后退了,然后应该会重新检测吧!!!!
             ToolsFunction.AddScore(-DataConst.SCORE_LINE / 2);                         //减分
         }
     }
 }
Exemplo n.º 7
0
        private void Update()
        {
            if (AttackList.Count > 0 &&
                ((MeController.StatuController.CurrentStatu == Status.IDLE &&
                  MeController.StatuController.CurStatuNameHash == Status.NAME_HASH_IDLE) ||
                 (MeController.StatuController.CurrentStatu == Status.RUN ||
                  MeController.StatuController.CurStatuNameHash == Status.NAME_HASH_RUN)))
            {
                CurVo = AttackList[0];
                AttackList.RemoveAt(0);
                switch (CurVo.ActionType)
                {
                case Actions.RUN:

                    MeController.MoveTo(CurVo.RunDestination.x, CurVo.RunDestination.y);
                    break;

                case Actions.DEATH:
                    MeController.StatuController.SetStatu(Status.DEATH);
                    break;

                case Actions.ATTACK:
                    if (Math.Abs(CurVo.TargetPoint.x) > 0)
                    {
                        int dir = CurVo.TargetPoint.x < MeController.Me.GoBase.transform.position.x
                                ? Directions.Left
                                : Directions.Right;
                        MeController.Me.ChangeDire(dir);
                    }
                    //怪物只有两连击
                    if (MeController.StatuController.CurrentCombStatu == Status.COMB_0 ||
                        MeController.StatuController.CurrentCombStatu == Status.COMB_2)
                    {
                        print("****SkillController.Attack1");
                        MeController.SkillController.RequestUseSkill(SkillController.Attack1);
                    }
                    else if (MeController.StatuController.CurrentCombStatu == Status.COMB_1)
                    {
                        print("****SkillController.Attack2");
                        MeController.SkillController.RequestUseSkill(SkillController.Attack2);
                    }
                    break;
                }
            }
            if (AttackList.Count > 0 &&
                (MeController.StatuController.CurrentStatu == Status.HURT1 ||
                 MeController.StatuController.CurrentStatu == Status.HURT2 ||
                 MeController.StatuController.CurrentStatu == Status.HURT3))
            {
                CurVo = AttackList[0];
                if (CurVo.ActionType == Actions.DEATH)
                {
                    AttackList.Clear();
                    MeController.StatuController.SetStatu(Status.DEATH);
                }
            }
            if (AttackList.Count > 0 && MeController.StatuController.CurrentStatu == Status.HURTDOWN)
            {
                CurVo = AttackList[0];
                if (CurVo.ActionType == Actions.DEATH)
                {
                    AttackList.Clear();
                    Invoke("Death", 0.3f);
                }
            }
        }