Beispiel #1
0
        // Function from file: air.dm
        public void add_to_active(dynamic T = null, bool?blockchanges = null)
        {
            blockchanges = blockchanges ?? true;

            Tile_Simulated S = null;


            if (T is Tile_Simulated && Lang13.Bool(T.air))
            {
                T.excited = true;
                this.active_turfs.Or(T);

                if (blockchanges == true && T.excited_group != null)
                {
                    T.excited_group.garbage_collect();
                }
            }
            else
            {
                foreach (dynamic _a in Lang13.Enumerate(T.atmos_adjacent_turfs, typeof(Tile_Simulated)))
                {
                    S = _a;

                    this.add_to_active(S);
                }
            }
            return;
        }
Beispiel #2
0
        // Function from file: scrubber.dm
        public override int?process_atmos(  )
        {
            dynamic        T  = null;
            Tile_Simulated AT = null;


            if (!Lang13.Bool(this.anchored) && !this.movable || !this.is_operational())
            {
                this.on = GlobalVars.FALSE;
                this.update_icon();
            }
            this.use_power = (this.on ?? 0) + 1;

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

            if (!Lang13.Bool(this.holding))
            {
                T = GlobalFuncs.get_turf(this);

                foreach (dynamic _a in Lang13.Enumerate(((Tile)T).GetAtmosAdjacentTurfs(GlobalVars.TRUE), typeof(Tile_Simulated)))
                {
                    AT = _a;

                    this.scrub(AT.return_air());
                }
            }
            return(null);
        }
        // Function from file: vent_scrubber.dm
        public override int?process_atmos(  )
        {
            Tile_Simulated tile = null;

            base.process_atmos();

            if ((this.stat & 3) != 0)
            {
                return(null);
            }

            if (!Lang13.Bool(this.nodes[1]))
            {
                this.on = 0;
            }

            if (!Lang13.Bool(this.on) || this.welded == true)
            {
                return(0);
            }
            this.scrub(this.loc);

            if (Lang13.Bool(this.widenet))
            {
                foreach (dynamic _a in Lang13.Enumerate(this.adjacent_turfs, typeof(Tile_Simulated)))
                {
                    tile = _a;

                    this.scrub(tile);
                }
            }
            return(null);
        }
Beispiel #4
0
        // Function from file: river.dm
        public virtual void Spread(dynamic probability = null, int?prob_loss = null)
        {
            probability = probability ?? 30;
            prob_loss   = prob_loss ?? 25;

            Tile_Simulated F = null;
            Tile_Simulated L = null;


            if (Convert.ToDouble(probability) <= 0)
            {
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this, 1), typeof(Tile_Simulated)))
            {
                F = _a;

                L = F;
                L.ChangeTurf(this.type);

                if (L != null && Rand13.PercentChance(Convert.ToInt32(probability)))
                {
                    L.Spread(probability - prob_loss);
                }
            }
            return;
        }
Beispiel #5
0
        // Function from file: LINDA_turf_tile.dm
        public void merge_groups(ExcitedGroup E = null)
        {
            Tile_Simulated T  = null;
            Tile_Simulated T2 = null;


            if (this.turf_list.len > E.turf_list.len)
            {
                GlobalVars.SSair.excited_groups.Remove(E);

                foreach (dynamic _a in Lang13.Enumerate(E.turf_list, typeof(Tile_Simulated)))
                {
                    T = _a;

                    T.excited_group = this;
                    this.turf_list.Add(T);
                    this.reset_cooldowns();
                }
            }
            else
            {
                GlobalVars.SSair.excited_groups.Remove(this);

                foreach (dynamic _b in Lang13.Enumerate(this.turf_list, typeof(Tile_Simulated)))
                {
                    T2 = _b;

                    T2.excited_group = E;
                    E.turf_list.Add(T2);
                    E.reset_cooldowns();
                }
            }
            return;
        }
