diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 1c84a2dafc9..6b41377750f 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -95,7 +95,7 @@ #define COLD_FIRE_MAXIMUM_TEMPERATURE_TO_EXIST 273 //fire will start if the temperature is 0 °C #define COLD_FIRE_SPREAD_RADIOSITY_SCALE 0.95 #define COLD_FIRE_GROWTH_RATE 40000 -#define FREON_MAXIMUM_BURN_TEMPERATURE 293 +#define FREON_MAXIMUM_BURN_TEMPERATURE 283 #define FREON_LOWER_TEMPERATURE 60 //minimum temperature allowed for the burn to go, we would have negative pressure otherwise #define FREON_OXYGEN_FULLBURN 10 diff --git a/code/__DEFINES/reactions.dm b/code/__DEFINES/reactions.dm index d7ef3e17a33..66134ffb486 100644 --- a/code/__DEFINES/reactions.dm +++ b/code/__DEFINES/reactions.dm @@ -53,16 +53,15 @@ #define METAL_HYDROGEN_RESEARCH_MAX_AMOUNT 3000 #define STIMULUM_RESEARCH_AMOUNT 50 //Plasma fusion properties -#define FUSION_ENERGY_THRESHOLD 3e9 //Amount of energy it takes to start a fusion reaction #define FUSION_MOLE_THRESHOLD 250 //Mole count required (tritium/plasma) to start a fusion reaction #define FUSION_TRITIUM_CONVERSION_COEFFICIENT (1e-10) #define INSTABILITY_GAS_POWER_FACTOR 0.003 #define FUSION_TRITIUM_MOLES_USED 1 #define PLASMA_BINDING_ENERGY 20000000 -#define TOROID_VOLUME_BREAKEVEN 1000 -#define FUSION_TEMPERATURE_THRESHOLD 10000 +#define TOROID_VOLUME_BREAKEVEN 1000 +#define FUSION_TEMPERATURE_THRESHOLD 9000 #define PARTICLE_CHANCE_CONSTANT (-20000000) -#define FUSION_RAD_MAX 2000 +#define FUSION_RAD_MAX 1500 #define FUSION_RAD_COEFFICIENT (-1000) #define FUSION_INSTABILITY_ENDOTHERMALITY 2 #define FUSION_MAXIMUM_TEMPERATURE 1e8 diff --git a/code/datums/components/crafting/recipes.dm b/code/datums/components/crafting/recipes.dm index 358d80ae207..5e09a05ffb9 100644 --- a/code/datums/components/crafting/recipes.dm +++ b/code/datums/components/crafting/recipes.dm @@ -902,3 +902,15 @@ reqs = list( /obj/item/reagent_containers/food/snacks/grown/wheat = 50 ) + + +/datum/crafting_recipe/elder_atmosian_statue + name = "Elder Atmosian Statue" + result = /obj/structure/statue/elder_atmosian + time = 6 SECONDS + reqs = list(/obj/item/stack/sheet/mineral/metal_hydrogen = 10, + /obj/item/grenade/gas_crystal/healium_crystal = 1, + /obj/item/grenade/gas_crystal/proto_nitrate_crystal = 1, + /obj/item/grenade/gas_crystal/cyrion_b_crystal = 1 + ) + category = CAT_MISC diff --git a/code/game/objects/items/fireaxe.dm b/code/game/objects/items/fireaxe.dm index bfdb86757b9..89b2fea8c90 100644 --- a/code/game/objects/items/fireaxe.dm +++ b/code/game/objects/items/fireaxe.dm @@ -74,3 +74,18 @@ /obj/item/fireaxe/boneaxe/update_icon_state() icon_state = "bone_axe0" + +/* + * Metal Hydrogen Axe + */ +/obj/item/fireaxe/metal_h2_axe // Blatant imitation of the fireaxe, but made out of metallic hydrogen + icon_state = "metalh2_axe0" + name = "metallic hydrogen axe" + desc = "A large, menacing axe made of an unkown substance that the most elder atmosians calls Metallic Hydrogen. Truly an otherwordly weapon." + +/obj/item/fireaxe/metal_h2_axe/ComponentInitialize() + . = ..() + AddComponent(/datum/component/two_handed, force_unwielded=5, force_wielded=23, icon_wielded="metalh2_axe1") + +/obj/item/fireaxe/metal_h2_axe/update_icon_state() + icon_state = "metalh2_axe0" diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 14a06a1d792..94d6ad04b4e 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -223,7 +223,6 @@ //location.hotspot_expose(1000,500,1) SSair.add_to_active(target, 0) - /obj/item/flamethrower/Initialize(mapload) . = ..() if(create_full) diff --git a/code/game/objects/items/grenades/atmos_grenades.dm b/code/game/objects/items/grenades/atmos_grenades.dm new file mode 100644 index 00000000000..b05b72c8a32 --- /dev/null +++ b/code/game/objects/items/grenades/atmos_grenades.dm @@ -0,0 +1,95 @@ +/obj/item/grenade/gas_crystal + desc = "Some kind of crystal, this shouldn't spawn" + name = "Gas Crystal" + icon = 'icons/obj/grenade.dmi' + icon_state = "bluefrag" + inhand_icon_state = "flashbang" + resistance_flags = FIRE_PROOF + + +/obj/item/grenade/gas_crystal/healium_crystal + name = "Healium crystal" + desc = "A crystal made from the Healium gas, it's cold to the touch." + icon_state = "healium_crystal" + ///Amount of stamina damage mobs will take if in range + var/stamina_damage = 30 + ///Range of the grenade that will cool down and affect mobs + var/freeze_range = 4 + ///Amount of gas released if the state is optimal + var/gas_amount = 250 + +/obj/item/grenade/gas_crystal/proto_nitrate_crystal + name = "Proto Nitrate crystal" + desc = "A crystal made from the Proto Nitrate gas, you can see the liquid gases inside." + icon_state = "proto_nitrate_crystal" + ///Range of the grenade air refilling + var/refill_range = 5 + ///Amount of Nitrogen gas released (close to the grenade) + var/n2_gas_amount = 400 + ///Amount of Oxygen gas released (close to the grenade) + var/o2_gas_amount = 100 + +/obj/item/grenade/gas_crystal/cyrion_b_crystal + name = "Cyrion B crystal" + desc = "A crystal made from the Cyrion B Gas, you can see the liquid plasma inside." + icon_state = "cyrion_b_crystal" + ex_dev = 1 + ex_heavy = 2 + ex_light = 4 + ex_flame = 2 + +/obj/item/grenade/gas_crystal/preprime(mob/user, delayoverride, msg = TRUE, volume = 60) + var/turf/turf_loc = get_turf(src) + log_grenade(user, turf_loc) //Inbuilt admin procs already handle null users + if(user) + add_fingerprint(user) + if(msg) + to_chat(user, "You crush the [src]! [capitalize(DisplayTimeText(det_time))]!") + if(shrapnel_type && shrapnel_radius) + shrapnel_initialized = TRUE + AddComponent(/datum/component/pellet_cloud, projectile_type=shrapnel_type, magnitude=shrapnel_radius) + active = TRUE + icon_state = initial(icon_state) + "_active" + playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', volume, TRUE) + SEND_SIGNAL(src, COMSIG_GRENADE_ARMED, det_time, delayoverride) + addtimer(CALLBACK(src, .proc/prime), isnull(delayoverride)? det_time : delayoverride) + +/obj/item/grenade/gas_crystal/healium_crystal/prime(mob/living/lanced_by) + . = ..() + update_mob() + playsound(src, 'sound/effects/spray2.ogg', 100, TRUE) + for(var/turf/turf_loc in view(freeze_range, loc)) + if(!isopenturf(turf_loc)) + continue + var/distance_from_center = max(get_dist(turf_loc, loc), 1) + var/turf/open/floor_loc = turf_loc + if(floor_loc.air.temperature > 260 && floor_loc.air.temperature < 370) + floor_loc.atmos_spawn_air("n2=[(gas_amount - 150) / distance_from_center];TEMP=273") + if(floor_loc.air.temperature > 370) + floor_loc.atmos_spawn_air("n2=[gas_amount / distance_from_center];TEMP=30") + floor_loc.MakeSlippery(TURF_WET_PERMAFROST, (5 / distance_from_center) MINUTES) + if(floor_loc.air.gases[/datum/gas/plasma]) + floor_loc.air.gases[/datum/gas/plasma][MOLES] -= floor_loc.air.gases[/datum/gas/plasma][MOLES] * 0.5 / distance_from_center + floor_loc.air_update_turf() + for(var/mob/living/carbon/live_mob in turf_loc) + live_mob.adjustStaminaLoss(stamina_damage / distance_from_center) + live_mob.adjust_bodytemperature(-150 / distance_from_center) + qdel(src) + +/obj/item/grenade/gas_crystal/proto_nitrate_crystal/prime(mob/living/lanced_by) + . = ..() + update_mob() + playsound(src, 'sound/effects/spray2.ogg', 100, TRUE) + for(var/turf/turf_loc in view(refill_range, loc)) + if(!isopenturf(turf_loc)) + continue + var/distance_from_center = max(get_dist(turf_loc, loc), 1) + var/turf/open/floor_loc = turf_loc + floor_loc.atmos_spawn_air("n2=[n2_gas_amount / distance_from_center];o2=[o2_gas_amount / distance_from_center];TEMP=273") + floor_loc.air_update_turf() + qdel(src) + +/obj/item/grenade/gas_crystal/cyrion_b_crystal/prime(mob/living/lanced_by) + . = ..() + update_mob() + qdel(src) diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index d2fe5cde658..5dd200d0339 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -482,6 +482,9 @@ GLOBAL_LIST_INIT(abductor_recipes, list ( \ //Metal Hydrogen GLOBAL_LIST_INIT(metalhydrogen_recipes, list( new /datum/stack_recipe("incomplete servant golem shell", /obj/item/golem_shell/servant, req_amount=20, res_amount=1), + new /datum/stack_recipe("ancient armor", /obj/item/clothing/suit/armor/elder_atmosian, req_amount = 8, res_amount = 1), + new /datum/stack_recipe("ancient helmet", /obj/item/clothing/head/helmet/elder_atmosian, req_amount = 5, res_amount = 1), + new /datum/stack_recipe("metallic hydrogen axe", /obj/item/fireaxe/metal_h2_axe, req_amount = 15, res_amount = 1), )) /obj/item/stack/sheet/mineral/metal_hydrogen @@ -492,7 +495,7 @@ GLOBAL_LIST_INIT(metalhydrogen_recipes, list( w_class = WEIGHT_CLASS_NORMAL resistance_flags = FIRE_PROOF | LAVA_PROOF | ACID_PROOF | INDESTRUCTIBLE point_value = 100 - custom_materials = list(/datum/material/metalhydrogen=MINERAL_MATERIAL_AMOUNT) + custom_materials = list(/datum/material/metalhydrogen = MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/metal_hydrogen /obj/item/stack/sheet/mineral/metal_hydrogen/get_main_recipes() diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index edcf6df50e0..c6fc5e767f6 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -300,3 +300,13 @@ desc = "A bust depicting a certain 19th century economist. You get the feeling a specter is haunting the station." icon_state = "marx" art_type = /datum/component/art/rev + +///////////Elder Atmosian/////////////////////////////////////////// + +/obj/structure/statue/elder_atmosian + name = "Elder Atmosian" + desc = "A statue of an Elder Atmosian, capable of bending the laws of thermodynamics to their will" + icon_state = "eng" + material_drop_type = /obj/item/stack/sheet/mineral/metal_hydrogen + max_integrity = 1000 + impressiveness = 100 diff --git a/code/game/turfs/open/_open.dm b/code/game/turfs/open/_open.dm index f80c206dc8a..12db5391b59 100644 --- a/code/game/turfs/open/_open.dm +++ b/code/game/turfs/open/_open.dm @@ -264,9 +264,18 @@ /turf/open/rad_act(pulse_strength) . = ..() if (air.gases[/datum/gas/carbon_dioxide] && air.gases[/datum/gas/oxygen]) - pulse_strength = min(pulse_strength,air.gases[/datum/gas/carbon_dioxide][MOLES]*1000,air.gases[/datum/gas/oxygen][MOLES]*2000) //Ensures matter is conserved properly - air.gases[/datum/gas/carbon_dioxide][MOLES]=max(air.gases[/datum/gas/carbon_dioxide][MOLES]-(pulse_strength/1000),0) - air.gases[/datum/gas/oxygen][MOLES]=max(air.gases[/datum/gas/oxygen][MOLES]-(pulse_strength/2000),0) + pulse_strength = min(pulse_strength, air.gases[/datum/gas/carbon_dioxide][MOLES] * 1000, air.gases[/datum/gas/oxygen][MOLES] * 2000) //Ensures matter is conserved properly + air.gases[/datum/gas/carbon_dioxide][MOLES] = max(air.gases[/datum/gas/carbon_dioxide][MOLES] - (pulse_strength * 0.001),0) + air.gases[/datum/gas/oxygen][MOLES] = max(air.gases[/datum/gas/oxygen][MOLES]-(pulse_strength * 0.002),0) air.assert_gas(/datum/gas/pluoxium) - air.gases[/datum/gas/pluoxium][MOLES]+=(pulse_strength/4000) + air.gases[/datum/gas/pluoxium][MOLES] +=(pulse_strength * 0.004) air.garbage_collect() + air_update_turf() + if (air.gases[/datum/gas/hydrogen]) + pulse_strength = min(pulse_strength, air.gases[/datum/gas/hydrogen][MOLES] * 1000) + air.gases[/datum/gas/hydrogen][MOLES] = max(air.gases[/datum/gas/hydrogen][MOLES] - (pulse_strength * 0.001), 0) + air.assert_gas(/datum/gas/tritium) + air.gases[/datum/gas/tritium][MOLES] += (pulse_strength * 0.001) + air.garbage_collect() + air_update_turf() + diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 9f5a5122c9a..20fb522d66e 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -448,12 +448,14 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) var/datum/gas_reaction/reaction = r var/list/min_reqs = reaction.min_requirements - if((min_reqs["TEMP"] && temp < min_reqs["TEMP"]) \ - || (min_reqs["ENER"] && ener < min_reqs["ENER"])) + if( (min_reqs["TEMP"] && temp < min_reqs["TEMP"]) || \ + (min_reqs["ENER"] && ener < min_reqs["ENER"]) || \ + (min_reqs["MAX_TEMP"] && temp > min_reqs["MAX_TEMP"]) + ) continue for(var/id in min_reqs) - if (id == "TEMP" || id == "ENER") + if (id == "TEMP" || id == "ENER" || id == "MAX_TEMP") continue if(!cached_gases[id] || cached_gases[id][MOLES] < min_reqs[id]) continue reaction_loop diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 1aae4814e8b..a700007ad73 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -170,6 +170,51 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g dangerous = TRUE rarity = 700 +/datum/gas/healium + id = "healium" + specific_heat = 10 + name = "Healium" + dangerous = TRUE + gas_overlay = "healium" + moles_visible = MOLES_GAS_VISIBLE + rarity = 100 + +/datum/gas/proto_nitrate + id = "proto_nitrate" + specific_heat = 30 + name = "Proto Nitrate" + dangerous = TRUE + gas_overlay = "proto_nitrate" + moles_visible = MOLES_GAS_VISIBLE + rarity = 100 + +/datum/gas/cyrion_b + id = "cyrion_b" + specific_heat = 350 + name = "Cyrion B" + dangerous = TRUE + gas_overlay = "cyrion_b" + moles_visible = MOLES_GAS_VISIBLE + rarity = 100 + +/datum/gas/halon + id = "halon" + specific_heat = 175 + name = "Halon" + dangerous = TRUE + gas_overlay = "halon" + moles_visible = MOLES_GAS_VISIBLE + rarity = 100 + +/datum/gas/hexane + id = "hexane" + specific_heat = 5 + name = "Hexane" + dangerous = TRUE + gas_overlay = "hexane" + moles_visible = MOLES_GAS_VISIBLE + rarity = 100 + /obj/effect/overlay/gas icon = 'icons/effects/atmospherics.dmi' mouse_opacity = MOUSE_OPACITY_TRANSPARENT diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index f4cf36121e2..e6e1b3c1801 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -1,13 +1,14 @@ //All defines used in reactions are located in ..\__DEFINES\reactions.dm -/*priority so far, check this list to see what are the numbers used. please use a different priority if the reaction doesn't work (higher number are done first) +/*priority so far, check this list to see what are the numbers used. Please use a different priority for each reaction(higher number are done first) miaster = -10 (this should always be under all other fires) -freonfire = -4 -plasmafire = -3 -h2fire = -2 -tritfire = -1 +freonfire = -5 +plasmafire = -4 +h2fire = -3 +tritfire = -2 +halon_o2removal = -1 nitrous_decomp = 0 water_vapor = 1 -fusion = 2 +pluox_formation = 2 nitrylformation = 3 bzformation = 4 freonformation = 5 @@ -15,6 +16,20 @@ stimformation = 5 nobiliumformation = 6 stimball = 7 ammoniacrystals = 8 +hexane_plasma_filtering = 9 +hexane_n2o_filtering = 10 +cyrion_b_decomp = 11 +healium_production = 12 +proto_nitrate_production = 13 +cyrion_b_production = 14 +halon_formation = 15 +hexane_formation = 16 +healium_crystal_production = 17 +proto_nitrate_crystal_production = 18 +cyrion_b_crystal_production = 19 +proto_nitrate_response = 20 - 25 +fusion = 26 +metallic_hydrogen = 27 nobiliumsuppression = INFINITY */ @@ -108,26 +123,28 @@ nobiliumsuppression = INFINITY var/burned_fuel = 0 - burned_fuel = max(0,0.00002*(temperature-(0.00001*(temperature**2))))*cached_gases[/datum/gas/nitrous_oxide][MOLES] + burned_fuel = max(0,0.00002 * (temperature - (0.00001 * (temperature**2)))) * cached_gases[/datum/gas/nitrous_oxide][MOLES] + if(cached_gases[/datum/gas/nitrous_oxide][MOLES] - burned_fuel < 0) + return NO_REACTION cached_gases[/datum/gas/nitrous_oxide][MOLES] -= burned_fuel if(burned_fuel) energy_released += (N2O_DECOMPOSITION_ENERGY_RELEASED * burned_fuel) ASSERT_GAS(/datum/gas/oxygen, air) - cached_gases[/datum/gas/oxygen][MOLES] += burned_fuel/2 + cached_gases[/datum/gas/oxygen][MOLES] += burned_fuel * 0.5 ASSERT_GAS(/datum/gas/nitrogen, air) cached_gases[/datum/gas/nitrogen][MOLES] += burned_fuel var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity return REACTING return NO_REACTION //tritium combustion: combustion of oxygen and tritium (treated as hydrocarbons). creates hotspots. exothermic /datum/gas_reaction/tritfire - priority = -1 //fire should ALWAYS be last, but tritium fires happen before plasma fires + priority = -2 //fire should ALWAYS be last, but tritium fires happen before plasma fires name = "Tritium Combustion" id = "tritfire" @@ -148,27 +165,27 @@ nobiliumsuppression = INFINITY var/turf/open/location = isturf(holder) ? holder : null var/burned_fuel = 0 if(cached_gases[/datum/gas/oxygen][MOLES] < cached_gases[/datum/gas/tritium][MOLES] || MINIMUM_TRIT_OXYBURN_ENERGY > air.thermal_energy()) - burned_fuel = cached_gases[/datum/gas/oxygen][MOLES]/TRITIUM_BURN_OXY_FACTOR + burned_fuel = cached_gases[/datum/gas/oxygen][MOLES] / TRITIUM_BURN_OXY_FACTOR cached_gases[/datum/gas/tritium][MOLES] -= burned_fuel else - burned_fuel = cached_gases[/datum/gas/tritium][MOLES]*TRITIUM_BURN_TRIT_FACTOR - cached_gases[/datum/gas/tritium][MOLES] -= cached_gases[/datum/gas/tritium][MOLES]/TRITIUM_BURN_TRIT_FACTOR + burned_fuel = cached_gases[/datum/gas/tritium][MOLES] * TRITIUM_BURN_TRIT_FACTOR + cached_gases[/datum/gas/tritium][MOLES] -= cached_gases[/datum/gas/tritium][MOLES] / TRITIUM_BURN_TRIT_FACTOR cached_gases[/datum/gas/oxygen][MOLES] -= cached_gases[/datum/gas/tritium][MOLES] if(burned_fuel) energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel) if(location && prob(10) && burned_fuel > TRITIUM_MINIMUM_RADIATION_ENERGY) //woah there let's not crash the server - radiation_pulse(location, energy_released/TRITIUM_BURN_RADIOACTIVITY_FACTOR) + radiation_pulse(location, energy_released / TRITIUM_BURN_RADIOACTIVITY_FACTOR) ASSERT_GAS(/datum/gas/water_vapor, air) //oxygen+more-or-less hydrogen=H2O - cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel/TRITIUM_BURN_OXY_FACTOR + cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / TRITIUM_BURN_OXY_FACTOR cached_results["fire"] += burned_fuel if(energy_released > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity //let the floor know a fire is happening if(istype(location)) @@ -184,7 +201,7 @@ nobiliumsuppression = INFINITY //plasma combustion: combustion of oxygen and plasma (treated as hydrocarbons). creates hotspots. exothermic /datum/gas_reaction/plasmafire - priority = -3 //fire should ALWAYS be last, but plasma fires happen after tritium fires + priority = -4 //fire should ALWAYS be last, but plasma fires happen after tritium fires name = "Plasma Combustion" id = "plasmafire" @@ -215,22 +232,22 @@ nobiliumsuppression = INFINITY if(temperature > PLASMA_UPPER_TEMPERATURE) temperature_scale = 1 else - temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE) + temperature_scale = (temperature - PLASMA_MINIMUM_BURN_TEMPERATURE) / (PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE) if(temperature_scale > 0) oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale if(cached_gases[/datum/gas/oxygen][MOLES] / cached_gases[/datum/gas/plasma][MOLES] > SUPER_SATURATION_THRESHOLD) //supersaturation. Form Tritium. super_saturation = TRUE - if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/plasma][MOLES]*PLASMA_OXYGEN_FULLBURN) - plasma_burn_rate = (cached_gases[/datum/gas/plasma][MOLES]*temperature_scale)/PLASMA_BURN_RATE_DELTA + if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/plasma][MOLES] * PLASMA_OXYGEN_FULLBURN) + plasma_burn_rate = (cached_gases[/datum/gas/plasma][MOLES] * temperature_scale) / PLASMA_BURN_RATE_DELTA else - plasma_burn_rate = (temperature_scale*(cached_gases[/datum/gas/oxygen][MOLES]/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA + plasma_burn_rate = (temperature_scale * (cached_gases[/datum/gas/oxygen][MOLES] / PLASMA_OXYGEN_FULLBURN)) / PLASMA_BURN_RATE_DELTA if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY) - plasma_burn_rate = min(plasma_burn_rate,cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/oxygen][MOLES]/oxygen_burn_rate) //Ensures matter is conserved properly + plasma_burn_rate = min(plasma_burn_rate, cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/oxygen][MOLES]/oxygen_burn_rate) //Ensures matter is conserved properly cached_gases[/datum/gas/plasma][MOLES] = QUANTIZE(cached_gases[/datum/gas/plasma][MOLES] - plasma_burn_rate) cached_gases[/datum/gas/oxygen][MOLES] = QUANTIZE(cached_gases[/datum/gas/oxygen][MOLES] - (plasma_burn_rate * oxygen_burn_rate)) if (super_saturation) - ASSERT_GAS(/datum/gas/tritium,air) + ASSERT_GAS(/datum/gas/tritium, air) cached_gases[/datum/gas/tritium][MOLES] += plasma_burn_rate else ASSERT_GAS(/datum/gas/carbon_dioxide,air) @@ -240,7 +257,7 @@ nobiliumsuppression = INFINITY energy_released += FIRE_PLASMA_ENERGY_RELEASED * (plasma_burn_rate) - cached_results["fire"] += (plasma_burn_rate)*(1+oxygen_burn_rate) + cached_results["fire"] += (plasma_burn_rate) * (1 + oxygen_burn_rate) if(energy_released > 0) var/new_heat_capacity = air.heat_capacity() @@ -261,14 +278,16 @@ nobiliumsuppression = INFINITY //freon reaction (is not a fire yet) /datum/gas_reaction/freonfire - priority = -4 + priority = -5 name = "Freon combustion" id = "freonfire" /datum/gas_reaction/freonfire/init_reqs() min_requirements = list( /datum/gas/oxygen = MINIMUM_MOLE_COUNT, - /datum/gas/freon = MINIMUM_MOLE_COUNT + /datum/gas/freon = MINIMUM_MOLE_COUNT, + "TEMP" = FREON_LOWER_TEMPERATURE, + "MAX_TEMP" = FREON_MAXIMUM_BURN_TEMPERATURE ) /datum/gas_reaction/freonfire/react(datum/gas_mixture/air, datum/holder) @@ -276,7 +295,9 @@ nobiliumsuppression = INFINITY var/old_heat_capacity = air.heat_capacity() var/list/cached_gases = air.gases //this speeds things up because accessing datum vars is slow var/temperature = air.temperature - var/turf/open/location = isturf(holder) ? holder : null + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder //Handle freon burning (only reaction now) var/freon_burn_rate = 0 @@ -287,19 +308,19 @@ nobiliumsuppression = INFINITY if(temperature < FREON_LOWER_TEMPERATURE) //stop the reaction when too cold temperature_scale = 0 else - temperature_scale = (FREON_MAXIMUM_BURN_TEMPERATURE - temperature)/(FREON_MAXIMUM_BURN_TEMPERATURE - FREON_LOWER_TEMPERATURE) //calculate the scale based on the temperature + temperature_scale = (FREON_MAXIMUM_BURN_TEMPERATURE - temperature) / (FREON_MAXIMUM_BURN_TEMPERATURE - FREON_LOWER_TEMPERATURE) //calculate the scale based on the temperature if(temperature_scale >= 0) oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale - if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/freon][MOLES]*FREON_OXYGEN_FULLBURN) - freon_burn_rate = (cached_gases[/datum/gas/freon][MOLES]*temperature_scale)/FREON_BURN_RATE_DELTA + if(cached_gases[/datum/gas/oxygen][MOLES] > cached_gases[/datum/gas/freon][MOLES] * FREON_OXYGEN_FULLBURN) + freon_burn_rate = (cached_gases[/datum/gas/freon][MOLES] * temperature_scale) / FREON_BURN_RATE_DELTA else - freon_burn_rate = (temperature_scale*(cached_gases[/datum/gas/oxygen][MOLES]/FREON_OXYGEN_FULLBURN))/FREON_BURN_RATE_DELTA + freon_burn_rate = (temperature_scale * (cached_gases[/datum/gas/oxygen][MOLES] / FREON_OXYGEN_FULLBURN)) / FREON_BURN_RATE_DELTA if(freon_burn_rate > MINIMUM_HEAT_CAPACITY) - freon_burn_rate = min(freon_burn_rate,cached_gases[/datum/gas/freon][MOLES],cached_gases[/datum/gas/oxygen][MOLES]/oxygen_burn_rate) //Ensures matter is conserved properly + freon_burn_rate = min(freon_burn_rate, cached_gases[/datum/gas/freon][MOLES], cached_gases[/datum/gas/oxygen][MOLES] / oxygen_burn_rate) //Ensures matter is conserved properly cached_gases[/datum/gas/freon][MOLES] = QUANTIZE(cached_gases[/datum/gas/freon][MOLES] - freon_burn_rate) cached_gases[/datum/gas/oxygen][MOLES] = QUANTIZE(cached_gases[/datum/gas/oxygen][MOLES] - (freon_burn_rate * oxygen_burn_rate)) - ASSERT_GAS(/datum/gas/carbon_dioxide,air) + ASSERT_GAS(/datum/gas/carbon_dioxide, air) cached_gases[/datum/gas/carbon_dioxide][MOLES] += freon_burn_rate if(temperature < 160 && temperature > 120 && prob(2)) @@ -310,10 +331,10 @@ nobiliumsuppression = INFINITY if(energy_released < 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity /datum/gas_reaction/h2fire - priority = -2 //fire should ALWAYS be last, but tritium fires happen before plasma fires + priority = -3 //fire should ALWAYS be last, but tritium fires happen before plasma fires name = "Hydrogen Combustion" id = "h2fire" @@ -337,22 +358,22 @@ nobiliumsuppression = INFINITY burned_fuel = cached_gases[/datum/gas/oxygen][MOLES]/HYDROGEN_BURN_OXY_FACTOR cached_gases[/datum/gas/hydrogen][MOLES] -= burned_fuel else - burned_fuel = cached_gases[/datum/gas/hydrogen][MOLES]*HYDROGEN_BURN_H2_FACTOR - cached_gases[/datum/gas/hydrogen][MOLES] -= cached_gases[/datum/gas/hydrogen][MOLES]/HYDROGEN_BURN_H2_FACTOR + burned_fuel = cached_gases[/datum/gas/hydrogen][MOLES] * HYDROGEN_BURN_H2_FACTOR + cached_gases[/datum/gas/hydrogen][MOLES] -= cached_gases[/datum/gas/hydrogen][MOLES] / HYDROGEN_BURN_H2_FACTOR cached_gases[/datum/gas/oxygen][MOLES] -= cached_gases[/datum/gas/hydrogen][MOLES] if(burned_fuel) energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel) ASSERT_GAS(/datum/gas/water_vapor, air) //oxygen+more-or-less hydrogen=H2O - cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel/HYDROGEN_BURN_OXY_FACTOR + cached_gases[/datum/gas/water_vapor][MOLES] += burned_fuel / HYDROGEN_BURN_OXY_FACTOR cached_results["fire"] += burned_fuel if(energy_released > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity + air.temperature = (temperature*old_heat_capacity + energy_released) / new_heat_capacity //let the floor know a fire is happening if(istype(location)) @@ -374,7 +395,9 @@ nobiliumsuppression = INFINITY /datum/gas_reaction/ammoniacrystals/init_reqs() min_requirements = list( /datum/gas/hydrogen = MINIMUM_MOLE_COUNT, - /datum/gas/nitrogen = MINIMUM_MOLE_COUNT + /datum/gas/nitrogen = MINIMUM_MOLE_COUNT, + "TEMP" = 150, + "MAX_TEMP" = 273 ) /datum/gas_reaction/ammoniacrystals/react(datum/gas_mixture/air, datum/holder) @@ -382,10 +405,14 @@ nobiliumsuppression = INFINITY var/old_heat_capacity = air.heat_capacity() var/list/cached_gases = air.gases var/temperature = air.temperature - var/turf/open/location = isturf(holder) ? holder : null + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder var/consumed_fuel = 0 - if(temperature > 150 && temperature < T0C && cached_gases[/datum/gas/nitrogen][MOLES] > cached_gases[/datum/gas/hydrogen][MOLES]) + if(cached_gases[/datum/gas/nitrogen][MOLES] > cached_gases[/datum/gas/hydrogen][MOLES]) consumed_fuel = (cached_gases[/datum/gas/hydrogen][MOLES] / AMMONIA_FORMATION_FACTOR) + if(cached_gases[/datum/gas/nitrogen][MOLES] - consumed_fuel < 0 || cached_gases[/datum/gas/hydrogen][MOLES] - consumed_fuel * 4 < 0) + return NO_REACTION cached_gases[/datum/gas/nitrogen][MOLES] -= consumed_fuel cached_gases[/datum/gas/hydrogen][MOLES] -= consumed_fuel * 4 if(prob(30 * consumed_fuel)) @@ -394,7 +421,7 @@ nobiliumsuppression = INFINITY if(energy_released > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = (temperature*old_heat_capacity + energy_released)/new_heat_capacity + air.temperature = (temperature * old_heat_capacity + energy_released)/new_heat_capacity //fusion: a terrible idea that was fun but broken. Now reworked to be less broken and more interesting. Again (and again, and again). Again! //Fusion Rework Counter: Please increment this if you make a major overhaul to this system again. @@ -402,7 +429,7 @@ nobiliumsuppression = INFINITY /datum/gas_reaction/fusion exclude = FALSE - priority = 2 + priority = 26 name = "Plasmic Fusion" id = "fusion" @@ -429,28 +456,28 @@ nobiliumsuppression = INFINITY var/initial_plasma = cached_gases[/datum/gas/plasma][MOLES] var/initial_hydrogen = cached_gases[/datum/gas/hydrogen][MOLES] var/scale_factor = (air.volume)/(PI) //We scale it down by volume/Pi because for fusion conditions, moles roughly = 2*volume, but we want it to be based off something constant between reactions. - var/toroidal_size = (2*PI)+TORADIANS(arctan((air.volume-TOROID_VOLUME_BREAKEVEN)/TOROID_VOLUME_BREAKEVEN)) //The size of the phase space hypertorus + var/toroidal_size = (2 * PI) //The size of the phase space hypertorus var/gas_power = 0 for (var/gas_id in cached_gases) - gas_power += (cached_gases[gas_id][GAS_META][META_GAS_FUSION_POWER]*cached_gases[gas_id][MOLES]) - var/instability = MODULUS((gas_power*INSTABILITY_GAS_POWER_FACTOR)**2,toroidal_size) //Instability effects how chaotic the behavior of the reaction is + gas_power += (cached_gases[gas_id][GAS_META][META_GAS_FUSION_POWER] * cached_gases[gas_id][MOLES]) + var/instability = MODULUS((gas_power * INSTABILITY_GAS_POWER_FACTOR)**2, toroidal_size) //Instability effects how chaotic the behavior of the reaction is cached_scan_results[id] = instability//used for analyzer feedback var/plasma = (initial_plasma-FUSION_MOLE_THRESHOLD)/(scale_factor) //We have to scale the amounts of hydrogen and plasma down a significant amount in order to show the chaotic dynamics we want var/hydrogen = (initial_hydrogen-FUSION_MOLE_THRESHOLD)/(scale_factor) //We also subtract out the threshold amount to make it harder for fusion to burn itself out. //The reaction is a specific form of the Kicked Rotator system, which displays chaotic behavior and can be used to model particle interactions. - plasma = MODULUS(plasma - (instability*sin(TODEGREES(hydrogen))), toroidal_size) + plasma = MODULUS(plasma - (instability * sin(TODEGREES(hydrogen))), toroidal_size) hydrogen = MODULUS(hydrogen - plasma, toroidal_size) - cached_gases[/datum/gas/plasma][MOLES] = plasma*scale_factor + FUSION_MOLE_THRESHOLD //Scales the gases back up - cached_gases[/datum/gas/hydrogen][MOLES] = hydrogen*scale_factor + FUSION_MOLE_THRESHOLD + cached_gases[/datum/gas/plasma][MOLES] = plasma * scale_factor + FUSION_MOLE_THRESHOLD //Scales the gases back up + cached_gases[/datum/gas/hydrogen][MOLES] = hydrogen * scale_factor + FUSION_MOLE_THRESHOLD var/delta_plasma = initial_plasma - cached_gases[/datum/gas/plasma][MOLES] - reaction_energy += delta_plasma*PLASMA_BINDING_ENERGY //Energy is gained or lost corresponding to the creation or destruction of mass. + reaction_energy += delta_plasma * PLASMA_BINDING_ENERGY //Energy is gained or lost corresponding to the creation or destruction of mass. if(instability < FUSION_INSTABILITY_ENDOTHERMALITY) - reaction_energy = max(reaction_energy,0) //Stable reactions don't end up endothermic. + reaction_energy = max(reaction_energy, 0) //Stable reactions don't end up endothermic. else if (reaction_energy < 0) reaction_energy *= (instability-FUSION_INSTABILITY_ENDOTHERMALITY)**0.5 @@ -461,24 +488,24 @@ nobiliumsuppression = INFINITY cached_gases[/datum/gas/tritium][MOLES] -= FUSION_TRITIUM_MOLES_USED //The decay of the tritium and the reaction's energy produces waste gases, different ones depending on whether the reaction is endo or exothermic if(reaction_energy > 0) - air.assert_gases(/datum/gas/carbon_dioxide,/datum/gas/water_vapor) - cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT) - cached_gases[/datum/gas/water_vapor][MOLES] += (FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT)) * 0.25 + air.assert_gases(/datum/gas/carbon_dioxide, /datum/gas/water_vapor) + cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED * (reaction_energy * FUSION_TRITIUM_CONVERSION_COEFFICIENT) + cached_gases[/datum/gas/water_vapor][MOLES] += (FUSION_TRITIUM_MOLES_USED * (reaction_energy * FUSION_TRITIUM_CONVERSION_COEFFICIENT)) * 0.25 else air.assert_gases(/datum/gas/carbon_dioxide) - cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED*(reaction_energy*-FUSION_TRITIUM_CONVERSION_COEFFICIENT) + cached_gases[/datum/gas/carbon_dioxide][MOLES] += FUSION_TRITIUM_MOLES_USED * (reaction_energy * -FUSION_TRITIUM_CONVERSION_COEFFICIENT) if(reaction_energy) if(location) - var/particle_chance = ((PARTICLE_CHANCE_CONSTANT)/(reaction_energy-PARTICLE_CHANCE_CONSTANT)) + 1//Asymptopically approaches 100% as the energy of the reaction goes up. + var/particle_chance = ((PARTICLE_CHANCE_CONSTANT) / (reaction_energy - PARTICLE_CHANCE_CONSTANT)) + 1//Asymptopically approaches 100% as the energy of the reaction goes up. if(prob(PERCENT(particle_chance))) location.fire_nuclear_particle() - var/rad_power = max((FUSION_RAD_COEFFICIENT/instability) + FUSION_RAD_MAX,0) + var/rad_power = max((FUSION_RAD_COEFFICIENT / instability) + FUSION_RAD_MAX, 0) radiation_pulse(location,rad_power) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY && (air.temperature <= FUSION_MAXIMUM_TEMPERATURE || reaction_energy <= 0)) //If above FUSION_MAXIMUM_TEMPERATURE, will only adjust temperature for endothermic reactions. - air.temperature = clamp(((air.temperature*old_heat_capacity + reaction_energy)/new_heat_capacity),TCMB,INFINITY) + air.temperature = clamp(((air.temperature * old_heat_capacity + reaction_energy) / new_heat_capacity), TCMB, INFINITY) return REACTING /datum/gas_reaction/nitrousformation //formationn of n2o, esothermic, requires bz as catalyst @@ -491,7 +518,8 @@ nobiliumsuppression = INFINITY /datum/gas/oxygen = 10, /datum/gas/nitrogen = 20, /datum/gas/bz = 5, - "TEMP" = 200 + "TEMP" = 200, + "MAX_TEMP" = 250 ) /datum/gas_reaction/nitrousformation/react(datum/gas_mixture/air) @@ -500,10 +528,8 @@ nobiliumsuppression = INFINITY var/old_heat_capacity = air.heat_capacity() var/heat_efficency = min(cached_gases[/datum/gas/oxygen][MOLES], cached_gases[/datum/gas/nitrogen][MOLES]) var/energy_used = heat_efficency * NITROUS_FORMATION_ENERGY - ASSERT_GAS(/datum/gas/nitrous_oxide,air) - if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency < 0)) //Shouldn't produce gas from nothing. - return NO_REACTION - if (temperature > 250) //maximum allowed temperature for the reaction + ASSERT_GAS(/datum/gas/nitrous_oxide, air) + if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency * 2 < 0)) //Shouldn't produce gas from nothing. return NO_REACTION cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency cached_gases[/datum/gas/nitrogen][MOLES] -= heat_efficency * 2 @@ -512,7 +538,7 @@ nobiliumsuppression = INFINITY if(energy_used > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity),TCMB) //the air heats up when reacting + air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB) //the air heats up when reacting return REACTING /datum/gas_reaction/nitrylformation //The formation of nitryl. Endothermic. Requires bz. @@ -523,9 +549,10 @@ nobiliumsuppression = INFINITY /datum/gas_reaction/nitrylformation/init_reqs() min_requirements = list( /datum/gas/oxygen = 10, - /datum/gas/nitrogen = 20, + /datum/gas/nitrogen = 10, /datum/gas/bz = 5, - "TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 60 + "TEMP" = 1500, + "MAX_TEMP" = 10000 ) /datum/gas_reaction/nitrylformation/react(datum/gas_mixture/air) @@ -533,12 +560,12 @@ nobiliumsuppression = INFINITY var/temperature = air.temperature var/old_heat_capacity = air.heat_capacity() - var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 100),cached_gases[/datum/gas/oxygen][MOLES],cached_gases[/datum/gas/nitrogen][MOLES]) + var/heat_efficency = min(temperature / (FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 8), cached_gases[/datum/gas/oxygen][MOLES], cached_gases[/datum/gas/nitrogen][MOLES]) var/energy_used = heat_efficency * NITRYL_FORMATION_ENERGY - ASSERT_GAS(/datum/gas/nitryl,air) - if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency < 0)) //Shouldn't produce gas from nothing. + ASSERT_GAS(/datum/gas/nitryl, air) + if ((cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - heat_efficency < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.05 < 0)) //Shouldn't produce gas from nothing. return NO_REACTION - cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency * 2 + cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency cached_gases[/datum/gas/nitrogen][MOLES] -= heat_efficency cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.05 //bz gets consumed to balance the nitryl production and not make it too common and/or easy cached_gases[/datum/gas/nitryl][MOLES] += heat_efficency @@ -546,7 +573,7 @@ nobiliumsuppression = INFINITY if(energy_used > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity),TCMB) //the air cools down when reacting + air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) //the air cools down when reacting return REACTING /datum/gas_reaction/bzformation //Formation of BZ by combining plasma and tritium at low pressures. Exothermic. @@ -566,29 +593,29 @@ nobiliumsuppression = INFINITY var/temperature = air.temperature var/pressure = air.return_pressure() var/old_heat_capacity = air.heat_capacity() - var/reaction_efficency = min(1/((pressure/(0.1*ONE_ATMOSPHERE))*(max(cached_gases[/datum/gas/plasma][MOLES]/cached_gases[/datum/gas/nitrous_oxide][MOLES],1))),cached_gases[/datum/gas/nitrous_oxide][MOLES],cached_gases[/datum/gas/plasma][MOLES]/2) - var/energy_released = 2*reaction_efficency*FIRE_CARBON_ENERGY_RELEASED - if ((cached_gases[/datum/gas/nitrous_oxide][MOLES] - reaction_efficency < 0 )|| (cached_gases[/datum/gas/plasma][MOLES] - (2*reaction_efficency) < 0) || energy_released <= 0) //Shouldn't produce gas from nothing. + var/reaction_efficency = min(1 / ((pressure / (0.1 * ONE_ATMOSPHERE)) * (max(cached_gases[/datum/gas/plasma][MOLES] / cached_gases[/datum/gas/nitrous_oxide][MOLES], 1))), cached_gases[/datum/gas/nitrous_oxide][MOLES], cached_gases[/datum/gas/plasma][MOLES] * 0.5) + var/energy_released = 2 * reaction_efficency * FIRE_CARBON_ENERGY_RELEASED + if ((cached_gases[/datum/gas/nitrous_oxide][MOLES] - reaction_efficency < 0 )|| (cached_gases[/datum/gas/plasma][MOLES] - (2 * reaction_efficency) < 0) || energy_released <= 0) //Shouldn't produce gas from nothing. return NO_REACTION - ASSERT_GAS(/datum/gas/bz,air) - cached_gases[/datum/gas/bz][MOLES] += reaction_efficency + ASSERT_GAS(/datum/gas/bz, air) + cached_gases[/datum/gas/bz][MOLES] += reaction_efficency * 2.5 if(reaction_efficency == cached_gases[/datum/gas/nitrous_oxide][MOLES]) - ASSERT_GAS(/datum/gas/oxygen,air) - cached_gases[/datum/gas/bz][MOLES] -= min(pressure,1) - cached_gases[/datum/gas/oxygen][MOLES] += min(pressure,1) + ASSERT_GAS(/datum/gas/oxygen, air) + cached_gases[/datum/gas/bz][MOLES] -= min(pressure,0.5) + cached_gases[/datum/gas/oxygen][MOLES] += min(pressure,0.5) cached_gases[/datum/gas/nitrous_oxide][MOLES] -= reaction_efficency - cached_gases[/datum/gas/plasma][MOLES] -= 2*reaction_efficency + cached_gases[/datum/gas/plasma][MOLES] -= 2 * reaction_efficency - SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((reaction_efficency**2)*BZ_RESEARCH_SCALE),BZ_RESEARCH_MAX_AMOUNT) + SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((reaction_efficency**2) * BZ_RESEARCH_SCALE), BZ_RESEARCH_MAX_AMOUNT) if(energy_released > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((temperature*old_heat_capacity + energy_released)/new_heat_capacity),TCMB) + air.temperature = max(((temperature * old_heat_capacity + energy_released) / new_heat_capacity), TCMB) return REACTING /datum/gas_reaction/metalhydrogen - priority = 9 + priority = 27 name = "Metal Hydrogen formation" id = "metalhydrogen" @@ -603,26 +630,28 @@ nobiliumsuppression = INFINITY var/list/cached_gases = air.gases var/temperature = air.temperature var/old_heat_capacity = air.heat_capacity() + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder ///the more heat you use the higher is this factor var/increase_factor = min((temperature / METAL_HYDROGEN_MINIMUM_HEAT), 5) ///the more moles you use and the higher the heat, the higher is the efficiency var/heat_efficency = cached_gases[/datum/gas/hydrogen][MOLES] * 0.01 * increase_factor var/pressure = air.return_pressure() var/energy_used = heat_efficency * METAL_HYDROGEN_FORMATION_ENERGY - var/turf/open/location = isturf(holder) ? holder : null if(pressure >= METAL_HYDROGEN_MINIMUM_PRESSURE && temperature >= METAL_HYDROGEN_MINIMUM_HEAT) cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.01 if (prob(20 * increase_factor)) - cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 10 - if (prob(50 / increase_factor)) + cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 3.5 + if (prob(100 / increase_factor)) new /obj/item/stack/sheet/mineral/metal_hydrogen(location) - SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT)) + SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT)) if(energy_used > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity),TCMB) + air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) return REACTING /datum/gas_reaction/freonformation @@ -642,20 +671,20 @@ nobiliumsuppression = INFINITY var/list/cached_gases = air.gases var/temperature = air.temperature var/old_heat_capacity = air.heat_capacity() - var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/carbon_dioxide][MOLES], cached_gases[/datum/gas/bz][MOLES]) + var/heat_efficency = min(temperature / (FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/carbon_dioxide][MOLES], cached_gases[/datum/gas/bz][MOLES]) var/energy_used = heat_efficency * 100 - ASSERT_GAS(/datum/gas/freon,air) - if ((cached_gases[/datum/gas/plasma][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/carbon_dioxide][MOLES] - heat_efficency < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency < 0)) //Shouldn't produce gas from nothing. + ASSERT_GAS(/datum/gas/freon, air) + if ((cached_gases[/datum/gas/plasma][MOLES] - heat_efficency * 1.5 < 0 ) || (cached_gases[/datum/gas/carbon_dioxide][MOLES] - heat_efficency * 0.75 < 0) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing. return NO_REACTION - cached_gases[/datum/gas/plasma][MOLES] -= heat_efficency * 5 - cached_gases[/datum/gas/carbon_dioxide][MOLES] -= heat_efficency + cached_gases[/datum/gas/plasma][MOLES] -= heat_efficency * 1.5 + cached_gases[/datum/gas/carbon_dioxide][MOLES] -= heat_efficency * 0.75 cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.25 - cached_gases[/datum/gas/freon][MOLES] += heat_efficency * 2 + cached_gases[/datum/gas/freon][MOLES] += heat_efficency * 2.5 if(energy_used > 0) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((temperature*old_heat_capacity - energy_used)/new_heat_capacity),TCMB) + air.temperature = max(((temperature * old_heat_capacity - energy_used)/new_heat_capacity), TCMB) return REACTING /datum/gas_reaction/stimformation //Stimulum formation follows a strange pattern of how effective it will be at a given temperature, having some multiple peaks and some large dropoffs. Exo and endo thermic. @@ -666,10 +695,9 @@ nobiliumsuppression = INFINITY /datum/gas_reaction/stimformation/init_reqs() min_requirements = list( /datum/gas/tritium = 30, - /datum/gas/plasma = 10, /datum/gas/bz = 20, /datum/gas/nitryl = 30, - "TEMP" = STIMULUM_HEAT_SCALE/2) + "TEMP" = 1500) /datum/gas_reaction/stimformation/react(datum/gas_mixture/air) var/list/cached_gases = air.gases @@ -677,19 +705,17 @@ nobiliumsuppression = INFINITY var/old_heat_capacity = air.heat_capacity() var/heat_scale = min(air.temperature/STIMULUM_HEAT_SCALE,cached_gases[/datum/gas/tritium][MOLES],cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/nitryl][MOLES]) var/stim_energy_change = heat_scale + STIMULUM_FIRST_RISE*(heat_scale**2) - STIMULUM_FIRST_DROP*(heat_scale**3) + STIMULUM_SECOND_RISE*(heat_scale**4) - STIMULUM_ABSOLUTE_DROP*(heat_scale**5) - - ASSERT_GAS(/datum/gas/stimulum,air) - if ((cached_gases[/datum/gas/tritium][MOLES] - heat_scale < 0 )|| (cached_gases[/datum/gas/plasma][MOLES] - heat_scale < 0) || (cached_gases[/datum/gas/nitryl][MOLES] - heat_scale < 0)) //Shouldn't produce gas from nothing. + ASSERT_GAS(/datum/gas/stimulum, air) + if ((cached_gases[/datum/gas/tritium][MOLES] - heat_scale < 0 ) || (cached_gases[/datum/gas/nitryl][MOLES] - heat_scale < 0)) //Shouldn't produce gas from nothing. return NO_REACTION - cached_gases[/datum/gas/stimulum][MOLES]+= heat_scale/10 + cached_gases[/datum/gas/stimulum][MOLES]+= heat_scale * 0.75 cached_gases[/datum/gas/tritium][MOLES] -= heat_scale - cached_gases[/datum/gas/plasma][MOLES] -= heat_scale cached_gases[/datum/gas/nitryl][MOLES] -= heat_scale - SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, STIMULUM_RESEARCH_AMOUNT*max(stim_energy_change,0)) + SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, STIMULUM_RESEARCH_AMOUNT * max(stim_energy_change, 0)) if(stim_energy_change) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((air.temperature*old_heat_capacity + stim_energy_change)/new_heat_capacity),TCMB) + air.temperature = max(((air.temperature * old_heat_capacity + stim_energy_change) / new_heat_capacity), TCMB) return REACTING /datum/gas_reaction/nobliumformation //Hyper-Noblium formation is extrememly endothermic, but requires high temperatures to start. Due to its high mass, hyper-nobelium uses large amounts of nitrogen and tritium. BZ can be used as a catalyst to make it less endothermic. @@ -701,25 +727,25 @@ nobiliumsuppression = INFINITY min_requirements = list( /datum/gas/nitrogen = 10, /datum/gas/tritium = 5, - "TEMP" = 5000000) + "TEMP" = 50000) /datum/gas_reaction/nobliumformation/react(datum/gas_mixture/air) var/list/cached_gases = air.gases - air.assert_gases(/datum/gas/hypernoblium,/datum/gas/bz) + air.assert_gases(/datum/gas/hypernoblium, /datum/gas/bz) var/old_heat_capacity = air.heat_capacity() - var/nob_formed = min((cached_gases[/datum/gas/nitrogen][MOLES]+cached_gases[/datum/gas/tritium][MOLES])/100,cached_gases[/datum/gas/tritium][MOLES]/10,cached_gases[/datum/gas/nitrogen][MOLES]/20) - var/energy_taken = nob_formed*(NOBLIUM_FORMATION_ENERGY/(max(cached_gases[/datum/gas/bz][MOLES],1))) - if ((cached_gases[/datum/gas/tritium][MOLES] - 10*nob_formed < 0) || (cached_gases[/datum/gas/nitrogen][MOLES] - 20*nob_formed < 0)) + var/nob_formed = min((cached_gases[/datum/gas/nitrogen][MOLES] + cached_gases[/datum/gas/tritium][MOLES]) * 0.01, cached_gases[/datum/gas/tritium][MOLES] * 0.1, cached_gases[/datum/gas/nitrogen][MOLES] * 0.2) + var/energy_taken = nob_formed * (NOBLIUM_FORMATION_ENERGY / (max(cached_gases[/datum/gas/bz][MOLES], 1))) + if ((cached_gases[/datum/gas/tritium][MOLES] - 5 * nob_formed < 0) || (cached_gases[/datum/gas/nitrogen][MOLES] - 10 * nob_formed < 0)) return NO_REACTION - cached_gases[/datum/gas/tritium][MOLES] -= 10*nob_formed - cached_gases[/datum/gas/nitrogen][MOLES] -= 20*nob_formed - cached_gases[/datum/gas/hypernoblium][MOLES]+= nob_formed - SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, nob_formed*NOBLIUM_RESEARCH_AMOUNT) + cached_gases[/datum/gas/tritium][MOLES] -= nob_formed * 5 + cached_gases[/datum/gas/nitrogen][MOLES] -= nob_formed * 10 + cached_gases[/datum/gas/hypernoblium][MOLES] += nob_formed + SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, nob_formed * NOBLIUM_RESEARCH_AMOUNT) if (nob_formed) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = max(((air.temperature*old_heat_capacity - energy_taken)/new_heat_capacity),TCMB) + air.temperature = max(((air.temperature * old_heat_capacity - energy_taken) / new_heat_capacity), TCMB) /datum/gas_reaction/miaster //dry heat sterilization: clears out pathogens in the air @@ -736,13 +762,13 @@ nobiliumsuppression = INFINITY /datum/gas_reaction/miaster/react(datum/gas_mixture/air, datum/holder) var/list/cached_gases = air.gases // As the name says it, it needs to be dry - if(cached_gases[/datum/gas/water_vapor] && cached_gases[/datum/gas/water_vapor][MOLES]/air.total_moles() > 0.1) + if(cached_gases[/datum/gas/water_vapor] && cached_gases[/datum/gas/water_vapor][MOLES] / air.total_moles() > 0.1) return //Replace miasma with oxygen var/cleaned_air = min(cached_gases[/datum/gas/miasma][MOLES], 20 + (air.temperature - FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 70) / 20) cached_gases[/datum/gas/miasma][MOLES] -= cleaned_air - ASSERT_GAS(/datum/gas/oxygen,air) + ASSERT_GAS(/datum/gas/oxygen, air) cached_gases[/datum/gas/oxygen][MOLES] += cleaned_air //Possibly burning a bit of organic matter through maillard reaction, so a *tiny* bit more heat would be understandable @@ -770,19 +796,641 @@ nobiliumsuppression = INFINITY location = get_turf(pick(pipenet.members)) else location = get_turf(holder) - air.assert_gases(/datum/gas/water_vapor,/datum/gas/nitryl,/datum/gas/carbon_dioxide,/datum/gas/nitrogen) - var/ball_shot_angle = 180*cos(cached_gases[/datum/gas/water_vapor][MOLES]/cached_gases[/datum/gas/nitryl][MOLES])+180 - var/stim_used = min(STIM_BALL_GAS_AMOUNT/cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/stimulum][MOLES]) - var/pluox_used = min(STIM_BALL_GAS_AMOUNT/cached_gases[/datum/gas/plasma][MOLES],cached_gases[/datum/gas/pluoxium][MOLES]) - var/energy_released = stim_used*STIMULUM_HEAT_SCALE//Stimulum has a lot of stored energy, and breaking it up releases some of it + air.assert_gases(/datum/gas/water_vapor, /datum/gas/nitryl, /datum/gas/carbon_dioxide, /datum/gas/nitrogen) + var/ball_shot_angle = 180 * cos(cached_gases[/datum/gas/water_vapor][MOLES] / cached_gases[/datum/gas/nitryl][MOLES]) + 180 + var/stim_used = min(STIM_BALL_GAS_AMOUNT / cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/stimulum][MOLES]) + var/pluox_used = min(STIM_BALL_GAS_AMOUNT / cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/pluoxium][MOLES]) + if ((cached_gases[/datum/gas/pluoxium][MOLES] - pluox_used < 0 ) || (cached_gases[/datum/gas/stimulum][MOLES] - stim_used < 0) || (cached_gases[/datum/gas/plasma][MOLES] - min(stim_used * pluox_used, 30) < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + var/energy_released = stim_used * STIMULUM_HEAT_SCALE//Stimulum has a lot of stored energy, and breaking it up releases some of it location.fire_nuclear_particle(ball_shot_angle) - cached_gases[/datum/gas/carbon_dioxide][MOLES] += 4*pluox_used - cached_gases[/datum/gas/nitrogen][MOLES] += 8*stim_used + cached_gases[/datum/gas/carbon_dioxide][MOLES] += 0.5 * pluox_used + cached_gases[/datum/gas/nitrogen][MOLES] += 2 * stim_used cached_gases[/datum/gas/pluoxium][MOLES] -= pluox_used cached_gases[/datum/gas/stimulum][MOLES] -= stim_used - cached_gases[/datum/gas/plasma][MOLES] *= 0.5 //Consumes half the plasma each time. + cached_gases[/datum/gas/plasma][MOLES] -= min(stim_used * pluox_used, 30) if(energy_released) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = clamp((air.temperature*old_heat_capacity + energy_released)/new_heat_capacity,TCMB,INFINITY) + air.temperature = clamp((air.temperature * old_heat_capacity + energy_released) / new_heat_capacity, TCMB, INFINITY) return REACTING + +/datum/gas_reaction/halon_formation + priority = 15 + name = "Halon formation" + id = "halon_formation" + +/datum/gas_reaction/halon_formation/init_reqs() + min_requirements = list( + /datum/gas/bz = MINIMUM_MOLE_COUNT, + /datum/gas/tritium = MINIMUM_MOLE_COUNT, + "TEMP" = 30, + "MAX_TEMP" = 55 + ) + +/datum/gas_reaction/halon_formation/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/tritium][MOLES], cached_gases[/datum/gas/bz][MOLES]) + var/energy_used = heat_efficency * 300 + ASSERT_GAS(/datum/gas/halon, air) + if ((cached_gases[/datum/gas/tritium][MOLES] - heat_efficency * 4 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/tritium][MOLES] -= heat_efficency * 4 + cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.25 + cached_gases[/datum/gas/halon][MOLES] += heat_efficency * 4.25 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/hexane_formation + priority = 16 + name = "Hexane formation" + id = "hexane_formation" + +/datum/gas_reaction/hexane_formation/init_reqs() + min_requirements = list( + /datum/gas/bz = MINIMUM_MOLE_COUNT, + /datum/gas/hydrogen = MINIMUM_MOLE_COUNT, + "TEMP" = 450, + "MAX_TEMP" = 465 + ) + +/datum/gas_reaction/hexane_formation/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/hydrogen][MOLES], cached_gases[/datum/gas/bz][MOLES]) + var/energy_used = heat_efficency * 600 + ASSERT_GAS(/datum/gas/hexane, air) + if ((cached_gases[/datum/gas/hydrogen][MOLES] - heat_efficency * 5 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 5 + cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.25 + cached_gases[/datum/gas/hexane][MOLES] += heat_efficency * 5.25 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/healium_formation + priority = 12 + name = "Healium formation" + id = "healium_formation" + +/datum/gas_reaction/healium_formation/init_reqs() + min_requirements = list( + /datum/gas/bz = MINIMUM_MOLE_COUNT, + /datum/gas/freon = MINIMUM_MOLE_COUNT, + "TEMP" = 25, + "MAX_TEMP" = 300 + ) + +/datum/gas_reaction/healium_formation/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.3, cached_gases[/datum/gas/freon][MOLES], cached_gases[/datum/gas/bz][MOLES]) + var/energy_used = heat_efficency * 9000 + ASSERT_GAS(/datum/gas/healium, air) + if ((cached_gases[/datum/gas/freon][MOLES] - heat_efficency * 2.75 < 0 ) || (cached_gases[/datum/gas/bz][MOLES] - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/freon][MOLES] -= heat_efficency * 2.75 + cached_gases[/datum/gas/bz][MOLES] -= heat_efficency * 0.25 + cached_gases[/datum/gas/healium][MOLES] += heat_efficency * 3 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/proto_nitrate_formation + priority = 13 + name = "Proto Nitrate formation" + id = "proto_nitrate_formation" + +/datum/gas_reaction/proto_nitrate_formation/init_reqs() + min_requirements = list( + /datum/gas/pluoxium = MINIMUM_MOLE_COUNT, + /datum/gas/hydrogen = MINIMUM_MOLE_COUNT, + "TEMP" = 5000, + "MAX_TEMP" = 10000 + ) + +/datum/gas_reaction/proto_nitrate_formation/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.005, cached_gases[/datum/gas/pluoxium][MOLES], cached_gases[/datum/gas/hydrogen][MOLES]) + var/energy_used = heat_efficency * 650 + ASSERT_GAS(/datum/gas/proto_nitrate, air) + if ((cached_gases[/datum/gas/pluoxium][MOLES] - heat_efficency * 0.2 < 0 ) || (cached_gases[/datum/gas/hydrogen][MOLES] - heat_efficency * 2 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/hydrogen][MOLES] -= heat_efficency * 2 + cached_gases[/datum/gas/pluoxium][MOLES] -= heat_efficency * 0.2 + cached_gases[/datum/gas/proto_nitrate][MOLES] += heat_efficency * 2.2 + + if(energy_used > 0) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/cyrion_b_formation + priority = 14 + name = "Cyrion B formation" + id = "cyrion_b_formation" + +/datum/gas_reaction/cyrion_b_formation/init_reqs() + min_requirements = list( + /datum/gas/hypernoblium = MINIMUM_MOLE_COUNT, + /datum/gas/stimulum = MINIMUM_MOLE_COUNT, + "TEMP" = 50000, + "MAX_TEMP" = 75000 + ) + +/datum/gas_reaction/cyrion_b_formation/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.000005, cached_gases[/datum/gas/hypernoblium][MOLES], cached_gases[/datum/gas/stimulum][MOLES]) + var/energy_used = heat_efficency * 5000 + ASSERT_GAS(/datum/gas/cyrion_b, air) + if ((cached_gases[/datum/gas/hypernoblium][MOLES] - heat_efficency * 0.01 < 0 ) || (cached_gases[/datum/gas/stimulum][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/hypernoblium][MOLES] -= heat_efficency * 0.01 + cached_gases[/datum/gas/stimulum][MOLES] -= heat_efficency * 0.5 + cached_gases[/datum/gas/cyrion_b][MOLES] += heat_efficency * 0.5 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/halon_o2removal + priority = -1 + name = "Halon o2 removal" + id = "halon_o2removal" + +/datum/gas_reaction/halon_o2removal/init_reqs() + min_requirements = list( + /datum/gas/halon = MINIMUM_MOLE_COUNT, + /datum/gas/oxygen = MINIMUM_MOLE_COUNT, + "TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + ) + +/datum/gas_reaction/halon_o2removal/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature / ( FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), cached_gases[/datum/gas/halon][MOLES], cached_gases[/datum/gas/oxygen][MOLES]) + var/energy_used = heat_efficency * 2500 + ASSERT_GAS(/datum/gas/carbon_dioxide, air) + if ((cached_gases[/datum/gas/halon][MOLES] - heat_efficency < 0 ) || (cached_gases[/datum/gas/oxygen][MOLES] - heat_efficency * 20 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/halon][MOLES] -= heat_efficency + cached_gases[/datum/gas/oxygen][MOLES] -= heat_efficency * 20 + cached_gases[/datum/gas/carbon_dioxide][MOLES] += heat_efficency * 5 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/hexane_plasma_filtering + priority = 9 + name = "Hexane plasma filtering" + id = "hexane_plasma_filtering" + +/datum/gas_reaction/hexane_plasma_filtering/init_reqs() + min_requirements = list( + /datum/gas/hexane = MINIMUM_MOLE_COUNT, + /datum/gas/plasma = MINIMUM_MOLE_COUNT, + "TEMP" = 150 + ) + +/datum/gas_reaction/hexane_plasma_filtering/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/hexane][MOLES], cached_gases[/datum/gas/plasma][MOLES]) + var/energy_used = heat_efficency * 250 + ASSERT_GAS(/datum/gas/carbon_dioxide, air) + if ((cached_gases[/datum/gas/hexane][MOLES] - heat_efficency * 0.2 < 0 ) || (cached_gases[/datum/gas/plasma][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/hexane][MOLES] -= heat_efficency * 0.2 + cached_gases[/datum/gas/plasma][MOLES] -= heat_efficency * 0.5 + cached_gases[/datum/gas/carbon_dioxide][MOLES] += heat_efficency * 0.4 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity - energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/hexane_n2o_filtering + priority = 10 + name = "Hexane n2o filtering" + id = "hexane_n2o_filtering" + +/datum/gas_reaction/hexane_n2o_filtering/init_reqs() + min_requirements = list( + /datum/gas/hexane = MINIMUM_MOLE_COUNT, + /datum/gas/nitrous_oxide = MINIMUM_MOLE_COUNT, + ) + +/datum/gas_reaction/hexane_n2o_filtering/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/old_heat_capacity = air.heat_capacity() + var/heat_efficency = min(temperature * 0.01, cached_gases[/datum/gas/hexane][MOLES], cached_gases[/datum/gas/nitrous_oxide][MOLES]) + var/energy_used = heat_efficency * 100 + ASSERT_GAS(/datum/gas/oxygen, air) + ASSERT_GAS(/datum/gas/nitrogen, air) + if ((cached_gases[/datum/gas/hexane][MOLES] - heat_efficency * 0.2 < 0 ) || (cached_gases[/datum/gas/nitrous_oxide][MOLES] - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/hexane][MOLES] -= heat_efficency * 0.2 + cached_gases[/datum/gas/nitrous_oxide][MOLES] -= heat_efficency * 0.6 + cached_gases[/datum/gas/oxygen][MOLES] += heat_efficency * 0.2 + cached_gases[/datum/gas/nitrogen][MOLES] += heat_efficency * 0.6 + + if(energy_used) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = max(((temperature * old_heat_capacity + energy_used) / new_heat_capacity), TCMB) + return REACTING + +/datum/gas_reaction/cyrion_b_decomp + priority = 11 + name = "Cyrion B decomposition" + id = "cyrion_b_decomp" + +/datum/gas_reaction/cyrion_b_decomp/init_reqs() + min_requirements = list( + /datum/gas/nitrogen = MINIMUM_MOLE_COUNT, + /datum/gas/cyrion_b = MINIMUM_MOLE_COUNT + ) + +/datum/gas_reaction/cyrion_b_decomp/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases //this speeds things up because accessing datum vars is slow + var/temperature = air.temperature + var/burned_fuel = 0 + burned_fuel = min(20, cached_gases[/datum/gas/nitrogen][MOLES], cached_gases[/datum/gas/cyrion_b][MOLES]) + if(cached_gases[/datum/gas/cyrion_b][MOLES] - burned_fuel < 0) + return NO_REACTION + cached_gases[/datum/gas/cyrion_b][MOLES] -= burned_fuel + + if(burned_fuel) + energy_released += (460 * burned_fuel) + + ASSERT_GAS(/datum/gas/oxygen, air) + ASSERT_GAS(/datum/gas/nitrogen, air) + cached_gases[/datum/gas/oxygen][MOLES] += burned_fuel * 0.3 + cached_gases[/datum/gas/nitrogen][MOLES] += burned_fuel * 0.7 + + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + return NO_REACTION + +/datum/gas_reaction/healium_crystal_formation + priority = 17 + name = "healium crystal formation" + id = "healium_crystal_formation" + +/datum/gas_reaction/healium_crystal_formation/init_reqs() + min_requirements = list( + /datum/gas/oxygen = 50, + /datum/gas/healium = 10, + "TEMP" = 1000, + "MAX_TEMP" = 2500 + ) + +/datum/gas_reaction/healium_crystal_formation/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder + var/consumed_fuel = 0 + consumed_fuel = min(cached_gases[/datum/gas/healium][MOLES] * 2.5, 20 * (temperature * 0.001)) + if ((cached_gases[/datum/gas/healium][MOLES] - consumed_fuel * 0.4 < 0 ) || (cached_gases[/datum/gas/oxygen][MOLES] - consumed_fuel * 0.1 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/oxygen][MOLES] -= consumed_fuel * 0.1 + cached_gases[/datum/gas/healium][MOLES] -= consumed_fuel * 0.4 + if(prob(2 * consumed_fuel)) + new /obj/item/grenade/gas_crystal/healium_crystal(location) + energy_released += consumed_fuel * 800 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/proto_nitrate_crystal_formation + priority = 18 + name = "hydrogen pluoxide crystal formation" + id = "proto_nitrate_crystal_formation" + +/datum/gas_reaction/proto_nitrate_crystal_formation/init_reqs() + min_requirements = list( + /datum/gas/nitrogen = 50, + /datum/gas/proto_nitrate = 10, + "TEMP" = 100, + "MAX_TEMP" = 150 + ) + +/datum/gas_reaction/proto_nitrate_crystal_formation/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder + var/consumed_fuel = 0 + consumed_fuel = min(cached_gases[/datum/gas/proto_nitrate][MOLES] * 0.15, 20 * (temperature * 0.01)) + if ((cached_gases[/datum/gas/proto_nitrate][MOLES] - consumed_fuel * 0.15 < 0 ) || (cached_gases[/datum/gas/nitrogen][MOLES] - consumed_fuel * 0.01 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/nitrogen][MOLES] -= consumed_fuel * 0.01 + cached_gases[/datum/gas/proto_nitrate][MOLES] -= consumed_fuel * 0.15 + if(prob(5 * consumed_fuel)) + new /obj/item/grenade/gas_crystal/proto_nitrate_crystal(location) + energy_released += consumed_fuel * 800 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/cyrion_b_crystal_formation + priority = 19 + name = "cyrion_b crystal formation" + id = "cyrion_b_crystal_formation" + +/datum/gas_reaction/cyrion_b_crystal_formation/init_reqs() + min_requirements = list( + /datum/gas/plasma = 50, + /datum/gas/cyrion_b = 10, + "TEMP" = 270, + "MAX_TEMP" = 280 + ) + +/datum/gas_reaction/cyrion_b_crystal_formation/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder + var/consumed_fuel = 0 + consumed_fuel = min(cached_gases[/datum/gas/cyrion_b][MOLES] * 0.1, 20 * (temperature * 0.02)) + if ((cached_gases[/datum/gas/cyrion_b][MOLES] - consumed_fuel * 0.05 < 0 ) || (cached_gases[/datum/gas/plasma][MOLES] - consumed_fuel * 5 < 0)) //Shouldn't produce gas from nothing. + return NO_REACTION + cached_gases[/datum/gas/plasma][MOLES] -= consumed_fuel * 5 + cached_gases[/datum/gas/cyrion_b][MOLES] -= consumed_fuel * 0.05 + if(prob(10 * consumed_fuel)) + new /obj/item/grenade/gas_crystal/cyrion_b_crystal(location) + energy_released += consumed_fuel * 800 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/proto_nitrate_plasma_response + priority = 20 + name = "Proto Nitrate plasma response" + id = "proto_nitrate_plasma_response" + +/datum/gas_reaction/proto_nitrate_plasma_response/init_reqs() + min_requirements = list( + /datum/gas/proto_nitrate = MINIMUM_MOLE_COUNT, + /datum/gas/plasma = MINIMUM_MOLE_COUNT, + "TEMP" = 250, + "MAX_TEMP" = 300 + ) + +/datum/gas_reaction/proto_nitrate_plasma_response/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + if(!isturf(holder)) + return NO_REACTION + var/turf/open/location = holder + if(cached_gases[/datum/gas/plasma][MOLES] > 10) + return NO_REACTION + var produced_amount = min(5, cached_gases[/datum/gas/plasma][MOLES], cached_gases[/datum/gas/proto_nitrate][MOLES]) + if(cached_gases[/datum/gas/plasma][MOLES] - produced_amount < 0 || cached_gases[/datum/gas/proto_nitrate][MOLES] - produced_amount * 0.1 < 0) + return NO_REACTION + cached_gases[/datum/gas/plasma][MOLES] -= produced_amount + cached_gases[/datum/gas/proto_nitrate][MOLES] -= produced_amount * 0.1 + energy_released -= produced_amount * 1500 + if(prob(produced_amount * 15)) + new/obj/item/stack/sheet/mineral/plasma(location) + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/proto_nitrate_bz_response + priority = 21 + name = "Proto Nitrate bz response" + id = "proto_nitrate_bz_response" + +/datum/gas_reaction/proto_nitrate_bz_response/init_reqs() + min_requirements = list( + /datum/gas/proto_nitrate = MINIMUM_MOLE_COUNT, + /datum/gas/bz = MINIMUM_MOLE_COUNT, + "TEMP" = 260, + "MAX_TEMP" = 280 + ) + +/datum/gas_reaction/proto_nitrate_bz_response/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/turf/open/location = isturf(holder) ? holder : null + var consumed_amount = min(5, cached_gases[/datum/gas/bz][MOLES], cached_gases[/datum/gas/proto_nitrate][MOLES]) + if(cached_gases[/datum/gas/bz][MOLES] - consumed_amount < 0) + return NO_REACTION + if(cached_gases[/datum/gas/bz][MOLES] < 30) + radiation_pulse(location, consumed_amount, 1, TRUE, FALSE) + cached_gases[/datum/gas/bz][MOLES] -= consumed_amount + else + for(var/mob/living/carbon/L in location) + L.hallucination += cached_gases[/datum/gas/bz][MOLES] * 0.5 + energy_released += 100 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/proto_nitrate_freon_fire_response + priority = 22 + name = "Proto Nitrate freon fire response" + id = "proto_nitrate_freon_fire_response" + +/datum/gas_reaction/proto_nitrate_freon_fire_response/init_reqs() + min_requirements = list( + /datum/gas/proto_nitrate = MINIMUM_MOLE_COUNT, + /datum/gas/freon = MINIMUM_MOLE_COUNT, + /datum/gas/oxygen = MINIMUM_MOLE_COUNT, + "TEMP" = 270, + "MAX_TEMP" = 310 + ) + +/datum/gas_reaction/proto_nitrate_freon_fire_response/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + if(cached_gases[/datum/gas/freon][MOLES] > 100 && cached_gases[/datum/gas/oxygen][MOLES] > 100) + var fuel_consumption = min(5, temperature * 0.03, cached_gases[/datum/gas/freon][MOLES], cached_gases[/datum/gas/proto_nitrate][MOLES]) + if(cached_gases[/datum/gas/proto_nitrate][MOLES] - fuel_consumption < 0) + return NO_REACTION + cached_gases[/datum/gas/proto_nitrate][MOLES] -= fuel_consumption + cached_gases[/datum/gas/freon][MOLES] += fuel_consumption * 0.01 + energy_released -= fuel_consumption * 1500 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + return NO_REACTION + +/datum/gas_reaction/proto_nitrate_tritium_response + priority = 23 + name = "Proto Nitrate tritium response" + id = "proto_nitrate_tritium_response" + +/datum/gas_reaction/proto_nitrate_tritium_response/init_reqs() + min_requirements = list( + /datum/gas/proto_nitrate = MINIMUM_MOLE_COUNT, + /datum/gas/tritium = MINIMUM_MOLE_COUNT, + "TEMP" = 150, + "MAX_TEMP" = 340 + ) + +/datum/gas_reaction/proto_nitrate_tritium_response/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + var/turf/open/location = isturf(holder) ? holder : null + var produced_amount = min(5, cached_gases[/datum/gas/tritium][MOLES], cached_gases[/datum/gas/proto_nitrate][MOLES]) + if(cached_gases[/datum/gas/tritium][MOLES] - produced_amount < 0 || cached_gases[/datum/gas/proto_nitrate][MOLES] - produced_amount * 0.01 < 0) + return NO_REACTION + location.rad_act(produced_amount * 2.4) + cached_gases[/datum/gas/tritium][MOLES] -= produced_amount + cached_gases[/datum/gas/hydrogen][MOLES] += produced_amount + cached_gases[/datum/gas/proto_nitrate][MOLES] -= produced_amount * 0.01 + energy_released += 50 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/proto_nitrate_hydrogen_response + priority = 24 + name = "Proto Nitrate hydrogen response" + id = "proto_nitrate_hydrogen_response" + +/datum/gas_reaction/proto_nitrate_hydrogen_response/init_reqs() + min_requirements = list( + /datum/gas/proto_nitrate = MINIMUM_MOLE_COUNT, + /datum/gas/hydrogen = 150, + ) + +/datum/gas_reaction/proto_nitrate_hydrogen_response/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + var produced_amount = min(5, cached_gases[/datum/gas/hydrogen][MOLES], cached_gases[/datum/gas/proto_nitrate][MOLES]) + if(cached_gases[/datum/gas/hydrogen][MOLES] - produced_amount < 0) + return NO_REACTION + cached_gases[/datum/gas/hydrogen][MOLES] -= produced_amount + cached_gases[/datum/gas/proto_nitrate][MOLES] += produced_amount * 0.5 + energy_released -= produced_amount * 2500 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING + +/datum/gas_reaction/proto_nitrate_cyrion_b_response + priority = 25 + name = "Proto Nitrate Cyrion B response" + id = "proto_nitrate_cyrion_b_response" + +/datum/gas_reaction/proto_nitrate_cyrion_b_response/init_reqs() + min_requirements = list( + /datum/gas/proto_nitrate = MINIMUM_MOLE_COUNT, + /datum/gas/cyrion_b = MINIMUM_MOLE_COUNT, + "TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + ) + +/datum/gas_reaction/proto_nitrate_cyrion_b_response/react(datum/gas_mixture/air, datum/holder) + var/list/cached_gases = air.gases + var/turf/open/location = isturf(holder) ? holder : null + var max_power = min(5, cached_gases[/datum/gas/cyrion_b][MOLES]) + cached_gases[/datum/gas/cyrion_b][MOLES] = 0 + explosion(location, max_power * 0.55, max_power * 0.95, max_power * 1.25, max_power* 3) + return REACTING + +/datum/gas_reaction/pluox_formation + priority = 2 + name = "Pluoxium formation" + id = "pluox_formation" + +/datum/gas_reaction/pluox_formation/init_reqs() + min_requirements = list( + /datum/gas/carbon_dioxide = MINIMUM_MOLE_COUNT, + /datum/gas/oxygen = MINIMUM_MOLE_COUNT, + /datum/gas/tritium = MINIMUM_MOLE_COUNT, + "TEMP" = 50, + "MAX_TEMP" = T0C + ) + +/datum/gas_reaction/pluox_formation/react(datum/gas_mixture/air, datum/holder) + var/energy_released = 0 + var/old_heat_capacity = air.heat_capacity() + var/list/cached_gases = air.gases + var/temperature = air.temperature + var produced_amount = min(5, cached_gases[/datum/gas/carbon_dioxide][MOLES], cached_gases[/datum/gas/oxygen][MOLES]) + if(cached_gases[/datum/gas/carbon_dioxide][MOLES] - produced_amount < 0 || cached_gases[/datum/gas/oxygen][MOLES] - produced_amount * 0.5 < 0 || cached_gases[/datum/gas/tritium][MOLES] - produced_amount * 0.01 < 0) + return NO_REACTION + cached_gases[/datum/gas/carbon_dioxide][MOLES] -= produced_amount + cached_gases[/datum/gas/oxygen][MOLES] -= produced_amount * 0.5 + cached_gases[/datum/gas/tritium][MOLES] -= produced_amount * 0.01 + ASSERT_GAS(/datum/gas/pluoxium, air) + cached_gases[/datum/gas/pluoxium][MOLES] += produced_amount + ASSERT_GAS(/datum/gas/hydrogen, air) + cached_gases[/datum/gas/hydrogen][MOLES] += produced_amount * 0.01 + energy_released += produced_amount * 250 + if(energy_released) + var/new_heat_capacity = air.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air.temperature = (temperature * old_heat_capacity + energy_released) / new_heat_capacity + return REACTING diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 5faac36c2f3..261565e7ee9 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -101,7 +101,12 @@ /datum/gas/nitryl = new/datum/tlv/dangerous, /datum/gas/pluoxium = new/datum/tlv(-1, -1, 1000, 1000), // Unlike oxygen, pluoxium does not fuel plasma/tritium fires /datum/gas/freon = new/datum/tlv/dangerous, - /datum/gas/hydrogen = new/datum/tlv/dangerous + /datum/gas/hydrogen = new/datum/tlv/dangerous, + /datum/gas/healium = new/datum/tlv/dangerous, + /datum/gas/proto_nitrate = new/datum/tlv/dangerous, + /datum/gas/cyrion_b = new/datum/tlv/dangerous, + /datum/gas/halon = new/datum/tlv/dangerous, + /datum/gas/hexane = new/datum/tlv/dangerous ) /obj/machinery/airalarm/server // No checks here. @@ -122,7 +127,12 @@ /datum/gas/nitryl = new/datum/tlv/no_checks, /datum/gas/pluoxium = new/datum/tlv/no_checks, /datum/gas/freon = new/datum/tlv/no_checks, - /datum/gas/hydrogen = new/datum/tlv/no_checks + /datum/gas/hydrogen = new/datum/tlv/no_checks, + /datum/gas/healium = new/datum/tlv/dangerous, + /datum/gas/proto_nitrate = new/datum/tlv/dangerous, + /datum/gas/cyrion_b = new/datum/tlv/dangerous, + /datum/gas/halon = new/datum/tlv/dangerous, + /datum/gas/hexane = new/datum/tlv/dangerous ) /obj/machinery/airalarm/kitchen_cold_room // Kitchen cold rooms start off at -80°C or 193.15°K. @@ -143,7 +153,12 @@ /datum/gas/nitryl = new/datum/tlv/dangerous, /datum/gas/pluoxium = new/datum/tlv(-1, -1, 1000, 1000), // Unlike oxygen, pluoxium does not fuel plasma/tritium fires /datum/gas/freon = new/datum/tlv/dangerous, - /datum/gas/hydrogen = new/datum/tlv/dangerous + /datum/gas/hydrogen = new/datum/tlv/dangerous, + /datum/gas/healium = new/datum/tlv/dangerous, + /datum/gas/proto_nitrate = new/datum/tlv/dangerous, + /datum/gas/cyrion_b = new/datum/tlv/dangerous, + /datum/gas/halon = new/datum/tlv/dangerous, + /datum/gas/hexane = new/datum/tlv/dangerous ) /obj/machinery/airalarm/unlocked @@ -531,7 +546,12 @@ /datum/gas/stimulum, /datum/gas/pluoxium, /datum/gas/freon, - /datum/gas/hydrogen + /datum/gas/hydrogen, + /datum/gas/healium, + /datum/gas/proto_nitrate, + /datum/gas/cyrion_b, + /datum/gas/halon, + /datum/gas/hexane, ), "scrubbing" = 1, "widenet" = 1 diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 7749bae169b..c0958a8eae8 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -64,7 +64,12 @@ "caution" = /obj/machinery/portable_atmospherics/canister, "miasma" = /obj/machinery/portable_atmospherics/canister/miasma, "freon" = /obj/machinery/portable_atmospherics/canister/freon, - "hydrogen" = /obj/machinery/portable_atmospherics/canister/hydrogen + "hydrogen" = /obj/machinery/portable_atmospherics/canister/hydrogen, + "healium" = /obj/machinery/portable_atmospherics/canister/healium, + "proto_nitrate" = /obj/machinery/portable_atmospherics/canister/proto_nitrate, + "cyrion_b" = /obj/machinery/portable_atmospherics/canister/cyrion_b, + "halon" = /obj/machinery/portable_atmospherics/canister/halon, + "hexane" = /obj/machinery/portable_atmospherics/canister/hexane ) /obj/machinery/portable_atmospherics/canister/interact(mob/user) @@ -80,28 +85,28 @@ . += "This canister is [mode]. A sticker on its side says MAX PRESSURE: [siunit(pressure_limit, "Pa", 0)]." /obj/machinery/portable_atmospherics/canister/nitrogen - name = "n2 canister" + name = "Nitrogen canister" desc = "Nitrogen gas. Reportedly useful for something." icon_state = "red" base_icon_state = "red" gas_type = /datum/gas/nitrogen /obj/machinery/portable_atmospherics/canister/oxygen - name = "o2 canister" + name = "Oxygen canister" desc = "Oxygen. Necessary for human life." icon_state = "blue" base_icon_state = "blue" gas_type = /datum/gas/oxygen /obj/machinery/portable_atmospherics/canister/carbon_dioxide - name = "co2 canister" + name = "Carbon dioxide canister" desc = "Carbon dioxide. What the fuck is carbon dioxide?" icon_state = "black" base_icon_state = "black" gas_type = /datum/gas/carbon_dioxide /obj/machinery/portable_atmospherics/canister/toxins - name = "plasma canister" + name = "Plasma canister" desc = "Plasma gas. The reason YOU are here. Highly toxic." icon_state = "orange" base_icon_state = "orange" @@ -115,55 +120,55 @@ gas_type = /datum/gas/bz /obj/machinery/portable_atmospherics/canister/nitrous_oxide - name = "n2o canister" + name = "Nitrous oxide canister" desc = "Nitrous oxide gas. Known to cause drowsiness." icon_state = "redws" base_icon_state = "redws" gas_type = /datum/gas/nitrous_oxide /obj/machinery/portable_atmospherics/canister/air - name = "air canister" + name = "Air canister" desc = "Pre-mixed air." icon_state = "grey" base_icon_state = "grey" /obj/machinery/portable_atmospherics/canister/tritium - name = "tritium canister" + name = "Tritium canister" desc = "Tritium. Inhalation might cause irradiation." icon_state = "green" base_icon_state = "green" gas_type = /datum/gas/tritium /obj/machinery/portable_atmospherics/canister/nob - name = "hyper-noblium canister" + name = "Hyper-noblium canister" desc = "Hyper-Noblium. More noble than all other gases." icon_state = "nob" base_icon_state = "nob" gas_type = /datum/gas/hypernoblium /obj/machinery/portable_atmospherics/canister/nitryl - name = "nitryl canister" + name = "Nitryl canister" desc = "Nitryl gas. Feels great 'til the acid eats your lungs." icon_state = "brown" base_icon_state = "brown" gas_type = /datum/gas/nitryl /obj/machinery/portable_atmospherics/canister/stimulum - name = "stimulum canister" + name = "Stimulum canister" desc = "Stimulum. High energy gas, high energy people." icon_state = "darkpurple" base_icon_state = "darkpurple" gas_type = /datum/gas/stimulum /obj/machinery/portable_atmospherics/canister/pluoxium - name = "pluoxium canister" + name = "Pluoxium canister" desc = "Pluoxium. Like oxygen, but more bang for your buck." icon_state = "darkblue" base_icon_state = "darkblue" gas_type = /datum/gas/pluoxium /obj/machinery/portable_atmospherics/canister/water_vapor - name = "water vapor canister" + name = "Water vapor canister" desc = "Water Vapor. We get it, you vape." icon_state = "water_vapor" base_icon_state = "water_vapor" @@ -171,7 +176,7 @@ filled = 1 /obj/machinery/portable_atmospherics/canister/miasma - name = "miasma canister" + name = "Miasma canister" desc = "Miasma. Makes you wish your nose were blocked." icon_state = "miasma" base_icon_state = "miasma" @@ -179,7 +184,7 @@ filled = 1 /obj/machinery/portable_atmospherics/canister/freon - name = "freon canister" + name = "Freon canister" desc = "Freon. Can absorb heat" icon_state = "freon" base_icon_state = "freon" @@ -187,13 +192,52 @@ filled = 1 /obj/machinery/portable_atmospherics/canister/hydrogen - name = "hydrogen canister" + name = "Hydrogen canister" desc = "Hydrogen, highly flammable" icon_state = "h2" base_icon_state = "h2" gas_type = /datum/gas/hydrogen filled = 1 +/obj/machinery/portable_atmospherics/canister/healium + name = "Healium canister" + desc = "Healium, causes deep sleep" + icon_state = "healium" + base_icon_state = "healium" + gas_type = /datum/gas/healium + filled = 1 + +/obj/machinery/portable_atmospherics/canister/proto_nitrate + name = "Proto Nitrate canister" + desc = "Proto Nitrate, react differently with various gases" + icon_state = "proto_nitrate" + base_icon_state = "proto_nitrate" + gas_type = /datum/gas/proto_nitrate + filled = 1 + +/obj/machinery/portable_atmospherics/canister/cyrion_b + name = "Cyrion B canister" + desc = "Cyrion B, highly toxic" + icon_state = "cyrion_b" + base_icon_state = "cyrion_b" + gas_type = /datum/gas/cyrion_b + filled = 1 + +/obj/machinery/portable_atmospherics/canister/halon + name = "Halon canister" + desc = "Halon, remove oxygen from high temperature fires and cool down the area" + icon_state = "halon" + base_icon_state = "halon" + gas_type = /datum/gas/halon + filled = 1 + +/obj/machinery/portable_atmospherics/canister/hexane + name = "Hexane canister" + desc = "hexane, highly flammable" + icon_state = "hexane" + base_icon_state = "hexane" + gas_type = /datum/gas/hexane + filled = 1 /obj/machinery/portable_atmospherics/canister/fusion_test name = "fusion test canister" @@ -207,7 +251,7 @@ air_contents.gases[/datum/gas/hydrogen][MOLES] = 500 air_contents.gases[/datum/gas/plasma][MOLES] = 500 air_contents.gases[/datum/gas/tritium][MOLES] = 350 - air_contents.temperature = 15000 + air_contents.temperature = 10000 /obj/machinery/portable_atmospherics/canister/proc/get_time_left() if(timing) diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index cc10b743a98..00f6f022023 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -24,6 +24,11 @@ /datum/gas/water_vapor, /datum/gas/freon, /datum/gas/hydrogen, + /datum/gas/healium, + /datum/gas/proto_nitrate, + /datum/gas/cyrion_b, + /datum/gas/halon, + /datum/gas/hexane, ) /obj/machinery/portable_atmospherics/scrubber/Destroy() diff --git a/code/modules/cargo/bounties/engineering.dm b/code/modules/cargo/bounties/engineering.dm index 2626ededb0f..e2d26119cda 100644 --- a/code/modules/cargo/bounties/engineering.dm +++ b/code/modules/cargo/bounties/engineering.dm @@ -34,6 +34,12 @@ description = "Our R&D department is working on the development of more efficient electrical batteries using hydrogen as a catalyst. Ship us a tank full of it. (20 Moles)" gas_type = /datum/gas/hydrogen +/datum/bounty/item/engineering/gas/cyrion_b_tank + name = "Full Tank of Cyrion-B" + description = "The main planet of \[REDACTED] has been chosen as testing grounds for the new weapon that uses the Cyrion-B gas. Ship us a tank full of it. (20 Moles)" + reward = 10000 + gas_type = /datum/gas/cyrion_b + /datum/bounty/item/engineering/emitter name = "Emitter" description = "We think there may be a defect in your station's emitter designs, based on the sheer number of delaminations your sector seems to see. Ship us one of yours." diff --git a/code/modules/cargo/exports/large_objects.dm b/code/modules/cargo/exports/large_objects.dm index 93461e281f3..fe4c65de21f 100644 --- a/code/modules/cargo/exports/large_objects.dm +++ b/code/modules/cargo/exports/large_objects.dm @@ -110,7 +110,20 @@ var/obj/machinery/portable_atmospherics/canister/C = O var/worth = 10 var/gases = C.air_contents.gases - C.air_contents.assert_gases(/datum/gas/bz,/datum/gas/stimulum,/datum/gas/hypernoblium,/datum/gas/miasma,/datum/gas/tritium,/datum/gas/pluoxium,/datum/gas/freon,/datum/gas/hydrogen) + C.air_contents.assert_gases(/datum/gas/bz, + /datum/gas/stimulum, + /datum/gas/hypernoblium, + /datum/gas/miasma, + /datum/gas/tritium, + /datum/gas/pluoxium, + /datum/gas/freon, + /datum/gas/hydrogen, + /datum/gas/healium, + /datum/gas/proto_nitrate, + /datum/gas/cyrion_b, + /datum/gas/halon, + /datum/gas/hexane + ) worth += gases[/datum/gas/hypernoblium][MOLES]*1000 worth += gases[/datum/gas/stimulum][MOLES]*100 @@ -120,4 +133,9 @@ worth += gases[/datum/gas/bz][MOLES]*4 worth += gases[/datum/gas/miasma][MOLES]*2 worth += gases[/datum/gas/hydrogen][MOLES]*1 + worth += gases[/datum/gas/healium][MOLES]*19 + worth += gases[/datum/gas/proto_nitrate][MOLES]*5 + worth += gases[/datum/gas/cyrion_b][MOLES]*1050 + worth += gases[/datum/gas/halon][MOLES]*9 + worth += gases[/datum/gas/hexane][MOLES]*6 return worth diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 35aa4b371c9..524178970dc 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -370,6 +370,16 @@ flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF strip_delay = 80 +/obj/item/clothing/head/helmet/elder_atmosian + name = "Elder Atmosian Helmet" + desc = "A superb helmet made with the thoughest and rarest materials avaiable to man." + icon_state = "knight_greyscale" + inhand_icon_state = "knight_greyscale" + armor = list(MELEE = 15, BULLET = 10, LASER = 30, ENERGY = 30, BOMB = 10, BIO = 10, RAD = 20, FIRE = 65, ACID = 40, WOUND = 15) + material_flags = MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Can change color and add prefix + flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR + flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH + //monkey sentience caps /obj/item/clothing/head/helmet/monkey_sentience diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index a30c736b03d..604a8be160b 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -287,3 +287,14 @@ cold_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT armor = list(MELEE = 25, BULLET = 20, LASER = 20, ENERGY = 30, BOMB = 20, BIO = 50, RAD = 20, FIRE = -10, ACID = 50, WOUND = 10) + +/obj/item/clothing/suit/armor/elder_atmosian + name = "Elder Atmosian Armor" + desc = "A superb armor made with the thoughest and rarest materials avaiable to man." + icon_state = "knight_grey" + inhand_icon_state = "knight_greyscale" + material_flags = MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS//Can change color and add prefix + armor = list(MELEE = 15, BULLET = 10, LASER = 30, ENERGY = 30, BOMB = 10, BIO = 10, RAD = 20, FIRE = 65, ACID = 40, WOUND = 15) + body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS + cold_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS + heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS diff --git a/code/modules/movespeed/modifiers/reagent.dm b/code/modules/movespeed/modifiers/reagent.dm index 698e1aa13c5..f0f2ec301ec 100644 --- a/code/modules/movespeed/modifiers/reagent.dm +++ b/code/modules/movespeed/modifiers/reagent.dm @@ -28,6 +28,9 @@ /datum/movespeed_modifier/reagent/freon multiplicative_slowdown = 1.6 +/datum/movespeed_modifier/reagent/halon + multiplicative_slowdown = 1.8 + /datum/movespeed_modifier/reagent/lenturi multiplicative_slowdown = 1.5 diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 93f20e54f5f..63efc861645 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -22,7 +22,9 @@ #define H2O_HEAT_PENALTY 12 //This'll get made slowly over time, I want my spice rock spicy god damnit #define FREON_HEAT_PENALTY -10 //very good heat absorbtion and less plasma and o2 generation #define HYDROGEN_HEAT_PENALTY 10 // similar heat penalty as tritium (dangerous) - +#define HEALIUM_HEAT_PENALTY 4 +#define PROTO_NITRATE_HEAT_PENALTY -3 +#define CYRION_B_HEAT_PENALTY 8 //All of these get divided by 10-bzcomp * 5 before having 1 added and being multiplied with power to determine rads //Keep the negative values here above -10 and we won't get negative rads @@ -33,11 +35,15 @@ #define PLUOXIUM_TRANSMIT_MODIFIER -5 //Should halve the power output #define H2O_TRANSMIT_MODIFIER 2 #define HYDROGEN_TRANSMIT_MODIFIER 25 //increase the radiation emission, but less than the trit (2.5) +#define HEALIUM_TRANSMIT_MODIFIER 2.4 +#define PROTO_NITRATE_TRANSMIT_MODIFIER 15 +#define CYRION_B_TRANSMIT_MODIFIER 20 #define BZ_RADIOACTIVITY_MODIFIER 5 //Improves the effect of transmit modifiers #define N2O_HEAT_RESISTANCE 6 //Higher == Gas makes the crystal more resistant against heat damage. #define HYDROGEN_HEAT_RESISTANCE 2 // just a bit of heat resistance to spice it up +#define PROTO_NITRATE_HEAT_RESISTANCE 5 #define POWERLOSS_INHIBITION_GAS_THRESHOLD 0.20 //Higher == Higher percentage of inhibitor gas needed before the charge inertia chain reaction effect starts. #define POWERLOSS_INHIBITION_MOLE_THRESHOLD 20 //Higher == More moles of the gas are needed before the charge inertia chain reaction effect starts. //Scales powerloss inhibition down until this amount of moles is reached @@ -159,6 +165,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /datum/gas/bz, /datum/gas/freon, /datum/gas/hydrogen, + /datum/gas/healium, + /datum/gas/proto_nitrate, + /datum/gas/cyrion_b, ) ///The list of gases mapped against their current comp. We use this to calculate different values the supermatter uses, like power or heat resistance. It doesn't perfectly match the air around the sm, instead moving up at a rate determined by gas_change_rate per call. Ranges from 0 to 1 var/list/gas_comp = list( @@ -173,6 +182,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /datum/gas/bz = 0, /datum/gas/freon = 0, /datum/gas/hydrogen = 0, + /datum/gas/healium = 0, + /datum/gas/proto_nitrate = 0, + /datum/gas/cyrion_b = 0, ) ///The list of gases mapped against their transmit values. We use it to determine the effect different gases have on radiation var/list/gas_trans = list( @@ -183,6 +195,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /datum/gas/tritium = TRITIUM_TRANSMIT_MODIFIER, /datum/gas/bz = BZ_TRANSMIT_MODIFIER, /datum/gas/hydrogen = HYDROGEN_TRANSMIT_MODIFIER, + /datum/gas/healium = HEALIUM_TRANSMIT_MODIFIER, + /datum/gas/proto_nitrate = PROTO_NITRATE_TRANSMIT_MODIFIER, + /datum/gas/cyrion_b = CYRION_B_TRANSMIT_MODIFIER, ) ///The list of gases mapped against their heat penaltys. We use it to determin molar and heat output var/list/gas_heat = list( @@ -196,11 +211,15 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /datum/gas/bz = BZ_HEAT_PENALTY, /datum/gas/freon = FREON_HEAT_PENALTY, /datum/gas/hydrogen = HYDROGEN_HEAT_PENALTY, + /datum/gas/healium = HEALIUM_HEAT_PENALTY, + /datum/gas/proto_nitrate = PROTO_NITRATE_HEAT_PENALTY, + /datum/gas/cyrion_b = CYRION_B_HEAT_PENALTY, ) ///The list of gases mapped against their heat resistance. We use it to moderate heat damage. var/list/gas_resist = list( /datum/gas/nitrous_oxide = N2O_HEAT_RESISTANCE, /datum/gas/hydrogen = HYDROGEN_HEAT_RESISTANCE, + /datum/gas/proto_nitrate = PROTO_NITRATE_HEAT_RESISTANCE, ) ///The list of gases mapped against their powermix ratio var/list/gas_powermix = list( @@ -214,6 +233,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /datum/gas/bz = 1, /datum/gas/freon = -1, /datum/gas/hydrogen = 1, + /datum/gas/healium = 1, + /datum/gas/proto_nitrate = 1, + /datum/gas/cyrion_b = 1, ) ///The last air sample's total molar count, will always be above or equal to 0 var/combined_gas = 0 @@ -624,6 +646,11 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(prob(50)) //(1 + (tritRad + pluoxDampen * bzDampen * o2Rad * plasmaRad / (10 - bzrads))) * freonbonus radiation_pulse(src, power * max(0, (1 + (power_transmission_bonus/(10-(gas_comp[/datum/gas/bz] * BZ_RADIOACTIVITY_MODIFIER)))) * freonbonus))// RadModBZ(500%) + + if(prob(gas_comp[/datum/gas/cyrion_b])) + playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, TRUE, extrarange = 10) + supermatter_zap(src, 6, clamp(power*2, 4000, 20000), ZAP_MOB_STUN) + if(gas_comp[/datum/gas/bz] >= 0.4 && prob(30 * gas_comp[/datum/gas/bz])) src.fire_nuclear_particle() // Start to emit radballs at a maximum of 30% chance per tick diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index f344a91f929..6aaec008bf4 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1362,6 +1362,61 @@ if(isplasmaman(L)) REMOVE_TRAIT(L, TRAIT_NOFIRE, type) return ..() + +/datum/reagent/healium + name = "Healium" + description = "A Powerful sleeping agent with healing properties" + reagent_state = GAS + metabolization_rate = REAGENTS_METABOLISM * 0.5 + color = "90560B" + taste_description = "rubbery" + +/datum/reagent/healium/on_mob_metabolize(mob/living/L) + . = ..() + ADD_TRAIT(L, TRAIT_KNOCKEDOUT, type) + +/datum/reagent/healium/on_mob_end_metabolize(mob/living/L) + REMOVE_TRAIT(L, TRAIT_KNOCKEDOUT, type) + return ..() + +/datum/reagent/halon + name = "Halon" + description = "A firefighter gas that remove oxygen and cool down the area" + reagent_state = GAS + metabolization_rate = REAGENTS_METABOLISM * 0.5 + color = "90560B" + taste_description = "minty" + +/datum/reagent/halon/on_mob_metabolize(mob/living/L) + . = ..() + L.add_movespeed_modifier(/datum/movespeed_modifier/reagent/halon) + ADD_TRAIT(L, TRAIT_RESISTHEAT, type) + +/datum/reagent/halon/on_mob_end_metabolize(mob/living/L) + L.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/halon) + REMOVE_TRAIT(L, TRAIT_RESISTHEAT, type) + return ..() + +/datum/reagent/hexane + name = "Hexane" + description = "A filtering gas, don't breathe it if you suffer from brain conditions" + reagent_state = GAS + metabolization_rate = REAGENTS_METABOLISM * 0.5 + color = "90560B" + taste_description = "fresh" + +/datum/reagent/hexane/on_mob_metabolize(mob/living/L) + . = ..() + L.add_movespeed_modifier(/datum/movespeed_modifier/reagent/halon) + ADD_TRAIT(L, CHANGELING_HIVEMIND_MUTE, type) + ADD_TRAIT(L, TRAIT_SIXTHSENSE, type) + +/datum/reagent/hexane/on_mob_end_metabolize(mob/living/L) + L.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/halon) + REMOVE_TRAIT(L, CHANGELING_HIVEMIND_MUTE, type) + REMOVE_TRAIT(L, TRAIT_SIXTHSENSE, type) + return ..() + /////////////////////////Colorful Powder//////////////////////////// //For colouring in /proc/mix_color_from_reagents diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index e8768306886..72c073ab4c6 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -99,7 +99,24 @@ var/list/breath_gases = breath.gases - breath.assert_gases(/datum/gas/oxygen, /datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/bz, /datum/gas/nitrogen, /datum/gas/tritium, /datum/gas/nitryl, /datum/gas/pluoxium, /datum/gas/stimulum, /datum/gas/freon, /datum/gas/hypernoblium) + breath.assert_gases(/datum/gas/oxygen, + /datum/gas/plasma, + /datum/gas/carbon_dioxide, + /datum/gas/nitrous_oxide, + /datum/gas/bz, + /datum/gas/nitrogen, + /datum/gas/tritium, + /datum/gas/nitryl, + /datum/gas/pluoxium, + /datum/gas/stimulum, + /datum/gas/freon, + /datum/gas/hypernoblium, + /datum/gas/healium, + /datum/gas/proto_nitrate, + /datum/gas/cyrion_b, + /datum/gas/halon, + /datum/gas/hexane + ) //Partial pressures in our breath var/O2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/oxygen][MOLES])+(8*breath.get_breath_partial_pressure(breath_gases[/datum/gas/pluoxium][MOLES])) @@ -314,6 +331,47 @@ breath_gases[/datum/gas/freon][MOLES]-=gas_breathed + // Healium + var/healium_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/healium][MOLES]) + if(healium_pp > gas_stimulation_min) + var/existing = H.reagents.get_reagent_amount(/datum/reagent/healium) + H.reagents.add_reagent(/datum/reagent/healium,max(0, 1 - existing)) + H.adjustOxyLoss(-5) + H.adjustFireLoss(-7) + H.adjustToxLoss(-7) + H.adjustBruteLoss(-10) + gas_breathed = breath_gases[/datum/gas/healium][MOLES] + breath_gases[/datum/gas/healium][MOLES]-=gas_breathed + + // Proto Nitrate + // Inert + // Cyrion B + var/cyrion_b_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/cyrion_b][MOLES]) + if(cyrion_b_pp > gas_stimulation_min) + H.adjustBruteLoss(25) + H.adjustOxyLoss(5) + H.adjustFireLoss(8) + H.adjustToxLoss(8) + gas_breathed = breath_gases[/datum/gas/cyrion_b][MOLES] + breath_gases[/datum/gas/cyrion_b][MOLES]-=gas_breathed + + // Halon + var/halon_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/halon][MOLES]) + if(halon_pp > gas_stimulation_min) + H.adjustOxyLoss(5) + var/existing = H.reagents.get_reagent_amount(/datum/reagent/halon) + H.reagents.add_reagent(/datum/reagent/halon,max(0, 1 - existing)) + gas_breathed = breath_gases[/datum/gas/halon][MOLES] + breath_gases[/datum/gas/halon][MOLES]-=gas_breathed + + // Hexane + var/hexane_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/hexane][MOLES]) + if(hexane_pp > gas_stimulation_min) + H.hallucination += 50 + H.reagents.add_reagent(/datum/reagent/hexane,5) + if(prob(33)) + H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) + // Stimulum gas_breathed = breath_gases[/datum/gas/stimulum][MOLES] if (gas_breathed > gas_stimulation_min) diff --git a/icons/effects/atmospherics.dmi b/icons/effects/atmospherics.dmi index acf48a0bd09..640b26fb3f2 100644 Binary files a/icons/effects/atmospherics.dmi and b/icons/effects/atmospherics.dmi differ diff --git a/icons/mob/inhands/weapons/axes_lefthand.dmi b/icons/mob/inhands/weapons/axes_lefthand.dmi index 6b4041e477d..8f8831d4d4a 100644 Binary files a/icons/mob/inhands/weapons/axes_lefthand.dmi and b/icons/mob/inhands/weapons/axes_lefthand.dmi differ diff --git a/icons/obj/atmos.dmi b/icons/obj/atmos.dmi index 574851ab51a..651b853922d 100644 Binary files a/icons/obj/atmos.dmi and b/icons/obj/atmos.dmi differ diff --git a/icons/obj/grenade.dmi b/icons/obj/grenade.dmi index b3cb9dd2e95..0bcda18de50 100644 Binary files a/icons/obj/grenade.dmi and b/icons/obj/grenade.dmi differ diff --git a/icons/obj/items_and_weapons.dmi b/icons/obj/items_and_weapons.dmi index b56e96ed336..2dfa83f5dc2 100644 Binary files a/icons/obj/items_and_weapons.dmi and b/icons/obj/items_and_weapons.dmi differ diff --git a/tgstation.dme b/tgstation.dme index bb322f87fee..bb61210249f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1087,6 +1087,7 @@ #include "code\game\objects\items\food\burgers.dm" #include "code\game\objects\items\food\cake.dm" #include "code\game\objects\items\grenades\antigravity.dm" +#include "code\game\objects\items\grenades\atmos_grenades.dm" #include "code\game\objects\items\grenades\chem_grenade.dm" #include "code\game\objects\items\grenades\clusterbuster.dm" #include "code\game\objects\items\grenades\emgrenade.dm"