diff --git a/baystation12.dme b/baystation12.dme index 7f4ed43cdd8..d007fb1cced 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -362,9 +362,6 @@ #include "code\FEA\FEA_group_helpers.dm" #include "code\FEA\FEA_system.dm" #include "code\FEA\FEA_turf_tile.dm" -#include "code\FEA\FEA_variables.dm" -#include "code\FEA\FEA_ZAS.dm" -#include "code\FEA\FEA_ZAS_Airflow.dm" #include "code\game\algorithm.dm" #include "code\game\atom_procs.dm" #include "code\game\cellautomata.dm" diff --git a/code/FEA/FEA_ZAS.dm b/code/FEA/FEA_ZAS.dm deleted file mode 100644 index 766cbe5fe4e..00000000000 --- a/code/FEA/FEA_ZAS.dm +++ /dev/null @@ -1,57 +0,0 @@ -/* AN EXPLANATION: -This file was added because I felt that the computations for movement -of air over large scales was not adequately done by FEA, and the attempt -to solve this problem, in the form of ZAS (Zone Atmos System), -simplified it too far, in my opinion, creating the effect of a single -opened air canister filling an entire room with a partial mix of that -gas with the pre-existing mix. This was slightly silly, due to large -rooms "flash filling" when you opened a canister, and the fact that the -procedures to recalculate the boundaries of the zones was far from -foolproof, and, indeed, often let air flash though solid bulkheads to -space. - -To solve this, I've both commented the hell out of the existing FEA code, -removed and/or replaced procs with more efficient procs, and added this -file, which contains some procedures for special cases, such as: - 1.) Moving large volumes of air into vacuum/lower pressure environs - (triggers when pressure behind a tile moving air to a lower - pressure exceeds an amount.) - e.g. A room of full air gets opened to a depressurised room - 2.) Dealing with pressure equalization. - (triggers when a large amount of gas is added to a room, it - follows behind the "stormfront" of gas change (Managed by FEA) - and triggers a rapid equalization of gas by utilizing a - psuedo-zone.) - e.g. Opening a tank of oxygen in a low pressure room, and after - spreading by FEA, it equalizes the pressure in the room, instead - instead of slowly flowing out like molasses. - -These procedures trigger when a check is made against the pressure changes -and situations occuring to the airgroup (if it is venting at high pressure, -airgroups will rejoin even if broken to ZAS process) will call these -specialized procs to help properly deal with these situation. ---SkyMarshal, May 2012*/ -/* WIP - - if(space_tiles) - for(var/T in space_tiles) - if(!istype(T,/turf/space)) space_tiles -= T - total_space += length(space_tiles) - if(length(space_tiles)) - space = space_tiles[1] - - if(total_space && space) - var/old_pressure = air.return_pressure() - air.temperature_mimic(space,OPEN_HEAT_TRANSFER_COEFFICIENT,total_space) - air.remove(MOLES_CELLSTANDARD * (air.group_multiplier/40) * total_space) - var/p_diff = old_pressure - air.return_pressure() - if(p_diff > vsc.AF_TINY_MOVEMENT_THRESHOLD) AirflowSpace(src,p_diff) - - air.graphic_archived = air.graphic - - air.temperature = max(TCMB,air.temperature) - - var/p_diff = (air.return_pressure()-Z.air.return_pressure())*connected_zones[Z]*(vsc.zone_share_percent/100) - if(p_diff > vsc.AF_TINY_MOVEMENT_THRESHOLD) Airflow(src,Z,p_diff) - air.share_ratio(Z.air,connected_zones[Z]*(vsc.zone_share_percent/100)) - */ \ No newline at end of file diff --git a/code/FEA/FEA_ZAS_Airflow.dm b/code/FEA/FEA_ZAS_Airflow.dm deleted file mode 100644 index 5fc42651c87..00000000000 --- a/code/FEA/FEA_ZAS_Airflow.dm +++ /dev/null @@ -1,451 +0,0 @@ -/* - -CONTAINS: -All AirflowX() procs, all Variable Setting Controls for airflow, save/load variable tweaks for airflow. - -VARIABLES: - -atom/movable/airflow_dest - The destination turf of a flying object. - -atom/movable/airflow_speed - The speed (1-15) at which a flying object is traveling to airflow_dest. Decays over time. - - -OVERLOADABLE PROCS: - -mob/airflow_stun() - Contains checks for and results of being stunned by airflow. - Called when airflow quantities exceed AF_HUMAN_STUN_THRESHOLD. - RETURNS: Null - -atom/movable/check_airflow_movable(n) - Contains checks for moving any object due to airflow. - n is the percent of 1 Atmosphere that is flowing. - RETURNS: 1 if the object moves under the air conditions, 0 if it stays put. - -atom/movable/airflow_hit(atom/A) - Contains results of hitting a solid object (A) due to airflow. - A is the dense object hit. - Use airflow_speed to determine how fast the projectile was going. - - -AUTOMATIC PROCS: - -Airflow(datum/air_group/A, datum/air_group/B, n, vae/list/turf/simulated/target) - Causes objects to fly along a pressure gradient. - Called by airflow calculations finding a high pressure gradient. A and B are two adjacent airgroups. - n is the pressure difference between them. - targets is a list of turfs between them. - -AirflowSpace(zone/A) - Causes objects to fly into space. - Called by airflow to space. A is a airgroup connected to space. - -atom/movable/GotoAirflowDest(n) -atom/movable/RepelAirflowDest(n) - Called by main airflow procs to cause the object to fly to or away from destination at speed n. - Probably shouldn't call this directly unless you know what you're - doing and have set airflow_dest. airflow_hit() will be called if the object collides with an obstacle. - -*/ - -mob/proc/airflow_stun() - //Purpose: AIRFLOW - //Called by: AIRFLOW - //Inputs: Hate - //Outputs: Sadness - - if(weakened <= 0) - src << pickweight("\red The sudden rush of air knocks you over!" = 5, "\red You get dragged off your feet by a rush of air!" = 5, "\red FUCKING AIRFLOW!" = 1) - weakened = max(weakened,5) - -mob/living/silicon/airflow_stun() - return - -mob/living/carbon/metroid/airflow_stun() - return - -mob/living/carbon/human/airflow_stun() - if(buckled) return 0 - if(wear_suit) - if(wear_suit.flags & SUITSPACE) return 0 - if(shoes) - if(shoes.flags & NOSLIP) return 0 - if(weakened <= 0) - src << pickweight("\red The sudden rush of air knocks you over!" = 5, "\red You get dragged off your feet by a rush of air!" = 5, "\red FUCKING AIRFLOW!" = 1) - weakened = max(weakened,2) - -atom/movable/proc/check_airflow_movable(n) - //Purpose: Determining if src is movable by airflow. - //Called by: AIRFLOW - //Inputs: Movement force - //Outputs: Boolean of capability to be moved. - - if(anchored && !ismob(src)) return 0 - - if(!istype(src,/obj/item) && n < air_master.AF_DENSE_MOVEMENT_THRESHOLD) return 0 - if(ismob(src) && n < air_master.AF_MOB_MOVEMENT_THRESHOLD) return 0 - - return 1 - -mob/dead/observer/check_airflow_movable() - return 0 - -mob/living/silicon/check_airflow_movable() - return 0 - - -obj/item/check_airflow_movable(n) - . = ..() - switch(w_class) - if(2) - if(n < air_master.AF_SMALL_MOVEMENT_THRESHOLD) return 0 - if(3) - if(n < air_master.AF_NORMAL_MOVEMENT_THRESHOLD) return 0 - if(4,5) - if(n < air_master.AF_LARGE_MOVEMENT_THRESHOLD) return 0 - -proc/Airflow(datum/air_group/A,datum/air_group/B,n,var/list/turf/simulated/target) - //Purpose: AIRFLOW between two airgroups. - //Called by: AIRFLOW - //Inputs: Air group venting, Air group receiving, force of airflow, midpoint turf(s) - //Outputs: None. - - //Now n is a percent of one atm. - n = round((n/air_master.AF_PERCENT_OF)*100,0.1) - - //Don't go any further if n is lower than the lowest value needed for airflow. - if(abs(n) < air_master.AF_TINY_MOVEMENT_THRESHOLD) - return - - if(!target || !target.len) - return - - //Get lists of things that can be thrown across the room for each zone. - var/list/pplz = A.movables() - var/list/otherpplz = B.movables() - - for(var/atom/movable/M in pplz) - - //Check for knocking people over - if(ismob(M) && n > air_master.AF_HUMAN_STUN_THRESHOLD) - if(M:nodamage) continue - M:airflow_stun() - - if(M.check_airflow_movable(n)) - - //Check for things that are in range of the midpoint turfs. - var/fail = 1 - for(var/turf/simulated/T in target) - if(M in range(T)) - fail = 0 - break - if(fail) - continue - - //If they're already being tossed, don't do it again. - if(!M.airflow_speed) - - M.airflow_dest = pick(target) //Pick a random midpoint to fly towards. - - spawn M.GotoAirflowDest(abs(n) * (air_master.AF_SPEED_MULTIPLIER/10)) - //Send the object flying at a speed determined by n and AF_SPEED_MULTIPLIER. - - //Do it again for the stuff in the other zone, making it fly away. - for(var/atom/movable/M in otherpplz) - - if(ismob(M) && abs(n) > air_master.AF_HUMAN_STUN_THRESHOLD) - if(M:nodamage) continue - M:airflow_stun() - - if(M.check_airflow_movable(abs(n))) - - var/fail = 1 - for(var/turf/simulated/T in target) - if(M in range(T)) - fail = 0 - break - if(fail) - continue - - if(M && !M.airflow_speed) - - M.airflow_dest = pick(target) - - spawn M.RepelAirflowDest(abs(n) * (air_master.AF_SPEED_MULTIPLIER/10)) - -proc/AirflowSpace(datum/air_group/A) - //Purpose: AIRFLOW between an airgroup and spess. - //Called by: AIRFLOW - //Inputs: Air group venting into space. - //Outputs: None. - // The space version of the Airflow(A,B,n) proc. - - var/n = A.air.total_moles*air_master.AF_SPACE_MULTIPLIER - //Here, n is determined by the space multiplier constant and the zone's air. - - n = round((n/air_master.AF_PERCENT_OF)*100,0.1) - - if(n < air_master.AF_TINY_MOVEMENT_THRESHOLD) return - - var/list/connected_turfs = A.space_borders //The midpoints are now all the space connections. - var/list/pplz = A.movables() //We only need to worry about things in the zone, not things in space. - - for(var/atom/movable/M in pplz) - - if(ismob(M) && n > air_master.AF_HUMAN_STUN_THRESHOLD) - if(M:nodamage) continue - M:airflow_stun() - - if(M.check_airflow_movable(n)) - - var/fail = 1 - for(var/turf/U in connected_turfs) - if(M in range(U)) fail = 0 - if(fail) continue - - if(!M.airflow_speed) - M.airflow_dest = pick(connected_turfs) - spawn - if(M) M.GotoAirflowDest(n * (air_master.AF_SPEED_MULTIPLIER/10)) - //Sometimes shit breaks, and M isn't there after the spawn. - -/atom/movable - var/turf/airflow_dest - var/airflow_speed = 0 - var/airflow_time = 0 - - proc/GotoAirflowDest(n) - //Purpose: Moving src between it's current position and where air is dragging them. - //Called by: AIRFLOW - //Inputs: Force. - //Outputs: None. - - if(!airflow_dest) return - if(airflow_speed < 0) return - if(airflow_speed) - airflow_speed = n - return - if(airflow_dest == loc) - step_away(src,loc) - if(ismob(src)) - if(src:nodamage) return - if(istype(src, /mob/living/carbon/human)) - if(istype(src, /mob/living/carbon/human)) - if(src:buckled) return - if(src:wear_suit) - if(src:wear_suit.flags & SUITSPACE) return - if(src:shoes) - if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return - src << "\red You are sucked away by airflow!" - - airflow_speed = min(round(n),9) - airflow_speed /= get_dist(src,airflow_dest) //The further away you are, the less you get dragged. - var - xo = airflow_dest.x - src.x - yo = airflow_dest.y - src.y - od = 0 - airflow_dest = null - if(!density) - density = 1 - od = 1 //It wasn't dense, but it is considered it for when being moved by airflow. - //Main loop to AIRFLOW - while(airflow_speed > 0) - if(airflow_speed <= 0) return - airflow_speed = min(airflow_speed,15) - airflow_speed -= air_master.AF_SPEED_DECAY - if(airflow_speed > 7) - if(airflow_time++ >= airflow_speed - 7) - sleep(1 * tick_multiplier) - else - sleep(max(1,10-(airflow_speed+3)) * tick_multiplier) - if ((!( src.airflow_dest ) || src.loc == src.airflow_dest)) - src.airflow_dest = locate(min(max(src.x + xo, 1), world.maxx), min(max(src.y + yo, 1), world.maxy), src.z) - if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy)) - return - step_towards(src, src.airflow_dest) - if(ismob(src) && src:client) src:client:move_delay = world.time + 10 - airflow_dest = null - //You cannot be tossed around by airflow more than once ever 1.5(times tick_multiplier) seconds) - airflow_speed = -1 - spawn(150 * tick_multiplier) airflow_speed = 0 - //Reset density. - if(od) - density = 0 - - proc/RepelAirflowDest(n) - //Purpose: Moving src between it's current position and where air is pushing them. - //Called by: AIRFLOW - //Inputs: Force. - //Outputs: None. - - if(!airflow_dest) return - if(airflow_speed < 0) return - if(airflow_speed) - airflow_speed = n - return - if(airflow_dest == loc) - step_away(src,loc) - if(ismob(src)) - if(src:nodamage) return - if(istype(src, /mob/living/carbon/human)) - if(istype(src, /mob/living/carbon/human)) - if(src:buckled) return - if(src:wear_suit) - if(src:wear_suit.flags & SUITSPACE) return - if(src:shoes) - if(src:shoes.type == /obj/item/clothing/shoes/magboots) return - src << "\red You are pushed away by airflow!" - airflow_speed = min(round(n),9) - airflow_speed /= get_dist(src,airflow_dest) //The further away you are, the less you get dragged. - var - xo = -(airflow_dest.x - src.x) - yo = -(airflow_dest.y - src.y) - od = 0 - airflow_dest = null - if(!density) - density = 1 - od = 1 - while(airflow_speed > 0) - if(airflow_speed <= 0) return - airflow_speed = min(airflow_speed,15) - airflow_speed -= air_master.AF_SPEED_DECAY - if(airflow_speed > 7) - if(airflow_time++ >= airflow_speed - 7) - sleep(1 * tick_multiplier) - else - sleep(max(1,10-(airflow_speed+3)) * tick_multiplier) - if ((!( src.airflow_dest ) || src.loc == src.airflow_dest)) - src.airflow_dest = locate(min(max(src.x + xo, 1), world.maxx), min(max(src.y + yo, 1), world.maxy), src.z) - if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy)) - return - step_towards(src, src.airflow_dest) - if(ismob(src) && src:client) src:client:move_delay = world.time + 10 - airflow_dest = null - airflow_speed = -1 - spawn(150 * tick_multiplier) airflow_speed = 0 - if(od) - density = 0 - - Bump(atom/A) - if(airflow_speed > 0 && airflow_dest) - airflow_hit(A) - else - airflow_speed = 0 - . = ..() - -atom/movable/proc/airflow_hit(atom/A) - //Purpose: Managing impacts between objects whirled around by airflow. - //Called by: AIRFLOW - //Inputs: Object to impact. - //Outputs: None. - - airflow_speed = -1 - spawn(50 * tick_multiplier) airflow_speed = 0 - airflow_dest = null - -mob/airflow_hit(atom/A) - for(var/mob/M in hearers(src)) - M.show_message("\red [src] slams into [A]!",1,"\red You hear a loud slam!",2) - playsound(src.loc, "smash.ogg", 25, 1, -1) - . = ..() - -obj/airflow_hit(atom/A) - for(var/mob/M in hearers(src)) - M.show_message("\red [src] slams into [A]!",1,"\red You hear a loud slam!",2) - playsound(src.loc, "smash.ogg", 25, 1, -1) - . = ..() - -obj/item/airflow_hit(atom/A) - airflow_speed = -1 - spawn(50 * tick_multiplier) airflow_speed = 0 - airflow_dest = null - -mob/living/carbon/human/airflow_hit(atom/A) - for(var/mob/M in hearers(src)) - M.show_message("\red [src] slams into [A]!",1,"\red You hear a loud slam!",2) - playsound(src.loc, "punch", 25, 1, -1) - loc:add_blood(src) - if (src.wear_suit) - src.wear_suit.add_blood(src) - if (src.w_uniform) - src.w_uniform.add_blood(src) - var/b_loss = airflow_speed * air_master.AF_DAMAGE_MULTIPLIER - for(var/organ in src:organs) - var/datum/organ/external/temp = src:organs["[organ]"] - if (istype(temp, /datum/organ/external)) - switch(temp.name) - if("head") - temp.take_damage(b_loss * 0.2, 0) - if("chest") - temp.take_damage(b_loss * 0.4, 0) - if("diaper") - temp.take_damage(b_loss * 0.1, 0) - spawn UpdateDamageIcon() - if(airflow_speed > 10) - paralysis += round(airflow_speed * air_master.AF_STUN_MULTIPLIER) - stunned = max(stunned,paralysis + 3) - else - stunned += round(airflow_speed * air_master.AF_STUN_MULTIPLIER/2) - . = ..() - -/datum/air_group/proc/movables() - //Purpose: Returns everything movable. - //Called by: AIRFLOW - //Inputs: Possible objects to move. - //Outputs: None. - - . = list() - for(var/turf/T in members) - for(var/atom/A in T) - . += A - -proc/Get_Dir(atom/S,atom/T) //Shamelessly stolen from AJX.AdvancedGetDir - var/GDist=get_dist(S,T) - var/GDir=get_dir(S,T) - if(GDist<=3) - if(GDist==0) return 0 - if(GDist==1) - return GDir - - - var/X1=S.x*10 - var/X2=T.x*10 - var/Y1=S.y*10 - var/Y2=T.y*10 - var/Ref - if(GDir==NORTHEAST) - Ref=(X2/X1)*Y1 - if(Ref-1>Y2) .=EAST - else if(Ref+1Y2) .=WEST - else if(Ref+1Y2) .=SOUTH - else if(Ref+1Y2) .=SOUTH - else if(Ref+1> air_master - del F - world.log << "TWEAKS: Airflow, Plasma and Damage settings loaded." \ No newline at end of file diff --git a/code/FEA/FEA_system.dm b/code/FEA/FEA_system.dm index fb7e87ac99c..e8236961bf7 100644 --- a/code/FEA/FEA_system.dm +++ b/code/FEA/FEA_system.dm @@ -54,6 +54,7 @@ Important Procedures */ var/kill_air = 0 +var/tick_multiplier = 2 atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0) //Purpose: Determines if the object (or airflow) can pass this atom. diff --git a/code/FEA/FEA_variables.dm b/code/FEA/FEA_variables.dm deleted file mode 100644 index 10d75864c67..00000000000 --- a/code/FEA/FEA_variables.dm +++ /dev/null @@ -1,631 +0,0 @@ -//Please note that mose of these variables are holdovers form ZAS, but I really do not want to expend the effort to prune it down quite yet. - -pl_control/var - PLASMA_DMG = 3 - PLASMA_DMG_NAME = "Plasma Damage Multiplier" - PLASMA_DMG_DESC = "Multiplier on how much damage inhaling plasma can do." - - OXY_TO_PLASMA = 1 - OXY_TO_PLASMA_NAME = "O2/Plasma Ratio" - OXY_TO_PLASMA_DESC = "Multiplier for the ratio of oxygen to plasma required in fires." - - CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth. - CLOTH_CONTAMINATION_NAME = "Plasma - Cloth Contamination" - CLOTH_CONTAMINATION_RANDOM = 60 - CLOTH_CONTAMINATION_METHOD = "Toggle" - CLOTH_CONTAMINATION_DESC = "If set to nonzero, plasma will contaminate cloth items (uniforms, backpacks, etc.)\ - and cause a small amount of damage over time to anyone carrying or wearing them. Contamination can be detected\ - with a Health Analyzer, and washed off in the washer." - - ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or - //decontaminated. - ALL_ITEM_CONTAMINATION_NAME = "Plasma - Full Contamination" - ALL_ITEM_CONTAMINATION_RANDOM = 10 - ALL_ITEM_CONTAMINATION_METHOD = "Toggle" - ALL_ITEM_CONTAMINATION_DESC = "Like Cloth Contamination, but all item types are susceptible." - - PLASMAGUARD_ONLY = 0 - PLASMAGUARD_ONLY_NAME = "Plasma - Biosuits/Spacesuits Only" - PLASMAGUARD_ONLY_RANDOM = 20 - PLASMAGUARD_ONLY_METHOD = "Toggle" - PLASMAGUARD_ONLY_DESC = "If on, any suits that are not biosuits or space suits will not protect against contamination." - - //CANISTER_CORROSION = 0 //If this is on, plasma must be stored in orange tanks and canisters, - //CANISTER_CORROSION_RANDOM = 20 //or it will corrode the tank. - //CANISTER_CORROSION_METHOD = "Toggle" - - GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 10,000. - GENETIC_CORRUPTION_NAME = "Plasma - Genetic Corruption" - GENETIC_CORRUPTION_RANDOM = "PROB10/3d6" - GENETIC_CORRUPTION_METHOD = "Numeric" - GENETIC_CORRUPTION_DESC = "When set to a probability in 1000, any humans in plasma will have this chance to develop a random mutation." - - SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited. - SKIN_BURNS_NAME = "Plasma - Skin Burns" - SKIN_BURNS_RANDOM = 10 - SKIN_BURNS_METHOD = "Toggle" - SKIN_BURNS_DESC = "When toggled, humans with exposed skin will suffer burns (similar to mustard gas) in plasma." - - //PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time. - //PLASMA_INJECTS_TOXINS_RANDOM = 30 - //PLASMA_INJECTS_TOXINS_METHOD = "Toggle" - - EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection. - EYE_BURNS_NAME = "Plasma - Eye Burns" - EYE_BURNS_RANDOM = 30 - EYE_BURNS_METHOD = "Toggle" - EYE_BURNS_DESC = "When toggled, humans without masks that cover the eyes will suffer temporary blurriness and sight loss,\ - and may need glasses to see again if exposed for long durations." - - //N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high. - //N2O_REACTION_RANDOM = 5 - - //PLASMA_COLOR = "onturf" //Plasma can change colors yaaaay! - //PLASMA_COLOR_RANDOM = "PICKonturf,onturf" - - //PLASMA_DMG_OFFSET = 1 - //PLASMA_DMG_OFFSET_RANDOM = "1d5" - //PLASMA_DMG_QUOTIENT = 10 - //PLASMA_DMG_QUOTIENT_RANDOM = "1d10+4" - - CONTAMINATION_LOSS = 0.1 - _NAME = "Plasma - Contamination Damage" - CONTAMINATION_LOSS_DESC = "A number representing the damage done per life cycle by contaminated items." - - PLASMA_HALLUCINATION = 1 - PLASMA_HALLUCINATION_NAME = "Plasma - Hallucination" - PLASMA_HALLUCINATION_METHOD = "Toggle" - PLASMA_HALLUCINATION_DESC = "If toggled, uses the remnants of the hallucination code to induce visions in those\ - who breathe plasma." - N2O_HALLUCINATION = 1 - N2O_HALLUCINATION_NAME = "Nitrous Oxide - Hallucination" - N2O_HALLUCINATION_METHOD = "Toggle" - N2O_HALLUCINATION_DESC = "If toggled, uses the remnants of the hallucination code to induce visions in those\ - who breathe N2O." - //CONTAMINATION_LOSS_RANDOM = "5d5" -//Plasma has a chance to be a different color. - -var/tick_multiplier = 2 -/datum/controller/air_system/var - //Used in /mob/carbon/human/life - OXYGEN_LOSS = 2 - OXYGEN_LOSS_NAME = "Damage - Oxygen Loss" - OXYGEN_LOSS_DESC = "A multiplier for damage due to lack of air, CO2 poisoning, and vacuum. Does not affect oxyloss\ - from being incapacitated or dying." - TEMP_DMG = 2 - TEMP_DMG_NAME = "Damage - Temperature" - TEMP_DMG_DESC = "A multiplier for damage due to body temperature irregularities." - BURN_DMG = 6 - BURN_DMG_NAME = "Damage - Fire" - BURN_DMG_DESC = "A multiplier for damage due to direct fire exposure." - - AF_TINY_MOVEMENT_THRESHOLD = 50 //% difference to move tiny items. - AF_TINY_MOVEMENT_THRESHOLD_NAME = "Airflow - Tiny Movement Threshold %" - AF_TINY_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the tiny weight class will move." - AF_SMALL_MOVEMENT_THRESHOLD = 70 //% difference to move small items. - AF_SMALL_MOVEMENT_THRESHOLD_NAME = "Airflow - Small Movement Threshold %" - AF_SMALL_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the small weight class will move." - AF_NORMAL_MOVEMENT_THRESHOLD = 90 //% difference to move normal items. - AF_NORMAL_MOVEMENT_THRESHOLD_NAME = "Airflow - Normal Movement Threshold %" - AF_NORMAL_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the normal weight class will move." - AF_LARGE_MOVEMENT_THRESHOLD = 100 //% difference to move large and huge items. - AF_LARGE_MOVEMENT_THRESHOLD_NAME = "Airflow - Large Movement Threshold %" - AF_LARGE_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the large or huge weight class will move." - AF_DENSE_MOVEMENT_THRESHOLD = 120 //% difference to move dense crap and mobs. - AF_DENSE_MOVEMENT_THRESHOLD_NAME = "Airflow - Dense Movement Threshold %" - AF_DENSE_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which dense objects (canisters, etc.) will be shifted by airflow." - AF_MOB_MOVEMENT_THRESHOLD = 175 - AF_MOB_MOVEMENT_THRESHOLD_NAME = "Airflow - Human Movement Threshold %" - AF_MOB_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which mobs will be shifted by airflow." - - AF_HUMAN_STUN_THRESHOLD = 130 - AF_HUMAN_STUN_THRESHOLD_NAME = "Airflow - Human Stun Threshold %" - AF_HUMAN_STUN_THRESHOLD_DESC = "Percent of 1 Atm. at which living things are stunned or knocked over." - - AF_PERCENT_OF = ONE_ATMOSPHERE - AF_PERCENT_OF_NAME = "Airflow - 100% Pressure" - AF_PERCENT_OF_DESC = "Normally set to 1 Atm. in kPa, this indicates what pressure is considered 100% by the system." - - AF_SPEED_MULTIPLIER = 4 //airspeed per movement threshold value crossed. - AF_SPEED_MULTIPLIER_NAME = "Airflow - Speed Increase per 10%" - AF_SPEED_MULTIPLIER_DESC = "Velocity increase of shifted items per 10% of airflow." - AF_DAMAGE_MULTIPLIER = 5 //Amount of damage applied per airflow_speed. - AF_DAMAGE_MULTIPLIER_NAME = "Airflow - Damage Per Velocity" - AF_DAMAGE_MULTIPLIER_DESC = "Amount of damage applied per unit of speed (1-15 units) at which mobs are thrown." - AF_STUN_MULTIPLIER = 1.5 //Seconds of stun applied per airflow_speed. - AF_STUN_MULTIPLIER_NAME = "Airflow - Stun Per Velocity" - AF_STUN_MULTIPLIER_DESC = "Amount of stun effect applied per unit of speed (1-15 units) at which mobs are thrown." - AF_SPEED_DECAY = 0.5 //Amount that flow speed will decay with time. - AF_SPEED_DECAY_NAME = "Airflow - Velocity Lost per Tick" - AF_SPEED_DECAY_DESC = "Amount of airflow speed lost per tick on a moving object." - AF_SPACE_MULTIPLIER = 2 //Increasing this will make space connections more DRAMATIC! - AF_SPACE_MULTIPLIER_NAME = "Airflow - Space Airflow Multiplier" - AF_SPACE_MULTIPLIER_DESC = "Increasing this multiplier will cause more powerful airflow to space." - AF_CANISTER_MULTIPLIER = 0.25 - AF_CANISTER_MULTIPLIER_NAME = "Airflow - Canister Airflow Multiplier" - AF_CANISTER_MULTIPLIER_DESC = "Increasing this multiplier will cause more powerful airflow from single-tile sources like canisters." - -/datum/controller/air_system - var - list/settings = list() - list/bitflags = list("1","2","4","8","16","32","64","128","256","512","1024") - pl_control/plc = new() - New() - . = ..() - settings = vars.Copy() - - var/datum/D = new() //Ensure only unique vars are put through by making a datum and removing all common vars. - for(var/V in D.vars) - settings -= V - - for(var/V in settings) - if(findtextEx(V,"_RANDOM") || findtextEx(V,"_DESC") || findtextEx(V,"_METHOD")) - settings -= V - - settings -= "settings" - settings -= "bitflags" - settings -= "plc" - - proc/ChangeSettingsDialog(mob/user,list/L) - //var/which = input(user,"Choose a setting:") in L - var/dat = "" - for(var/ch in L) - if(findtextEx(ch,"_RANDOM") || findtextEx(ch,"_DESC") || findtextEx(ch,"_METHOD") || findtextEx(ch,"_NAME")) continue - var/vw - var/vw_desc = "No Description." - var/vw_name = ch - if(ch in plc.settings) - vw = plc.vars[ch] - if("[ch]_DESC" in plc.vars) vw_desc = plc.vars["[ch]_DESC"] - if("[ch]_NAME" in plc.vars) vw_name = plc.vars["[ch]_NAME"] - else - vw = vars[ch] - if("[ch]_DESC" in vars) vw_desc = vars["[ch]_DESC"] - if("[ch]_NAME" in plc.vars) vw_name = vars["[ch]_NAME"] - dat += "[vw_name] = [vw] \[Change\]
" - dat += "[vw_desc]