Beispiel #6
0
        // Function from file: LINDA_turf_tile.dm
        public void self_breakdown(  )
        {
            GasMixture     A       = null;
            ByTable        A_gases = null;
            Tile_Simulated T       = null;
            Tile_Simulated T2      = null;
            ByTable        T_gases = null;
            dynamic        id      = null;

            A       = new GasMixture();
            A_gases = A.gases;

            foreach (dynamic _a in Lang13.Enumerate(this.turf_list, typeof(Tile_Simulated)))
            {
                T = _a;

                A.merge(T.air);
            }

            foreach (dynamic _c in Lang13.Enumerate(this.turf_list, typeof(Tile_Simulated)))
            {
                T2 = _c;

                T_gases = T2.air.gases;

                foreach (dynamic _b in Lang13.Enumerate(T_gases))
                {
                    id = _b;

                    T_gases[id][1] = A_gases[id][1] / this.turf_list.len;
                }
                T2.update_visuals();
            }
            return;
        }
        // Function from file: helpers.dm
        public override void generate(  )
        {
            ByTable        map = null;
            Tile_Simulated T   = null;
            Tile_Simulated T2  = null;


            if (!(this.mother != null))
            {
                return;
            }
            map = this.mother.map;

            foreach (dynamic _a in Lang13.Enumerate(map, typeof(Tile_Simulated)))
            {
                T = _a;

                GlobalVars.SSair.remove_from_active(T);
            }

            foreach (dynamic _b in Lang13.Enumerate(map, typeof(Tile_Simulated)))
            {
                T2 = _b;


                if (T2.air != null)
                {
                    T2.air.copy_from_turf(T2);
                }
                GlobalVars.SSair.add_to_active(T2);
            }
            return;
        }
Beispiel #8
0
        // Function from file: air.dm
        public void process_super_conductivity(  )
        {
            Tile_Simulated T = null;


            foreach (dynamic _a in Lang13.Enumerate(this.active_super_conductivity, typeof(Tile_Simulated)))
            {
                T = _a;

                T.super_conduct();
            }
            return;
        }
Beispiel #9
0
        // Function from file: flamethrower.dm
        public void flame_turf(ByTable turflist = null)
        {
            dynamic        previousturf = null;
            Tile_Simulated T            = null;
            dynamic        M            = null;


            if (!this.lit || this.operating)
            {
                return;
            }
            this.operating = true;
            previousturf   = GlobalFuncs.get_turf(this);

            foreach (dynamic _a in Lang13.Enumerate(turflist, typeof(Tile_Simulated)))
            {
                T = _a;


                if (!(T.air != null))
                {
                    break;
                }

                if (T == previousturf)
                {
                    continue;
                }

                if (!T.CanAtmosPass(previousturf))
                {
                    break;
                }
                this.ignite_turf(T);
                Task13.Sleep(1);
                previousturf = T;
            }
            this.operating = false;

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchViewers(this.loc, 1)))
            {
                M = _b;


                if (Lang13.Bool(M.client) && M.machine == this)
                {
                    this.attack_self(M);
                }
            }
            return;
        }
Beispiel #10
0
        // Function from file: turf.dm
        public override dynamic Destroy(  )
        {
            Tile_Simulated T = null;


            foreach (dynamic _a in Lang13.Enumerate(this.atmos_adjacent_turfs, typeof(Tile_Simulated)))
            {
                T = _a;

                GlobalVars.SSair.add_to_active(T);
            }
            base.Destroy();
            return(4);
        }
Beispiel #11
0
        // Function from file: air.dm
        public void process_active_turfs(  )
        {
            int            fire_count = 0;
            Tile_Simulated T          = null;

            fire_count = this.times_fired;

            foreach (dynamic _a in Lang13.Enumerate(this.active_turfs, typeof(Tile_Simulated)))
            {
                T = _a;

                T.process_cell(fire_count);
            }
            return;
        }
Beispiel #12
0
        // Function from file: LINDA_turf_tile.dm
        public void garbage_collect(  )
        {
            Tile_Simulated T = null;


            foreach (dynamic _a in Lang13.Enumerate(this.turf_list, typeof(Tile_Simulated)))
            {
                T = _a;

                T.excited_group = null;
            }
            this.turf_list.Cut();
            GlobalVars.SSair.excited_groups.Remove(this);
            return;
        }
