Esempio n. 1
0
        // Function from file: chrono_eraser.dm
        public override GasMixture return_air(  )
        {
            GasMixture GM = null;

            GM = new GasMixture();
            GM.assert_gases("o2", "n2");
            GM.gases["o2"][1] = 21.83659553527832;
            GM.gases["n2"][1] = 82.14720153808594;
            GM.temperature    = 293.41;
            return(GM);
        }
Esempio n. 2
0
        // Function from file: tank.dm
        public Obj_Machinery_Atmospherics_Components_Unary_Tank_Air(dynamic loc = null, int?process = null) : base((object)(loc), process)
        {
            GasMixture air_contents = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            air_contents = this.airs[1];
            air_contents.assert_gases("o2", "n2");
            air_contents.gases["o2"][1] = (air_contents.volume ?? 0) * 2533.125 / Convert.ToDouble(air_contents.temperature * 8.31) * 0.2;
            air_contents.gases["n2"][1] = (air_contents.volume ?? 0) * 2533.125 / Convert.ToDouble(air_contents.temperature * 8.31) * 0.8;
            return;
        }
Esempio n. 3
0
        // Function from file: supermatter.dm
        public override int?process(dynamic seconds = null)
        {
            Ent_Static L                = null;
            string     stability        = null;
            Mob_Living mob              = null;
            Mob_Living H                = null;
            double     rads             = 0;
            GasMixture env              = null;
            GasMixture removed          = null;
            bool       removed_nitrogen = false;
            int        temp_factor      = 0;
            double     device_energy    = 0;
            Mob_Living_Carbon_Human l   = null;
            Mob_Living l2               = null;
            double     rads2            = 0;

            L = this.loc;

            if (L == null)
            {
                return(26);
            }

            if (!(L is Tile))
            {
                return(null);
            }

            if (L is Tile_Space)
            {
                return(null);
            }

            if (this.damage > this.warning_point)
            {
                if ((Game13.timeofday - this.lastwarning) / 10 >= 30)
                {
                    stability = String13.NumberToString(Num13.Floor(this.damage / this.explosion_point * 100));

                    if (this.damage > this.emergency_point)
                    {
                        this.radio.talk_into(this, "" + this.emergency_alert + " Instability: " + stability + "%");
                        this.lastwarning = Game13.timeofday;

                        if (!this.has_reached_emergency)
                        {
                            this.investigate_log("has reached the emergency point for the first time.", "supermatter");
                            GlobalFuncs.message_admins("" + this + " has reached the emergency point <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=" + this.x + ";Y=" + this.y + ";Z=" + this.z + "'>(JMP)</a>.");
                            this.has_reached_emergency = true;
                        }
                    }
                    else if (this.damage >= this.damage_archived)
                    {
                        this.radio.talk_into(this, "" + this.warning_alert + " Instability: " + stability + "%");
                        this.lastwarning = Game13.timeofday - 150;
                    }
                    else
                    {
                        this.radio.talk_into(this, "" + this.safe_alert);
                        this.lastwarning = Game13.timeofday;
                    }
                }

                if (this.damage > this.explosion_point)
                {
                    foreach (dynamic _a in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living)))
                    {
                        mob = _a;


                        if (mob is Mob_Living_Carbon_Human)
                        {
                            H = mob;
                            H.hallucination += Num13.MaxInt(50, Num13.MinInt(300, ((int)(Math.Sqrt(1 / (Map13.GetDistance(mob, this) + 1)) * 600))));
                        }
                        rads = Math.Sqrt(1 / (Map13.GetDistance(mob, this) + 1)) * 200;
                        mob.rad_act(rads);
                    }
                    this.explode();
                }
            }
            env     = L.return_air();
            removed = env.remove(this.gasefficency * env.total_moles());

            if (!(removed != null) || !(removed.total_moles() != 0))
            {
                this.damage += Num13.MaxInt(((int)((this.power - 1600) / 10)), 0);
                this.power   = Num13.MinInt(((int)(this.power)), 1600);
                return(1);
            }
            this.damage_archived = this.damage;
            this.damage          = Num13.MaxInt(((int)(this.damage + Convert.ToDouble((removed.temperature - 800) / 150))), 0);
            removed_nitrogen     = false;

            if (Lang13.Bool(removed.gases["n2"]))
            {
                removed_nitrogen = Lang13.Bool(removed.gases["n2"][1] * 2);
            }
            removed.assert_gases("o2", "plasma");
            this.oxygen = Num13.MaxInt(Num13.MinInt(Convert.ToInt32((removed.gases["o2"][1] - removed_nitrogen) / 103.98379516601562), 1), 0);
            temp_factor = 50;

            if (this.oxygen > 0.8)
            {
                this.icon_state = "" + this.base_icon_state + "_glow";
            }
            else
            {
                temp_factor     = 30;
                this.icon_state = this.base_icon_state;
            }
            this.power = Num13.MaxInt(Convert.ToInt32(removed.temperature * temp_factor / 273.41 * this.oxygen + this.power), 0);
            this.transfer_energy();
            device_energy               = this.power * 0.55;
            removed.temperature        += device_energy / 5;
            removed.temperature         = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(removed.temperature), 2500));
            removed.gases["plasma"][1] += Num13.MaxInt(((int)(device_energy / 750)), 0);
            removed.gases["o2"][1]     += Num13.MaxInt(((int)((device_energy + Convert.ToDouble(removed.temperature) - 273.41) / 325)), 0);
            env.merge(removed);

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInView(Num13.MinInt(7, Num13.Floor(Math.Pow(this.power, 0.25))), this), typeof(Mob_Living_Carbon_Human)))
            {
                l = _b;


                if (!(l.glasses is Obj_Item_Clothing_Glasses_Meson))
                {
                    l.hallucination = Num13.MaxInt(0, Num13.MinInt(200, ((int)(l.hallucination + this.power * this.config_hallucination_power * Math.Sqrt(1 / Num13.MaxInt(1, Map13.GetDistance(l, this)))))));
                }
            }

            foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRange(Num13.Floor(Math.Pow(this.power / 100, 0.25)), this), typeof(Mob_Living)))
            {
                l2 = _c;

                rads2 = this.power / 10 * Math.Sqrt(1 / Num13.MaxInt(Map13.GetDistance(l2, this), 1));
                l2.rad_act(rads2);
            }
            this.power -= Math.Pow(this.power / 500, 3);
            return(1);
        }
