// Function from file: keycard authentication.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || this.waiting || !this.allowed(Task13.User))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "red_alert":

                if (!(this.event_source != null))
                {
                    this.sendEvent("Red Alert");
                    _default = GlobalVars.TRUE;
                }
                break;

            case "emergency_maint":

                if (!(this.event_source != null))
                {
                    this.sendEvent("Emergency Maintenance Access");
                    _default = GlobalVars.TRUE;
                }
                break;

            case "auth_swipe":

                if (this.event_source != null)
                {
                    this.event_source.trigger_event(Task13.User);
                    this.event_source = null;
                    _default          = GlobalVars.TRUE;
                }
                break;
            }
            return(_default);
        }
Exemple #2
0
        // Function from file: pump.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic pressure = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on = !Lang13.Bool(this.on) ?1:0;
                this.investigate_log("was turned " + (Lang13.Bool(this.on) ? "on" : "off") + " by " + GlobalFuncs.key_name(Task13.User), "atmos");
                _default = GlobalVars.TRUE;
                break;

            case "pressure":
                pressure = _params["pressure"];

                if (pressure == "max")
                {
                    pressure = 4500;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "input")
                {
                    pressure = Interface13.Input("New output pressure (0-" + 4500 + " kPa):", this.name, this.target_pressure, null, null, InputType.Num | InputType.Null);

                    if (!(pressure == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (String13.ParseNumber(pressure) != null)
                {
                    pressure = String13.ParseNumber(pressure);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_pressure = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(pressure), 4500));
                    this.investigate_log("was set to " + this.target_pressure + " kPa by " + GlobalFuncs.key_name(Task13.User), "atmos");
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
        // Function from file: keycard authentication.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.physical_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "keycard_auth", this.name, 375, 125, master_ui, state);
                ui.open();
            }
            return(0);
        }
        // Function from file: uplink.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.inventory_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "uplink", this.name, 450, 750, master_ui, state);
                ui.set_autoupdate(GlobalVars.FALSE);
                ui.set_style("syndicate");
                ui.open();
            }
            return(0);
        }
        // Function from file: uplink.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic item          = null;
            ByTable uplink_items  = null;
            ByTable buyable_items = null;
            dynamic category      = null;
            dynamic I             = null;


            if (!Lang13.Bool(this.active))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "buy":
                item          = _params["item"];
                uplink_items  = GlobalFuncs.get_uplink_items(this.gamemode);
                buyable_items = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(uplink_items))
                {
                    category = _a;

                    buyable_items.Add(uplink_items[category]);
                }

                if (buyable_items.Contains(item))
                {
                    I = buyable_items[item];
                    I.buy(Task13.User, this);
                    _default = GlobalVars.TRUE;
                }
                break;

            case "lock":
                this.active = GlobalVars.FALSE;
                GlobalVars.SStgui.close_uis(this);
                break;
            }
            return(_default);
        }
        // Function from file: pump.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic plasma   = null;
            dynamic n2o      = null;
            dynamic pressure = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on = !this.on;

                if (this.on && !Lang13.Bool(this.holding))
                {
                    plasma = this.air_contents.gases["plasma"];
                    n2o    = this.air_contents.gases["n2o"];

                    if (Lang13.Bool(n2o) || Lang13.Bool(plasma))
                    {
                        GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(Task13.User)).str(" (<A HREF='?_src_=holder;adminmoreinfo=").Ref(Task13.User).str("'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(Task13.User).str("'>FLW</A>) turned on a pump that contains ").item((Lang13.Bool(n2o) ? "N2O" : "")).item((Lang13.Bool(n2o) && Lang13.Bool(plasma) ? " & " : "")).item((Lang13.Bool(plasma) ? "Plasma" : "")).str("! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(this.x).str(";Y=").item(this.y).str(";Z=").item(this.z).str("'>JMP</a>)").ToString());
                        GlobalFuncs.log_admin("" + GlobalFuncs.key_name(Task13.User) + " turned on a pump that contains " + (Lang13.Bool(n2o) ? "N2O" : "") + (Lang13.Bool(n2o) && Lang13.Bool(plasma) ? " & " : "") + (Lang13.Bool(plasma) ? "Plasma" : "") + " at " + this.x + ", " + this.y + ", " + this.z);
                    }
                }
                _default = GlobalVars.TRUE;
                break;

            case "direction":

                if (this.direction == "out")
                {
                    this.direction = "in";
                }
                else
                {
                    this.direction = "out";
                }
                _default = GlobalVars.TRUE;
                break;

            case "pressure":
                pressure = _params["pressure"];

                if (pressure == "reset")
                {
                    pressure = 101.32499694824219;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "min")
                {
                    pressure = 10.132499694824219;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "max")
                {
                    pressure = 1013.25;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "input")
                {
                    pressure = Interface13.Input("New release pressure (" + 10.132499694824219 + "-" + 1013.25 + " kPa):", this.name, this.pump.target_pressure, null, null, InputType.Num | InputType.Null);

                    if (!(pressure == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (String13.ParseNumber(pressure) != null)
                {
                    pressure = String13.ParseNumber(pressure);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.pump.target_pressure = Num13.MaxInt(((int)(10.132499694824219)), Num13.MinInt(Num13.Floor(Convert.ToDouble(pressure)), ((int)(1013.25))));
                    this.investigate_log("was set to " + this.pump.target_pressure + " kPa by " + GlobalFuncs.key_name(Task13.User) + ".", "atmos");
                }
                break;

            case "eject":

                if (Lang13.Bool(this.holding))
                {
                    this.holding.loc = GlobalFuncs.get_turf(this);
                    this.holding     = null;
                    _default         = GlobalVars.TRUE;
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
        // Function from file: filter.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.default_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "atmos_filter", this.name, 470, 140, master_ui, state);
                ui.open();
            }
            return(0);
        }
Exemple #8
0
        // Function from file: thermomachine.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic target = null;
            double? adjust = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on        = !this.on;
                this.use_power = (this.on ?1:0) + 1;
                this.investigate_log("was turned " + (this.on ? "on" : "off") + " by " + GlobalFuncs.key_name(Task13.User), "atmos");
                _default = GlobalVars.TRUE;
                break;

            case "target":
                target = _params["target"];
                adjust = String13.ParseNumber(_params["adjust"]);

                if (target == "input")
                {
                    target = Interface13.Input("Set new target (" + this.min_temperature + "-" + this.max_temperature + " K):", this.name, this.target_temperature, null, null, InputType.Num | InputType.Null);

                    if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (Lang13.Bool(adjust))
                {
                    target   = this.target_temperature + (adjust ?? 0);
                    _default = GlobalVars.TRUE;
                }
                else if (String13.ParseNumber(target) != null)
                {
                    target   = String13.ParseNumber(target);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_temperature = Num13.MaxInt(((int)(this.min_temperature)), Num13.MinInt(Convert.ToInt32(target), Convert.ToInt32(this.max_temperature)));
                    this.investigate_log("was set to " + this.target_temperature + " K by " + GlobalFuncs.key_name(Task13.User), "atmos");
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
        // Function from file: atmos_control.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            Signal  signal = null;
            dynamic target = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || !(this.radio_connection != null))
            {
                return(_default);
            }
            signal = new Signal();
            signal.transmission_method = 1;
            signal.source = this;
            signal.data   = new ByTable().Set("sigtype", "command");

            switch ((string)(action))
            {
            case "reconnect":
                this.reconnect(Task13.User);
                _default = GlobalVars.TRUE;
                break;

            case "input":
                signal.data.Add(new ByTable().Set("tag", this.input_tag).Set("power_toggle", GlobalVars.TRUE));
                _default = GlobalVars.TRUE;
                break;

            case "output":
                signal.data.Add(new ByTable().Set("tag", this.output_tag).Set("power_toggle", GlobalVars.TRUE));
                _default = GlobalVars.TRUE;
                break;

            case "pressure":
                target = Interface13.Input("New target pressure:", this.name, this.output_info["internal"], null, null, InputType.Num | InputType.Null);

                if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                {
                    target = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(target), ((int)(5066.25))));
                    signal.data.Add(new ByTable().Set("tag", this.output_tag).Set("set_internal_pressure", target));
                    _default = GlobalVars.TRUE;
                }
                break;
            }
            this.radio_connection.post_signal(this, signal, GlobalVars.RADIO_ATMOSIA);
            return(_default);
        }
        // Function from file: chem_heater.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic target = null;
            double? adjust = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on  = !Lang13.Bool(this.on) ?1:0;
                _default = GlobalVars.TRUE;
                break;

            case "temperature":
                target = _params["target"];
                adjust = String13.ParseNumber(_params["adjust"]);

                if (target == "input")
                {
                    target = Interface13.Input("New target temperature:", this.name, this.target_temperature, null, null, InputType.Num | InputType.Null);

                    if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (Lang13.Bool(adjust))
                {
                    target = (this.target_temperature ?? 0) + (adjust ?? 0);
                }
                else if (String13.ParseNumber(target) != null)
                {
                    target   = String13.ParseNumber(target);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_temperature = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(target), 1000));
                }
                break;

            case "eject":
                this.on = GlobalVars.FALSE;
                this.eject_beaker();
                _default = GlobalVars.TRUE;
                break;
            }
            return(_default);
        }
