Beispiel #1
0
        // Function from file: receiver.dm
        public bool check_receive_level(Signal signal = null)
        {
            Obj_Machinery_Telecomms_Hub H   = null;
            ByTable connected_levels        = null;
            Obj_Machinery_Telecomms_Relay R = null;


            if (Lang13.IntNullable(signal.data["level"]) != this.listening_level)
            {
                foreach (dynamic _b in Lang13.Enumerate(this.links, typeof(Obj_Machinery_Telecomms_Hub)))
                {
                    H = _b;

                    connected_levels = new ByTable();

                    foreach (dynamic _a in Lang13.Enumerate(H.links, typeof(Obj_Machinery_Telecomms_Relay)))
                    {
                        R = _a;


                        if (R.can_receive(signal))
                        {
                            connected_levels.Or(R.listening_level);
                        }
                    }

                    if (connected_levels.Contains(signal.data["level"]))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        // Function from file: job.dm
        public virtual ByTable get_access(  )
        {
            ByTable _default = null;


            if (!(GlobalVars.config != null))
            {
                return(this.minimal_access.Copy());
            }
            _default = new ByTable();

            if (GlobalVars.config.jobs_have_minimal_access)
            {
                _default = this.minimal_access.Copy();
            }
            else
            {
                _default = this.access.Copy();
            }

            if ((GlobalVars.config.jobs_have_maint_access & 4) != 0)
            {
                _default.Or(new ByTable(new object [] { GlobalVars.access_maint_tunnels }));
            }
            return(_default);
        }
Beispiel #3
0
        // Function from file: security.dm
        public override ByTable get_access(  )
        {
            ByTable L = null;

            L = new ByTable();
            L.Or(base.get_access() | this.check_config_for_sec_maint());
            return(L);
        }
Beispiel #4
0
        // Function from file: cameranet.dm
        public void visibility(Mob_Camera_AiEye ai = null)
        {
            int     x1            = 0;
            int     y1            = 0;
            int?    x2            = null;
            int?    y2            = null;
            ByTable visibleChunks = null;
            int?    x             = null;
            int?    y             = null;
            ByTable remove        = null;
            ByTable add           = null;
            dynamic chunk         = null;
            dynamic c             = null;
            dynamic chunk2        = null;
            dynamic c2            = null;

            x1            = Num13.MaxInt(0, ai.x - 16) & 65520;
            y1            = Num13.MaxInt(0, ai.y - 16) & 65520;
            x2            = Num13.MinInt(Game13.map_size_x, ai.x + 16) & 65520;
            y2            = Num13.MinInt(Game13.map_size_y, ai.y + 16) & 65520;
            visibleChunks = new ByTable();
            x             = null;
            x             = x1;

            while ((x ?? 0) <= (x2 ?? 0))
            {
                y = null;
                y = y1;

                while ((y ?? 0) <= (y2 ?? 0))
                {
                    visibleChunks.Or(this.getCameraChunk(x, y, ai.z));
                    y += GlobalVars.CHUNK_SIZE;
                }
                x += GlobalVars.CHUNK_SIZE;
            }
            remove = ai.visibleCameraChunks - visibleChunks;
            add    = visibleChunks - ai.visibleCameraChunks;

            foreach (dynamic _a in Lang13.Enumerate(remove))
            {
                chunk = _a;

                c = chunk;
                ((Camerachunk)c).remove(ai);
            }

            foreach (dynamic _b in Lang13.Enumerate(add))
            {
                chunk2 = _b;

                c2 = chunk2;
                ((Camerachunk)c2).add(ai);
            }
            return;
        }
Beispiel #5
0
        // Function from file: dna.dm
        public ByTable species_get_spans(  )
        {
            ByTable spans = null;

            spans = new ByTable();

            if (Lang13.Bool(this.species))
            {
                spans.Or(this.species.get_spans());
            }
            return(spans);
        }
Beispiel #6
0
        // Function from file: dna.dm
        public ByTable mutations_get_spans(  )
        {
            ByTable        spans = null;
            Mutation_Human M     = null;

            spans = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(this.mutations, typeof(Mutation_Human)))
            {
                M = _a;

                spans.Or(M.get_spans());
            }
            return(spans);
        }
Beispiel #7
0
        // Function from file: assistant.dm
        public override ByTable get_access(  )
        {
            ByTable _default = null;


            if ((GlobalVars.config.jobs_have_maint_access & 1) != 0 || !GlobalVars.config.jobs_have_minimal_access)
            {
                _default = base.get_access();
                _default.Or(new ByTable(new object [] { GlobalVars.access_maint_tunnels }));
            }
            else
            {
                return(base.get_access());
            }
            return(_default);
        }
Beispiel #8
0
        // Function from file: mutations.dm
        public virtual dynamic on_acquiring(dynamic owner = null)
        {
            ByTable mut_overlay = null;


            if (!Lang13.Bool(owner) || !(owner is Mob_Living_Carbon_Human) || Convert.ToInt32(owner.stat) == 2 || Lang13.Bool(owner.dna.mutations.Contains(this)))
            {
                return(1);
            }

            if (this.species_allowed.len != 0 && !(this.species_allowed.Find(owner.dna.species.id) != 0))
            {
                return(1);
            }

            if (this.health_req != 0 && Convert.ToDouble(owner.health) < this.health_req)
            {
                return(1);
            }
            owner.dna.mutations.Add(this);

            if (Lang13.Bool(this.text_gain_indication))
            {
                owner.WriteMsg(this.text_gain_indication);
            }

            if (this.visual_indicators.len != 0)
            {
                mut_overlay = new ByTable(new object [] { this.get_visual_indicator(owner) });

                if (Lang13.Bool(owner.overlays_standing[this.layer_used]))
                {
                    mut_overlay = owner.overlays_standing[this.layer_used];
                    mut_overlay.Or(this.get_visual_indicator(owner));
                }
                owner.remove_overlay(this.layer_used);
                owner.overlays_standing[this.layer_used] = mut_overlay;
                owner.apply_overlay(this.layer_used);
            }
            return(null);
        }
Beispiel #9
0
        // Function from file: experimentor.dm
        public void rapidDupe(Ent_Static user = null)
        {
            ByTable dupes   = null;
            int     counter = 0;
            int     max     = 0;
            dynamic R       = null;
            dynamic R2      = null;

            this.audible_message("" + this + " emits a loud pop!");
            dupes   = new ByTable();
            max     = Rand13.Int(5, 10);
            counter = 1;

            while (counter < max)
            {
                R          = Lang13.Call(this.type, GlobalFuncs.get_turf(this));
                R.name     = this.name;
                R.desc     = this.desc;
                R.realName = this.realName;
                R.realProc = this.realProc;
                R.revealed = GlobalVars.TRUE;
                dupes.Or(R);
                ((Ent_Dynamic)R).throw_at_fast(Rand13.PickFromTable(Map13.FetchInViewExcludeThis(GlobalFuncs.get_turf(this), 7)), 10, 1);
                counter++;
            }
            counter = 0;
            Task13.Schedule(Rand13.Int(10, 100), (Task13.Closure)(() => {
                counter = 1;

                while (counter <= dupes.len)
                {
                    R2 = dupes[counter];
                    GlobalFuncs.qdel(R2);
                    counter++;
                }
                return;
            }));
            this.warn_admins(user, "Rapid duplicator", false);
            return;
        }
Beispiel #10
0
        // Function from file: storage.dm
        public ByTable can_see_contents(  )
        {
            ByTable cansee = null;
            dynamic M      = null;

            cansee = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(this.is_seeing))
            {
                M = _a;


                if (M.s_active == this && Lang13.Bool(M.client))
                {
                    cansee.Or(M);
                }
                else
                {
                    this.is_seeing.Remove(M);
                }
            }
            return(cansee);
        }
        // Function from file: scanners.dm
        public void flick_sonar(Obj pipe = null)
        {
            Image   I      = null;
            ByTable nearby = null;
            dynamic M      = null;

            I       = new Image("icons/effects/effects.dmi", pipe, "blip", pipe.layer + 1);
            I.alpha = 128;
            nearby  = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(null, pipe)))
            {
                M = _a;


                if (Lang13.Bool(M.client))
                {
                    nearby.Or(M.client);
                }
            }
            GlobalFuncs.flick_overlay(I, nearby, 8);
            return;
        }
