// Function from file: mineral_doors.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (Convert.ToDouble(exposed_temperature) > 300) { this.TemperatureAct(exposed_temperature); } return(null); }
// Function from file: LINDA_turf_tile.dm public void copy_air(GasMixture copy = null) { if (this.air != null && copy != null) { this.air.copy_from(copy); } return; }
// Function from file: LINDA_turf_tile.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (this.temperature > this.heat_capacity) { this.to_be_destroyed = true; } return(null); }
// Function from file: transit_tube_pod.dm public override GasMixture return_air( ) { GasMixture GM = null; GM = new GasMixture(); GM.copy_from(this.air_contents); return(GM); }
// Function from file: firealarm.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (!Lang13.Bool(this.emagged) && this.detecting && Convert.ToDouble(exposed_temperature) > 473.41) { this.alarm(); } return(null); }
// Function from file: effects_foam.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (Rand13.PercentChance(Num13.MaxInt(0, Convert.ToInt32(exposed_temperature - 475)))) { this.kill_foam(); } return(null); }
// Function from file: gas_mixture.dm public dynamic compare(GasMixture sample = null, int?datatype = null, int?adjacents = null) { datatype = datatype ?? 1; adjacents = adjacents ?? 0; ByTable sample_gases = null; ByTable cached_gases = null; dynamic id = null; bool gas_moles = false; bool sample_moles = false; double delta = 0; dynamic temp = null; dynamic sample_temp = null; double temperature_delta = 0; sample_gases = sample.gases; cached_gases = this.gases; foreach (dynamic _a in Lang13.Enumerate(cached_gases | sample_gases)) { id = _a; gas_moles = (Lang13.Bool(cached_gases[id]) ? Lang13.Bool(cached_gases[id][datatype]) : false); sample_moles = (Lang13.Bool(sample_gases[id]) ? Lang13.Bool(sample_gases[id][datatype]) : false); delta = Math.Abs((gas_moles ?1:0) - (sample_moles ?1:0)) / ((adjacents ?? 0) + 1); if (delta > 0.5199189782142639 && delta > (gas_moles ?1:0) * 0.041) { return(id); } } if (this.total_moles() > 0.5199189782142639) { temp = null; sample_temp = null; switch ((int?)(datatype)) { case 1: temp = this.temperature; sample_temp = sample.temperature; break; case 2: temp = this.temperature_archived; sample_temp = sample.temperature_archived; break; } temperature_delta = Math.Abs(Convert.ToDouble(temp - sample_temp)); if (temperature_delta > 4 && temperature_delta > Convert.ToDouble(temp * 4)) { return("temp"); } } return(""); }
// Function from file: window.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (Convert.ToDouble(exposed_temperature) > (this.reinf == true ? 1600 : 800) + 273.41) { this.hit(Num13.Floor((exposed_volume ?? 0) / 100), false); } base.temperature_expose(air, (object)(exposed_temperature), exposed_volume); return(null); }
// Function from file: portable_atmospherics.dm public Obj_Machinery_PortableAtmospherics(dynamic loc = null) : base((object)(loc)) { // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; GlobalVars.SSair.atmos_machinery.Add(this); this.air_contents = new GasMixture(); this.air_contents.volume = this.volume; this.air_contents.temperature = 293.41; return; // Warning! Attempt to return some other value! }
// Function from file: canister.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (Convert.ToDouble(exposed_temperature) > this.temperature_resistance) { this.health -= 5; this.healthcheck(); } return(null); }
// Function from file: tanks.dm public Obj_Item_Weapon_Tank(dynamic loc = null) : base((object)(loc)) { // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; this.air_contents = new GasMixture(this.volume); this.air_contents.temperature = 293.41; this.internals_action = new Action_ItemAction_Tank_Internals(this); GlobalVars.SSobj.processing.Or(this); return; }
// Function from file: glowshroom.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (Convert.ToDouble(exposed_temperature) > 300) { this.endurance -= 5; this.CheckEndurance(); } return(null); }
// Function from file: transfer_valve.dm public void merge_gases( ) { GasMixture temp = null; this.tank_two.air_contents.volume += this.tank_one.air_contents.volume; temp = ((GasMixture)this.tank_one.air_contents).remove_ratio(1); this.tank_two.air_contents.merge(temp); return; }
// Function from file: LINDA_fire.dm public override bool hotspot_expose(dynamic exposed_temperature = null, int exposed_volume = 0, bool?soh = null) { GasMixture air_contents = null; double oxy = 0; double tox = 0; bool igniting = false; air_contents = this.return_air(); if (!(air_contents != null)) { return(false); } oxy = (Lang13.Bool(air_contents.gases["o2"]) ? Lang13.Bool(air_contents.gases["o2"][1]) : false) ?1:0; tox = (Lang13.Bool(air_contents.gases["plasma"]) ? Lang13.Bool(air_contents.gases["plasma"][1]) : false) ?1:0; if (Lang13.Bool(this.active_hotspot)) { if (soh == true) { if (tox > 0.5 && oxy > 0.5) { if (Convert.ToDouble(this.active_hotspot.temperature) < Convert.ToDouble(exposed_temperature)) { this.active_hotspot.temperature = exposed_temperature; } if (Convert.ToDouble(this.active_hotspot.volume) < exposed_volume) { this.active_hotspot.volume = exposed_volume; } } } return(true); } igniting = false; if (Convert.ToDouble(exposed_temperature) > 373.41 && tox > 0.5) { igniting = true; } if (igniting) { if (oxy < 0.5 || tox < 0.5) { return(false); } this.active_hotspot = GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Hotspot), this); this.active_hotspot.temperature = exposed_temperature; this.active_hotspot.volume = exposed_volume; this.active_hotspot.just_spawned = this.current_cycle < GlobalVars.SSair.times_fired; GlobalVars.SSair.add_to_active(this, false); } return(igniting); }
// Function from file: gas_mixture.dm public dynamic check_turf(dynamic model = null, int?atmos_adjacent_turfs = null) { atmos_adjacent_turfs = atmos_adjacent_turfs ?? 4; GasMixture copied = null; copied = new GasMixture(); copied.copy_from_turf(model); return(this.compare(copied, 2, atmos_adjacent_turfs)); }
// 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); }
// 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; }
// Function from file: LINDA_fire.dm public bool perform_exposure( ) { Ent_Static location = null; GasMixture affected = null; dynamic A = null; dynamic item = null; location = this.loc; if (!(location is Tile_Simulated) || !Lang13.Bool(((dynamic)location).air)) { return(false); } if ((this.volume ?? 0) > 2375) { this.bypassing = true; } else { this.bypassing = false; } if (this.bypassing) { if (!this.just_spawned) { this.volume = ((dynamic)location).air.fuel_burnt * 40000; this.temperature = ((dynamic)location).air.temperature; } } else { affected = ((GasMixture)((dynamic)location).air).remove_ratio((this.volume ?? 0) / Convert.ToDouble(((dynamic)location).air.volume)); affected.temperature = this.temperature; affected.react(); this.temperature = affected.temperature; this.volume = affected.fuel_burnt * 40000; location.assume_air(affected); } foreach (dynamic _a in Lang13.Enumerate(this.loc)) { A = _a; item = A; if (Lang13.Bool(item) && item != this) { ((Ent_Static)item).fire_act(null, this.temperature, this.volume); } } return(false); }
// Function from file: plating.dm public Tile_Simulated_Floor_Engine_N2o(dynamic loc = null) : base((object)(loc)) { GasMixture adding = null; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; adding = new GasMixture(); adding.assert_gas("n2o"); adding.gases["n2o"][1] = 6000; adding.temperature = 293.41; this.assume_air(adding); return; }
// Function from file: heat_exchanger.dm public override int?process_atmos( ) { GasMixture air_contents = null; GasMixture partner_air_contents = null; double air_heat_capacity = 0; double other_air_heat_capacity = 0; double combined_heat_capacity = 0; dynamic old_temperature = null; dynamic other_old_temperature = null; dynamic combined_energy = null; dynamic new_temperature = null; base.process_atmos(); if (!(this.partner != null)) { return(0); } if (GlobalVars.SSair.times_fired <= this.update_cycle) { return(0); } this.update_cycle = GlobalVars.SSair.times_fired; this.partner.update_cycle = GlobalVars.SSair.times_fired; air_contents = this.airs[1]; partner_air_contents = this.partner.airs[1]; air_heat_capacity = air_contents.heat_capacity(); other_air_heat_capacity = partner_air_contents.heat_capacity(); combined_heat_capacity = other_air_heat_capacity + air_heat_capacity; old_temperature = air_contents.temperature; other_old_temperature = partner_air_contents.temperature; if (combined_heat_capacity > 0) { combined_energy = partner_air_contents.temperature * other_air_heat_capacity + air_heat_capacity * Convert.ToDouble(air_contents.temperature); new_temperature = combined_energy / combined_heat_capacity; air_contents.temperature = new_temperature; partner_air_contents.temperature = new_temperature; } if (Math.Abs(Convert.ToDouble(old_temperature - air_contents.temperature)) > 1) { this.update_parents(); } if (Math.Abs(Convert.ToDouble(other_old_temperature - partner_air_contents.temperature)) > 1) { this.partner.update_parents(); } return(1); }
// Function from file: grille.dm public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null) { if (!this.destroyed) { if (Convert.ToDouble(exposed_temperature) > 1773.1500244140625) { this.health -= 1; this.healthcheck(); } } base.temperature_expose(air, (object)(exposed_temperature), exposed_volume); return(null); }
// Function from file: components_base.dm public override void unsafe_pressure_release(dynamic user = null, double?pressures = null) { dynamic T = null; GasMixture environment = null; dynamic lost = null; int times_lost = 0; double I = 0; dynamic air = null; dynamic shared_loss = null; dynamic to_release = null; double I2 = 0; dynamic air2 = null; base.unsafe_pressure_release((object)(user), pressures); T = GlobalFuncs.get_turf(this); if (Lang13.Bool(T)) { environment = ((Ent_Static)T).return_air(); lost = null; times_lost = 0; foreach (dynamic _a in Lang13.IterateRange(1, this.device_type)) { I = _a; air = this.airs[I]; lost += (pressures ?? 0) * (environment.volume ?? 0) / Convert.ToDouble(air.temperature * 8.31); times_lost++; } shared_loss = lost / times_lost; to_release = null; foreach (dynamic _b in Lang13.IterateRange(1, this.device_type)) { I2 = _b; air2 = this.airs[I2]; if (!Lang13.Bool(to_release)) { to_release = air2.remove(shared_loss); continue; } to_release.merge(air2.remove(shared_loss)); } ((Ent_Static)T).assume_air(to_release); this.air_update_turf(true); } return; }
// Function from file: atmosmachinery.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { dynamic T = null; GasMixture int_air = null; GasMixture env_air = null; int? unsafe_wrenching = null; double? internal_pressure = null; if (this.can_unwrench && A is Obj_Item_Weapon_Wrench) { T = GlobalFuncs.get_turf(this); if (this.level == 1 && T is Tile && T.intact) { user.WriteMsg("<span class='warning'>You must remove the plating first!</span>"); return(1); } int_air = this.return_air(); env_air = this.loc.return_air(); this.add_fingerprint(user); unsafe_wrenching = GlobalVars.FALSE; internal_pressure = int_air.return_pressure() - env_air.return_pressure(); GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 50, 1); user.WriteMsg(new Txt("<span class='notice'>You begin to unfasten ").the(this).item().str("...</span>").ToString()); if ((internal_pressure ?? 0) > 202.41) { user.WriteMsg(new Txt("<span class='warning'>As you begin unwrenching ").the(this).item().str(" a gush of air blows in your face... maybe you should reconsider?</span>").ToString()); unsafe_wrenching = GlobalVars.TRUE; } if (GlobalFuncs.do_after(user, 20 / A.toolspeed, null, this) && !Lang13.Bool(this.gc_destroyed)) { ((Ent_Static)user).visible_message(new Txt().item(user).str(" unfastens ").the(this).item().str(".").ToString(), new Txt("<span class='notice'>You unfasten ").the(this).item().str(".</span>").ToString(), "<span class='italics'>You hear ratchet.</span>"); this.investigate_log("was <span class='warning'>REMOVED</span> by " + GlobalFuncs.key_name(Task13.User), "atmos"); if (Lang13.Bool(unsafe_wrenching)) { this.unsafe_pressure_release(user, internal_pressure); } this.Deconstruct(); } } else { return(base.attackby((object)(A), (object)(user), _params, silent, replace_spent)); } return(null); }
// Function from file: disposal-unit.dm public override void initialize( ) { Ent_Static L = null; GasMixture env = null; GasMixture removed = null; L = this.loc; env = new GasMixture(); env.copy_from(L.return_air()); removed = env.remove(6.066249847412109); this.air_contents.merge(removed); this.trunk_check(); return; }
// Function from file: transfer_valve.dm public void split_gases( ) { double? ratio1 = null; GasMixture temp = null; if (!this.valve_open || !Lang13.Bool(this.tank_one) || !Lang13.Bool(this.tank_two)) { return; } ratio1 = Lang13.DoubleNullable(this.tank_one.air_contents.volume / this.tank_two.air_contents.volume); temp = ((GasMixture)this.tank_two.air_contents).remove_ratio(ratio1); this.tank_one.air_contents.merge(temp); this.tank_two.air_contents.volume -= this.tank_one.air_contents.volume; return; }
// Function from file: bomb.dm public void release( ) { GasMixture removed = null; dynamic T = null; removed = this.air_contents.remove(this.air_contents.total_moles()); T = GlobalFuncs.get_turf(this); if (!Lang13.Bool(T)) { return; } ((Ent_Static)T).assume_air(removed); this.air_update_turf(); return; }
// Function from file: he_pipes.dm public override int?process(dynamic seconds = null) { GasMixture pipe_air = null; double h_r = 0; double h_g = 0; double h_b = 0; dynamic scale = null; int heat_limit = 0; if (!(this.parent != null)) { return(null); } pipe_air = this.return_air(); if (Lang13.Bool(pipe_air.temperature) && (Convert.ToDouble(this.icon_temperature) > 500 || Convert.ToDouble(pipe_air.temperature) > 500)) { if (Math.Abs(Convert.ToDouble(pipe_air.temperature - this.icon_temperature)) > 10) { this.icon_temperature = pipe_air.temperature; h_r = GlobalFuncs.heat2colour_r(this.icon_temperature); h_g = GlobalFuncs.heat2colour_g(this.icon_temperature); h_b = GlobalFuncs.heat2colour_b(this.icon_temperature); if (Convert.ToDouble(this.icon_temperature) < 2000) { scale = (this.icon_temperature - 500) / 1500; h_r = (h_r - 64) * Convert.ToDouble(scale) + 64; h_g = (h_g - 64) * Convert.ToDouble(scale) + 64; h_b = (h_b - 64) * Convert.ToDouble(scale) + 64; } Icon13.Animate(new ByTable().Set(1, this).Set("color", String13.ColorCode(((int)(h_r)), ((int)(h_g)), ((int)(h_b)))).Set("time", 20).Set("easing", 1)); } } if (Lang13.Bool(this.buckled_mob)) { heat_limit = 1000; if (Convert.ToDouble(pipe_air.temperature) > heat_limit + 1) { this.buckled_mob.apply_damage(Math.Log(Convert.ToDouble(pipe_air.temperature - heat_limit)) * 4, "fire", "chest"); } } return(null); }
// Function from file: flamethrower.dm public void ignite_turf(dynamic target = null, double?release_amount = null) { release_amount = release_amount ?? 0.05; GasMixture air_transfer = null; air_transfer = ((GasMixture)this.ptank.air_contents).remove_ratio(release_amount); if (Lang13.Bool(air_transfer.gases["plasma"])) { air_transfer.gases["plasma"][1] *= 5; } ((Ent_Static)target).assume_air(air_transfer); ((Tile)target).hotspot_expose(this.ptank.air_contents.temperature * 2 + 380, 500); GlobalVars.SSair.add_to_active(target, false); return; }
// Function from file: tank.dm public Obj_Machinery_Atmospherics_Components_Unary_Tank(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.volume = this.volume; air_contents.temperature = 293.41; if (Lang13.Bool(this.gas_type)) { air_contents.assert_gas(this.gas_type); air_contents.gases[this.gas_type][1] = (air_contents.volume ?? 0) * 2533.125 / Convert.ToDouble(air_contents.temperature * 8.31); this.name = "" + this.name + " (" + air_contents.gases[this.gas_type][3][2] + ")"; } return; }
// Function from file: LINDA_turf_tile.dm public override dynamic remove_air(double amount = 0) { GasMixture removed = null; if (this.air != null) { removed = null; removed = this.air.remove(amount); this.update_visuals(); return(removed); } else { return(base.remove_air(amount)); } }