예제 #1
0
        // Function from file: gravitygenerator.dm
        public override dynamic Destroy(  )
        {
            Obj_Machinery_GravityGenerator_Part O = null;

            this.investigate_log("was destroyed!", "gravity");
            this.on = false;
            this.update_list();

            foreach (dynamic _a in Lang13.Enumerate(this.parts, typeof(Obj_Machinery_GravityGenerator_Part)))
            {
                O = _a;

                O.main_part = null;
                GlobalFuncs.qdel(O);
            }
            return(base.Destroy());
        }
예제 #2
0
        // Function from file: gravitygenerator.dm
        public void setup_parts(  )
        {
            dynamic our_turf    = null;
            ByTable spawn_turfs = null;
            int     count       = 0;
            dynamic T           = null;
            Obj_Machinery_GravityGenerator_Part part = null;

            our_turf    = GlobalFuncs.get_turf(this);
            spawn_turfs = Map13.FetchInBlock(Map13.GetTile(Convert.ToInt32(our_turf.x - 1), Convert.ToInt32(our_turf.y + 2), Convert.ToInt32(our_turf.z)), Map13.GetTile(Convert.ToInt32(our_turf.x + 1), Convert.ToInt32(our_turf.y), Convert.ToInt32(our_turf.z)));
            count       = 10;

            foreach (dynamic _a in Lang13.Enumerate(spawn_turfs))
            {
                T = _a;

                count--;

                if (T == our_turf)
                {
                    continue;
                }
                part = new Obj_Machinery_GravityGenerator_Part(T);

                if (count == 5)
                {
                    this.middle = part;
                }

                if (count <= 3)
                {
                    part.density = false;
                    part.layer   = 401;
                }
                part.sprite_number = count;
                part.main_part     = this;
                this.parts.Add(part);
                part.update_icon();
            }
            return;
        }