// Function from file: vent_scrubber.dm
 public void set_frequency(double new_frequency = 0)
 {
     GlobalVars.SSradio.remove_object(this, this.frequency);
     this.frequency        = new_frequency;
     this.radio_connection = GlobalVars.SSradio.add_object(this, this.frequency, this.radio_filter_in);
     return;
 }
        // Function from file: magnet.dm
        public Obj_Machinery_MagneticController(dynamic loc = null) : base((object)(loc))
        {
            Obj_Machinery_MagneticModule M = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            if (this.autolink)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_MagneticModule)))
                {
                    M = _a;


                    if (M.freq == this.frequency && M.code == this.code)
                    {
                        this.magnets.Add(M);
                    }
                }
            }
            Task13.Schedule(45, (Task13.Closure)(() => {
                if (GlobalVars.SSradio != null)
                {
                    this.radio_connection = GlobalVars.SSradio.add_object(this, this.frequency, GlobalVars.RADIO_MAGNETS);
                }
                return;
            }));

            if (Lang13.Bool(this.path))
            {
                this.filter_path();
            }
            return;
        }
 // Function from file: alarmlock.dm
 public override void initialize(  )
 {
     base.initialize();
     GlobalVars.SSradio.remove_object(this, this.air_frequency);
     this.air_connection = GlobalVars.SSradio.add_object(this, this.air_frequency, GlobalVars.RADIO_TO_AIRALARM);
     this.open();
     return;
 }
 // Function from file: alarmlock.dm
 public override dynamic Destroy(  )
 {
     if (GlobalVars.SSradio != null)
     {
         GlobalVars.SSradio.remove_object(this, this.air_frequency);
     }
     this.air_connection = null;
     return(base.Destroy());
 }
        // Function from file: dp_vent_pump.dm
        public void set_frequency(double new_frequency = 0)
        {
            GlobalVars.SSradio.remove_object(this, this.frequency);
            this.frequency = new_frequency;

            if (this.frequency != 0)
            {
                this.radio_connection = GlobalVars.SSradio.add_object(this, this.frequency, GlobalVars.RADIO_ATMOSIA);
            }
            return;
        }
        // Function from file: vent_pump.dm
        public override dynamic Destroy(  )
        {
            dynamic A = null;

            A = GlobalFuncs.get_area_master(this);
            A.air_vent_names.Remove(this.id_tag);
            A.air_vent_info.Remove(this.id_tag);

            if (GlobalVars.SSradio != null)
            {
                GlobalVars.SSradio.remove_object(this, this.frequency);
            }
            this.radio_connection = null;
            return(base.Destroy());
        }
Exemplo n.º 7
0
        // Function from file: signaler.dm
        public void set_frequency(double new_frequency = 0)
        {
            if (!(GlobalVars.SSradio != null))
            {
                Task13.Sleep(20);
            }

            if (!(GlobalVars.SSradio != null))
            {
                return;
            }
            GlobalVars.SSradio.remove_object(this, this.frequency);
            this.frequency        = new_frequency;
            this.radio_connection = GlobalVars.SSradio.add_object(this, this.frequency, GlobalVars.RADIO_CHAT);
            return;
        }
Exemplo n.º 8
0
        // Function from file: radio.dm
        public RadioFrequency return_frequency(dynamic new_frequency = null)
        {
            string         f_text    = null;
            RadioFrequency frequency = null;

            f_text    = String13.NumberToString(Convert.ToDouble(new_frequency));
            frequency = this.frequencies[f_text];

            if (!(frequency != null))
            {
                frequency                = new RadioFrequency();
                frequency.frequency      = new_frequency;
                this.frequencies[f_text] = frequency;
            }
            return(frequency);
        }
Exemplo n.º 9
0
        // Function from file: radio.dm
        public RadioFrequency add_object(Obj device = null, double new_frequency = 0, string filter = null)
        {
            string         f_text    = null;
            RadioFrequency frequency = null;

            f_text    = String13.NumberToString(new_frequency);
            frequency = this.frequencies[f_text];

            if (!(frequency != null))
            {
                frequency                = new RadioFrequency();
                frequency.frequency      = new_frequency;
                this.frequencies[f_text] = frequency;
            }
            frequency.add_listener(device, filter);
            return(frequency);
        }
Exemplo n.º 10
0
        // Function from file: console.dm
        public void post_signal(string command = null)
        {
            RadioFrequency frequency     = null;
            Signal         status_signal = null;

            frequency = GlobalVars.SSradio.return_frequency(1435);

            if (!(frequency != null))
            {
                return;
            }
            status_signal        = new Signal();
            status_signal.source = this;
            status_signal.transmission_method = 1;
            status_signal.data["command"]     = command;
            frequency.post_signal(this, status_signal);
            return;
        }
