示例#1
0
        // Function from file: lightreplacer.dm
        public void ReplaceLight(Obj_Machinery_Light target = null, dynamic U = null)
        {
            dynamic L1 = null;
            dynamic L2 = null;


            if (target.status != 0)
            {
                if (this.CanUse(U))
                {
                    if (!this.Use(U))
                    {
                        return;
                    }
                    U.WriteMsg(new Txt("<span class='notice'>You replace the ").item(target.fitting).str(" with ").the(this).item().str(".</span>").ToString());

                    if (target.status != 1)
                    {
                        L1                 = Lang13.Call(target.light_type, target.loc);
                        L1.status          = target.status;
                        L1.rigged          = target.rigged;
                        L1.brightness      = target.brightness;
                        L1.switchcount     = target.switchcount;
                        target.switchcount = 0;
                        L1.update();
                        target.status = 1;
                        target.update();
                    }
                    L2                 = Lang13.Call(target.light_type);
                    target.status      = Convert.ToInt32(L2.status);
                    target.switchcount = Convert.ToInt32(L2.switchcount);
                    target.rigged      = this.emagged;
                    target.brightness  = L2.brightness;
                    target.on          = target.has_power();
                    target.update();
                    GlobalFuncs.qdel(L2);

                    if (target.on && target.rigged)
                    {
                        target.explode();
                    }
                    return;
                }
                else
                {
                    U.WriteMsg(this.failmsg);
                    return;
                }
            }
            else
            {
                U.WriteMsg("<span class='warning'>There is a working " + target.fitting + " already inserted!</span>");
                return;
            }
            return;
        }
        // Function from file: shriek.dm
        public override dynamic sting_action(Mob user = null, Ent_Static target = null)
        {
            Obj_Machinery_Light L = null;


            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(Task13.User, 5), typeof(Obj_Machinery_Light)))
            {
                L = _a;

                L.on = true;
                L.broken();
            }
            GlobalFuncs.empulse(GlobalFuncs.get_turf(user), 2, 5, true);
            return(1);
        }
示例#3
0
        // Function from file: shriek.dm
        public override dynamic sting_action(Mob user = null, Ent_Static target = null)
        {
            Mob_Living          M = null;
            Obj_Machinery_Light L = null;


            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_hearers_in_view(4, user), typeof(Mob_Living)))
            {
                M = _a;


                if (M is Mob_Living_Carbon)
                {
                    if (!(M.mind != null) || !(M.mind.changeling != null))
                    {
                        M.adjustEarDamage(0, 30);
                        M.confused += 25;
                        M.Jitter(50);
                    }
                    else
                    {
                        M.WriteMsg(new Sound("sound/effects/screech.ogg"));
                    }
                }

                if (M is Mob_Living_Silicon)
                {
                    M.WriteMsg(new Sound("sound/weapons/flash.ogg"));
                    M.Weaken(Rand13.Int(5, 10));
                }
            }

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRange(user, 4), typeof(Obj_Machinery_Light)))
            {
                L = _b;

                L.on = true;
                L.broken();
            }
            GlobalFuncs.feedback_add_details("changeling_powers", "RS");
            return(1);
        }
示例#4
0
        // Function from file: prison_break.dm
        public override bool start(  )
        {
            dynamic             A = null;
            Obj_Machinery_Light L = null;


            foreach (dynamic _b in Lang13.Enumerate(this.prisonAreas))
            {
                A = _b;


                foreach (dynamic _a in Lang13.Enumerate(A, typeof(Obj_Machinery_Light)))
                {
                    L = _a;

                    L.flicker(10);
                }
            }
            return(false);
        }
示例#5
0
        // Function from file: statue.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic             T = null;
            Obj_Machinery_Light L = null;


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


                foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Machinery_Light)))
                {
                    L = _a;

                    L.flicker();
                }
            }
            return(false);
        }