Beispiel #12
0
        // Function from file: equipment_locker.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            ByTable mobs = null;


            if (!Lang13.Bool(user.client))
            {
                return(null);
            }

            if (!this.cooldown)
            {
                this.cooldown = true;
                Task13.Schedule(40, (Task13.Closure)(() => {
                    this.cooldown = false;
                    return;
                }));
                mobs = new ByTable();
                mobs.Or(user);
                GlobalFuncs.mineral_scan_pulse(mobs, GlobalFuncs.get_turf(user));
            }
            return(null);
        }
Beispiel #13
0
        // Function from file: blueprints.dm
        public dynamic detect_room(dynamic first = null)
        {
            ByTable                   found     = null;
            ByTable                   pending   = null;
            ByTable                   border    = null;
            Ent_Static                T         = null;
            dynamic                   dir       = null;
            bool                      skip      = false;
            Obj_Structure_Window      W         = null;
            Obj_Machinery_Door_Window D         = null;
            Tile                      NT        = null;
            Ent_Static                A         = null;
            dynamic                   V         = null;
            dynamic                   F         = null;
            dynamic                   direction = null;
            Tile                      U         = null;

            found   = new ByTable();
            pending = new ByTable(new object [] { first });
            border  = new ByTable();

            while (pending.len != 0)
            {
                if (found.len + pending.len > 300)
                {
                    return(GlobalVars.ROOM_ERR_TOOLARGE);
                }
                T = pending[1];
                pending.Remove(T);

                foreach (dynamic _d in Lang13.Enumerate(GlobalVars.cardinal))
                {
                    dir = _d;

                    skip = false;

                    foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Structure_Window)))
                    {
                        W = _a;


                        if (dir == W.dir || new ByTable(new object [] { GlobalVars.NORTHEAST, GlobalVars.SOUTHEAST, GlobalVars.NORTHWEST, GlobalVars.SOUTHWEST }).Contains(W.dir))
                        {
                            skip = true;
                            break;
                        }
                    }

                    if (skip)
                    {
                        continue;
                    }

                    foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj_Machinery_Door_Window)))
                    {
                        D = _b;


                        if (dir == D.dir)
                        {
                            skip = true;
                            break;
                        }
                    }

                    if (skip)
                    {
                        continue;
                    }
                    NT = Map13.GetStep(T, Convert.ToInt32(dir));

                    if (!(NT is Tile) || found.Contains(NT) || pending.Contains(NT))
                    {
                        continue;
                    }

                    switch ((int)(this.check_tile_is_border(NT, dir)))
                    {
                    case 1:
                        pending.Add(NT);
                        break;

                    case 2:
                        A = NT.loc;

                        if (!Lang13.Bool(found[A.name]))
                        {
                            found[A.name] = NT.loc;
                        }
                        break;

                    case 3:
                        border[NT] += dir;
                        break;

                    case 4:
                        return(GlobalVars.ROOM_ERR_SPACE);

                        break;
                    }
                }
                found.Add(T);
            }

            foreach (dynamic _f in Lang13.Enumerate(border))
            {
                V = _f;

                F = V;

                foreach (dynamic _e in Lang13.Enumerate(GlobalVars.cardinal))
                {
                    direction = _e;


                    if (direction == border[F])
                    {
                        continue;
                    }
                    U = Map13.GetStep(F, Convert.ToInt32(direction));

                    if (border.Contains(U) || found.Contains(U))
                    {
                        continue;
                    }

                    if (this.check_tile_is_border(U, direction) == GlobalVars.BORDER_2NDTILE)
                    {
                        found.Add(U);
                    }
                }
                found.Or(F);
            }
            return(found);
        }
        // Function from file: slime_extracts.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            ByTable           blocked = null;
            dynamic           borks   = null;
            Mob_Living_Carbon C       = null;
            int?    i      = null;
            dynamic chosen = null;
            dynamic B      = null;
            int?    j      = null;

            GlobalFuncs.feedback_add_details("slime_cores_used", "" + this.type);
            blocked = new ByTable(new object [] {
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Store_Bread),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Breadslice),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Store_Cake),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Cakeslice),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Store),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pie),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Kebab),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizza),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizzaslice),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Salad),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Meat),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Meat_Slab),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Soup),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Grown),
                typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Grown_Mushroom)
            });
            blocked.Or(Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable)));
            borks = Lang13.GetTypes(typeof(Obj_Item_Weapon_ReagentContainers_Food_Snacks)) - blocked;
            GlobalFuncs.playsound(GlobalFuncs.get_turf(holder.my_atom), "sound/effects/phasein.ogg", 100, 1);

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchViewers(null, GlobalFuncs.get_turf(holder.my_atom)), typeof(Mob_Living_Carbon)))
            {
                C = _a;

                C.flash_eyes();
            }
            i = null;
            i = 1;

            while ((i ?? 0) <= Rand13.Int(1, 2) + 4)
            {
                chosen = Rand13.PickFromTable(borks);
                B      = Lang13.Call(chosen);

                if (Lang13.Bool(B))
                {
                    B.loc = GlobalFuncs.get_turf(holder.my_atom);

                    if (Rand13.PercentChance(50))
                    {
                        j = null;
                        j = 1;

                        while ((j ?? 0) <= Rand13.Int(1, 3))
                        {
                            Map13.Step(B, Convert.ToInt32(Rand13.Pick(new object [] { GlobalVars.NORTH, GlobalVars.SOUTH, GlobalVars.EAST, GlobalVars.WEST })));
                            j++;
                        }
                    }
                }
                i++;
            }
            return;
        }