Beispiel #13
0
        // Function from file: LINDA_turf_tile.dm
        public void dismantle(  )
        {
            Tile_Simulated T = null;


            foreach (dynamic _a in Lang13.Enumerate(this.turf_list, typeof(Tile_Simulated)))
            {
                T = _a;

                T.excited         = false;
                T.recently_active = false;
                T.excited_group   = null;
                GlobalVars.SSair.active_turfs.Remove(T);
            }
            this.garbage_collect();
            return;
        }
Beispiel #14
0
        // Function from file: blob_reagents.dm
        public override dynamic damage_reaction(Obj_Effect_Blob B = null, double original_health = 0, dynamic damage = null, dynamic damage_type = null, dynamic cause = null)
        {
            Tile_Simulated T = null;


            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(B, 1), typeof(Tile_Simulated)))
            {
                T = _a;


                if (Rand13.PercentChance(Convert.ToInt32(damage)))
                {
                    T.MakeSlippery(1);
                }
            }
            return(base.damage_reaction(B, original_health, (object)(damage), (object)(damage_type), (object)(cause)));
        }
Beispiel #15
0
        // Function from file: simulated.dm
        public virtual void MakeSlippery(int?wet_setting = null)
        {
            wet_setting = wet_setting ?? 1;

            Tile_Simulated F = null;


            if ((this.wet ?? 0) >= (wet_setting ?? 0))
            {
                return;
            }
            this.wet = wet_setting;

            if (wet_setting != 0)
            {
                if (this.wet_overlay != null)
                {
                    this.overlays.Remove(this.wet_overlay);
                    this.wet_overlay = null;
                }
                F = this;

                if (F is Tile_Simulated_Floor)
                {
                    this.wet_overlay = new Image("icons/effects/water.dmi", this, "wet_floor_static");
                }
                else
                {
                    this.wet_overlay = new Image("icons/effects/water.dmi", this, "wet_static");
                }
                this.overlays.Add(this.wet_overlay);
            }
            Task13.Schedule(Rand13.Int(790, 820), (Task13.Closure)(() => {
                if (!(this is Tile_Simulated))
                {
                    return;
                }
                this.MakeDry(wet_setting);
                return;
            }));
            return;
        }
Beispiel #16
0
        // Function from file: space.dm
        public void update_starlight(  )
        {
            Tile_Simulated T = null;


            if (GlobalVars.config != null)
            {
                if (GlobalVars.config.starlight)
                {
                    foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInBlock(Map13.GetTile(Num13.MaxInt(this.x - 1, 1), Num13.MaxInt(this.y - 1, 1), this.z), Map13.GetTile(Num13.MinInt(this.x + 1, Game13.map_size_x), Num13.MinInt(this.y + 1, Game13.map_size_y), this.z)), typeof(Tile_Simulated)))
                    {
                        T = _a;

                        this.SetLuminosity(4, 1);
                        return;
                    }
                    this.SetLuminosity(0);
                }
            }
            return;
        }
Beispiel #17
0
        // Function from file: blob_reagents.dm
        public override void death_reaction(Obj_Effect_Blob B = null, dynamic cause = null)
        {
            Tile_Simulated T = null;


            if (!(cause == null))
            {
                B.visible_message("<span class='warning'><b>The blob ruptures, spraying the area with liquid!</b></span>");
            }

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(B, 1), typeof(Tile_Simulated)))
            {
                T = _a;


                if (Rand13.PercentChance(50))
                {
                    T.MakeSlippery(1);
                }
            }
            return;
        }
Beispiel #18
0
        // Function from file: spacevine.dm
        public override bool start(  )
        {
            ByTable turfs           = null;
            Obj_Effect_Spacevine SV = null;
            Zone_Hallway         A  = null;
            Tile_Simulated       F  = null;
            dynamic T = null;

            turfs = new ByTable();
            SV    = new Obj_Effect_Spacevine();

            foreach (dynamic _b in Lang13.Enumerate(typeof(Game13), typeof(Zone_Hallway)))
            {
                A = _b;


                foreach (dynamic _a in Lang13.Enumerate(A, typeof(Tile_Simulated)))
                {
                    F = _a;


                    if (F.Enter(SV))
                    {
                        turfs.Add(F);
                    }
                }
            }
            GlobalFuncs.qdel(SV);

            if (turfs.len != 0)
            {
                T = Rand13.PickFromTable(turfs);
                new Obj_Effect_SpacevineController(T);
            }
            return(false);
        }