" - user << browse(dat,"window=settings") - Topic(href,href_list) - if("changevar" in href_list) - ChangeSetting(usr,href_list["changevar"]) - proc/ChangeSetting(mob/user,ch) - var/vw - var/how = "Text" - if(ch in plc.settings) - vw = plc.vars[ch] - if("[ch]_METHOD" in vars) - how = plc.vars["[ch]_METHOD"] - else - if(isnum(vw)) - how = "Numeric" - else - how = "Text" - else - vw = vars[ch] - if("[ch]_METHOD" in vars) - how = vars["[ch]_METHOD"] - else - if(isnum(vw)) - how = "Numeric" - else - how = "Text" - var/newvar = vw - switch(how) - if("Numeric") - newvar = input(user,"Enter a number:","Settings",newvar) as num - if("Bit Flag") - var/flag = input(user,"Toggle which bit?","Settings") in bitflags - flag = text2num(flag) - if(newvar & flag) - newvar &= ~flag - else - newvar |= flag - if("Toggle") - newvar = !newvar - if("Text") - newvar = input(user,"Enter a string:","Settings",newvar) as text - if("Long Text") - newvar = input(user,"Enter text:","Settings",newvar) as message - vw = newvar - if(ch in plc.settings) - plc.vars[ch] = vw - else - vars[ch] = vw - if(how == "Toggle") - newvar = (newvar?"ON":"OFF") - world << "\blue [key_name(user)] changed the setting [ch] to [newvar]." - //user << "[which] has been changed to [newvar]." - if(ch in plc.settings) - ChangeSettingsDialog(user,plc.settings) - else - ChangeSettingsDialog(user,settings) - proc/RandomizeWithProbability() - for(var/V in settings) - var/newvalue - if("[V]_RANDOM" in vars) - if(isnum(vars["[V]_RANDOM"])) - newvalue = prob(vars["[V]_RANDOM"]) - else if(istext(vars["[V]_RANDOM"])) - newvalue = roll(vars["[V]_RANDOM"]) - else - newvalue = vars[V] - V = newvalue - - proc/ChangePlasma() - for(var/V in plc.settings) - plc.Randomize(V) - ////world << "Plasma randomized." - - proc/SetDefault(def) - switch(def) - if("Original") - plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth. - - plc.ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or - - plc.PLASMAGUARD_ONLY = 0 - - //plc.CANISTER_CORROSION = 0 //If this is on, plasma must be stored in orange tanks and canisters, - - plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000. - - plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited. - - //plc.PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time. - - plc.EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection. - - //plc.N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high. - - //plc.PLASMA_COLOR = "onturf" //Plasma can change colors yaaaay! - - //plc.PLASMA_DMG_OFFSET = 1 - //plc.PLASMA_DMG_QUOTIENT = 10 - - plc.CONTAMINATION_LOSS = 0 - if("Hazard-Low") - plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth. - - plc.ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or - - plc.PLASMAGUARD_ONLY = 0 - - // plc.CANISTER_CORROSION = 0 //If this is on, plasma must be stored in orange tanks and canisters, - - plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000. - - plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited. - - // plc.PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time. - - plc.EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection. - - // plc.N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high. - - // plc.PLASMA_COLOR = "onturf" //RBPYB - - //if(prob(20)) - // plc.PLASMA_COLOR = pick("red","yellow","blue","purple") - - //plc.PLASMA_DMG_OFFSET = 1.5 - //plc.PLASMA_DMG_QUOTIENT = 8 - - plc.CONTAMINATION_LOSS = 0.01 - - var/s = pick(plc.settings) - plc.Randomize(s) - - if("Hazard-High") - plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth. - - plc.ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or - - plc.PLASMAGUARD_ONLY = 0 - - // plc.CANISTER_CORROSION = 1 //If this is on, plasma must be stored in orange tanks and canisters, - - plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000. - - plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited. - - // plc.PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time. - - plc.EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection. - - // plc.N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high. - - // plc.PLASMA_COLOR = "onturf"//pick("red","yellow","blue","purple") //RBPYB - - //plc.PLASMA_DMG_OFFSET = 3 - //plc.PLASMA_DMG_QUOTIENT = 5 - - plc.CONTAMINATION_LOSS = 0.05 - - for(var/i = rand(3,5),i>0,i--) - var/s = pick(plc.settings) - plc.Randomize(s) - - if("Everything") - plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth. - - plc.ALL_ITEM_CONTAMINATION = 1 //If this is on, any item can be contaminated, so suits and tools must be discarded or ELSE - - plc.PLASMAGUARD_ONLY = 1 - - // plc.CANISTER_CORROSION = 1 //If this is on, plasma must be stored in orange tanks and canisters, - - plc.GENETIC_CORRUPTION = 5 //Chance of genetic corruption as well as toxic damage, X in 1000. - - plc.SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited. - - // plc.PLASMA_INJECTS_TOXINS = 1 //Plasma damage injects the toxins chemical to do damage over time. - - plc.EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection. - - // plc.N2O_REACTION = 1 //Plasma can react with N2O, making sparks and starting a fire if levels are high. - - // plc.PLASMA_COLOR = "onturf" //RBPYB - - //plc.PLASMA_DMG_OFFSET = 3 - //plc.PLASMA_DMG_QUOTIENT = 5 - - plc.CONTAMINATION_LOSS = 0.02 - /////world << "Plasma color updated." - -pl_control - var/list/settings = list() - New() - . = ..() - settings = vars.Copy() - - var/datum/D = new() //Ensure only unique vars are put through by making a datum and removing all common vars. - for(var/V in D.vars) - settings -= V - - for(var/V in settings) - if(findtextEx(V,"_RANDOM") || findtextEx(V,"_DESC")) - settings -= V - - settings -= "settings" - proc/Randomize(V) - //world << "Randomizing [V]" - var/newvalue - if("[V]_RANDOM" in vars) - if(isnum(vars["[V]_RANDOM"])) - newvalue = prob(vars["[V]_RANDOM"]) - if(newvalue) - //world << "Probability [vars["[V]_RANDOM"]]%: Success." - else - //world << "Probability [vars["[V]_RANDOM"]]%: Failure." - else if(istext(vars["[V]_RANDOM"])) - var/txt = vars["[V]_RANDOM"] - if(findtextEx(txt,"PROB")) - //world << "Probability/Roll Combo \..." - txt = dd_text2list(txt,"/") - txt[1] = dd_replacetext(txt[1],"PROB","") - var/p = text2num(txt[1]) - var/r = txt[2] - //world << "Prob:[p]% Roll:[r]" - if(prob(p)) - newvalue = roll(r) - //world << "Success. New value: [newvalue]" - else - newvalue = vars[V] - //world << "Probability check failed." - else if(findtextEx(txt,"PICK")) - txt = dd_replacetext(txt,"PICK","") - //world << "Pick: [txt]" - txt = dd_text2list(txt,",") - newvalue = pick(txt) - //world << "Picked: [newvalue]" - else - newvalue = roll(txt) - //world << "Roll: [txt] - [newvalue]" - else - newvalue = vars[V] - vars[V] = newvalue - ////world << "Plasma color updated." - -mob/proc/Change_Airflow_Constants() - set category = "Debug" - - var/choice = input("Which constant will you modify?","Change Airflow Constants")\ - as null|anything in list("Movement Threshold","Speed Multiplier","Damage Multiplier","Stun Multiplier","Speed Decay") - - var/n - - switch(choice) - if("Movement Threshold") - n = input("What will you change it to","Change Airflow Constants",air_master.AF_DENSE_MOVEMENT_THRESHOLD) as num - n = max(1,n) - air_master.AF_DENSE_MOVEMENT_THRESHOLD = n - world.log << "air_master.AF_DENSE_MOVEMENT_THRESHOLD set to [n]." - if("Speed Multiplier") - n = input("What will you change it to","Change Airflow Constants",air_master.AF_SPEED_MULTIPLIER) as num - n = max(1,n) - air_master.AF_SPEED_MULTIPLIER = n - world.log << "air_master.AF_SPEED_MULTIPLIER set to [n]." - if("Damage Multiplier") - n = input("What will you change it to","Change Airflow Constants",air_master.AF_DAMAGE_MULTIPLIER) as num - air_master.AF_DAMAGE_MULTIPLIER = n - world.log << "AF_DAMAGE_MULTIPLIER set to [n]." - if("Stun Multiplier") - n = input("What will you change it to","Change Airflow Constants",air_master.AF_STUN_MULTIPLIER) as num - air_master.AF_STUN_MULTIPLIER = n - world.log << "AF_STUN_MULTIPLIER set to [n]." - if("Speed Decay") - n = input("What will you change it to","Change Airflow Constants",air_master.AF_SPEED_DECAY) as num - air_master.AF_SPEED_DECAY = n - world.log << "AF_SPEED_DECAY set to [n]." - if("Space Flow Multiplier") - n = input("What will you change it to","Change Airflow Constants",air_master.AF_SPEED_DECAY) as num - air_master.AF_SPEED_DECAY = n - world.log << "AF_SPEED_DECAY set to [n]." - -obj/var/contaminated = 0 - -obj/item/proc - can_contaminate() - if(flags & PLASMAGUARD) return 0 - if((flags & SUITSPACE) && !air_master.plc.PLASMAGUARD_ONLY) return 1 - if(air_master.plc.ALL_ITEM_CONTAMINATION) return 1 - else if(istype(src,/obj/item/clothing)) return 1 - else if(istype(src,/obj/item/weapon/storage/backpack)) return 1 - -/mob/living/carbon/human/proc/contaminate() - if(!pl_suit_protected()) - suit_contamination() - else if(air_master.plc.PLASMAGUARD_ONLY) - if(!wear_suit.flags & PLASMAGUARD) wear_suit.contaminated = 1 - - - - if(!pl_head_protected()) - if(wear_mask) wear_mask.contaminated = 1 - if(prob(1)) suit_contamination() //Plasma can sometimes get through such an open suit. - else if(air_master.plc.PLASMAGUARD_ONLY) - if(!head.flags & PLASMAGUARD) head.contaminated = 1 - - if(istype(back,/obj/item/weapon/storage/backpack) || air_master.plc.ALL_ITEM_CONTAMINATION) - back.contaminated = 1 - - if(l_hand) - if(l_hand.can_contaminate()) l_hand.contaminated = 1 - if(r_hand) - if(r_hand.can_contaminate()) r_hand.contaminated = 1 - if(belt) - if(belt.can_contaminate()) belt.contaminated = 1 - if(wear_id && !pl_suit_protected()) - if(wear_id.can_contaminate()) wear_id.contaminated = 1 - if(l_ear && !pl_head_protected()) - if(l_ear.can_contaminate()) l_ear.contaminated = 1 - if(r_ear && !pl_head_protected()) - if(r_ear.can_contaminate()) r_ear.contaminated = 1 - -/mob/living/carbon/human/proc/pl_effects() - if(stat >= 2) - return - if(air_master.plc.SKIN_BURNS) - if(!pl_head_protected() || !pl_suit_protected()) - burn_skin(0.75) - if (coughedtime != 1) - coughedtime = 1 - emote("gasp") - spawn (20) - coughedtime = 0 - updatehealth() - if(air_master.plc.EYE_BURNS && !pl_head_protected()) - if(!wear_mask) - if(prob(20)) usr << "\red Your eyes burn!" - eye_stat += 2.5 - eye_blurry += 1.5 - if (eye_stat >= 20 && !(disabilities & 1)) - src << "\red Your eyes start to burn badly!" - disabilities |= 1 - if (prob(max(0,eye_stat - 20) + 1)) - src << "\red You are blinded!" - eye_blind += 20 - eye_stat = max(eye_stat-25,0) - else - if(!(wear_mask.flags & MASKCOVERSEYES)) - if(prob(20)) usr << "\red Your eyes burn!" - eye_stat += 2.5 - eye_blurry = min(eye_blurry+1.5,50) - if (eye_stat >= 20 && !(disabilities & 1)) - src << "\red Your eyes start to burn badly!" - disabilities |= 1 - if (prob(max(0,eye_stat - 20) + 1) &&!eye_blind) - src << "\red You are blinded!" - eye_blind += 20 - eye_stat = 0 - if(air_master.plc.GENETIC_CORRUPTION) - if(rand(1,1000) < air_master.plc.GENETIC_CORRUPTION) - randmutb(src) - src << "\red High levels of toxins cause you to spontaneously mutate." - domutcheck(src,null) - -/mob/living/carbon/human/proc/FireBurn(mx as num) - //NO! NOT INTO THE PIT! IT BURRRRRNS! - mx *= air_master.BURN_DMG - - var - head_exposure = 1 - chest_exposure = 1 - groin_exposure = 1 - legs_exposure = 1 - feet_exposure = 1 - arms_exposure = 1 - hands_exposure = 1 - for(var/obj/item/clothing/C in src) - if(l_hand == C || r_hand == C) continue - if(C.body_parts_covered & HEAD) - head_exposure *= C.heat_transfer_coefficient - if(C.body_parts_covered & UPPER_TORSO) - chest_exposure *= C.heat_transfer_coefficient - if(C.body_parts_covered & LOWER_TORSO) - groin_exposure *= C.heat_transfer_coefficient - if(C.body_parts_covered & LEGS) - legs_exposure *= C.heat_transfer_coefficient - if(C.body_parts_covered & FEET) - feet_exposure *= C.heat_transfer_coefficient - if(C.body_parts_covered & ARMS) - arms_exposure *= C.heat_transfer_coefficient - if(C.body_parts_covered & HANDS) - arms_exposure *= C.heat_transfer_coefficient - - mx *= 10 - - apply_damage("head", 0, 2.5*mx*head_exposure) - apply_damage("chest", 0, 2.5*mx*chest_exposure) - apply_damage("groin", 0, 2.0*mx*groin_exposure) - apply_damage("l_leg", 0, 0.6*mx*legs_exposure) - apply_damage("r_leg", 0, 0.6*mx*legs_exposure) - apply_damage("l_arm", 0, 0.4*mx*arms_exposure) - apply_damage("r_arm", 0, 0.4*mx*arms_exposure) - apply_damage("l_foot", 0, 0.25*mx*feet_exposure) - apply_damage("r_foot", 0, 0.25*mx*feet_exposure) - apply_damage("l_hand", 0, 0.25*mx*hands_exposure) - apply_damage("r_hand", 0, 0.25*mx*hands_exposure) - -/mob/living/carbon/human/proc/suit_interior() - . = list() - if(!pl_suit_protected()) - for(var/obj/item/I in src) - . += I - return . - . += wear_mask - . += w_uniform - . += shoes - . += gloves - if(!pl_head_protected()) - . += head - -/mob/living/carbon/human/proc/pl_head_protected() - if(head) - if(head.flags & PLASMAGUARD || head.flags & HEADSPACE) return 1 - return 0 - -/mob/living/carbon/human/proc/pl_suit_protected() - if(wear_suit) - if(wear_suit.flags & PLASMAGUARD || wear_suit.flags & SUITSPACE) return 1 - return 0 - -/mob/living/carbon/human/proc/suit_contamination() - if(air_master.plc.ALL_ITEM_CONTAMINATION) - for(var/obj/item/I in src) - I.contaminated = 1 - else - if(wear_suit) wear_suit.contaminated = 1 - if(w_uniform) w_uniform.contaminated = 1 - if(shoes) shoes.contaminated = 1 - if(gloves) gloves.contaminated = 1 - if(wear_mask) wear_mask.contaminated = 1 - - -turf/Entered(obj/item/I) - . = ..() - if(istype(I)) - var/datum/gas_mixture/env = return_air(1) - if(env.toxins > 0.35) - if(I.can_contaminate()) - I.contaminated = 1 \ No newline at end of file diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm index 5661f8d212d..ebbf265ca31 100644 --- a/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm +++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm @@ -60,12 +60,6 @@ //a lot of these variables are pretty hacked, so dont rely on the comments /obj/machinery/power/supermatter/process() - var/datum/gas_mixture/env = loc.return_air() - - //Remove gas from surrounding area - var/transfer_moles = gasefficency * env.total_moles - var/datum/gas_mixture/removed = env.remove(transfer_moles) - //core can no longer spontaneously explode /* previousdet = det diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index 754903fe8d7..dcd8969b6bb 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -137,7 +137,7 @@ datum/controller/game_controller spawn(0) - air_master.process() +// air_master.process() air_master_ready = 1 spawn(0) tension_master.process() diff --git a/code/game/vehicles/airtight/airtight.dm b/code/game/vehicles/airtight/airtight.dm index 44ee0fff2b4..27a8cde7184 100644 --- a/code/game/vehicles/airtight/airtight.dm +++ b/code/game/vehicles/airtight/airtight.dm @@ -46,7 +46,7 @@ delay = 20 process(var/obj/vehicle/airtight/V) - if(V.cabin_air && V.cabin_air.return_volume() > 0) + if(V.cabin_air && V.cabin_air.volume > 0) var/delta = V.cabin_air.temperature - T20C V.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1))) return @@ -65,8 +65,8 @@ var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2) var/transfer_moles = 0 if(pressure_delta > 0) //cabin pressure lower than release pressure - if(tank_air.return_temperature() > 0) - transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) + if(tank_air.temperature > 0) + transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = tank_air.remove(transfer_moles) cabin_air.merge(removed) else if(pressure_delta < 0) //cabin pressure higher than release pressure @@ -75,7 +75,7 @@ if(t_air) pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) if(pressure_delta > 0) //if location pressure is lower than cabin pressure - transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION) + transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles) if(t_air) t_air.merge(removed) @@ -123,11 +123,11 @@ /obj/vehicle/airtight/proc/return_temperature() . = 0 if(use_internal_tank) - . = cabin_air.return_temperature() + . = cabin_air.temperature else var/datum/gas_mixture/t_air = get_turf_air() if(t_air) - . = t_air.return_temperature() + . = t_air.temperature return /obj/vehicle/airtight/proc/connect(obj/machinery/atmospherics/portables_connector/new_port) diff --git a/code/game/vehicles/vehicle.dm b/code/game/vehicles/vehicle.dm index 87d40b69303..c83a391a310 100644 --- a/code/game/vehicles/vehicle.dm +++ b/code/game/vehicles/vehicle.dm @@ -166,12 +166,12 @@ if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH))) mecha.setInternalDamage(MECHA_INT_TANK_BREACH) var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air() - if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents + if(int_tank_air && int_tank_air.volume>0) //heat the air_contents int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15)) - if(mecha.cabin_air && mecha.cabin_air.return_volume()>0) - mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15)) - if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2) - mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire") + if(mecha.cabin_air && mecha.cabin_air.volume>0) + mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.temperature+rand(10,15)) + if(mecha.cabin_air.temperature>mecha.max_temperature/2) + mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.temperature,0.1),"fire") if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum mecha.pr_int_temp_processor.stop() if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 80897df1c35..fa68b836d90 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -217,7 +217,6 @@ var/turf/T = get_turf(usr) if(istype(T, /turf/simulated)) var/datum/air_group/AG = T:parent - AG.next_check = 30 AG.group_processing = 0 else usr << "Local airgroup is unsimulated!"