示例#6
0
        // Function from file: lighting.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic coil = null;

            this.add_fingerprint(user);

            switch ((int)(this.stage))
            {
            case 1:

                if (A is Obj_Item_Weapon_Wrench)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 75, 1);
                    Task13.User.WriteMsg("<span class='notice'>You begin deconstructing " + this + "...</span>");

                    if (!GlobalFuncs.do_after(Task13.User, 30 / A.toolspeed, null, this))
                    {
                        return(null);
                    }
                    new Obj_Item_Stack_Sheet_Metal(GlobalFuncs.get_turf(this.loc), this.sheets_refunded);
                    ((Ent_Static)user).visible_message("" + user.name + " deconstructs " + this + ".", "<span class='notice'>You deconstruct " + this + ".</span>", "<span class='italics'>You hear a ratchet.</span>");
                    GlobalFuncs.playsound(this.loc, "sound/items/Deconstruct.ogg", 75, 1);
                    GlobalFuncs.qdel(this);
                    return(null);
                }

                if (A is Obj_Item_Stack_CableCoil)
                {
                    coil = A;

                    if (Lang13.Bool(coil.use(1)))
                    {
                        switch ((string)(this.fixture_type))
                        {
                        case "tube":
                            this.icon_state = "tube-construct-stage2";
                            break;

                        case "bulb":
                            this.icon_state = "bulb-construct-stage2";
                            break;
                        }
                        this.stage = 2;
                        ((Ent_Static)user).visible_message("" + user.name + " adds wires to " + this + ".", "<span class='notice'>You add wires to " + this + ".</span>");
                    }
                    else
                    {
                        user.WriteMsg("<span class='warning'>You need one length of cable to wire " + this + "!</span>");
                    }
                    return(null);
                }
                break;

            case 2:

                if (A is Obj_Item_Weapon_Wrench)
                {
                    Task13.User.WriteMsg("<span class='warning'>You have to remove the wires first!</span>");
                    return(null);
                }

                if (A is Obj_Item_Weapon_Wirecutters)
                {
                    this.stage = 1;

                    switch ((string)(this.fixture_type))
                    {
                    case "tube":
                        this.icon_state = "tube-construct-stage1";
                        break;

                    case "bulb":
                        this.icon_state = "bulb-construct-stage1";
                        break;
                    }
                    new Obj_Item_Stack_CableCoil(GlobalFuncs.get_turf(this.loc), 1, "red");
                    ((Ent_Static)user).visible_message("" + user.name + " removes the wiring from " + this + ".", "<span class='notice'>You remove the wiring from " + this + ".</span>", "<span class='italics'>You hear clicking.</span>");
                    GlobalFuncs.playsound(this.loc, "sound/items/Wirecutter.ogg", 100, 1);
                    return(null);
                }

                if (A is Obj_Item_Weapon_Screwdriver)
                {
                    ((Ent_Static)user).visible_message("" + user.name + " closes " + this + "'s casing.", "<span class='notice'>You close " + this + "'s casing.</span>", "<span class='italics'>You hear screwing.</span>");
                    GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 75, 1);

                    switch ((string)(this.fixture_type))
                    {
                    case "tube":
                        this.newlight = new Obj_Machinery_Light_Built(this.loc);
                        break;

                    case "bulb":
                        this.newlight = new Obj_Machinery_Light_Small_Built(this.loc);
                        break;
                    }
                    this.newlight.dir = this.dir;
                    this.transfer_fingerprints_to(this.newlight);
                    GlobalFuncs.qdel(this);
                    return(null);
                }
                break;
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }
        // 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);
        }
        // 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;
            Obj_Machinery_Light      L = null;
            EffectSystem_SparkSpread s = null;
            Mob_Living_Carbon_Human  M = null;
            EffectSystem_SparkSpread z = null;


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

                    Task13.Schedule(0, (Task13.Closure)(() => {
                        foreach (dynamic _b in Lang13.Enumerate(T.contents, typeof(Obj_Machinery_Light)))
                        {
                            L = _b;

                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (!L.on)
                                {
                                    return;
                                }
                                L.visible_message(new Txt("<span class='warning'><b>").The(L).item().str(" suddenly flares brightly and begins to spark!</span>").ToString());
                                s = new EffectSystem_SparkSpread();
                                s.set_up(4, 0, L);
                                s.start();
                                GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), L.loc);
                                Task13.Sleep(20);

                                if (!L.on)
                                {
                                    return;
                                }
                                Icon13.Flick("" + L.base_state + "2", L);

                                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInView(L, this.shock_range), typeof(Mob_Living_Carbon_Human)))
                                {
                                    M = _a;


                                    if (M == thearea)
                                    {
                                        continue;
                                    }
                                    L.Beam(M, "purple_lightning", "icons/effects/effects.dmi", 5);
                                    M.electrocute_act(this.shock_damage, "" + L.name, null, true);
                                    z = new EffectSystem_SparkSpread();
                                    z.set_up(4, 0, M);
                                    z.start();
                                    GlobalFuncs.playsound(M, "sound/machines/defib_zap.ogg", 50, 1, -1);
                                }
                                return;
                            }));
                        }
                        return;
                    }));
                }
            }
            return(false);
        }
        // Function from file: shadowling_abilities.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic                  T      = null;
            Obj_Item                 F      = null;
            Obj_Machinery_Light      L      = null;
            Obj_Machinery_Computer   C      = null;
            Obj_Effect_Glowshroom    G      = null;
            Mob_Living               H      = null;
            Mob_Living_Silicon_Robot borgie = null;


            if (!this.shadowling_check(thearea) && !this.admin_override)
            {
                this.revert_cast();
                return(false);
            }
            thearea.WriteMsg("<span class='shadowling'>You silently disable all nearby lights.</span>");

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


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

                    this.extinguishItem(F);
                }

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

                    L.on = false;
                    L.visible_message("<span class='warning'>" + L + " flickers and falls dark.</span>");
                    L.update(false);
                }

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

                    C.SetLuminosity(0);
                    C.visible_message("<span class='warning'>" + C + " grows dim, its screen barely readable.</span>");
                }

                foreach (dynamic _d in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(thearea, 7), typeof(Obj_Effect_Glowshroom)))
                {
                    G = _d;

                    G.visible_message("<span class='warning'>" + G + " withers away!</span>");
                    GlobalFuncs.qdel(G);
                }

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

                    this.extinguishMob(H);
                }

                foreach (dynamic _f in Lang13.Enumerate(T.contents, typeof(Mob_Living_Silicon_Robot)))
                {
                    borgie = _f;

                    borgie.update_headlamp(true);
                }
            }
            return(false);
        }