Beispiel #19
0
        // Function from file: LINDA_fire.dm
        public override int?process(dynamic seconds = null)
        {
            Ent_Static     location             = null;
            double         radiated_temperature = 0;
            Tile_Simulated T = null;


            if (this.just_spawned)
            {
                this.just_spawned = false;
                return(0);
            }
            location = this.loc;

            if (!(location is Tile_Simulated))
            {
                GlobalFuncs.qdel(this);
                return(null);
            }

            if (Lang13.Bool(((dynamic)location).excited_group))
            {
                ((ExcitedGroup)((dynamic)location).excited_group).reset_cooldowns();
            }

            if (Convert.ToDouble(this.temperature) < 373.41 || (this.volume ?? 0) <= 1)
            {
                GlobalFuncs.qdel(this);
                return(null);
            }

            if (!Lang13.Bool(((dynamic)location).air) || !Lang13.Bool(((dynamic)location).air.gases["plasma"]) || !Lang13.Bool(((dynamic)location).air.gases["o2"]) || Convert.ToDouble(((dynamic)location).air.gases["plasma"][1]) < 0.5 || Convert.ToDouble(((dynamic)location).air.gases["o2"][1]) < 0.5)
            {
                GlobalFuncs.qdel(this);
                return(null);
            }
            this.perform_exposure();

            if (Lang13.Bool(((dynamic)location).wet))
            {
                ((dynamic)location).wet = 0;
            }

            if (this.bypassing)
            {
                this.icon_state = "3";
                ((dynamic)location).burn_tile();

                if (Convert.ToDouble(((dynamic)location).air.temperature) > 423.41)
                {
                    radiated_temperature = Convert.ToDouble(((dynamic)location).air.temperature * 0.85);

                    foreach (dynamic _a in Lang13.Enumerate(((dynamic)location).atmos_adjacent_turfs, typeof(Tile_Simulated)))
                    {
                        T = _a;


                        if (Lang13.Bool(T.active_hotspot))
                        {
                            T.hotspot_expose(radiated_temperature, 625);
                        }
                    }
                }
            }
            else if ((this.volume ?? 0) > 1000)
            {
                this.icon_state = "2";
            }
            else
            {
                this.icon_state = "1";
            }

            if (Convert.ToDouble(this.temperature) > Convert.ToDouble(((dynamic)location).max_fire_temperature_sustained))
            {
                ((dynamic)location).max_fire_temperature_sustained = this.temperature;
            }

            if (Lang13.Bool(((dynamic)location).heat_capacity) && Convert.ToDouble(this.temperature) > Convert.ToDouble(((dynamic)location).heat_capacity))
            {
                ((dynamic)location).to_be_destroyed = 1;
            }
            return(1);
        }
