mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Fixes cryogenic showers
Changes shower temperature settings to use more reasonable temperature values. A menu is now shown when adjusting shower temperature.
This commit is contained in:
@@ -129,6 +129,7 @@
|
|||||||
var/watertemp = "normal" //freezing, normal, or boiling
|
var/watertemp = "normal" //freezing, normal, or boiling
|
||||||
var/mobpresent = 0 //true if there is a mob on the shower's loc, this is to ease process()
|
var/mobpresent = 0 //true if there is a mob on the shower's loc, this is to ease process()
|
||||||
var/is_washing = 0
|
var/is_washing = 0
|
||||||
|
var/list/temperature_settings = list("normal" = 310, "boiling" = T0C+100, "freezing" = T0C)
|
||||||
|
|
||||||
/obj/machinery/shower/New()
|
/obj/machinery/shower/New()
|
||||||
..()
|
..()
|
||||||
@@ -150,7 +151,7 @@
|
|||||||
if(on)
|
if(on)
|
||||||
if (M.loc == loc)
|
if (M.loc == loc)
|
||||||
wash(M)
|
wash(M)
|
||||||
check_heat(M)
|
process_heat(M)
|
||||||
for (var/atom/movable/G in src.loc)
|
for (var/atom/movable/G in src.loc)
|
||||||
G.clean_blood()
|
G.clean_blood()
|
||||||
|
|
||||||
@@ -158,15 +159,11 @@
|
|||||||
if(I.type == /obj/item/device/analyzer)
|
if(I.type == /obj/item/device/analyzer)
|
||||||
user << "<span class='notice'>The water temperature seems to be [watertemp].</span>"
|
user << "<span class='notice'>The water temperature seems to be [watertemp].</span>"
|
||||||
if(istype(I, /obj/item/weapon/wrench))
|
if(istype(I, /obj/item/weapon/wrench))
|
||||||
|
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
|
||||||
user << "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>"
|
user << "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>"
|
||||||
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||||
if(do_after(user, 50))
|
if(do_after(user, 50))
|
||||||
switch(watertemp)
|
watertemp = newtemp
|
||||||
if("normal")
|
|
||||||
watertemp = "freezing"
|
|
||||||
if("freezing")
|
|
||||||
watertemp = "boiling"
|
|
||||||
if("boiling")
|
|
||||||
watertemp = "normal"
|
|
||||||
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I].</span>")
|
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I].</span>")
|
||||||
add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
|
|
||||||
@@ -177,8 +174,8 @@
|
|||||||
|
|
||||||
if(on)
|
if(on)
|
||||||
overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
|
overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
|
||||||
if(watertemp == "freezing")
|
if(temperature_settings[watertemp] < T20C)
|
||||||
return
|
return //no mist for cold water
|
||||||
if(!ismist)
|
if(!ismist)
|
||||||
spawn(50)
|
spawn(50)
|
||||||
if(src && on)
|
if(src && on)
|
||||||
@@ -200,7 +197,7 @@
|
|||||||
wash(O)
|
wash(O)
|
||||||
if(ismob(O))
|
if(ismob(O))
|
||||||
mobpresent += 1
|
mobpresent += 1
|
||||||
check_heat(O)
|
process_heat(O)
|
||||||
|
|
||||||
/obj/machinery/shower/Uncrossed(atom/movable/O)
|
/obj/machinery/shower/Uncrossed(atom/movable/O)
|
||||||
if(ismob(O))
|
if(ismob(O))
|
||||||
@@ -304,8 +301,8 @@
|
|||||||
if(!on) return
|
if(!on) return
|
||||||
wash_floor()
|
wash_floor()
|
||||||
if(!mobpresent) return
|
if(!mobpresent) return
|
||||||
for(var/mob/living/carbon/C in loc)
|
for(var/mob/living/L in loc)
|
||||||
check_heat(C)
|
process_heat(L)
|
||||||
|
|
||||||
/obj/machinery/shower/proc/wash_floor()
|
/obj/machinery/shower/proc/wash_floor()
|
||||||
if(!ismist && is_washing)
|
if(!ismist && is_washing)
|
||||||
@@ -317,22 +314,19 @@
|
|||||||
spawn(100)
|
spawn(100)
|
||||||
is_washing = 0
|
is_washing = 0
|
||||||
|
|
||||||
/obj/machinery/shower/proc/check_heat(mob/M as mob)
|
/obj/machinery/shower/proc/process_heat(mob/living/M)
|
||||||
if(!on || watertemp == "normal") return
|
if(!on || !istype(M)) return
|
||||||
if(iscarbon(M))
|
|
||||||
var/mob/living/carbon/C = M
|
var/temperature = temperature_settings[watertemp]
|
||||||
|
var/temp_adj = between(BODYTEMP_COOLING_MAX, temperature - M.bodytemperature, BODYTEMP_HEATING_MAX)
|
||||||
if(watertemp == "freezing")
|
M.bodytemperature += temp_adj
|
||||||
C.bodytemperature = max(80, C.bodytemperature - 80)
|
|
||||||
C << "<span class='warning'>The water is freezing!</span>"
|
if(ishuman(M))
|
||||||
return
|
var/mob/living/carbon/human/H = M
|
||||||
if(watertemp == "boiling")
|
if(temperature >= H.species.heat_level_1)
|
||||||
C.bodytemperature = min(500, C.bodytemperature + 35)
|
H << "<span class='danger'>The water is searing hot!</span>"
|
||||||
C.adjustFireLoss(5)
|
else if(temperature <= H.species.cold_level_1)
|
||||||
C << "<span class='danger'>The water is searing!</span>"
|
H << "<span class='warning'>The water is freezing cold!</span>"
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/bikehorn/rubberducky
|
/obj/item/weapon/bikehorn/rubberducky
|
||||||
name = "rubber ducky"
|
name = "rubber ducky"
|
||||||
|
|||||||
Reference in New Issue
Block a user