예제 #1
0
 // Function from file: Beacon.dm
 public override dynamic Destroy(  )
 {
     if (this.Beacon != null)
     {
         GlobalFuncs.qdel(this.Beacon);
     }
     this.Beacon = null;
     return(base.Destroy());
 }
예제 #2
0
        // Function from file: Beacon.dm
        public Obj_Machinery_BluespaceBeacon(dynamic loc = null) : base((object)(loc))
        {
            Ent_Static T = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            T           = this.loc;
            this.Beacon = new Obj_Item_Device_Radio_Beacon();
            this.Beacon.invisibility = 100;
            this.Beacon.loc          = T;
            this.hide(Lang13.Bool(((dynamic)T).intact));
            return;
        }
예제 #3
0
        // Function from file: equipment_locker.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic device_turf                      = null;
            ByTable L                                = null;
            Obj_Item_Device_Radio_Beacon B           = null;
            dynamic T                                = null;
            dynamic chosen_beacon                    = null;
            Obj_Effect_Portal_Wormhole_JauntTunnel J = null;

            device_turf = GlobalFuncs.get_turf(user);

            if (!Lang13.Bool(device_turf) || Convert.ToInt32(device_turf.z) == 2 || Convert.ToDouble(device_turf.z) >= 7)
            {
                user.WriteMsg("<span class='notice'>You're having difficulties getting the " + this.name + " to work.</span>");
                return(null);
            }
            else
            {
                ((Ent_Static)user).visible_message("<span class='notice'>" + user.name + " activates the " + this.name + "!</span>");
                L = new ByTable();

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

                    T = GlobalFuncs.get_turf(B);

                    if (Lang13.Bool(T.z) == true)
                    {
                        L.Add(B);
                    }
                }

                if (!(L.len != 0))
                {
                    user.WriteMsg("<span class='notice'>The " + this.name + " failed to create a wormhole.</span>");
                    return(null);
                }
                chosen_beacon = Rand13.PickFromTable(L);
                J             = new Obj_Effect_Portal_Wormhole_JauntTunnel(GlobalFuncs.get_turf(this), chosen_beacon, null, 100);
                J.target      = chosen_beacon;
                GlobalFuncs.try_move_adjacent(J);
                GlobalFuncs.playsound(this, "sound/effects/sparks4.ogg", 50, 1);
                GlobalFuncs.qdel(this);
            }
            return(null);
        }
예제 #4
0
        // Function from file: Beacon.dm
        public override int?process(dynamic seconds = null)
        {
            Ent_Static T = null;


            if (!(this.Beacon != null))
            {
                T           = this.loc;
                this.Beacon = new Obj_Item_Device_Radio_Beacon();
                this.Beacon.invisibility = 100;
                this.Beacon.loc          = T;
            }

            if (this.Beacon != null)
            {
                if (this.Beacon.loc != this.loc)
                {
                    this.Beacon.loc = this.loc;
                }
            }
            this.updateicon();
            return(null);
        }
        // Function from file: anomaly_bluespace.dm
        public override void end(  )
        {
            dynamic T        = null;
            dynamic chosen   = null;
            ByTable possible = null;
            Obj_Item_Device_Radio_Beacon W = null;
            dynamic           FROM         = null;
            dynamic           TO           = null;
            ByTable           flashers     = null;
            Mob_Living_Carbon C            = null;
            double            y_distance   = 0;
            double            x_distance   = 0;
            Ent_Dynamic       A            = null;
            Tile        newloc             = null;
            Ent_Dynamic M          = null;
            Obj         blueeffect = null;


            if (this.newAnomaly.loc != null)
            {
                T = GlobalFuncs.safepick(GlobalFuncs.get_area_turfs(this.impact_area));

                if (Lang13.Bool(T))
                {
                    possible = new ByTable();

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

                        possible.Add(W);
                    }

                    if (possible.len > 0)
                    {
                        chosen = Rand13.PickFromTable(possible);
                    }

                    if (Lang13.Bool(chosen))
                    {
                        FROM = T;
                        TO   = GlobalFuncs.get_turf(chosen);
                        GlobalFuncs.playsound(TO, "sound/effects/phasein.ogg", 100, 1);
                        GlobalFuncs.priority_announce("Massive bluespace translocation detected.", "Anomaly Alert");
                        flashers = new ByTable();

                        foreach (dynamic _b in Lang13.Enumerate(Map13.FetchViewers(null, TO), typeof(Mob_Living_Carbon)))
                        {
                            C = _b;


                            if (C.flash_eyes())
                            {
                                flashers.Add(C);
                            }
                        }
                        y_distance = Convert.ToDouble(TO.y - FROM.y);
                        x_distance = Convert.ToDouble(TO.x - FROM.x);

                        foreach (dynamic _c in Lang13.Enumerate(GlobalFuncs.ultra_range(12, FROM), typeof(Ent_Dynamic)))
                        {
                            A = _c;


                            if (A is Obj_Item_Device_Radio_Beacon)
                            {
                                continue;
                            }

                            if (Lang13.Bool(A.anchored))
                            {
                                continue;
                            }
                            newloc = Map13.GetTile(((int)(A.x + x_distance)), ((int)(A.y + y_distance)), Convert.ToInt32(TO.z));

                            if (!A.Move(newloc) && newloc != null)
                            {
                                A.loc = newloc;
                            }
                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (A is Mob && !flashers.Contains(A))
                                {
                                    M = A;

                                    if (Lang13.Bool(((dynamic)M).client))
                                    {
                                        blueeffect                  = new Obj(this);
                                        blueeffect.screen_loc       = "WEST,SOUTH to EAST,NORTH";
                                        blueeffect.icon             = "icons/effects/effects.dmi";
                                        blueeffect.icon_state       = "shieldsparkles";
                                        blueeffect.layer            = 17;
                                        blueeffect.mouse_opacity    = 0;
                                        ((dynamic)M).client.screen += blueeffect;
                                        Task13.Sleep(20);
                                        ((dynamic)M).client.screen -= blueeffect;
                                        GlobalFuncs.qdel(blueeffect);
                                    }
                                }
                                return;
                            }));
                        }
                    }
                    GlobalFuncs.qdel(this.newAnomaly);
                }
            }
            return;
        }
예제 #6
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;
        }
예제 #7
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);
        }