Beispiel #20
0
        // Function from file: air.dm
        public void setup_allturfs(double?z_level = null)
        {
            double?        z_start       = null;
            double?        z_finish      = null;
            ByTable        turfs_to_init = null;
            Tile_Simulated T             = null;
            dynamic        tile          = null;
            dynamic        enemy_tile    = null;
            GasMixture     enemy_air     = null;
            dynamic        is_active     = null;
            Tile_Simulated T2            = null;

            z_start  = 1;
            z_finish = Game13.map_size_z;

            if (1 <= (z_level ?? 0) && (z_level ?? 0) <= Game13.map_size_z)
            {
                z_level  = Num13.Floor(z_level ?? 0);
                z_start  = z_level;
                z_finish = z_level;
            }
            turfs_to_init = Map13.FetchInBlock(Map13.GetTile(1, 1, ((int)(z_start ?? 0))), Map13.GetTile(Game13.map_size_x, Game13.map_size_y, ((int)(z_finish ?? 0))));

            foreach (dynamic _b in Lang13.Enumerate(turfs_to_init, typeof(Tile_Simulated)))
            {
                T = _b;

                T.CalculateAdjacentTurfs();
                T.excited = false;
                this.active_turfs.Remove(T);

                if (T.blocks_air)
                {
                    continue;
                }
                T.update_visuals();

                foreach (dynamic _a in Lang13.Enumerate(T.atmos_adjacent_turfs))
                {
                    tile = _a;

                    enemy_tile = tile;
                    enemy_air  = ((Ent_Static)enemy_tile).return_air();
                    is_active  = T.air.compare(enemy_air);

                    if (Lang13.Bool(is_active))
                    {
                        GlobalFuncs.testing("Active turf found. Return value of compare(): " + is_active);
                        T.excited = true;
                        this.active_turfs.Or(T);
                        break;
                    }
                }
            }

            if (this.active_turfs.len != 0)
            {
                GlobalFuncs.warning("There are " + this.active_turfs.len + " active turfs at roundstart, this is a mapping error caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required)");

                foreach (dynamic _c in Lang13.Enumerate(this.active_turfs, typeof(Tile_Simulated)))
                {
                    T2 = _c;

                    GlobalVars.active_turfs_startlist.Add("" + T2.x + ", " + T2.y + ", " + T2.z + "\n");
                }
            }
            return;
        }
Beispiel #21
0
        // Function from file: area_copy.dm
        public dynamic copy_contents_to(dynamic A = null, bool?platingRequired = null, bool?nerf_weapons = null)
        {
            platingRequired = platingRequired ?? false;
            nerf_weapons    = nerf_weapons ?? false;

            ByTable        turfs_src       = null;
            ByTable        turfs_trg       = null;
            int            src_min_x       = 0;
            int            src_min_y       = 0;
            ByTable        refined_src     = null;
            dynamic        T               = null;
            dynamic        T2              = null;
            int            trg_min_x       = 0;
            int            trg_min_y       = 0;
            ByTable        refined_trg     = null;
            dynamic        T3              = null;
            dynamic        T4              = null;
            ByTable        toupdate        = null;
            ByTable        copiedobjs      = null;
            Tile_Simulated T5              = null;
            dynamic        coordstring     = null;
            dynamic        B               = null;
            int            old_dir1        = 0;
            string         old_icon_state1 = null;
            string         old_icon1       = null;
            dynamic        X               = null;
            Obj            O               = null;
            dynamic        O2              = null;
            dynamic        M               = null;
            dynamic        SM              = null;
            dynamic        V               = null;
            Tile_Simulated T1              = null;


            if (!Lang13.Bool(A) || !(this != null))
            {
                return(0);
            }
            turfs_src   = GlobalFuncs.get_area_turfs(this.type);
            turfs_trg   = GlobalFuncs.get_area_turfs(A.type);
            src_min_x   = 99999;
            src_min_y   = 99999;
            refined_src = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(turfs_src))
            {
                T = _a;

                src_min_x = Num13.MinInt(src_min_x, Convert.ToInt32(T.x));
                src_min_y = Num13.MinInt(src_min_y, Convert.ToInt32(T.y));
            }

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

                refined_src[T2] = "" + (T2.x - src_min_x) + "." + (T2.y - src_min_y);
            }
            trg_min_x   = 99999;
            trg_min_y   = 99999;
            refined_trg = new ByTable();

            foreach (dynamic _c in Lang13.Enumerate(turfs_trg))
            {
                T3 = _c;

                trg_min_x = Num13.MinInt(trg_min_x, Convert.ToInt32(T3.x));
                trg_min_y = Num13.MinInt(trg_min_y, Convert.ToInt32(T3.y));
            }

            foreach (dynamic _d in Lang13.Enumerate(turfs_trg))
            {
                T4 = _d;

                refined_trg["" + (T4.x - trg_min_x) + "." + (T4.y - trg_min_y)] = T4;
            }
            toupdate   = new ByTable();
            copiedobjs = new ByTable();

            foreach (dynamic _h in Lang13.Enumerate(refined_src, typeof(Tile_Simulated)))
            {
                T5 = _h;

                coordstring = refined_src[T5];
                B           = refined_trg[coordstring];

                if (!(B is Tile))
                {
                    continue;
                }

                if (platingRequired == true)
                {
                    if (B is Tile_Space)
                    {
                        continue;
                    }
                }
                old_dir1        = T5.dir;
                old_icon_state1 = T5.icon_state;
                old_icon1       = T5.icon;
                X            = Lang13.Call(T5.type, B);
                X.dir        = old_dir1;
                X.icon       = old_icon1;
                X.icon_state = old_icon_state1;

                foreach (dynamic _e in Lang13.Enumerate(T5, typeof(Obj)))
                {
                    O = _e;

                    O2 = GlobalFuncs.DuplicateObject(O, true, null, X, nerf_weapons);

                    if (!Lang13.Bool(O2))
                    {
                        continue;
                    }
                    copiedobjs.Add(((Ent_Static)O2).GetAllContents());
                }

                foreach (dynamic _f in Lang13.Enumerate(T5))
                {
                    M = _f;


                    if (M is Mob_Camera)
                    {
                        continue;
                    }
                    SM = GlobalFuncs.DuplicateObject(M, true, null, X);
                    copiedobjs.Add(((Ent_Static)SM).GetAllContents());
                }

                foreach (dynamic _g in Lang13.Enumerate(T5.vars - GlobalVars.forbidden_vars))
                {
                    V = _g;


                    if (V == "air")
                    {
                        X.air.copy_from(T5.air);
                        continue;
                    }
                    X.vars[V] = T5.vars[V];
                }
                toupdate.Add(X);
            }

            if (toupdate.len != 0)
            {
                foreach (dynamic _i in Lang13.Enumerate(toupdate, typeof(Tile_Simulated)))
                {
                    T1 = _i;

                    T1.CalculateAdjacentTurfs();
                    GlobalVars.SSair.add_to_active(T1, true);
                }
            }
            return(copiedobjs);
        }
