Example #1
0
        // Function from file: teleporter.dm
        public void set_target(Mob user = null)
        {
            ByTable L         = null;
            ByTable areaindex = null;
            Obj_Item_Device_Radio_Beacon R = null;
            dynamic T       = null;
            string  tmpname = null;
            Obj_Item_Weapon_Implant_Tracking I = null;
            Ent_Static M                      = null;
            dynamic    T2                     = null;
            string     tmpname2               = null;
            dynamic    desc                   = null;
            ByTable    L2                     = null;
            ByTable    areaindex2             = null;
            ByTable    S                      = null;
            Obj_Machinery_Teleport_Station R2 = null;
            dynamic T3       = null;
            string  tmpname3 = null;
            dynamic desc2    = null;
            dynamic trg      = null;


            if (this.regime_set == "Teleporter")
            {
                L         = new ByTable();
                areaindex = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Device_Radio_Beacon)))
                {
                    R = _a;

                    T = GlobalFuncs.get_turf(R);

                    if (!Lang13.Bool(T))
                    {
                        continue;
                    }

                    if (Convert.ToInt32(T.z) == 2 || Convert.ToDouble(T.z) > 7)
                    {
                        continue;
                    }
                    tmpname = T.loc.name;

                    if (Lang13.Bool(areaindex[tmpname]))
                    {
                        tmpname = "" + tmpname + " (" + ++areaindex[tmpname] + ")";
                    }
                    else
                    {
                        areaindex[tmpname] = 1;
                    }
                    L[tmpname] = R;
                }

                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.tracked_implants, typeof(Obj_Item_Weapon_Implant_Tracking)))
                {
                    I = _b;


                    if (!Lang13.Bool(I.implanted) || !(I.loc is Mob))
                    {
                        continue;
                    }
                    else
                    {
                        M = I.loc;

                        if (Convert.ToInt32(((dynamic)M).stat) == 2)
                        {
                            if (Convert.ToDouble(((dynamic)M).timeofdeath + 6000) < Game13.time)
                            {
                                continue;
                            }
                        }
                        T2 = GlobalFuncs.get_turf(M);

                        if (!Lang13.Bool(T2))
                        {
                            continue;
                        }

                        if (Convert.ToInt32(T2.z) == 2)
                        {
                            continue;
                        }
                        tmpname2 = ((dynamic)M).real_name;

                        if (Lang13.Bool(areaindex[tmpname2]))
                        {
                            tmpname2 = "" + tmpname2 + " (" + ++areaindex[tmpname2] + ")";
                        }
                        else
                        {
                            areaindex[tmpname2] = 1;
                        }
                        L[tmpname2] = I;
                    }
                }
                desc        = Interface13.Input("Please select a location to lock in.", "Locking Computer", null, null, L, InputType.Any);
                this.target = L[desc];
            }
            else
            {
                L2         = new ByTable();
                areaindex2 = new ByTable();
                S          = this.power_station.linked_stations;

                if (!(S.len != 0))
                {
                    user.WriteMsg("<span class='alert'>No connected stations located.</span>");
                    return;
                }

                foreach (dynamic _c in Lang13.Enumerate(S, typeof(Obj_Machinery_Teleport_Station)))
                {
                    R2 = _c;

                    T3 = GlobalFuncs.get_turf(R2);

                    if (!Lang13.Bool(T3) || !Lang13.Bool(R2.teleporter_hub) || !Lang13.Bool(R2.teleporter_console))
                    {
                        continue;
                    }

                    if (Convert.ToInt32(T3.z) == 2 || Convert.ToDouble(T3.z) > 7)
                    {
                        continue;
                    }
                    tmpname3 = T3.loc.name;

                    if (Lang13.Bool(areaindex2[tmpname3]))
                    {
                        tmpname3 = "" + tmpname3 + " (" + ++areaindex2[tmpname3] + ")";
                    }
                    else
                    {
                        areaindex2[tmpname3] = 1;
                    }
                    L2[tmpname3] = R2;
                }
                desc2       = Interface13.Input("Please select a station to lock in.", "Locking Computer", null, null, L2, InputType.Any);
                this.target = L2[desc2];

                if (Lang13.Bool(this.target))
                {
                    trg = this.target;
                    trg.linked_stations.Or(this.power_station);
                    trg.stat &= 65533;

                    if (Lang13.Bool(trg.teleporter_hub))
                    {
                        trg.teleporter_hub.stat &= 65533;
                        trg.teleporter_hub.update_icon();
                    }

                    if (Lang13.Bool(trg.teleporter_console))
                    {
                        trg.teleporter_console.stat &= 65533;
                        trg.teleporter_console.update_icon();
                    }
                }
            }
            return;
        }
