Beispiel #1
0
        // Function from file: swarmer.dm
        public void DismantleMachine(Obj_Machinery target = null)
        {
            dynamic D = null;
            Obj_Item_Stack_Sheet_Metal M = null;
            Obj_Item      I = null;
            dynamic       N = null;
            Obj_Machinery C = null;

            this.do_attack_animation(target);
            this.WriteMsg("<span class='info'>We begin to dismantle this machine. We will need to be uninterrupted.</span>");
            D         = GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Swarmer_Dismantle), GlobalFuncs.get_turf(target));
            D.pixel_x = target.pixel_x;
            D.pixel_y = target.pixel_y;
            D.pixel_z = target.pixel_z;

            if (GlobalFuncs.do_mob(this, target, 100))
            {
                this.WriteMsg("<span class='info'>Dismantling complete.</span>");
                M        = new Obj_Item_Stack_Sheet_Metal(target.loc);
                M.amount = 5;

                foreach (dynamic _a in Lang13.Enumerate(target.component_parts, typeof(Obj_Item)))
                {
                    I = _a;

                    I.loc = M.loc;
                }
                N         = GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Swarmer_Disintegration), GlobalFuncs.get_turf(target));
                N.pixel_x = target.pixel_x;
                N.pixel_y = target.pixel_y;
                N.pixel_z = target.pixel_z;
                target.dropContents();

                if (target is Obj_Machinery_Computer)
                {
                    C = target;

                    if (Lang13.Bool(((dynamic)C).circuit))
                    {
                        ((dynamic)C).circuit.loc = M.loc;
                    }
                }
                GlobalFuncs.qdel(target);
            }
            return;
        }
Beispiel #2
0
        // Function from file: air.dm
        public void process_atmos_machinery(  )
        {
            double        seconds = 0;
            Obj_Machinery M       = null;

            seconds = this.wait * 0.1;

            foreach (dynamic _a in Lang13.Enumerate(this.atmos_machinery, typeof(Obj_Machinery)))
            {
                M = _a;


                if (M != null && M.process_atmos(  ) != 26)
                {
                    continue;
                }
                this.atmos_machinery.Remove(M);
            }
            return;
        }
Beispiel #3
0
        // Function from file: areas.dm
        public void power_change(  )
        {
            dynamic       RA = null;
            Obj_Machinery M  = null;


            foreach (dynamic _b in Lang13.Enumerate(this.related))
            {
                RA = _b;


                foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery)))
                {
                    M = _a;

                    M.power_change();
                }
                RA.updateicon();
            }
            return;
        }