Esempio n. 4
0
        // Function from file: LINDA_system.dm
        public void atmos_spawn_air(int flag = 0, double?amount = null)
        {
            GasMixture G         = null;
            ByTable    new_gases = null;


            if (!Lang13.Bool(this.text) || !Lang13.Bool(amount) || !(this.air != null))
            {
                return;
            }
            G         = new GasMixture();
            new_gases = G.gases;

            if ((flag & 2) != 0)
            {
                G.temperature = 293.41;
            }

            if ((flag & 1) != 0)
            {
                G.temperature += 1000;
            }

            if ((flag & 4) != 0)
            {
                G.assert_gas("plasma");
                new_gases["plasma"][1] += amount;
            }

            if ((flag & 8) != 0)
            {
                G.assert_gas("o2");
                new_gases["o2"][1] += amount;
            }

            if ((flag & 16) != 0)
            {
                G.assert_gas("co2");
                new_gases["co2"][1] += amount;
            }

            if ((flag & 32) != 0)
            {
                G.assert_gas("n2");
                new_gases["n2"][1] += amount;
            }

            if ((flag & 64) != 0)
            {
                G.assert_gas("n2o");
                new_gases["n2o"][1] += amount;
            }

            if ((flag & 256) != 0)
            {
                G.assert_gases("o2", "n2");
                new_gases["o2"][1] += (amount ?? 0) * 21.83659553527832;
                new_gases["n2"][1] += (amount ?? 0) * 82.14720153808594;
            }
            this.air.merge(G);
            GlobalVars.SSair.add_to_active(this, false);
            return;
        }