Example #2
0
        // Function from file: prisoner.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string  dat = null;
            dynamic Tr  = null;
            Obj_Item_Weapon_Implant_Chem     C = null;
            Obj_Item_Weapon_Implant_Tracking T = null;
            dynamic loc_display = null;
            dynamic M           = null;
            dynamic mob_loc     = null;
            Browser popup       = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            ((Mob)a).set_machine(this);
            dat = "";

            if (!this.screen)
            {
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";lock=1'>Unlock Console</A>").ToString();
            }
            else if (this.screen)
            {
                dat += "<H3>Prisoner ID Management</H3>";

                if (this.inserted_id is Obj_Item_Weapon_Card_Id_Prisoner)
                {
                    dat += new Txt("<A href='?src=").Ref(this).str(";id=eject'>").item(this.inserted_id).str("</A><br>").ToString();
                    dat += new Txt("Collected Points: ").item(this.inserted_id.points).str(". <A href='?src=").Ref(this).str(";id=reset'>Reset.</A><br>").ToString();
                    dat += new Txt("Card goal: ").item(this.inserted_id.goal).str(".  <A href='?src=").Ref(this).str(";id=setgoal'>Set </A><br>").ToString();
                    dat += "Space Law recommends quotas of 100 points per minute they would normally serve in the brig.<BR>";
                }
                else
                {
                    dat += new Txt("<A href='?src=").Ref(this).str(";id=insert'>Insert Prisoner ID.</A><br>").ToString();
                }
                dat += "<H3>Prisoner Implant Management</H3>";
                dat += "<HR>Chemical Implants<BR>";
                Tr   = null;

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.tracked_implants, typeof(Obj_Item_Weapon_Implant_Chem)))
                {
                    C = _a;

                    Tr = GlobalFuncs.get_turf(C);

                    if (Lang13.Bool(Tr) && Convert.ToInt32(Tr.z) != this.z)
                    {
                        continue;
                    }

                    if (!Lang13.Bool(C.implanted))
                    {
                        continue;
                    }
                    dat += "ID: " + C.imp_in.name + " | Remaining Units: " + C.reagents.total_volume + " <BR>";
                    dat += "| Inject: ";
                    dat += new Txt("<A href='?src=").Ref(this).str(";inject1=").Ref(C).str("'>(<font class='bad'>(1)</font>)</A>").ToString();
                    dat += new Txt("<A href='?src=").Ref(this).str(";inject5=").Ref(C).str("'>(<font class='bad'>(5)</font>)</A>").ToString();
                    dat += new Txt("<A href='?src=").Ref(this).str(";inject10=").Ref(C).str("'>(<font class='bad'>(10)</font>)</A><BR>").ToString();
                    dat += "********************************<BR>";
                }
                dat += "<HR>Tracking Implants<BR>";

                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.tracked_implants, typeof(Obj_Item_Weapon_Implant_Tracking)))
                {
                    T = _b;


                    if (!(T.imp_in is Mob_Living_Carbon))
                    {
                        continue;
                    }

                    if (!Lang13.Bool(T.implanted))
                    {
                        continue;
                    }
                    Tr = GlobalFuncs.get_turf(T);

                    if (Lang13.Bool(Tr) && Convert.ToInt32(Tr.z) != this.z)
                    {
                        continue;
                    }
                    loc_display = "Unknown";
                    M           = T.imp_in;

                    if (Lang13.Bool(Tr.z) == true && !(M.loc is Tile_Space))
                    {
                        mob_loc     = GlobalFuncs.get_turf(M);
                        loc_display = mob_loc.loc;
                    }
                    dat += "ID: " + T.imp_in.name + " | Location: " + loc_display + "<BR>";
                    dat += new Txt("<A href='?src=").Ref(this).str(";warn=").Ref(T).str("'>(<font class='bad'><i>Message Holder</i></font>)</A> |<BR>").ToString();
                    dat += "********************************<BR>";
                }
                dat += new Txt("<HR><A href='?src=").Ref(this).str(";lock=1'>Lock Console</A>").ToString();
            }
            popup = new Browser(a, "computer", "Prisoner Management Console", 400, 500);
            popup.set_content(dat);
            popup.set_title_image(((Mob)a).browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
Example #3
0
        // Function from file: teleportation.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic current_location = null;
            dynamic sr = null;
            Obj_Item_Device_Radio_Beacon W = null;
            dynamic tr     = null;
            dynamic direct = null;
            Obj_Item_Weapon_Implant_Tracking W2 = null;
            Ent_Static M       = null;
            dynamic    tr2     = null;
            dynamic    direct2 = null;
            dynamic    M2      = null;

            base.Topic(href, href_list, (object)(hsrc));

            if (Task13.User.stat != 0 || Task13.User.restrained())
            {
                return(null);
            }
            current_location = GlobalFuncs.get_turf(Task13.User);

            if (!Lang13.Bool(current_location) || Convert.ToInt32(current_location.z) == 2)
            {
                Task13.User.WriteMsg("The " + this + " is malfunctioning.");
                return(null);
            }

            if (Task13.User.contents.Find(this) != 0 || Map13.GetDistance(this, Task13.User) <= 1 && this.loc is Tile)
            {
                Task13.User.set_machine(this);

                if (Lang13.Bool(href_list["refresh"]))
                {
                    this.temp = "<B>Persistent Signal Locator</B><HR>";
                    sr        = GlobalFuncs.get_turf(this);

                    if (Lang13.Bool(sr))
                    {
                        this.temp += "<B>Located Beacons:</B><BR>";

                        foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Device_Radio_Beacon)))
                        {
                            W = _a;


                            if (W.frequency == this.frequency)
                            {
                                tr = GlobalFuncs.get_turf(W);

                                if (tr.z == sr.z && Lang13.Bool(tr))
                                {
                                    direct = Num13.MaxInt(((int)(Math.Abs(Convert.ToDouble(tr.x - sr.x)))), ((int)(Math.Abs(Convert.ToDouble(tr.y - sr.y)))));

                                    if (Convert.ToDouble(direct) < 5)
                                    {
                                        direct = "very strong";
                                    }
                                    else if (Convert.ToDouble(direct) < 10)
                                    {
                                        direct = "strong";
                                    }
                                    else if (Convert.ToDouble(direct) < 20)
                                    {
                                        direct = "weak";
                                    }
                                    else
                                    {
                                        direct = "very weak";
                                    }
                                    this.temp += "" + W.code + "-" + GlobalFuncs.dir2text(Map13.GetDistance(sr, tr)) + "-" + direct + "<BR>";
                                }
                            }
                        }
                        this.temp += "<B>Extranneous Signals:</B><BR>";

                        foreach (dynamic _b in Lang13.Enumerate(GlobalVars.tracked_implants, typeof(Obj_Item_Weapon_Implant_Tracking)))
                        {
                            W2 = _b;


                            if (!Lang13.Bool(W2.implanted) || !(W2.loc is Mob))
                            {
                                continue;
                            }
                            else
                            {
                                M = W2.loc;

                                if (Convert.ToInt32(((dynamic)M).stat) == 2)
                                {
                                    if (Convert.ToDouble(((dynamic)M).timeofdeath + 6000) < Game13.time)
                                    {
                                        continue;
                                    }
                                }
                            }
                            tr2 = GlobalFuncs.get_turf(W2);

                            if (tr2.z == sr.z && Lang13.Bool(tr2))
                            {
                                direct2 = Num13.MaxInt(((int)(Math.Abs(Convert.ToDouble(tr2.x - sr.x)))), ((int)(Math.Abs(Convert.ToDouble(tr2.y - sr.y)))));

                                if (Convert.ToDouble(direct2) < 20)
                                {
                                    if (Convert.ToDouble(direct2) < 5)
                                    {
                                        direct2 = "very strong";
                                    }
                                    else if (Convert.ToDouble(direct2) < 10)
                                    {
                                        direct2 = "strong";
                                    }
                                    else
                                    {
                                        direct2 = "weak";
                                    }
                                    this.temp += "" + W2.imp_in.name + "-" + GlobalFuncs.dir2text(Map13.GetDistance(sr, tr2)) + "-" + direct2 + "<BR>";
                                }
                            }
                        }
                        this.temp += new Txt("<B>You are at [").item(sr.x).str(",").item(sr.y).str(",").item(sr.z).str("]</B> in orbital coordinates.<BR><BR><A href='byond://?src=").Ref(this).str(";refresh=1'>Refresh</A><BR>").ToString();
                    }
                    else
                    {
                        this.temp += "<B><FONT color='red'>Processing Error:</FONT></B> Unable to locate orbital position.<BR>";
                    }
                }
                else if (Lang13.Bool(href_list["freq"]))
                {
                    this.frequency += String13.ParseNumber(href_list["freq"]) ?? 0;
                    this.frequency  = GlobalFuncs.sanitize_frequency(this.frequency);
                }
                else if (Lang13.Bool(href_list["temp"]))
                {
                    this.temp = null;
                }

                if (this.loc is Mob)
                {
                    this.attack_self(this.loc);
                }
                else
                {
                    foreach (dynamic _c in Lang13.Enumerate(Map13.FetchViewers(this, 1)))
                    {
                        M2 = _c;


                        if (Lang13.Bool(M2.client))
                        {
                            this.attack_self(M2);
                        }
                    }
                }
            }
            return(null);
        }