Beispiel #15
0
        // Function from file: datum_pipeline.dm
        public void reconcile_air(  )
        {
            ByTable  GL = null;
            ByTable  PL = null;
            int?     i  = null;
            Pipeline P  = null;
            Obj_Machinery_Atmospherics_Components_Binary_Valve             V = null;
            Obj_Machinery_Atmospherics_Components_Unary_PortablesConnector C = null;
            double     total_thermal_energy = 0;
            double     total_heat_capacity  = 0;
            GasMixture total_gas_mixture    = null;
            dynamic    i2      = null;
            dynamic    G       = null;
            dynamic    i3      = null;
            dynamic    G2      = null;
            ByTable    G_gases = null;
            dynamic    id      = null;

            GL = new ByTable();
            PL = new ByTable();
            PL.Add(this);
            i = null;
            i = 1;

            while ((i ?? 0) <= PL.len)
            {
                P = PL[i];
                GL.Add(P.air);
                GL.Add(P.other_airs);

                foreach (dynamic _a in Lang13.Enumerate(P.other_atmosmch, typeof(Obj_Machinery_Atmospherics_Components_Binary_Valve)))
                {
                    V = _a;


                    if (V.open)
                    {
                        PL.Or(V.parents[1]);
                        PL.Or(V.parents[2]);
                    }
                }

                foreach (dynamic _b in Lang13.Enumerate(P.other_atmosmch, typeof(Obj_Machinery_Atmospherics_Components_Unary_PortablesConnector)))
                {
                    C = _b;


                    if (C.connected_device != null)
                    {
                        GL.Add(C.portableConnectorReturnAir());
                    }
                }
                i++;
            }
            total_thermal_energy = 0;
            total_heat_capacity  = 0;
            total_gas_mixture    = new GasMixture(0);

            foreach (dynamic _c in Lang13.Enumerate(GL))
            {
                i2 = _c;

                G = i2;
                total_gas_mixture.volume += Convert.ToDouble(G.volume);
                total_gas_mixture.merge(G);
                total_thermal_energy += Convert.ToDouble(((GasMixture)G).thermal_energy());
                total_heat_capacity  += ((GasMixture)G).heat_capacity();
            }
            total_gas_mixture.temperature = (total_heat_capacity != 0 ? total_thermal_energy / total_heat_capacity : 0);

            if ((total_gas_mixture.volume ?? 0) > 0)
            {
                foreach (dynamic _e in Lang13.Enumerate(GL))
                {
                    i3 = _e;

                    G2 = i3;
                    G2.copy_from(total_gas_mixture);
                    G_gases = G2.gases;

                    foreach (dynamic _d in Lang13.Enumerate(G_gases))
                    {
                        id = _d;

                        G_gases[id][1] *= G2.volume / total_gas_mixture.volume;
                    }
                }
            }
            return;
        }
