Ejemplo n.º 1
0
 public Data_ActionConfig GetCharacterCurActionConfig(List <int> action_list, int anim_set_type)
 {
     for (int i = 0; i < action_list.Count; ++i)
     {
         Data_ActionConfig action_config = GetDataById(action_list[i]);
         if (action_config != null && (anim_set_type == -1 || action_config.m_AnimSetType == anim_set_type))
         {
             return(action_config);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        private float GetRunSpeed(NpcInfo info)
        {
            Data_ActionConfig ac = info.GetCurActionConfig();

            if (null != ac)
            {
                return(ac.m_FastStdSpeed);
            }
            else
            {
                LogSystem.Error("AiLogic_Demo_Melee can't find CurActionConfig");
            }
            return(0.0f);
        }
Ejemplo n.º 3
0
        protected void GetAnimationDirAndSpeed(MovementMode mode, RelMoveDir rmd, float move_speed, out Animation_Type at, out float speed_factor)
        {
            Data_ActionConfig action_config = m_CurActionConfig;

            if (mode == MovementMode.LowSpeed)
            {
                at = Animation_Type.AT_SlowMove;
            }
            else if (mode == MovementMode.HighSpeed)
            {
                at = Animation_Type.AT_FastMove;
            }
            else
            {
                at = new Animation_Type[] {
                    Animation_Type.AT_Idle0,            // N
                    Animation_Type.AT_RunForward,       // F
                    Animation_Type.AT_RunBackward,      // B
                    Animation_Type.AT_Idle0,            // N
                    Animation_Type.AT_RunLeft,          // L
                    Animation_Type.AT_RunForwardLeft,   // LF
                    Animation_Type.AT_RunBackwardLeft,  // BL
                    Animation_Type.AT_Idle0,            // N
                    Animation_Type.AT_RunRight,         // R
                    Animation_Type.AT_RunForwardRight,  // FR
                    Animation_Type.AT_RunBackwardRight, // BR
                }[(int)rmd];
            }
            //                           N    F   B       N   L       LF      BL      N   R       FR      BR
            //speed_factor = new float[] { 0f, 1f, 1 / 2f, 0f, 3 / 4f, 7 / 8f, 5 / 8f, 0f, 3 / 4f, 7 / 8f, 5 / 8f }[(int)rmd];
            if (action_config != null)
            {
                if (mode == MovementMode.LowSpeed)
                {
                    speed_factor = move_speed / action_config.m_SlowStdSpeed;
                }
                else if (mode == MovementMode.HighSpeed)
                {
                    speed_factor = move_speed / action_config.m_FastStdSpeed;
                }
                else
                {
                    speed_factor = new float[] {
                        0f,                                                    //N
                        move_speed / action_config.m_ForwardStdSpeed,          //F
                        move_speed / action_config.m_BackStdSpeed,             //B
                        0f,                                                    //N
                        move_speed / action_config.m_LeftRightStdSpeed,        //L
                        move_speed / action_config.m_LeftRightForwardStdSpeed, // LF
                        move_speed / action_config.m_LeftRightBackStdSpeed,    //LB
                        0f,
                        move_speed / action_config.m_LeftRightStdSpeed,        //R
                        move_speed / action_config.m_LeftRightForwardStdSpeed, //RF
                        move_speed / action_config.m_LeftRightBackStdSpeed     //RB
                    }[(int)rmd];
                }
            }
            else
            {
                speed_factor = 1.0f;
            }
        }