Exemplo n.º 1
0
        // Function from file: medical_tools.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            TopicInput filter = null;

            base.Topic(href, href_list, (object)(hsrc));
            filter = new TopicInput(href, href_list);

            if (Lang13.Bool(filter.get("eject")))
            {
                this.go_out();
            }

            if (Lang13.Bool(filter.get("view_stats")))
            {
                Interface13.Browse(this.chassis.occupant, this.get_patient_stats(), "window=msleeper");
                GlobalFuncs.onclose(this.chassis.occupant, "msleeper");
                return(null);
            }

            if (Lang13.Bool(filter.get("inject")))
            {
                this.inject_reagent(filter.getType("inject", typeof(Reagent)), filter.getObj("source"));
            }
            return(null);
        }
Exemplo n.º 2
0
        // Function from file: mecha_control_console.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            TopicInput filter  = null;
            dynamic    MT      = null;
            string     message = null;
            dynamic    M       = null;
            dynamic    MT2     = null;
            dynamic    MT3     = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            filter = new TopicInput(href, href_list);

            if (Lang13.Bool(href_list["send_message"]))
            {
                MT      = filter.getObj("send_message");
                message = GlobalFuncs.stripped_input(Task13.User, "Input message", "Transmit message");
                M       = ((Obj_Item_MechaParts_MechaTracking)MT).in_mecha();

                if (Lang13.Bool(GlobalFuncs.trim(message)) && Lang13.Bool(M))
                {
                    ((Obj_Mecha)M).occupant_message(message);
                }
                return(null);
            }

            if (Lang13.Bool(href_list["shock"]))
            {
                MT2 = filter.getObj("shock");
                MT2.shock();
            }

            if (Lang13.Bool(href_list["get_log"]))
            {
                MT3 = filter.getObj("get_log");
                this.stored_data = ((Obj_Item_MechaParts_MechaTracking)MT3).get_mecha_log();
                this.screen      = true;
            }

            if (Lang13.Bool(href_list["return"]))
            {
                this.screen = false;
            }
            this.updateUsrDialog();
            return(null);
        }
