Beispiel #1
0
        /// <summary>
        /// Returns IsPathBlocked
        /// </summary>
        // Token: 0x06000037 RID: 55 RVA: 0x00004408 File Offset: 0x00002608
        public static bool Go(Entity E, Vector3 Dir, float Accelaration)
        {
            bool IsPathBlocked = false;

            bool[]    FBlocks             = Ground.GetFacingIsAir(E.Position, Physics.Find2DDualDirectionsOfDirection(Dir), Dir);
            Direction MonoFacingDirection = Physics.Find2DUnitDirectionOfDirection(Dir);
            bool      flag = Information.IsNothing(FBlocks);
            bool      Go;

            if (flag)
            {
                Go = true;
            }
            else
            {
                bool flag2 = FBlocks[2];
                if (flag2)
                {
                    bool flag3 = FBlocks[3];
                    if (flag3)
                    {
                        bool flag4 = FBlocks[0];
                        if (flag4)
                        {
                            bool flag5 = FBlocks[1];
                            if (flag5)
                            {
                                bool flag6 = FBlocks[4];
                                if (flag6)
                                {
                                    E.Velocity += Accelaration * Dir;
                                    E.MovedFB   = true;
                                }
                                else
                                {
                                    bool flag7 = MonoFacingDirection == Direction.Left || MonoFacingDirection == Direction.Right;
                                    if (flag7)
                                    {
                                        E.Velocity += Accelaration * Dir * Vector3.Right;
                                        E.MovedFB   = true;
                                    }
                                    else
                                    {
                                        E.Velocity += Accelaration * Dir * Vector3.Backward;
                                        E.MovedFB   = true;
                                    }
                                }
                            }
                            else
                            {
                                bool flag8 = MonoFacingDirection == Direction.Left || MonoFacingDirection == Direction.Right;
                                if (flag8)
                                {
                                    E.Velocity += Accelaration * Dir * Vector3.Right;
                                    E.MovedFB   = true;
                                }
                                else
                                {
                                    bool flag9 = MonoFacingDirection == Direction.Forward || MonoFacingDirection == Direction.Backward;
                                    if (flag9)
                                    {
                                        Controls.Go(E, Actions.Up2);
                                        E.MovedFB = true;
                                    }
                                }
                            }
                        }
                        else
                        {
                            bool flag10 = FBlocks[1];
                            if (flag10)
                            {
                                bool flag11 = MonoFacingDirection == Direction.Left || MonoFacingDirection == Direction.Right;
                                if (flag11)
                                {
                                    Controls.Go(E, Actions.Up2);
                                    E.MovedFB = true;
                                }
                                else
                                {
                                    bool flag12 = MonoFacingDirection == Direction.Forward || MonoFacingDirection == Direction.Backward;
                                    if (flag12)
                                    {
                                        E.Velocity += Accelaration * Dir * Vector3.Backward;
                                        E.MovedFB   = true;
                                    }
                                }
                            }
                            else
                            {
                                Controls.Go(E, Actions.Up2);
                                E.MovedFB = true;
                            }
                        }
                    }
                    else
                    {
                        bool flag13 = FBlocks[2];
                        if (flag13)
                        {
                            bool flag14 = FBlocks[0];
                            if (flag14)
                            {
                                E.Velocity   += Accelaration * Dir * Vector3.Right;
                                E.MovedFB     = true;
                                IsPathBlocked = true;
                            }
                            else
                            {
                                Controls.Go(E, Actions.Up2);
                                E.MovedFB = true;
                            }
                        }
                    }
                }
                else
                {
                    bool flag15 = FBlocks[3];
                    if (flag15)
                    {
                        bool flag16 = FBlocks[3];
                        if (flag16)
                        {
                            bool flag17 = FBlocks[1];
                            if (flag17)
                            {
                                E.Velocity   += Accelaration * Dir * Vector3.Backward;
                                E.MovedFB     = true;
                                IsPathBlocked = true;
                            }
                            else
                            {
                                Controls.Go(E, Actions.Up2);
                                E.MovedFB = true;
                            }
                        }
                    }
                }
                Go = IsPathBlocked;
            }
            return(Go);
        }