// Function from file: vent_scrubber.dm
        public bool scrub(Ent_Static tile = null)
        {
            GasMixture environment     = null;
            dynamic    air_contents    = null;
            ByTable    env_gases       = null;
            int?       should_we_scrub = null;
            dynamic    id              = null;
            double     transfer_moles  = 0;
            dynamic    removed         = null;
            ByTable    removed_gases   = null;
            GasMixture filtered_out    = null;
            ByTable    filtered_gases  = null;
            double     transfer_moles2 = 0;
            dynamic    removed2        = null;


            if (!(tile is Tile_Simulated))
            {
                return(false);
            }
            environment  = tile.return_air();
            air_contents = this.airs[1];
            env_gases    = environment.gases;

            if ((((int)(this.scrubbing ?? 0)) & 1) != 0)
            {
                should_we_scrub = GlobalVars.FALSE;

                foreach (dynamic _a in Lang13.Enumerate(env_gases))
                {
                    id = _a;


                    if (id == "n2" || id == "o2")
                    {
                        continue;
                    }

                    if (Lang13.Bool(env_gases[id][1]))
                    {
                        should_we_scrub = GlobalVars.TRUE;
                        break;
                    }
                }

                if (Lang13.Bool(should_we_scrub))
                {
                    transfer_moles = Num13.MinInt(1, ((int)(this.volume_rate / (environment.volume ?? 0)))) * environment.total_moles();
                    removed        = tile.remove_air(transfer_moles);
                    removed_gases  = removed.gases;

                    if (removed == null)
                    {
                        return(false);
                    }
                    filtered_out             = new GasMixture();
                    filtered_gases           = filtered_out.gases;
                    filtered_out.temperature = removed.temperature;

                    if (Lang13.Bool(this.scrub_Toxins) && Lang13.Bool(removed_gases["plasma"]))
                    {
                        filtered_out.assert_gas("plasma");
                        filtered_gases["plasma"][1] = removed_gases["plasma"][1];
                        removed.gases["plasma"][1]  = 0;
                    }

                    if (Lang13.Bool(this.scrub_CO2) && Lang13.Bool(removed_gases["co2"]))
                    {
                        filtered_out.assert_gas("co2");
                        filtered_out.gases["co2"][1] = removed_gases["co2"][1];
                        removed.gases["co2"][1]      = 0;
                    }

                    if (Lang13.Bool(removed_gases["agent_b"]))
                    {
                        filtered_out.assert_gas("agent_b");
                        filtered_out.gases["agent_b"][1] = removed_gases["agent_b"][1];
                        removed.gases["agent_b"][1]      = 0;
                    }

                    if (Lang13.Bool(this.scrub_N2O) && Lang13.Bool(removed_gases["n2o"]))
                    {
                        filtered_out.assert_gas("n2o");
                        filtered_out.gases["n2o"][1] = removed_gases["n2o"][1];
                        removed.gases["n2o"][1]      = 0;
                    }
                    removed.garbage_collect();
                    air_contents.merge(filtered_out);
                    tile.assume_air(removed);
                    ((Tile)tile).air_update_turf();
                }
            }
            else
            {
                if (Convert.ToDouble(air_contents.return_pressure()) >= 5066.25)
                {
                    return(false);
                }
                transfer_moles2 = environment.total_moles() * (this.volume_rate / (environment.volume ?? 0));
                removed2        = tile.remove_air(transfer_moles2);
                air_contents.merge(removed2);
                ((Tile)tile).air_update_turf();
            }
            this.update_parents();
            return(true);
        }