Beispiel #1
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;
        }
Beispiel #2
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;
        }