Beispiel #16
0
        // Function from file: blob_report.dm
        public void count(bool?count_territories = null)
        {
            dynamic T = null;
            Obj     O = null;
            ByTable valid_territories = null;
            dynamic A = null;


            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInBlock(Map13.GetTile(1, 1, 1), Map13.GetTile(Game13.map_size_x, Game13.map_size_y, 1))))
            {
                T = _b;


                if (T is Tile_Simulated_Floor)
                {
                    if (!T.burnt)
                    {
                        this.floor += 12;
                    }
                    else
                    {
                        this.floor += 1;
                    }
                }

                if (T is Tile_Simulated_Wall)
                {
                    if (T.intact)
                    {
                        this.wall += 2;
                    }
                    else
                    {
                        this.wall += 1;
                    }
                }

                if (T is Tile_Simulated_Wall_RWall)
                {
                    if (T.intact)
                    {
                        this.r_wall += 2;
                    }
                    else
                    {
                        this.r_wall += 1;
                    }
                }

                foreach (dynamic _a in Lang13.Enumerate(T.contents, typeof(Obj)))
                {
                    O = _a;


                    if (O is Obj_Structure_Window)
                    {
                        this.window += 1;
                    }
                    else if (O is Obj_Structure_Grille && !Lang13.Bool(((dynamic)O).destroyed))
                    {
                        this.grille += 1;
                    }
                    else if (O is Obj_Machinery_Door)
                    {
                        this.door += 1;
                    }
                    else if (O is Obj_Machinery)
                    {
                        this.mach += 1;
                    }
                }
            }

            if (count_territories == true)
            {
                valid_territories = new ByTable();

                foreach (dynamic _c in Lang13.Enumerate(typeof(Game13)))
                {
                    A = _c;


                    if (Lang13.Bool(A.z) == true)
                    {
                        if (!valid_territories.Contains(A.type) && A.valid_territory)
                        {
                            valid_territories.Or(A.type);
                        }
                    }
                }

                if (valid_territories.len != 0)
                {
                    this.num_territories = valid_territories.len;
                }
                else
                {
                    Game13.WriteMsg("ERROR: NO VALID TERRITORIES");
                }
            }
            return;
        }