Exemple #11
0
        // Function from file: wires.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic    target_wire = null;
            Mob        L           = null;
            dynamic    I           = null;
            Ent_Static O           = null;
            dynamic    A           = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || !Lang13.Bool(this.interactable(Task13.User)))
            {
                return(_default);
            }
            target_wire = _params["wire"];
            L           = Task13.User;
            I           = L.get_active_hand();

            switch ((string)(action))
            {
            case "cut":

                if (I is Obj_Item_Weapon_Wirecutters || Lang13.Bool(GlobalFuncs.IsAdminGhost(Task13.User)))
                {
                    GlobalFuncs.playsound(this.holder, "sound/items/Wirecutter.ogg", 20, 1);
                    this.cut_color(target_wire);
                    _default = GlobalVars.TRUE;
                }
                else
                {
                    L.WriteMsg("<span class='warning'>You need wirecutters!</span>");
                }
                break;

            case "pulse":

                if (I is Obj_Item_Device_Multitool || Lang13.Bool(GlobalFuncs.IsAdminGhost(Task13.User)))
                {
                    GlobalFuncs.playsound(this.holder, "sound/weapons/empty.ogg", 20, 1);
                    this.pulse_color(target_wire);
                    _default = GlobalVars.TRUE;
                }
                else
                {
                    L.WriteMsg("<span class='warning'>You need a multitool!</span>");
                }
                break;

            case "attach":

                if (Lang13.Bool(this.is_attached(target_wire)))
                {
                    O = this.detach_assembly(target_wire);

                    if (O != null)
                    {
                        L.put_in_hands(O);
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (I is Obj_Item_Device_Assembly)
                {
                    A = I;

                    if (A.attachable)
                    {
                        if (!L.drop_item())
                        {
                            return(_default);
                        }
                        this.attach_assembly(target_wire, A);
                        _default = GlobalVars.TRUE;
                    }
                    else
                    {
                        L.WriteMsg("<span class='warning'>You need an attachable assembly!</span>");
                    }
                }
                break;
            }
            return(_default);
        }
Exemple #12
0
        // Function from file: wires.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "wires";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.physical_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "wires", "" + this.holder.name + " wires", 350, this.wires.len * 30 + 150, master_ui, state);
                ui.open();
            }
            return(0);
        }