diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index eba85018d34..ac619b10b20 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -107,7 +107,4 @@ #define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :( #define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value). -#define PRESSURE_SUIT_REDUCTION_COEFFICIENT 0.8 //This is how much (percentual) a suit with the flag STOPSPRESSUREDMAGE reduces pressure. -#define PRESSURE_HEAD_REDUCTION_COEFFICIENT 0.4 //This is how much (percentual) a helmet/hat with the flag STOPSPRESSUREDMAGE reduces pressure. - #define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this \ No newline at end of file diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index a7dbe0957aa..ea27b6bdf82 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -211,9 +211,17 @@ reagents.chem_temp = total_temp /obj/item/weapon/grenade/chem_grenade/proc/can_flood_from(myloc, maxrange) + var/turf/myturf = get_turf(myloc) var/list/reachable = list(myloc) for(var/i=1; i<=maxrange; i++) + var/list/turflist = list() for(var/turf/T in (orange(i, myloc) - orange(i-1, myloc))) + turflist |= T + for(var/turf/T in turflist) + if( !(get_dir(T,myloc) in cardinal) && (abs(T.x - myturf.x) == abs(T.y - myturf.y) )) + turflist.Remove(T) + turflist.Add(T) // we move the purely diagonal turfs to the end of the list. + for(var/turf/T in turflist) if(T in reachable) continue for(var/turf/NT in orange(1, T)) if(!(NT in reachable)) continue diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index c644c33ab0d..744cc804bd9 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -213,7 +213,7 @@ imp_in.reagents.add_reagent("synaptizine", 10) imp_in.reagents.add_reagent("omnizine", 10) - imp_in.reagents.add_reagent("morphine", 10) + imp_in.reagents.add_reagent("stimulants", 10) /obj/item/weapon/implant/emp diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 79c1960f3a8..0b33449b5ef 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -73,22 +73,18 @@ var/loc_temp = get_temperature(environment) - //world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Fire protection: [heat_protection] - Location: [loc] - src: [src]" - // Aliens are now weak to fire. //After then, it reacts to the surrounding atmosphere based on your thermal protection if(!on_fire) // If you're on fire, ignore local air temperature if(loc_temp > bodytemperature) //Place is hotter than we are - var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of heat protection. if(thermal_protection < 1) bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) else bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) - // bodytemperature -= max((loc_temp - bodytemperature / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) - // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. if(bodytemperature > 360.15) //Body temperature is too hot. throw_alert("alien_fire") @@ -134,6 +130,9 @@ bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up! return +/mob/living/carbon/alien/reagent_check(var/datum/reagent/R) //can metabolize all reagents + return 0 + /mob/living/carbon/alien/IsAdvancedToolUser() return has_fine_manipulation diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index 4ace45627ab..a34c6337786 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -36,13 +36,6 @@ else healths.icon_state = "health7" - -/mob/living/carbon/alien/humanoid/hunter/handle_environment() - if(m_intent == "run" || resting) - ..() - else - adjustToxLoss(-heal_rate) - /mob/living/carbon/alien/humanoid/hunter/movement_delay() . = -1 //hunters are sanic . += ..() //but they still need to slow down on stun diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 40c3574d756..bd6400fe5af 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -124,9 +124,6 @@ unEquip(r_store) unEquip(l_store) -/mob/living/carbon/alien/humanoid/reagent_check(var/datum/reagent/R) - return 0 - /mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I) playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free ..(I, cuff_break = 1) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index acdbfd4d055..858d3ec155b 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -30,7 +30,6 @@ //BREATH TEMPERATURE handle_breath_temperature(breath) - /mob/living/carbon/alien/handle_status_effects() ..() //natural reduction of movement delay due to stun. diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index d14b746171c..d3aa47771a2 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -52,20 +52,10 @@ /mob/living/carbon/human/calculate_affecting_pressure(var/pressure) - ..() - var/pressure_difference = abs( pressure - ONE_ATMOSPHERE ) - - var/pressure_adjustment_coefficient = 1 //Determins how much the clothing you are wearing protects you in percent. - if(wear_suit && (wear_suit.flags & STOPSPRESSUREDMAGE)) - pressure_adjustment_coefficient -= PRESSURE_SUIT_REDUCTION_COEFFICIENT - if(head && (head.flags & STOPSPRESSUREDMAGE)) - pressure_adjustment_coefficient -= PRESSURE_HEAD_REDUCTION_COEFFICIENT - pressure_adjustment_coefficient = max(pressure_adjustment_coefficient,0) //So it isn't less than 0 - pressure_difference = pressure_difference * pressure_adjustment_coefficient - if(pressure > ONE_ATMOSPHERE) - return ONE_ATMOSPHERE + pressure_difference + if((wear_suit && (wear_suit.flags & STOPSPRESSUREDMAGE)) && (head && (head.flags & STOPSPRESSUREDMAGE))) + return ONE_ATMOSPHERE else - return ONE_ATMOSPHERE - pressure_difference + return pressure /mob/living/carbon/human/handle_disabilities() @@ -146,21 +136,6 @@ //END FIRE CODE -/mob/living/carbon/human/proc/stabilize_temperature_from_calories() - switch(bodytemperature) - if(-INFINITY to 260.15) //260.15 is 310.15 - 50, the temperature where you start to feel effects. - if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. - nutrition -= 2 - var/body_temperature_difference = 310.15 - bodytemperature - bodytemperature += max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) - if(260.15 to 360.15) - var/body_temperature_difference = 310.15 - bodytemperature - bodytemperature += body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR - if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects. - //We totally need a sweat system cause it totally makes sense...~ - var/body_temperature_difference = 310.15 - bodytemperature - bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers - //This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, CHEST, GROIN, etc. See setup.dm for the full list) /mob/living/carbon/human/proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to. var/thermal_protection_flags = 0 diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 957e938d47e..5be1ee2fb9d 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1143,7 +1143,7 @@ return 1 /datum/species/proc/handle_breath_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H) // called by human/life, handles temperatures - if( (abs(310.15 - breath.temperature) > 50) && !(mutations_list[COLDRES] in H.dna.mutations) && !(COLDRES in specflags)) // Hot air hurts :( + if(abs(310.15 - breath.temperature) > 50) if(!(mutations_list[COLDRES] in H.dna.mutations)) // COLD DAMAGE switch(breath.temperature) @@ -1162,18 +1162,18 @@ H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head") if(1000 to INFINITY) H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head") + /datum/species/proc/handle_environment(datum/gas_mixture/environment, var/mob/living/carbon/human/H) if(!environment) return var/loc_temp = H.get_temperature(environment) - //world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]" - //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. - if(H.stat != 2) - H.stabilize_temperature_from_calories() + //Body temperature is adjusted in two steps. First, your body tries to stabilize itself a bit. + if(H.stat != DEAD) + H.natural_bodytemperature_stabilization() - //After then, it reacts to the surrounding atmosphere based on your thermal protection + //Then, it reacts to the surrounding atmosphere based on your thermal protection if(!H.on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases if(loc_temp < H.bodytemperature) //Place is colder than we are diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 3b4025f9528..997387dd784 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -238,15 +238,8 @@ if(reagents) reagents.metabolize(src) -/mob/living/carbon/handle_blood() - return - -/mob/living/carbon/handle_random_events() - return - /mob/living/carbon/proc/handle_heart() return -/mob/living/carbon/handle_environment(var/datum/gas_mixture/environment) return /mob/living/carbon/handle_stomach() spawn(0) @@ -503,3 +496,20 @@ healths.icon_state = "health6" else healths.icon_state = "health7" + + +//used in human and monkey handle_environment() +/mob/living/carbon/proc/natural_bodytemperature_stabilization() + var/body_temperature_difference = 310.15 - bodytemperature + switch(bodytemperature) + if(-INFINITY to 260.15) //260.15 is 310.15 - 50, the temperature where you start to feel effects. + if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. + nutrition -= 2 + bodytemperature += max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) + if(260.15 to 310.15) + bodytemperature += max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4)) + if(310.15 to 360.15) + bodytemperature += min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4)) + if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects. + //We totally need a sweat system cause it totally makes sense...~ + bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 77a3961653e..1a11316bb04 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -18,10 +18,6 @@ if(prob(1)) emote(pick("scratch","jump","roll","tail")) -/mob/living/carbon/monkey/calculate_affecting_pressure(var/pressure) - ..() - return pressure - /mob/living/carbon/monkey/handle_mutations_and_radiation() if (radiation) @@ -46,23 +42,69 @@ emote("gasp") ..() +/mob/living/carbon/monkey/handle_breath_temperature(datum/gas_mixture/breath) + if(abs(310.15 - breath.temperature) > 50) + switch(breath.temperature) + if(-INFINITY to 120) + adjustFireLoss(3) + if(120 to 200) + adjustFireLoss(1.5) + if(200 to 260) + adjustFireLoss(0.5) + if(360 to 400) + adjustFireLoss(2) + if(400 to 1000) + adjustFireLoss(3) + if(1000 to INFINITY) + adjustFireLoss(8) /mob/living/carbon/monkey/handle_environment(datum/gas_mixture/environment) if(!environment) return - var/environment_heat_capacity = environment.heat_capacity() - if(istype(get_turf(src), /turf/space)) - var/turf/heat_turf = get_turf(src) - environment_heat_capacity = heat_turf.heat_capacity - if(!on_fire) - if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) - var/transfer_coefficient = 1 + var/loc_temp = get_temperature(environment) - handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) + if(stat != DEAD) + natural_bodytemperature_stabilization() - if(stat != 2) - bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) + if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases + if(loc_temp < bodytemperature) + bodytemperature += min(((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) + else + bodytemperature += min(((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) + + if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT) + switch(bodytemperature) + if(360 to 400) + throw_alert("temp","hot",1) + adjustFireLoss(2) + if(400 to 460) + throw_alert("temp","hot",2) + adjustFireLoss(3) + if(460 to INFINITY) + throw_alert("temp","hot",3) + if(on_fire) + adjustFireLoss(8) + else + adjustFireLoss(3) + + else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) + if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) + switch(bodytemperature) + if(200 to 260) + throw_alert("temp","cold",1) + adjustFireLoss(0.5) + if(120 to 200) + throw_alert("temp","cold",2) + adjustFireLoss(1.5) + if(-INFINITY to 120) + throw_alert("temp","cold",3) + adjustFireLoss(3) + else + clear_alert("temp") + + else + clear_alert("temp") //Account for massive pressure differences @@ -84,14 +126,6 @@ return -/mob/living/carbon/monkey/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) - if(status_flags & GODMODE) return - var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) - - if(exposed_temperature > bodytemperature) - adjustFireLoss(20.0*discomfort) - else - adjustFireLoss(5.0*discomfort) /mob/living/carbon/monkey/handle_hud_icons() @@ -120,10 +154,8 @@ if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) return 1 -///FIRE CODE /mob/living/carbon/monkey/handle_fire() if(..()) return - adjustFireLoss(6) + bodytemperature += BODYTEMP_HEATING_MAX return -//END FIRE CODE diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 41e2982d9b4..51b73cc9a7a 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -204,6 +204,9 @@ /mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools return 0 +/mob/living/carbon/monkey/reagent_check(var/datum/reagent/R) //can metabolize all reagents + return 0 + /mob/living/carbon/monkey/canBeHandcuffed() return 1 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f6e909e9f25..3cc7827073c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -193,7 +193,7 @@ Sorry Giacom. Please don't be mad :( //This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually //affects them once clothing is factored in. ~Errorage /mob/living/proc/calculate_affecting_pressure(var/pressure) - return 0 + return pressure //sort of a legacy burn method for /electrocute, /shock, and the e_chair @@ -814,4 +814,4 @@ Sorry Giacom. Please don't be mad :( return initial(pixel_x) /mob/living/proc/get_standard_pixel_y_offset(lying = 0) - return initial(pixel_y) + return initial(pixel_y) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 43211c0a253..74ac5e70c30 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -5,7 +5,7 @@ /mob/living/simple_animal/hostile/mimic name = "crate" desc = "A rectangular steel crate." - icon = 'icons/obj/storage.dmi' + icon = 'icons/obj/crates.dmi' icon_state = "crate" icon_living = "crate" diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 98496d254fe..2cec576afb1 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -220,7 +220,7 @@ datum/reagents/proc/metabolize(var/mob/M) for(var/A in reagent_list) var/datum/reagent/R = A if(M && R) - if(M.reagent_check(R) != 1) + if(!M.reagent_check(R)) if(R.volume >= R.overdose_threshold && !R.overdosed && R.overdose_threshold > 0) R.overdosed = 1 M << "You feel like you took too much of [R.name]!" diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 0a8f3b2d1c7..e49cb61e992 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -592,7 +592,7 @@ /obj/machinery/chem_master/constructable/attackby(var/obj/item/B as obj, var/mob/user as mob, params) - if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0_", B)) + if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0", B)) if(beaker) beaker.loc = src.loc beaker = null @@ -760,7 +760,7 @@ obj/machinery/computer/pandemic/proc/replicator_cooldown(var/waittime) if(!D) return var/name = stripped_input(usr,"Name:","Name the culture",D.name,MAX_NAME_LEN) - if(name == null) + if(name == null || wait) return var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc) B.icon_state = "bottle3" diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 16b8d2a05d2..2d83c9580b8 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -93,7 +93,7 @@ /obj/item/weapon/reagent_containers/hypospray/medipen/stimpack //goliath kiting name = "stimpack medipen" - desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor as well as a ." + desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor." icon_state = "stimpen" volume = 20 amount_per_transfer_from_this = 20 diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi index 0f73d04e0c2..fbc69f8e91a 100644 Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi index 6fcd74552cb..276ed025c8c 100644 Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