Esempio n. 1
0
 // Function from file: lightreplacer.dm
 public virtual void janicart_insert(dynamic user = null, Obj_Structure_Janitorialcart J = null)
 {
     J.put_in_cart(this, user);
     J.myreplacer = this;
     J.update_icon();
     return;
 }
        // Function from file: cart.dm
        public void generate_menu(Mob user = null)
        {
            Obj_Item_Radio_Integrated_Signal S = null;
            Data_Record t          = null;
            int         powercount = 0;
            Obj_Machinery_Computer_Monitor pMon = null;
            int count = 0;
            Obj_Machinery_Computer_Monitor pMon2 = null;
            ByTable L = null;
            Obj_Machinery_Power_Terminal term = null;
            Obj_Machinery_Power          A    = null;
            ByTable S2  = null;
            ByTable chg = null;
            Obj_Machinery_Power_Apc A2     = null;
            Data_Record             R      = null;
            Data_Record             R2     = null;
            Data_Crime          c          = null;
            Data_Crime          c2         = null;
            dynamic             S3         = null;
            dynamic             SO         = null;
            dynamic             S4         = null;
            dynamic             SO2        = null;
            dynamic             cl         = null;
            dynamic             ldat       = null;
            Obj_Item_Weapon_Mop M          = null;
            dynamic             ml         = null;
            double?direction               = null;
            Obj_Structure_Janitorialcart B = null;
            dynamic bl         = null;
            double? direction2 = null;
            Mob_Living_SimpleAnimal_Bot_Cleanbot B2 = null;
            dynamic bl2                    = null;
            double? direction3             = null;
            Newscaster_FeedChannel current = null;
            Newscaster_FeedChannel chan    = null;
            int i = 0;
            Newscaster_FeedMessage msg     = null;
            Newscaster_FeedComment comment = null;


            switch ((int)(this.mode))
            {
            case 40:
                S          = this.radio;
                this.menu  = "<h4><img src=pda_signaler.png> Remote Signaling System</h4>";
                this.menu += new Txt("\n<a href='byond://?src=").Ref(this).str(";choice=Send Signal'>Send Signal</A><BR>\nFrequency:\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=-10'>-</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=-2'>-</a>\n").item(GlobalFuncs.format_frequency(S.frequency)).str("\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=2'>+</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Frequency;sfreq=10'>+</a><br>\n<br>\nCode:\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=-5'>-</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=-1'>-</a>\n").item(S.code).str("\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=1'>+</a>\n<a href='byond://?src=").Ref(this).str(";choice=Signal Code;scode=5'>+</a><br>").ToString();
                break;

            case 41:
                this.menu  = "<h4><img src=pda_notes.png> Crew Manifest</h4>";
                this.menu += "Entries cannot be modified from this terminal.<br><br>";

                if (GlobalVars.data_core.general != null)
                {
                    foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        t = _a;

                        this.menu += "" + t.fields["name"] + " - " + t.fields["rank"] + "<br>";
                    }
                }
                this.menu += "<br>";
                break;

            case 42:
                this.menu  = "<h4><img src=pda_status.png> Station Status Display Interlink</h4>";
                this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=blank'>Clear</A> ]<BR>").ToString();
                this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=shuttle'>Shuttle ETA</A> ]<BR>").ToString();
                this.menu += new Txt("[ <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=message'>Message</A> ]").ToString();
                this.menu += new Txt("<ul><li> Line 1: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=setmsg1'>").item((Lang13.Bool(this.message1) ? this.message1 : ((dynamic)("(none)")))).str("</A>").ToString();
                this.menu += new Txt("<li> Line 2: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=setmsg2'>").item((Lang13.Bool(this.message2) ? this.message2 : ((dynamic)("(none)")))).str("</A></ul><br>").ToString();
                this.menu += new Txt("[ Alert: <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=default'>None</A> |").ToString();
                this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=redalert'>Red Alert</A> |").ToString();
                this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=lockdown'>Lockdown</A> |").ToString();
                this.menu += new Txt(" <A HREF='?src=").Ref(this).str(";choice=Status;statdisp=alert;alert=biohazard'>Biohazard</A> ]<BR>").ToString();
                break;

            case 43:
                this.menu          = "<h4><img src=pda_power.png> Power Monitors - Please select one</h4><BR>";
                this.powmonitor    = null;
                this.powermonitors = new ByTable();
                powercount         = 0;

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


                    if (!((pMon.stat & 3) != 0))
                    {
                        powercount++;
                        this.powermonitors.Add(pMon);
                    }
                }

                if (!(powercount != 0))
                {
                    this.menu += "<span class='danger'>No connection<BR></span>";
                }
                else
                {
                    this.menu += "<FONT SIZE=-1>";
                    count      = 0;

                    foreach (dynamic _c in Lang13.Enumerate(this.powermonitors, typeof(Obj_Machinery_Computer_Monitor)))
                    {
                        pMon2 = _c;

                        count++;
                        this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Power Select;target=").item(count).str("'>").item(pMon2).str(" </a><BR>").ToString();
                    }
                    this.menu += "</FONT>";
                }
                break;

            case 433:
                this.menu = "<h4><img src=pda_power.png> Power Monitor </h4><BR>";

                if (!Lang13.Bool(this.powmonitor))
                {
                    this.menu += "<span class='danger'>No connection<BR></span>";
                }
                else
                {
                    L = new ByTable();

                    foreach (dynamic _d in Lang13.Enumerate(this.powmonitor.attached.powernet.nodes, typeof(Obj_Machinery_Power_Terminal)))
                    {
                        term = _d;


                        if (term.master is Obj_Machinery_Power_Apc)
                        {
                            A = term.master;
                            L.Add(A);
                        }
                    }
                    this.menu += "<PRE>Total power: " + this.powmonitor.attached.powernet.viewavail + " W<BR>Total load:  " + String13.NumberToString(this.powmonitor.attached.powernet.viewload, 10) + " W<BR>";
                    this.menu += "<FONT SIZE=-1>";

                    if (L.len > 0)
                    {
                        this.menu += "Area                           Eqp./Lgt./Env.  Load   Cell<HR>";
                        S2         = new ByTable(new object [] { " Off", "AOff", "  On", " AOn" });
                        chg        = new ByTable(new object [] { "N", "C", "F" });

                        foreach (dynamic _e in Lang13.Enumerate(L, typeof(Obj_Machinery_Power_Apc)))
                        {
                            A2 = _e;

                            this.menu += String13.SubStr(GlobalFuncs.add_tspace(A2.area.name, 30), 1, 30);
                            this.menu += " " + S2[(A2.equipment ?? 0) + 1] + " " + S2[(A2.lighting ?? 0) + 1] + " " + S2[(A2.environ ?? 0) + 1] + " " + GlobalFuncs.add_lspace(A2.lastused_total, 6) + "  " + (Lang13.Bool(A2.cell) ? "" + GlobalFuncs.add_lspace(Num13.Floor(((Obj_Item_Weapon_StockParts_Cell)A2.cell).percent()), 3) + "% " + chg[A2.charging + 1] : "  N/C") + "<BR>";
                        }
                    }
                    this.menu += "</FONT></PRE>";
                }
                break;

            case 44:
                this.menu = "<h4><img src=pda_medical.png> Medical Record List</h4>";

                if (GlobalVars.data_core.general != null)
                {
                    foreach (dynamic _f in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        R = _f;

                        this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Medical Records;target=").item(R.fields["id"]).str("'>").item(R.fields["id"]).str(": ").item(R.fields["name"]).str("<br>").ToString();
                    }
                }
                this.menu += "<br>";
                break;

            case 441:
                this.menu = "<h4><img src=pda_medical.png> Medical Record</h4>";

                if (GlobalVars.data_core.general.Contains(this.active1))
                {
                    this.menu += "Name: " + this.active1.fields["name"] + " ID: " + this.active1.fields["id"] + "<br>";
                    this.menu += "Sex: " + this.active1.fields["sex"] + "<br>";
                    this.menu += "Age: " + this.active1.fields["age"] + "<br>";
                    this.menu += "Rank: " + this.active1.fields["rank"] + "<br>";
                    this.menu += "Fingerprint: " + this.active1.fields["fingerprint"] + "<br>";
                    this.menu += "Physical Status: " + this.active1.fields["p_stat"] + "<br>";
                    this.menu += "Mental Status: " + this.active1.fields["m_stat"] + "<br>";
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                this.menu += "<h4><img src=pda_medical.png> Medical Data</h4>";

                if (GlobalVars.data_core.medical.Contains(this.active2))
                {
                    this.menu += "Blood Type: " + this.active2.fields["blood_type"] + "<br><br>";
                    this.menu += "Minor Disabilities: " + this.active2.fields["mi_dis"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["mi_dis_d"] + "<br><br>";
                    this.menu += "Major Disabilities: " + this.active2.fields["ma_dis"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["ma_dis_d"] + "<br><br>";
                    this.menu += "Allergies: " + this.active2.fields["alg"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["alg_d"] + "<br><br>";
                    this.menu += "Current Diseases: " + this.active2.fields["cdi"] + "<br>";
                    this.menu += "Details: " + this.active2.fields["cdi_d"] + "<br><br>";
                    this.menu += "Important Notes: " + this.active2.fields["notes"] + "<br>";
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                break;

            case 45:
                this.menu = "<h4><img src=pda_cuffs.png> Security Record List</h4>";

                if (GlobalVars.data_core.general != null)
                {
                    foreach (dynamic _g in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        R2 = _g;

                        this.menu += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Security Records;target=").item(R2.fields["id"]).str("'>").item(R2.fields["id"]).str(": ").item(R2.fields["name"]).str("<br>").ToString();
                    }
                }
                this.menu += "<br>";
                break;

            case 451:
                this.menu = "<h4><img src=pda_cuffs.png> Security Record</h4>";

                if (GlobalVars.data_core.general.Contains(this.active1))
                {
                    this.menu += "Name: " + this.active1.fields["name"] + " ID: " + this.active1.fields["id"] + "<br>";
                    this.menu += "Sex: " + this.active1.fields["sex"] + "<br>";
                    this.menu += "Age: " + this.active1.fields["age"] + "<br>";
                    this.menu += "Rank: " + this.active1.fields["rank"] + "<br>";
                    this.menu += "Fingerprint: " + this.active1.fields["fingerprint"] + "<br>";
                    this.menu += "Physical Status: " + this.active1.fields["p_stat"] + "<br>";
                    this.menu += "Mental Status: " + this.active1.fields["m_stat"] + "<br>";
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                this.menu += "<h4><img src=pda_cuffs.png> Security Data</h4>";

                if (GlobalVars.data_core.security.Contains(this.active3))
                {
                    this.menu += "Criminal Status: " + this.active3.fields["criminal"] + "<br>";
                    this.menu += "<BR>\nMinor Crimes:";
                    this.menu += @"<table style=""text-align:center;"" border=""1"" cellspacing=""0"" width=""100%"">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>";

                    foreach (dynamic _h in Lang13.Enumerate(this.active3.fields["mi_crim"], typeof(Data_Crime)))
                    {
                        c = _h;

                        this.menu += "<tr><td>" + c.crimeName + "</td>";
                        this.menu += "<td>" + c.crimeDetails + "</td>";
                        this.menu += "<td>" + c.author + "</td>";
                        this.menu += "<td>" + c.time + "</td>";
                        this.menu += "</tr>";
                    }
                    this.menu += "</table>";
                    this.menu += "<BR>\nMajor Crimes:";
                    this.menu += @"<table style=""text-align:center;"" border=""1"" cellspacing=""0"" width=""100%"">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>";

                    foreach (dynamic _i in Lang13.Enumerate(this.active3.fields["ma_crim"], typeof(Data_Crime)))
                    {
                        c2 = _i;

                        this.menu += "<tr><td>" + c2.crimeName + "</td>";
                        this.menu += "<td>" + c2.crimeDetails + "</td>";
                        this.menu += "<td>" + c2.author + "</td>";
                        this.menu += "<td>" + c2.time + "</td>";
                        this.menu += "</tr>";
                    }
                    this.menu += "</table>";
                    this.menu += "<BR>\nImportant Notes:<br>";
                    this.menu += "" + this.active3.fields["notes"];
                }
                else
                {
                    this.menu += "<b>Record Lost!</b><br>";
                }
                this.menu += "<br>";
                break;

            case 47:
                this.menu  = "<h4><img src=pda_crate.png> Supply Record Interlink</h4>";
                this.menu += "<BR><B>Supply shuttle</B><BR>";
                this.menu += "Location: ";

                switch ((int)(GlobalVars.SSshuttle.supply.mode))
                {
                case 2:
                    this.menu += "Moving to ";

                    if (GlobalVars.SSshuttle.supply.z != 1)
                    {
                        this.menu += "station";
                    }
                    else
                    {
                        this.menu += "centcomm";
                    }
                    this.menu += " (" + GlobalVars.SSshuttle.supply.timeLeft(600) + " Mins)";
                    break;

                default:
                    this.menu += "At ";

                    if (GlobalVars.SSshuttle.supply.z != 1)
                    {
                        this.menu += "centcomm";
                    }
                    else
                    {
                        this.menu += "station";
                    }
                    break;
                }
                this.menu += "<BR>Current approved orders: <BR><ol>";

                foreach (dynamic _k in Lang13.Enumerate(GlobalVars.SSshuttle.shoppinglist))
                {
                    S3 = _k;

                    SO         = S3;
                    this.menu += "<li>#" + SO.id + " - " + SO.pack.name + " approved by " + SO.orderer + " " + (Lang13.Bool(SO.reason) ? "(" + SO.reason + ")" : "") + "</li>";
                }
                this.menu += "</ol>";
                this.menu += "Current requests: <BR><ol>";

                foreach (dynamic _l in Lang13.Enumerate(GlobalVars.SSshuttle.requestlist))
                {
                    S4 = _l;

                    SO2        = S4;
                    this.menu += "<li>#" + SO2.id + " - " + SO2.pack.name + " requested by " + SO2.orderer + "</li>";
                }
                this.menu += "</ol><font size=\"-3\">Upgrade NOW to Space Parts & Space Vendors PLUS for full remote order control and inventory management.";
                break;

            case 49:
                this.menu = "<h4><img src=pda_bucket.png> Persistent Custodial Object Locator</h4>";
                cl        = GlobalFuncs.get_turf(this);

                if (Lang13.Bool(cl))
                {
                    this.menu += "Current Orbital Location: <b>[" + cl.x + "," + cl.y + "]</b>";
                    this.menu += "<h4>Located Mops:</h4>";
                    ldat       = null;

                    foreach (dynamic _m in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Weapon_Mop)))
                    {
                        M = _m;

                        ml = GlobalFuncs.get_turf(M);

                        if (Lang13.Bool(ml))
                        {
                            if (ml.z != cl.z)
                            {
                                continue;
                            }
                            direction = Map13.GetDistance(this, M);
                            ldat     += "Mop - <b>[" + ml.x + "," + ml.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction)) + ")]</b> - " + (Lang13.Bool(M.reagents.total_volume) ? "Wet" : "Dry") + "<br>";
                        }
                    }

                    if (!Lang13.Bool(ldat))
                    {
                        this.menu += "None";
                    }
                    else
                    {
                        this.menu += "" + ldat;
                    }
                    this.menu += "<h4>Located Janitorial Cart:</h4>";
                    ldat       = null;

                    foreach (dynamic _n in Lang13.Enumerate(typeof(Game13), typeof(Obj_Structure_Janitorialcart)))
                    {
                        B = _n;

                        bl = GlobalFuncs.get_turf(B);

                        if (Lang13.Bool(bl))
                        {
                            if (bl.z != cl.z)
                            {
                                continue;
                            }
                            direction2 = Map13.GetDistance(this, B);
                            ldat      += "Cart - <b>[" + bl.x + "," + bl.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction2)) + ")]</b> - Water level: " + B.reagents.total_volume + "/100<br>";
                        }
                    }

                    if (!Lang13.Bool(ldat))
                    {
                        this.menu += "None";
                    }
                    else
                    {
                        this.menu += "" + ldat;
                    }
                    this.menu += "<h4>Located Cleanbots:</h4>";
                    ldat       = null;

                    foreach (dynamic _o in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living_SimpleAnimal_Bot_Cleanbot)))
                    {
                        B2 = _o;

                        bl2 = GlobalFuncs.get_turf(B2);

                        if (Lang13.Bool(bl2))
                        {
                            if (bl2.z != cl.z)
                            {
                                continue;
                            }
                            direction3 = Map13.GetDistance(this, B2);
                            ldat      += "Cleanbot - <b>[" + bl2.x + "," + bl2.y + " (" + String13.ToUpper(GlobalFuncs.dir2text(direction3)) + ")]</b> - " + (Lang13.Bool(B2.on) ? "Online" : "Offline") + "<br>";
                        }
                    }

                    if (!Lang13.Bool(ldat))
                    {
                        this.menu += "None";
                    }
                    else
                    {
                        this.menu += "" + ldat;
                    }
                }
                else
                {
                    this.menu += "ERROR: Unable to determine current location.";
                }
                this.menu += new Txt("<br><br><A href='byond://?src=").Ref(this).str(";choice=49'>Refresh GPS Locator</a>").ToString();
                break;

            case 53:
                this.menu  = "<h4><img src=pda_notes.png> Newscaster Access</h4>";
                this.menu += new Txt("<br> Current Newsfeed: <A href='byond://?src=").Ref(this).str(";choice=Newscaster Switch Channel'>").item((Lang13.Bool(this.current_channel) ? this.current_channel : "None")).str("</a> <br>").ToString();
                current    = null;

                foreach (dynamic _p in Lang13.Enumerate(GlobalVars.news_network.network_channels, typeof(Newscaster_FeedChannel)))
                {
                    chan = _p;


                    if (chan.channel_name == this.current_channel)
                    {
                        current = chan;
                    }
                }

                if (!(current != null))
                {
                    this.menu += "<h5> ERROR : NO CHANNEL FOUND </h5>";
                    return;
                }
                i = 1;

                foreach (dynamic _r in Lang13.Enumerate(current.messages, typeof(Newscaster_FeedMessage)))
                {
                    msg = _r;

                    this.menu += "-" + msg.returnBody(-1) + " <BR><FONT SIZE=1>[Story by <FONT COLOR='maroon'>" + msg.returnAuthor(-1) + "</FONT>]</FONT><BR>";
                    this.menu += "<b><font size=1>" + msg.comments.len + " comment" + (msg.comments.len > 1 ? "s" : "") + "</font></b><br>";

                    if (msg.img != null)
                    {
                        Interface13.CacheBrowseResource(user, msg.img, "tmp_photo" + i + ".png");
                        this.menu += "<img src='tmp_photo" + i + ".png' width = '180'><BR>";
                    }
                    i++;

                    foreach (dynamic _q in Lang13.Enumerate(msg.comments, typeof(Newscaster_FeedComment)))
                    {
                        comment = _q;

                        this.menu += "<font size=1><small>" + comment.body + "</font><br><font size=1><small><small><small>" + comment.author + " " + comment.time_stamp + "</small></small></small></small></font><br>";
                    }
                }
                this.menu += new Txt("<br> <A href='byond://?src=").Ref(this).str(";choice=Newscaster Message'>Post Message</a>").ToString();
                break;

            case 54:
                this.menu = "<h4><img src=pda_medbot.png> Bots Interlink</h4>";
                this.bot_control();
                break;
            }
            return;
        }
 // Function from file: lightreplacer.dm
 public override void janicart_insert(dynamic user = null, Obj_Structure_Janitorialcart J = null)
 {
     return;
 }