Exemplo n.º 1
0
        // Function from file: turf.dm
        public override bool Enter(Ent_Dynamic O = null, Ent_Static oldloc = null)
        {
            Obj         obstacle        = null;
            ByTable     large_dense     = null;
            Ent_Dynamic border_obstacle = null;
            Ent_Dynamic obstacle2       = null;


            if (!(O != null))
            {
                return(true);
            }

            if (O.loc is Tile)
            {
                foreach (dynamic _a in Lang13.Enumerate(O.loc, typeof(Obj)))
                {
                    obstacle = _a;


                    if (!obstacle.CheckExit(O, this) && obstacle != O && obstacle != oldloc)
                    {
                        O.Bump(obstacle, 1);
                        return(false);
                    }
                }
            }
            large_dense = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(this, typeof(Ent_Dynamic)))
            {
                border_obstacle = _b;


                if (Lang13.Bool(border_obstacle.flags & 512))
                {
                    if (!border_obstacle.CanPass(O, O.loc, 1) && oldloc != border_obstacle)
                    {
                        O.Bump(border_obstacle, 1);
                        return(false);
                    }
                }
                else
                {
                    large_dense.Add(border_obstacle);
                }
            }

            if (!this.CanPass(O, this))
            {
                O.Bump(this, 1);
                return(false);
            }

            foreach (dynamic _c in Lang13.Enumerate(large_dense, typeof(Ent_Dynamic)))
            {
                obstacle2 = _c;


                if (!obstacle2.CanPass(O, O.loc, 1) && oldloc != obstacle2)
                {
                    O.Bump(obstacle2, 1);
                    return(false);
                }
            }
            return(true);
        }