Beispiel #22
0
        // Function from file: computer.dm
        public override int?process(dynamic seconds = null)
        {
            Tile_Simulated           T = null;
            EffectSystem_SparkSpread s = null;
            dynamic M  = null;
            dynamic T2 = null;
            EffectSystem_SparkSpread s2 = null;
            dynamic item = null;
            Obj_Effect_HolodeckEffect HE = null;


            if (this.damaged)
            {
                if (Rand13.PercentChance(10))
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.linked, typeof(Tile_Simulated)))
                    {
                        T = _a;


                        if (Rand13.PercentChance(5))
                        {
                            s = new EffectSystem_SparkSpread();
                            s.set_up(2, 1, T);
                            s.start();
                            return(null);
                        }
                    }
                }
            }

            if (!Lang13.Bool(base.process((object)(seconds))) || !(this.active == true))
            {
                return(null);
            }

            if (!this.floorcheck())
            {
                this.emergency_shutdown();
                this.damaged = true;

                foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.ultra_range(10, this)))
                {
                    M = _b;

                    M.show_message("The holodeck overloads!");
                }

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


                    if (Rand13.PercentChance(30))
                    {
                        s2 = new EffectSystem_SparkSpread();
                        s2.set_up(2, 1, T2);
                        s2.start();
                    }
                    ((Ent_Static)T2).ex_act(3);
                    ((Tile)T2).hotspot_expose(1000, 500, true);
                }
            }

            if (!Lang13.Bool(this.emagged))
            {
                foreach (dynamic _d in Lang13.Enumerate(this.spawned))
                {
                    item = _d;


                    if (!Lang13.Bool(this.linked.Contains(GlobalFuncs.get_turf(item))))
                    {
                        this.derez(item, false);
                    }
                }
            }

            foreach (dynamic _e in Lang13.Enumerate(this.effects, typeof(Obj_Effect_HolodeckEffect)))
            {
                HE = _e;

                HE.tick();
            }
            this.active_power_usage = this.spawned.len * 3 + this.effects.len * 5 + 50;
            return(null);
        }