Exemplo n.º 3
0
        // Function from file: medical_tools.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            TopicInput filter   = null;
            int        m        = 0;
            string     message  = null;
            double     i        = 0;
            dynamic    reagent  = null;
            dynamic    reagent2 = null;

            base.Topic(href, href_list, (object)(hsrc));
            filter = new TopicInput(href, href_list);

            if (Lang13.Bool(filter.get("toggle_mode")))
            {
                this.mode = !this.mode;
                this.update_equip_info();
                return(null);
            }

            if (Lang13.Bool(filter.get("select_reagents")))
            {
                this.processed_reagents.len = 0;
                m = 0;

                foreach (dynamic _a in Lang13.IterateRange(1, this.known_reagents.len))
                {
                    i = _a;


                    if (m >= this.synth_speed)
                    {
                        break;
                    }
                    reagent = filter.get("reagent_" + i);

                    if (Lang13.Bool(reagent) && this.known_reagents.Contains(reagent))
                    {
                        message = "" + (m != 0 ? ", " : null) + this.known_reagents[reagent];
                        this.processed_reagents.Add(reagent);
                        m++;
                    }
                }

                if (this.processed_reagents.len != 0)
                {
                    message += " added to production";
                    GlobalVars.SSobj.processing.Or(this);
                    this.occupant_message(message);
                    this.occupant_message("Reagent processing started.");
                    this.log_message("Reagent processing started.");
                }
                return(null);
            }

            if (Lang13.Bool(filter.get("show_reagents")))
            {
                Interface13.Browse(this.chassis.occupant, this.get_reagents_page(), "window=msyringegun");
            }

            if (Lang13.Bool(filter.get("purge_reagent")))
            {
                reagent2 = filter.get("purge_reagent");

                if (Lang13.Bool(reagent2))
                {
                    this.reagents.del_reagent(reagent2);
                }
                return(null);
            }

            if (Lang13.Bool(filter.get("purge_all")))
            {
                this.reagents.clear_reagents();
                return(null);
            }
            return(null);
        }
        // Function from file: mech_fabricator.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            TopicInput filter    = null;
            string     tpart_set = null;
            string     T         = null;
            dynamic    v         = null;
            Design     D         = null;
            string     T2        = null;
            dynamic    v2        = null;
            Design     D2        = null;
            dynamic    index     = null;
            dynamic    new_index = null;
            string     T3        = null;
            dynamic    v3        = null;
            Design     D3        = null;
            dynamic    part      = null;
            double?    amount    = null;
            string     material  = null;
            double     removed   = 0;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            filter = new TopicInput(href, href_list);

            if (Lang13.Bool(href_list["part_set"]))
            {
                tpart_set = filter.getStr("part_set");

                if (Lang13.Bool(tpart_set))
                {
                    if (tpart_set == "clear")
                    {
                        this.part_set = null;
                    }
                    else
                    {
                        this.part_set = tpart_set;
                        this.screen   = "parts";
                    }
                }
            }

            if (Lang13.Bool(href_list["part"]))
            {
                T = filter.getStr("part");

                foreach (dynamic _a in Lang13.Enumerate(this.files.known_designs))
                {
                    v = _a;

                    D = this.files.known_designs[v];

                    if ((D.build_type & 16) != 0)
                    {
                        if (D.id == T)
                        {
                            if (!this.processing_queue)
                            {
                                this.build_part(D);
                            }
                            else
                            {
                                this.add_to_queue(D);
                            }
                            break;
                        }
                    }
                }
            }

            if (Lang13.Bool(href_list["add_to_queue"]))
            {
                T2 = filter.getStr("add_to_queue");

                foreach (dynamic _b in Lang13.Enumerate(this.files.known_designs))
                {
                    v2 = _b;

                    D2 = this.files.known_designs[v2];

                    if ((D2.build_type & 16) != 0)
                    {
                        if (D2.id == T2)
                        {
                            this.add_to_queue(D2);
                            break;
                        }
                    }
                }
                this.update_queue_on_page(); return(null);
            }

            if (Lang13.Bool(href_list["remove_from_queue"]))
            {
                this.remove_from_queue(filter.getNum("remove_from_queue"));
                this.update_queue_on_page(); return(null);
            }

            if (Lang13.Bool(href_list["partset_to_queue"]))
            {
                this.add_part_set_to_queue(filter.get("partset_to_queue"));
                this.update_queue_on_page(); return(null);
            }

            if (Lang13.Bool(href_list["process_queue"]))
            {
                Task13.Schedule(0, (Task13.Closure)(() => {
                    if (this.processing_queue || this.being_built != null)
                    {
                        return;
                    }
                    this.processing_queue = true;
                    this.process_queue();
                    this.processing_queue = false;
                    return;
                }));
            }

            if (Lang13.Bool(href_list["clear_temp"]))
            {
                this.temp = null;
            }

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

            if (Lang13.Bool(href_list["queue_move"]) && Lang13.Bool(href_list["index"]))
            {
                index     = filter.getNum("index");
                new_index = index + filter.getNum("queue_move");

                if (Lang13.Bool(Lang13.IsNumber(index)) && Lang13.Bool(Lang13.IsNumber(new_index)))
                {
                    if (GlobalFuncs.IsInRange(new_index, 1, this.queue.len))
                    {
                        this.queue.Swap(Convert.ToInt32(index), Convert.ToInt32(new_index));
                    }
                }
                this.update_queue_on_page(); return(null);
            }

            if (Lang13.Bool(href_list["clear_queue"]))
            {
                this.queue = new ByTable();
                this.update_queue_on_page(); return(null);
            }

            if (Lang13.Bool(href_list["sync"]))
            {
                this.f_sync();
            }

            if (Lang13.Bool(href_list["part_desc"]))
            {
                T3 = filter.getStr("part_desc");

                foreach (dynamic _c in Lang13.Enumerate(this.files.known_designs))
                {
                    v3 = _c;

                    D3 = this.files.known_designs[v3];

                    if ((D3.build_type & 16) != 0)
                    {
                        if (D3.id == T3)
                        {
                            part      = D3.build_path;
                            this.temp = new Txt("<h1>").item(Lang13.Initial(part, "name")).str(" description:</h1>\n								").item(Lang13.Initial(part, "desc")).str("<br>\n								<a href='?src=").Ref(this).str(";clear_temp=1'>Return</a>\n								").ToString();
                            break;
                        }
                    }
                }
            }

            if (Lang13.Bool(href_list["remove_mat"]) && Lang13.Bool(href_list["material"]))
            {
                amount   = String13.ParseNumber(href_list["remove_mat"]);
                material = href_list["material"];

                if ((amount ?? 0) < 0 || (amount ?? 0) > Convert.ToDouble(this.resources[material]))
                {
                    return(null);
                }
                removed = this.remove_material(material, amount);

                if (removed == -1)
                {
                    this.temp = "Not enough " + this.material2name(material) + " to produce a sheet.";
                }
                else
                {
                    this.temp = "Ejected " + removed + " of " + this.material2name(material);
                }
                this.temp += new Txt("<br><a href='?src=").Ref(this).str(";clear_temp=1'>Return</a>").ToString();
            }
            this.updateUsrDialog();
            return(null);
        }