mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Merge pull request #5332 from mwerezak/wound-infections
Gives the suit coolers a proper process() proc
This commit is contained in:
@@ -16,23 +16,28 @@
|
||||
//TODO: make it heat up the surroundings when not in space
|
||||
|
||||
/obj/item/device/suit_cooling_unit/New()
|
||||
processing_objects |= src
|
||||
|
||||
cell = new/obj/item/weapon/cell() //comes with the crappy default power cell - high-capacity ones shouldn't be hard to find
|
||||
cell.loc = src
|
||||
|
||||
/obj/item/device/suit_cooling_unit/proc/cool_mob(mob/M)
|
||||
if (!on || !cell) return
|
||||
|
||||
//make sure they have a suit and we are attached to it
|
||||
if (!attached_to_suit(M))
|
||||
/obj/item/device/suit_cooling_unit/process()
|
||||
if (!on || !cell)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if (!ismob(loc))
|
||||
return
|
||||
|
||||
if (!attached_to_suit(loc)) //make sure they have a suit and we are attached to it
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = loc
|
||||
|
||||
var/efficiency = H.get_pressure_protection() //you need to have a good seal for effective cooling
|
||||
var/env_temp = get_environment_temperature() //wont save you from a fire
|
||||
var/temp_adj = min(H.bodytemperature - max(thermostat, env_temp), max_cooling)
|
||||
|
||||
if (temp_adj < 0) //only cools, doesn't heat
|
||||
if (temp_adj < 0.5) //only cools, doesn't heat, also we don't need extreme precision
|
||||
return
|
||||
|
||||
var/charge_usage = (temp_adj/max_cooling)*charge_consumption
|
||||
@@ -85,7 +90,8 @@
|
||||
|
||||
/obj/item/device/suit_cooling_unit/proc/turn_off()
|
||||
if (ismob(src.loc))
|
||||
src.loc << "\The [src] clicks and whines as it powers down." //let them know
|
||||
var/mob/M = src.loc
|
||||
M.show_message("\The [src] clicks and whines as it powers down.", 2) //let them know in case it's run out of power.
|
||||
on = 0
|
||||
updateicon()
|
||||
|
||||
|
||||
@@ -785,13 +785,8 @@
|
||||
*/
|
||||
|
||||
proc/stabilize_body_temperature()
|
||||
//TODO find a better place to put this
|
||||
if (s_store && istype(s_store, /obj/item/device/suit_cooling_unit))
|
||||
var/obj/item/device/suit_cooling_unit/CU = s_store
|
||||
CU.cool_mob(src)
|
||||
|
||||
if (species.flags & IS_SYNTHETIC)
|
||||
bodytemperature += species.synth_temp_gain //that CPU/posibrain just keeps putting out heat.
|
||||
bodytemperature += species.synth_temp_gain //just keep putting out heat.
|
||||
return
|
||||
|
||||
var/body_temperature_difference = species.body_temperature - bodytemperature
|
||||
|
||||
Reference in New Issue
Block a user