Beispiel #17
0
        // Function from file: artefact.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            string     wgw         = null;
            Tile       T           = null;
            ByTable    nearby_mobs = null;
            Mob_Living L           = null;
            dynamic    T2          = null;


            if (!Lang13.Bool(this.target) && this.possible.len != 0)
            {
                this.target = Interface13.Input(user, "Select your victim!", "Voodoo", null, this.possible, InputType.Null | InputType.Any);
                return(null);
            }

            if (user.zone_selected == "chest")
            {
                if (Lang13.Bool(this.link))
                {
                    this.target   = null;
                    this.link.loc = GlobalFuncs.get_turf(this);
                    user.WriteMsg("<span class='notice'>You remove the " + this.link + " from the doll.</span>");
                    this.link = null;
                    this.update_targets();
                    return(null);
                }
            }

            if (Lang13.Bool(this.target) && this.cooldown < Game13.time)
            {
                switch ((string)(user.zone_selected))
                {
                case "mouth":
                    wgw = GlobalFuncs.sanitize(Interface13.Input(user, "What would you like the victim to say", "Voodoo", null, null, InputType.Str));
                    ((Ent_Dynamic)this.target).say(wgw);
                    GlobalFuncs.log_game("" + user + user.key + " made " + this.target + this.target.key + " say " + wgw + " with a voodoo doll.");
                    break;

                case "eyes":
                    ((Mob)user).set_machine(this);
                    ((Mob)user).reset_perspective(this.target);
                    Task13.Schedule(100, (Task13.Closure)(() => {
                        ((Mob)user).reset_perspective(null);
                        ((Mob)user).unset_machine();
                        return;
                    }));
                    break;

                case "r_leg":
                case "l_leg":
                    user.WriteMsg("<span class='notice'>You move the doll's legs around.</span>");
                    T = Map13.GetStep(this.target, Convert.ToInt32(Rand13.PickFromTable(GlobalVars.cardinal)));
                    this.target.Move(T);
                    break;

                case "r_arm":
                case "l_arm":
                    nearby_mobs = new ByTable();

                    foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(this.target, 1), typeof(Mob_Living)))
                    {
                        L = _a;


                        if (L != this.target)
                        {
                            nearby_mobs.Or(L);
                        }
                    }

                    if (nearby_mobs.len != 0)
                    {
                        T2 = Rand13.PickFromTable(nearby_mobs);
                        GlobalFuncs.log_game("" + user + user.key + " made " + this.target + this.target.key + " click on " + T2 + " with a voodoo doll.");
                        this.target.ClickOn(T2);
                        this.GiveHint(this.target);
                    }
                    break;

                case "head":
                    user.WriteMsg("<span class='notice'>You smack the doll's head with your hand.</span>");
                    ((Mob)this.target).Dizzy(10);
                    this.target.WriteMsg("<span class='warning'>You suddenly feel as if your head was hit with a hammer!</span>");
                    this.GiveHint(this.target, user);
                    break;
                }
                this.cooldown = Game13.time + this.cooldown_time;
            }
            return(null);
        }