Beispiel #4
0
        // Function from file: server.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_Machinery_RND_Server         S = null;
            Obj_Machinery_Computer_Rdconsole C = null;
            Obj_Machinery S2      = null;
            double?       num     = null;
            double?       num2    = null;
            string        choice  = null;
            dynamic       T       = null;
            string        choice2 = null;
            dynamic       D       = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            Task13.User.set_machine(this);

            if (!this.allowed(Task13.User) && !Lang13.Bool(this.emagged))
            {
                Task13.User.WriteMsg("<span class='danger'>You do not have the required access level.</span>");
                return(null);
            }

            if (Lang13.Bool(href_list["main"]))
            {
                this.screen = 0;
            }
            else if (Lang13.Bool(href_list["access"]) || Lang13.Bool(href_list["data"]) || Lang13.Bool(href_list["transfer"]))
            {
                this.temp_server = null;
                this.consoles    = new ByTable();
                this.servers     = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                {
                    S = _a;


                    if (S.server_id == String13.ParseNumber(href_list["access"]) || S.server_id == String13.ParseNumber(href_list["data"]) || S.server_id == String13.ParseNumber(href_list["transfer"]))
                    {
                        this.temp_server = S;
                        break;
                    }
                }

                if (Lang13.Bool(href_list["access"]))
                {
                    this.screen = 1;

                    foreach (dynamic _b in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Rdconsole)))
                    {
                        C = _b;


                        if (C.sync)
                        {
                            this.consoles.Add(C);
                        }
                    }
                }
                else if (Lang13.Bool(href_list["data"]))
                {
                    this.screen = 2;
                }
                else if (Lang13.Bool(href_list["transfer"]))
                {
                    this.screen = 3;

                    foreach (dynamic _c in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_RND_Server)))
                    {
                        S2 = _c;


                        if (S2 == this)
                        {
                            continue;
                        }
                        this.servers.Add(S2);
                    }
                }
            }
            else if (Lang13.Bool(href_list["upload_toggle"]))
            {
                num = String13.ParseNumber(href_list["upload_toggle"]);

                if (this.temp_server.id_with_upload.Contains(num))
                {
                    this.temp_server.id_with_upload.Remove(num);
                }
                else
                {
                    this.temp_server.id_with_upload.Add(num);
                }
            }
            else if (Lang13.Bool(href_list["download_toggle"]))
            {
                num2 = String13.ParseNumber(href_list["download_toggle"]);

                if (this.temp_server.id_with_download.Contains(num2))
                {
                    this.temp_server.id_with_download.Remove(num2);
                }
                else
                {
                    this.temp_server.id_with_download.Add(num2);
                }
            }
            else if (Lang13.Bool(href_list["reset_tech"]))
            {
                choice = Interface13.Alert("Technology Data Reset", "Are you sure you want to reset this technology to its default data? Data lost cannot be recovered.", "Continue", "Cancel");

                if (choice == "Continue")
                {
                    T = this.temp_server.files.known_tech[href_list["reset_tech"]];

                    if (Lang13.Bool(T))
                    {
                        T.level = 1;
                    }
                }
                this.temp_server.files.RefreshResearch();
            }
            else if (Lang13.Bool(href_list["reset_design"]))
            {
                choice2 = Interface13.Alert("Design Data Deletion", "Are you sure you want to delete this design? If you still have the prerequisites for the design, it'll reset to its base reliability. Data lost cannot be recovered.", "Continue", "Cancel");

                if (choice2 == "Continue")
                {
                    D = this.temp_server.files.known_designs[href_list["reset_design"]];

                    if (Lang13.Bool(D))
                    {
                        this.temp_server.files.known_designs.Remove(D.id);
                    }
                }
                this.temp_server.files.RefreshResearch();
            }
            this.updateUsrDialog();
            return(null);
        }
        public void Wrap(  )
        {
            ByTable    choices         = null;
            Mob_Living L               = null;
            Obj        O               = null;
            Obj_Effect_Spider_Cocoon C = null;
            bool          large_cocoon = false;
            Obj_Item      I            = null;
            Obj_Structure S            = null;
            Obj_Machinery M            = null;
            Mob_Living    L2           = null;


            if (this.stat == 2)
            {
                return;
            }

            if (!Lang13.Bool(this.cocoon_target))
            {
                choices = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInView(this, 1), typeof(Mob_Living)))
                {
                    L = _a;


                    if (L == this)
                    {
                        continue;
                    }

                    if (this.Adjacent(L))
                    {
                        choices.Add(L);
                    }
                }

                foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj)))
                {
                    O = _b;


                    if (this.Adjacent(O))
                    {
                        choices.Add(O);
                    }
                }
                this.cocoon_target = Interface13.Input(this, "What do you wish to cocoon?", null, null, null | choices, InputType.Any);
            }

            if (Lang13.Bool(this.cocoon_target) && this.busy != 4)
            {
                this.busy = 4;
                this.visible_message(new Txt("<span class='notice'>").the(this).item().str(" begins to secrete a sticky substance around ").the(this.cocoon_target).item().str(".</span>").ToString());
                this.stop_automated_movement = true;
                Map13.Walk(this, 0, 0);

                if (GlobalFuncs.do_after(this, 50, null, this))
                {
                    if (this.busy == 4)
                    {
                        if (Lang13.Bool(this.cocoon_target) && this.cocoon_target.loc is Tile && Map13.GetDistance(this, this.cocoon_target) <= 1)
                        {
                            C            = new Obj_Effect_Spider_Cocoon(this.cocoon_target.loc);
                            large_cocoon = false;
                            C.pixel_x    = Convert.ToInt32(this.cocoon_target.pixel_x);
                            C.pixel_y    = Convert.ToInt32(this.cocoon_target.pixel_y);

                            foreach (dynamic _c in Lang13.Enumerate(C.loc, typeof(Obj_Item)))
                            {
                                I = _c;

                                I.loc = C;
                            }

                            foreach (dynamic _d in Lang13.Enumerate(C.loc, typeof(Obj_Structure)))
                            {
                                S = _d;


                                if (!Lang13.Bool(S.anchored))
                                {
                                    S.loc        = C;
                                    large_cocoon = true;
                                }
                            }

                            foreach (dynamic _e in Lang13.Enumerate(C.loc, typeof(Obj_Machinery)))
                            {
                                M = _e;


                                if (!Lang13.Bool(M.anchored))
                                {
                                    M.loc        = C;
                                    large_cocoon = true;
                                }
                            }

                            foreach (dynamic _f in Lang13.Enumerate(C.loc, typeof(Mob_Living)))
                            {
                                L2 = _f;


                                if (L2 is Mob_Living_SimpleAnimal_Hostile_Poison_GiantSpider)
                                {
                                    continue;
                                }
                                large_cocoon = true;
                                L2.loc       = C;
                                C.pixel_x    = L2.pixel_x;
                                C.pixel_y    = L2.pixel_y;
                                this.fed++;
                                this.visible_message(new Txt("<span class='danger'>").the(this).item().str(" sticks a proboscis into ").the(L2).item().str(" and sucks a viscous substance out.</span>").ToString());
                                break;
                            }

                            if (large_cocoon)
                            {
                                C.icon_state = Rand13.Pick(new object [] { "cocoon_large1", "cocoon_large2", "cocoon_large3" });
                            }
                        }
                    }
                }
                this.cocoon_target           = null;
                this.busy                    = 0;
                this.stop_automated_movement = false;
            }
            return;
        }
