reagents mob temp

This commit is contained in:
Fox McCloud
2019-03-19 14:58:53 -04:00
parent de09634df1
commit eedc8afa8e
3 changed files with 41 additions and 3 deletions
@@ -513,3 +513,12 @@ emp_act
return TRUE
if(check_mask && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH))
return TRUE
/mob/living/carbon/human/proc/reagent_safety_check(hot = TRUE)
if(wear_mask)
to_chat(src, "<span class='danger'>Your [wear_mask.name] protects you from the [hot ? "hot" : "cold"] liquid!</span>")
return FALSE
if(head)
to_chat(src, "<span class='danger'>Your [head.name] protects you from the [hot ? "hot" : "cold"] liquid!</span>")
return FALSE
return TRUE
+29
View File
@@ -554,6 +554,35 @@ var/const/INGEST = 2
react_type = "OBJ"
else
return
if(react_type == "LIVING" && ishuman(A))
var/mob/living/carbon/human/H = A
if(method == TOUCH)
var/obj/item/organ/external/head/affecting = H.get_organ("head")
if(affecting)
if(chem_temp > H.dna.species.heat_level_1)
if(H.reagent_safety_check())
to_chat(H, "<span class='danger'>You are scalded by the hot chemicals!</span>")
affecting.receive_damage(0, round(log(chem_temp / 50) * 10))
H.emote("scream")
H.adjust_bodytemperature(min(max((chem_temp - T0C) - 20, 5), 500))
else if(chem_temp < H.dna.species.cold_level_1)
if(H.reagent_safety_check(FALSE))
to_chat(H, "<span class='danger'>You are frostbitten by the freezing cold chemicals!</span>")
affecting.receive_damage(0, round(log(T0C - chem_temp / 50) * 10))
H.emote("scream")
H.adjust_bodytemperature(- min(max(T0C - chem_temp - 20, 5), 500))
if(method == INGEST)
if(chem_temp > H.dna.species.heat_level_1)
to_chat(H, "<span class='danger'>You scald yourself trying to consume the boiling hot substance!</span>")
H.adjustFireLoss(7)
H.adjust_bodytemperature(min(max((chem_temp - T0C) - 20, 5), 700))
else if(chem_temp < H.dna.species.cold_level_1)
to_chat(H, "<span class='danger'>You frostburn yourself trying to consume the freezing cold substance!</span>")
H.adjustFireLoss(7)
H.adjust_bodytemperature(- min(max((T0C - chem_temp) - 20, 5), 700))
for(var/datum/reagent/R in reagent_list)
switch(react_type)
if("LIVING")
@@ -94,11 +94,11 @@
/obj/machinery/chem_heater/Topic(href, href_list)
if(..())
return 0
return FALSE
if(href_list["toggle_on"])
if(!beaker.reagents.total_volume)
return
return FALSE
on = !on
. = 1
@@ -110,7 +110,7 @@
var/target = input("Please input the target temperature", name) as num
desired_temp = Clamp(target, 0, 1000)
else
return 0
return FALSE
. = 1
if(href_list["eject_beaker"])