Beispiel #18
0
        // Function from file: radio.dm
        public override void talk_into(dynamic M = null, dynamic input = null, dynamic channel = null, ByTable spans = null)
        {
            dynamic     freq      = null;
            double?     freqnum   = null;
            dynamic     position  = null;
            string      real_name = null;
            string      mobkey    = null;
            bool        voicemask = false;
            dynamic     voice     = null;
            dynamic     speaker   = null;
            string      jobname   = null;
            Data_Record findjob   = null;
            dynamic     B         = null;
            Signal      signal    = null;
            Signal      signal2   = null;
            Obj_Machinery_Telecomms_Receiver R  = null;
            Obj_Machinery_Telecomms_Allinone R2 = null;
            int?   filter_type = null;
            Signal signal3     = null;
            Obj_Machinery_Telecomms_Receiver R3 = null;


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

            if (!Lang13.Bool(M) || !Lang13.Bool(input))
            {
                return;
            }

            if (((Wires)this.wires).is_cut("transmit"))
            {
                return;
            }

            if (!((Ent_Dynamic)M).IsVocal())
            {
                return;
            }

            if (this.use_command)
            {
                spans.Or("commmand_headset");
            }

            if (Lang13.Bool(channel) && this.channels != null && this.channels.len > 0)
            {
                if (channel == "department")
                {
                    channel = this.channels[1];
                }
                freq = this.secure_radio_connections[channel];

                if (!Lang13.Bool(this.channels[channel]))
                {
                    return;
                }
            }
            else
            {
                freq    = this.frequency;
                channel = null;
            }
            freqnum   = String13.ParseNumber(freq);
            position  = GlobalFuncs.get_turf(this);
            real_name = M.name;
            mobkey    = "none";
            voicemask = false;
            voice     = ((Ent_Dynamic)M).GetVoice();

            if (M is Mob)
            {
                speaker   = M;
                real_name = speaker.real_name;

                if (Lang13.Bool(speaker.client))
                {
                    mobkey = speaker.key;
                }
            }

            if (M is Mob_Living_Carbon_Human)
            {
                findjob = GlobalFuncs.find_record("name", voice, GlobalVars.data_core.general);

                if (voice != real_name)
                {
                    voicemask = true;
                }

                if (findjob != null)
                {
                    jobname = findjob.fields["rank"];
                }
                else
                {
                    jobname = "Unknown";
                }
            }
            else if (M is Mob_Living_Carbon)
            {
                jobname = "No id";
            }
            else if (M is Mob_Living_Silicon_Ai)
            {
                jobname = "AI";
            }
            else if (M is Mob_Living_Silicon_Robot)
            {
                B       = M;
                jobname = "" + B.designation + " Cyborg";
            }
            else if (M is Mob_Living_Silicon_Pai)
            {
                jobname = "Personal AI";
            }
            else if (M is Obj)
            {
                jobname = "Machine";
            }
            else
            {
                jobname = "Unknown";
            }

            if (freqnum == GlobalVars.CENTCOM_FREQ && this.centcom)
            {
                signal = new Signal();
                signal.transmission_method = 2;
                signal.data = new ByTable()
                              .Set("mob", M)
                              .Set("mobtype", M.type)
                              .Set("realname", real_name)
                              .Set("name", voice)
                              .Set("job", jobname)
                              .Set("key", mobkey)
                              .Set("vmask", voicemask)
                              .Set("compression", 0)
                              .Set("message", input)
                              .Set("radio", this)
                              .Set("slow", 0)
                              .Set("traffic", 0)
                              .Set("type", 0)
                              .Set("server", null)
                              .Set("reject", 0)
                              .Set("level", 0)
                              .Set("languages", this.languages)
                              .Set("spans", spans)
                              .Set("verb_say", M.verb_say)
                              .Set("verb_ask", M.verb_ask)
                              .Set("verb_exclaim", M.verb_exclaim)
                              .Set("verb_yell", M.verb_yell)
                ;
                signal.frequency = freqnum;
                GlobalFuncs.Broadcast_Message(M, voicemask, this, input, voice, jobname, real_name, 5, Lang13.Bool(signal.data["compression"]), new ByTable(new object [] { position.z, 0 }), freq, spans, this.verb_say, this.verb_ask, this.verb_exclaim, this.verb_yell);
                return;
            }

            if (this.subspace_transmission)
            {
                signal2 = new Signal();
                signal2.transmission_method = 2;
                signal2.data = new ByTable()
                               .Set("mob", M)
                               .Set("mobtype", M.type)
                               .Set("realname", real_name)
                               .Set("name", voice)
                               .Set("job", jobname)
                               .Set("key", mobkey)
                               .Set("vmask", voicemask)
                               .Set("compression", Rand13.Int(35, 65))
                               .Set("message", input)
                               .Set("radio", this)
                               .Set("slow", 0)
                               .Set("traffic", 0)
                               .Set("type", 0)
                               .Set("server", null)
                               .Set("reject", 0)
                               .Set("level", position.z)
                               .Set("languages", M.languages)
                               .Set("spans", spans)
                               .Set("verb_say", M.verb_say)
                               .Set("verb_ask", M.verb_ask)
                               .Set("verb_exclaim", M.verb_exclaim)
                               .Set("verb_yell", M.verb_yell)
                ;
                signal2.frequency = freq;

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.telecomms_list, typeof(Obj_Machinery_Telecomms_Receiver)))
                {
                    R = _a;

                    R.receive_signal(signal2);
                }

                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.telecomms_list, typeof(Obj_Machinery_Telecomms_Allinone)))
                {
                    R2 = _b;

                    R2.receive_signal(signal2);
                }
                return;
            }
            filter_type = 2;
            signal3     = new Signal();
            signal3.transmission_method = 2;
            signal3.data = new ByTable()
                           .Set("mob", M)
                           .Set("mobtype", M.type)
                           .Set("realname", real_name)
                           .Set("name", voice)
                           .Set("job", jobname)
                           .Set("key", mobkey)
                           .Set("vmask", voicemask)
                           .Set("compression", 0)
                           .Set("message", input)
                           .Set("radio", this)
                           .Set("slow", 0)
                           .Set("traffic", 0)
                           .Set("type", 0)
                           .Set("server", null)
                           .Set("reject", 0)
                           .Set("level", position.z)
                           .Set("languages", this.languages)
                           .Set("spans", spans)
                           .Set("verb_say", M.verb_say)
                           .Set("verb_ask", M.verb_ask)
                           .Set("verb_exclaim", M.verb_exclaim)
                           .Set("verb_yell", M.verb_yell)
            ;
            signal3.frequency = freqnum;

            foreach (dynamic _c in Lang13.Enumerate(GlobalVars.telecomms_list, typeof(Obj_Machinery_Telecomms_Receiver)))
            {
                R3 = _c;

                R3.receive_signal(signal3);
            }
            Task13.Schedule(20, (Task13.Closure)(() => {
                if (Lang13.Bool(signal3.data["level"].Contains(Lang13.Bool(signal3.data["done"]) && Lang13.Bool(position.z))))
                {
                    return;
                }
                GlobalFuncs.Broadcast_Message(M, voicemask, this, input, voice, jobname, real_name, filter_type, Lang13.Bool(signal3.data["compression"]), new ByTable(new object [] { position.z }), freq, spans, this.verb_say, this.verb_ask, this.verb_exclaim, this.verb_yell);
                return;
            }));
            return;
        }
        // Function from file: atmos_control.dm
        public void reconnect(Mob user = null)
        {
            ByTable        IO      = null;
            RadioFrequency freq    = null;
            dynamic        devices = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump U = null;
            ByTable text = null;
            Obj_Machinery_Atmospherics_Components_Unary_OutletInjector U2 = null;
            ByTable text2              = null;
            dynamic S                  = null;
            dynamic new_devices        = null;
            Obj_Machinery_AirSensor U3 = null;
            ByTable text3              = null;
            Obj_Machinery_Atmospherics_Components_Unary_OutletInjector U4 = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump       U5 = null;

            IO      = new ByTable();
            freq    = GlobalVars.SSradio.return_frequency(1441);
            devices = freq.devices["_default"];

            foreach (dynamic _a in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                U = _a;

                text = GlobalFuncs.splittext(U.id_tag, "_");
                IO.Or(text[1]);
            }

            foreach (dynamic _b in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_OutletInjector)))
            {
                U2 = _b;

                text2 = GlobalFuncs.splittext(U2.id, "_");
                IO.Or(text2[1]);
            }

            if (!(IO.len != 0))
            {
                user.WriteMsg("<span class='alert'>No machinery detected.</span>");
            }
            S = Interface13.Input("Select the device set: ", "Selection", IO[1], null, IO, InputType.Any);

            if (this != null)
            {
                this.input_tag  = "" + S + "_in";
                this.output_tag = "" + S + "_out";
                this.name       = "" + String13.ToUpper(S) + " Supply Control";
                new_devices     = freq.devices["4"];

                foreach (dynamic _c in Lang13.Enumerate(new_devices, typeof(Obj_Machinery_AirSensor)))
                {
                    U3 = _c;

                    text3 = GlobalFuncs.splittext(U3.id_tag, "_");

                    if (text3[1] == S)
                    {
                        this.sensors = new ByTable().Set("" + S + "_sensor", "Tank");
                        break;
                    }
                }
            }

            foreach (dynamic _d in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_OutletInjector)))
            {
                U4 = _d;

                U4.broadcast_status();
            }

            foreach (dynamic _e in Lang13.Enumerate(devices, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                U5 = _e;

                U5.broadcast_status();
            }
            return;
        }
        // Function from file: chem_grenade.dm
        public ByTable can_flood_from(Ent_Static myloc = null, int?maxrange = null)
        {
            dynamic myturf    = null;
            ByTable reachable = null;
            int?    i         = null;
            ByTable turflist  = null;
            dynamic T         = null;
            dynamic T2        = null;
            dynamic T3        = null;
            dynamic NT        = null;

            myturf    = GlobalFuncs.get_turf(myloc);
            reachable = new ByTable(new object [] { myloc });
            i         = null;
            i         = 1;

            while ((i ?? 0) <= (maxrange ?? 0))
            {
                turflist = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(myloc, i) - Map13.FetchInRangeExcludeThis(myloc, (i ?? 0) - 1)))
                {
                    T = _a;

                    turflist.Or(T);
                }

                foreach (dynamic _b in Lang13.Enumerate(turflist))
                {
                    T2 = _b;


                    if (!GlobalVars.cardinal.Contains(Map13.GetDistance(T2, myloc)) && Math.Abs(Convert.ToDouble(T2.x - myturf.x)) == Math.Abs(Convert.ToDouble(T2.y - myturf.y)))
                    {
                        turflist.Remove(T2);
                        turflist.Add(T2);
                    }
                }

                foreach (dynamic _d in Lang13.Enumerate(turflist))
                {
                    T3 = _d;


                    if (reachable.Contains(T3))
                    {
                        continue;
                    }

                    foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(T3, 1)))
                    {
                        NT = _c;


                        if (!reachable.Contains(NT))
                        {
                            continue;
                        }

                        if (!GlobalVars.cardinal.Contains(Map13.GetDistance(T3, NT)))
                        {
                            continue;
                        }

                        if (!Lang13.Bool(NT.CanAtmosPass(T3)))
                        {
                            continue;
                        }
                        reachable.Or(T3);
                        break;
                    }
                }
                i++;
            }
            return(reachable);
        }
        // Function from file: chem_grenade.dm
        public override void prime(  )
        {
            bool     has_reagents          = false;
            Obj_Item I                     = null;
            dynamic  M                     = null;
            dynamic  last                  = null;
            dynamic  T                     = null;
            dynamic  A                     = null;
            dynamic  DT                    = null;
            dynamic  DA                    = null;
            EffectSystem_SteamSpread steam = null;
            ByTable    viewable            = null;
            ByTable    accessible          = null;
            ByTable    reactable           = null;
            ByTable    mycontents          = null;
            dynamic    T2                  = null;
            Ent_Static A2                  = null;
            double?    fraction            = null;
            Ent_Static A3                  = null;


            if (this.stage != 3 || !(this.reagents != null))
            {
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(this.beakers, typeof(Obj_Item)))
            {
                I = _a;


                if (Lang13.Bool(I.reagents.total_volume))
                {
                    has_reagents = true;
                }
            }

            if (!has_reagents)
            {
                GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver2.ogg", 50, 1);
                return;
            }

            if (Lang13.Bool(this.nadeassembly))
            {
                M    = GlobalFuncs.get_mob_by_ckey(this.assemblyattacher);
                last = GlobalFuncs.get_mob_by_ckey(this.nadeassembly.fingerprintslast);
                T    = GlobalFuncs.get_turf(this);
                A    = GlobalFuncs.get_area(T);
                GlobalFuncs.message_admins(new Txt("grenade primed by an assembly, attached by ").item(GlobalFuncs.key_name_admin(M)).str("<A HREF='?_src_=holder;adminmoreinfo=").Ref(M).str("'>(?)</A> (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(M).str("'>FLW</A>) and last touched by ").item(GlobalFuncs.key_name_admin(last)).str("<A HREF='?_src_=holder;adminmoreinfo=").Ref(last).str("'>(?)</A> (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(last).str("'>FLW</A>) (").item(this.nadeassembly.a_left.name).str(" and ").item(this.nadeassembly.a_right.name).str(") at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(T.x).str(";Y=").item(T.y).str(";Z=").item(T.z).str("'>").item(A.name).str(" (JMP)</a>.").ToString());
                GlobalFuncs.log_game("grenade primed by an assembly, attached by " + GlobalFuncs.key_name(M) + " and last touched by " + GlobalFuncs.key_name(last) + " (" + this.nadeassembly.a_left.name + " and " + this.nadeassembly.a_right.name + ") at " + A.name + " (" + T.x + ", " + T.y + ", " + T.z + ")");
            }
            GlobalFuncs.playsound(this.loc, "sound/effects/bamf.ogg", 50, 1);
            DT = GlobalFuncs.get_turf(this);
            DA = GlobalFuncs.get_area(DT);
            GlobalFuncs.log_game("A grenade detonated at " + DA.name + " (" + DT.x + ", " + DT.y + ", " + DT.z + ")");
            this.update_mob();
            this.mix_reagents();

            if (Lang13.Bool(this.reagents.total_volume))
            {
                steam = new EffectSystem_SteamSpread();
                steam.set_up(10, 0, GlobalFuncs.get_turf(this));
                steam.attach(this);
                steam.start();
                viewable   = Map13.FetchInView(this.loc, this.affected_area);
                accessible = this.can_flood_from(this.loc, this.affected_area);
                reactable  = accessible;
                mycontents = this.GetAllContents();

                foreach (dynamic _c in Lang13.Enumerate(accessible))
                {
                    T2 = _c;


                    foreach (dynamic _b in Lang13.Enumerate(((Ent_Static)T2).GetAllContents(), typeof(Ent_Static)))
                    {
                        A2 = _b;


                        if (mycontents.Contains(A2))
                        {
                            continue;
                        }

                        if (!viewable.Contains(A2))
                        {
                            continue;
                        }
                        reactable.Or(A2);
                    }
                }

                if (!(reactable.len != 0))
                {
                    GlobalFuncs.qdel(this);
                    return;
                }
                fraction = 1 / reactable.len;

                foreach (dynamic _d in Lang13.Enumerate(reactable, typeof(Ent_Static)))
                {
                    A3 = _d;

                    this.reagents.reaction(A3, GlobalVars.TOUCH, fraction);
                }
            }
            GlobalFuncs.qdel(this);
            return;
        }