Beispiel #6
0
        // Function from file: computer_funcs.dm
        public void load_program(dynamic A = null, bool?force = null, bool?delay = null)
        {
            force = force ?? false;
            delay = delay ?? false;

            Obj_Effect_HolodeckEffect HE    = null;
            dynamic                   item  = null;
            Obj_Machinery             M     = null;
            Obj_Structure             S     = null;
            ByTable                   added = null;
            Obj_Effect_HolodeckEffect HE2   = null;
            dynamic                   x     = null;
            Obj_Machinery             M2    = null;
            Obj_Structure             S2    = null;


            if (this.stat != 0)
            {
                A     = this.offline_program;
                force = true;
                delay = false;
            }

            if (this.program == A)
            {
                return;
            }

            if (Game13.time < this.last_change + (this.damaged ? 500 : 0) + 25 && !(force == true))
            {
                if (delay == true)
                {
                    Task13.Sleep(25);
                }
                else
                {
                    if (Game13.time < this.last_change + 15)
                    {
                        return;
                    }

                    if (Map13.GetDistance(Task13.User, this) <= 3)
                    {
                        Task13.User.WriteMsg("<span class='warning'>ERROR. Recalibrating projection apparatus.</span>");
                        return;
                    }
                }
            }
            this.last_change = Game13.time;
            this.active      = A != this.offline_program;
            this.use_power   = (this.active == true ?1:0) + 1;

            foreach (dynamic _a in Lang13.Enumerate(this.effects, typeof(Obj_Effect_HolodeckEffect)))
            {
                HE = _a;

                HE.deactivate(this);
            }

            foreach (dynamic _b in Lang13.Enumerate(this.spawned))
            {
                item = _b;

                this.derez(item, null, force);
            }
            this.program = A;
            this.spawned = ((Zone)A).copy_contents_to(this.linked, true, !Lang13.Bool(this.emagged));

            foreach (dynamic _c in Lang13.Enumerate(this.spawned, typeof(Obj_Machinery)))
            {
                M = _c;

                M.flags |= 128;
            }

            foreach (dynamic _d in Lang13.Enumerate(this.spawned, typeof(Obj_Structure)))
            {
                S = _d;

                S.flags |= 128;
            }
            this.effects = new ByTable();
            Task13.Schedule(30, (Task13.Closure)(() => {
                added = new ByTable();

                foreach (dynamic _e in Lang13.Enumerate(this.spawned, typeof(Obj_Effect_HolodeckEffect)))
                {
                    HE2 = _e;

                    this.effects.Add(HE2);
                    this.spawned -= HE2;
                    x             = HE2.activate(this);

                    if (x is Ent_Static || x is ByTable)
                    {
                        this.spawned += x;
                        added.Add(x);
                    }
                }

                foreach (dynamic _f in Lang13.Enumerate(added, typeof(Obj_Machinery)))
                {
                    M2 = _f;

                    M2.flags |= 128;
                }

                foreach (dynamic _g in Lang13.Enumerate(added, typeof(Obj_Structure)))
                {
                    S2 = _g;

                    S2.flags |= 128;
                }
                return;
            }));
            return;
        }
