コード例 #1
0
        // Function from file: closets.dm
        public bool can_close(  )
        {
            Obj_Structure_Closet closet = null;


            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Obj_Structure_Closet)))
            {
                closet = _a;


                if (closet != this && !closet.wall_mounted)
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
        // Function from file: tgstation.dme
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic              T    = null;
            Obj_Machinery_Door   door = null;
            Obj_Structure_Closet C    = null;

            thearea.WriteMsg(new Sound("sound/magic/Knock.ogg"));

            foreach (dynamic _c in Lang13.Enumerate(targets))
            {
                T = _c;


                foreach (dynamic _a in Lang13.Enumerate(T.contents, typeof(Obj_Machinery_Door)))
                {
                    door = _a;

                    Task13.Schedule(1, (Task13.Closure)(() => {
                        if (door is Obj_Machinery_Door_Airlock)
                        {
                            ((dynamic)door).locked = 0;
                        }
                        door.open();
                        return;
                    }));
                }

                foreach (dynamic _b in Lang13.Enumerate(T.contents, typeof(Obj_Structure_Closet)))
                {
                    C = _b;

                    Task13.Schedule(1, (Task13.Closure)(() => {
                        C.locked = false;
                        C.open();
                        return;
                    }));
                }
            }
            return(false);
        }
        // Function from file: revenant_abilities.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic T     = null;
            dynamic floor = null;
            Obj_Structure_Closet        closet       = null;
            Obj_Structure_Bodycontainer corpseholder = null;
            Obj_Machinery_DnaScannernew dna          = null;
            Obj_Structure_Window        window       = null;
            Obj_Machinery_Light         light        = null;


            if (this.attempt_cast(thearea))
            {
                foreach (dynamic _f in Lang13.Enumerate(targets))
                {
                    T = _f;

                    Task13.Schedule(0, (Task13.Closure)(() => {
                        if (Lang13.Bool(T.flags & 1))
                        {
                            T.flags -= 1;
                            GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), T);
                        }

                        if (!(T is Tile_Simulated_Floor_Plating) && !(T is Tile_Simulated_Floor_Engine_Cult) && T is Tile_Simulated_Floor && Rand13.PercentChance(15))
                        {
                            floor = T;

                            if (floor.intact)
                            {
                                floor.builtin_tile.loc = floor;
                            }
                            floor.broken = 0;
                            floor.burnt  = false;
                            ((Tile_Simulated_Floor)floor).make_plating(true);
                        }

                        if (!(T is Tile_Simulated_Wall_Shuttle) && !(T is Tile_Simulated_Wall_Cult) && !(T is Tile_Simulated_Wall_Rust) && !(T is Tile_Simulated_Wall_RWall) && T is Tile_Simulated_Wall && Rand13.PercentChance(15))
                        {
                            GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), T);
                            ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall_Rust));
                        }

                        if (!(T is Tile_Simulated_Wall_RWall_Rust) && T is Tile_Simulated_Wall_RWall && Rand13.PercentChance(15))
                        {
                            GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), T);
                            ((Tile)T).ChangeTurf(typeof(Tile_Simulated_Wall_RWall_Rust));
                        }

                        foreach (dynamic _a in Lang13.Enumerate(T.contents, typeof(Obj_Structure_Closet)))
                        {
                            closet = _a;

                            closet.open();
                        }

                        foreach (dynamic _b in Lang13.Enumerate(T.contents, typeof(Obj_Structure_Bodycontainer)))
                        {
                            corpseholder = _b;


                            if (corpseholder.connected.loc == corpseholder)
                            {
                                corpseholder.open();
                            }
                        }

                        foreach (dynamic _c in Lang13.Enumerate(T.contents, typeof(Obj_Machinery_DnaScannernew)))
                        {
                            dna = _c;

                            dna.open_machine();
                        }

                        foreach (dynamic _d in Lang13.Enumerate(T.contents, typeof(Obj_Structure_Window)))
                        {
                            window = _d;

                            window.hit(Rand13.Int(50, 90));

                            if (window != null && window.fulltile)
                            {
                                GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant_Cracks), window.loc);
                            }
                        }

                        foreach (dynamic _e in Lang13.Enumerate(T.contents, typeof(Obj_Machinery_Light)))
                        {
                            light = _e;

                            light.flicker(20);
                        }
                        return;
                    }));
                }
            }
            return(false);
        }