Exemplo n.º 11
0
        // Function from file: radio.dm
        public bool remove_object(Obj device = null, double old_frequency = 0)
        {
            string         f_text    = null;
            RadioFrequency frequency = null;

            f_text    = String13.NumberToString(old_frequency);
            frequency = this.frequencies[f_text];

            if (frequency != null)
            {
                frequency.remove_listener(device);

                if (frequency.devices.len == 0)
                {
                    GlobalFuncs.qdel(frequency);
                    this.frequencies.Remove(f_text);
                }
            }
            return(true);
        }
        // Function from file: vent_scrubber.dm
        public override dynamic Destroy(  )
        {
            dynamic A = null;
            dynamic I = null;

            A = GlobalFuncs.get_area_master(this);
            A.air_scrub_names.Remove(this.id_tag);
            A.air_scrub_info.Remove(this.id_tag);

            if (GlobalVars.SSradio != null)
            {
                GlobalVars.SSradio.remove_object(this, this.frequency);
            }
            this.radio_connection = null;

            foreach (dynamic _a in Lang13.Enumerate(this.adjacent_turfs))
            {
                I = _a;

                I = null;
            }
            return(base.Destroy());
        }
Exemplo n.º 13
0
        // Function from file: meter.dm
        public override int?process_atmos(  )
        {
            GasMixture     environment      = null;
            double         env_pressure     = 0;
            int            val              = 0;
            int            val2             = 0;
            int            val3             = 0;
            RadioFrequency radio_connection = null;
            Signal         signal           = null;


            if (!Lang13.Bool(this.target))
            {
                this.icon_state = "meterX";
                return(0);
            }

            if ((this.stat & 3) != 0)
            {
                this.icon_state = "meter0";
                return(0);
            }
            this.f_use_power(5);
            environment = ((Ent_Static)this.target).return_air();

            if (!(environment != null))
            {
                this.icon_state = "meterX";
                return(0);
            }
            env_pressure = environment.return_pressure();

            if (env_pressure <= 15.198750495910645)
            {
                this.icon_state = "meter0";
            }
            else if (env_pressure <= 182.38499450683594)
            {
                val             = Num13.Floor(env_pressure / 30.39750099182129 + 0.5);
                this.icon_state = "meter1_" + val;
            }
            else if (env_pressure <= 3039.75)
            {
                val2            = Num13.Floor(env_pressure / 506.625 - 0.41) + 1;
                this.icon_state = "meter2_" + val2;
            }
            else if (env_pressure <= 5978.1748046875)
            {
                val3            = Num13.Floor(env_pressure / 506.625 - 6) + 1;
                this.icon_state = "meter3_" + val3;
            }
            else
            {
                this.icon_state = "meter4";
            }

            if (this.frequency != 0)
            {
                radio_connection = GlobalVars.SSradio.return_frequency(this.frequency);

                if (!(radio_connection != null))
                {
                    return(null);
                }
                signal        = new Signal();
                signal.source = this;
                signal.transmission_method = 1;
                signal.data = new ByTable().Set("id_tag", this.id_tag).Set("device", "AM").Set("pressure", Num13.Floor(env_pressure)).Set("sigtype", "status");
                radio_connection.post_signal(this, signal);
            }
            return(null);
        }
 // Function from file: alarmlock.dm
 public Obj_Machinery_Door_Airlock_Alarmlock(dynamic loc = null) : base((object)(loc))
 {
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     this.air_connection = new RadioFrequency();
     return;
 }
        // Function from file: atmos_control.dm
        public void reconnect(Mob user = null)
        {
            ByTable        IO      = null;
            RadioFrequency freq    = null;
            dynamic        devices = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump U = null;
            ByTable text = null;
            Obj_Machinery_Atmospherics_Components_Unary_OutletInjector U2 = null;
            ByTable text2              = null;
            dynamic S                  = null;
            dynamic new_devices        = null;
            Obj_Machinery_AirSensor U3 = null;
            ByTable text3              = null;
            Obj_Machinery_Atmospherics_Components_Unary_OutletInjector U4 = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump       U5 = null;

            IO      = new ByTable();
            freq    = GlobalVars.SSradio.return_frequency(1441);
            devices = freq.devices["_default"];

            foreach (dynamic _a in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                U = _a;

                text = GlobalFuncs.splittext(U.id_tag, "_");
                IO.Or(text[1]);
            }

            foreach (dynamic _b in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_OutletInjector)))
            {
                U2 = _b;

                text2 = GlobalFuncs.splittext(U2.id, "_");
                IO.Or(text2[1]);
            }

            if (!(IO.len != 0))
            {
                user.WriteMsg("<span class='alert'>No machinery detected.</span>");
            }
            S = Interface13.Input("Select the device set: ", "Selection", IO[1], null, IO, InputType.Any);

            if (this != null)
            {
                this.input_tag  = "" + S + "_in";
                this.output_tag = "" + S + "_out";
                this.name       = "" + String13.ToUpper(S) + " Supply Control";
                new_devices     = freq.devices["4"];

                foreach (dynamic _c in Lang13.Enumerate(new_devices, typeof(Obj_Machinery_AirSensor)))
                {
                    U3 = _c;

                    text3 = GlobalFuncs.splittext(U3.id_tag, "_");

                    if (text3[1] == S)
                    {
                        this.sensors = new ByTable().Set("" + S + "_sensor", "Tank");
                        break;
                    }
                }
            }

            foreach (dynamic _d in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_OutletInjector)))
            {
                U4 = _d;

                U4.broadcast_status();
            }

            foreach (dynamic _e in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                U5 = _e;

                U5.broadcast_status();
            }
            return;
        }