Beispiel #7
0
        // Function from file: areas.dm
        public void firealert(Obj_Machinery source = null)
        {
            ByTable cameras = null;
            dynamic RA      = null;
            Obj_Machinery_Door_Firedoor         D  = null;
            Obj_Machinery_Firealarm             F  = null;
            Obj_Machinery_Camera                C  = null;
            Obj_Machinery_Computer_StationAlert a  = null;
            Mob_Living_Silicon            aiPlayer = null;
            Mob_Living_SimpleAnimal_Drone D2       = null;


            if (this.always_unpowered)
            {
                return;
            }
            cameras = new ByTable();

            foreach (dynamic _d in Lang13.Enumerate(this.related))
            {
                RA = _d;


                if (!RA.fire)
                {
                    ((Zone)RA).set_fire_alarm_effect();

                    foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery_Door_Firedoor)))
                    {
                        D = _a;


                        if (!D.blocked)
                        {
                            if (D.operating)
                            {
                                D.nextstate = GlobalVars.CLOSED;
                            }
                            else if (!D.density)
                            {
                                Task13.Schedule(0, (Task13.Closure)(() => {
                                    D.close();
                                    return;
                                }));
                            }
                        }
                    }

                    foreach (dynamic _b in Lang13.Enumerate(RA, typeof(Obj_Machinery_Firealarm)))
                    {
                        F = _b;

                        F.update_icon();
                    }
                }

                foreach (dynamic _c in Lang13.Enumerate(RA, typeof(Obj_Machinery_Camera)))
                {
                    C = _c;

                    cameras.Add(C);
                }
            }

            foreach (dynamic _e in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert)))
            {
                a = _e;

                a.triggerAlarm("Fire", this, cameras, source);
            }

            foreach (dynamic _f in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
            {
                aiPlayer = _f;

                aiPlayer.triggerAlarm("Fire", this, cameras, source);
            }

            foreach (dynamic _g in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone)))
            {
                D2 = _g;

                D2.triggerAlarm("Fire", this, cameras, source);
            }
            return;
        }
Beispiel #8
0
        // Function from file: areas.dm
        public void firereset(Obj_Machinery source = null)
        {
            dynamic RA = null;
            Obj_Machinery_Door_Firedoor         D        = null;
            Obj_Machinery_Firealarm             F        = null;
            Mob_Living_Silicon                  aiPlayer = null;
            Obj_Machinery_Computer_StationAlert a        = null;
            Mob_Living_SimpleAnimal_Drone       D2       = null;


            foreach (dynamic _c in Lang13.Enumerate(this.related))
            {
                RA = _c;


                if (RA.fire)
                {
                    RA.fire          = false;
                    RA.mouse_opacity = 0;
                    ((Zone)RA).updateicon();

                    foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery_Door_Firedoor)))
                    {
                        D = _a;


                        if (!D.blocked)
                        {
                            if (D.operating)
                            {
                                D.nextstate = 1;
                            }
                            else if (D.density)
                            {
                                Task13.Schedule(0, (Task13.Closure)(() => {
                                    D.open();
                                    return;
                                }));
                            }
                        }
                    }

                    foreach (dynamic _b in Lang13.Enumerate(RA, typeof(Obj_Machinery_Firealarm)))
                    {
                        F = _b;

                        F.update_icon();
                    }
                }
            }

            foreach (dynamic _d in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
            {
                aiPlayer = _d;

                aiPlayer.cancelAlarm("Fire", this, source);
            }

            foreach (dynamic _e in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert)))
            {
                a = _e;

                a.cancelAlarm("Fire", this, source);
            }

            foreach (dynamic _f in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone)))
            {
                D2 = _f;

                D2.cancelAlarm("Fire", this, source);
            }
            return;
        }