- crate mimic have wrong icon var. 8953

- fixes constructable chem master icon when parts are exchanged. 8616
- lowers toolboxes inhands sprite, fixes missing one. 8433
- fixes exploit in pandemic to avoid the bottle creation cooldown. 8031
- fixes chem grenade not getting to southwest side. 8019
- remove handle_env, /handle_random_events() and handle_blood at carbon level, identical to living level.
- fixes human bodytemp dropping to 20C in normal environment. (32.5C 90.5F when naked now)
- you now need both adequate headgear+suit to protect against pressure. (removing two defines)
- fixes alien hunter being immune to env fire in stalk mode (removing hunter/handle_env())
- fixes monkey not metabolizing reagents, also make larva metabolize them. 7108
- remove calculate_affecting_pressure from monkey level, simplification.
- refactors monkey's handle environment, no more handle_temp_damage proc, it's all in handle_env.Fixes temperature alert not showing for monkey.
- refactor monkey/handle_fire (similar to alien/human now.)
- replaces morphine with stimulants in adrenal implant. 8832
- refactor handle_breath_temperature.
This commit is contained in:
phil235
2015-04-20 18:15:06 +02:00
parent 8f50c568ed
commit fc158ef7bd
19 changed files with 106 additions and 93 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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"

View File

@@ -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 << "<span class = 'userdanger'>You feel like you took too much of [R.name]!</span>"

View File

@@ -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"

View File

@@ -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