diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 92444251a3..73cbd5aa6d 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -1301,8 +1301,8 @@ proc/listclearnulls(list/list) return 1 */ -/proc/do_after(var/mob/user as mob, delay as num, var/numticks = 5) // Replacing the upper one with this one because Byond keeps feeling that the upper one is an infinate loop - if(!user || isnull(user)) // This one should have less temptation +/proc/do_after(var/mob/user as mob, delay as num, var/numticks = 5, var/needhand = 1) // Replacing the upper one with this one because Byond keeps feeling that the upper one is an infinate loop + if(!user || isnull(user)) // This one should have less temptation return 0 if(numticks == 0) return 0 @@ -1313,7 +1313,10 @@ proc/listclearnulls(list/list) for(var/i = 0, iYour sanity barely endures the seconds spent in the vault's browsing window. The only thing to remind you of this when you stop browsing is a dusty old tome sitting on the desk. You don't really remember printing it." - for (var/mob/V in hearers(src)) - V.show_message("[usr] stares at the blank screen for a few moments, his expression frozen in fear. When he finally awakens from it, he looks a lot older.", 2) + user << "Your sanity barely endures the seconds spent in the vault's browsing window. The only thing to remind you of this when you stop browsing is a dusty old tome sitting on the desk. You don't really remember printing it." + user.visible_message("[user] stares at the blank screen for a few moments, his expression frozen in fear. When he finally awakens from it, he looks a lot older.", 2) src.arcanecheckout = 0 if(1) // Inventory diff --git a/code/game/objects/watercloset.dm b/code/game/objects/watercloset.dm index 4a8b7e3322..011acc91e7 100644 --- a/code/game/objects/watercloset.dm +++ b/code/game/objects/watercloset.dm @@ -1,4 +1,4 @@ -//todo: flushing, flushing heads, showers actually cleaning people +//todo: toothbrushes, and some sort of "toilet-filthinator" for the hos /obj/structure/toilet name = "toilet" @@ -8,18 +8,43 @@ density = 0 anchored = 1 var/open = 0 + var/mob/swirlie = null /obj/structure/toilet/New() open = round(rand(0, 1)) update_icon() /obj/structure/toilet/attack_hand() - open = !open - update_icon() + if(!swirlie) + open = !open + update_icon() + else + usr.visible_message("[usr] slams the toilet seat onto [swirlie.name]'s head!", "You slam the toilet seat onto [swirlie.name]'s head!", "You hear reverberating porcelain.") + swirlie.adjustBruteLoss(8) /obj/structure/toilet/update_icon() icon_state = "toilet[open]" +/obj/structure/toilet/attackby(var/obj/item/I, var/mob/user) + if(istype(I, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = I + var/mob/GM = G.affecting + if(ismob(G.affecting)) + if(G.state>1 && GM.loc == get_turf(src)) + if(open && !swirlie) + user.visible_message("[user] starts to give [GM.name] a swirlie!", "You start to give [GM.name] a swirlie!") + swirlie = GM + if(do_after(user, 30, 5, 0)) + user.visible_message("[user] gives [GM.name] a swirlie!", "You give [GM.name] a swirlie!", "You hear a toilet flushing.") + if(!GM.internal) + GM.adjustOxyLoss(5) + swirlie = null + else + user.visible_message("[user] slams [GM.name] into the [src]!", "You slam [GM.name] into the [src]!") + GM.adjustBruteLoss(8) + else + user << "You need a tighter grip." + /obj/structure/urinal @@ -30,9 +55,20 @@ density = 0 anchored = 1 +/obj/structure/urinal/attackby(var/obj/item/I, var/mob/user) + if(istype(I, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = I + var/mob/GM = G.affecting + if(ismob(G.affecting)) + if(G.state>1 && GM.loc == get_turf(src)) + user.visible_message("[user] slams [GM.name] into the [src]!", "You slam [GM.name] into the [src]!") + GM.adjustBruteLoss(8) + else + user << "You need a tighter grip." -/obj/structure/shower + +/obj/machinery/shower name = "shower" desc = "The HS-451. Installed in the 2550s by the Nanotrasen Hygiene Division." icon = 'watercloset.dmi' @@ -41,7 +77,9 @@ anchored = 1 var/on = 0 var/obj/effect/mist/mymist = null - var/ismist = 0 //needs a var so we can make it linger~ + var/ismist = 0 //needs a var so we can make it linger~ + 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() //add heat controls? when emagged, you can freeze to death in it? @@ -52,22 +90,37 @@ layer = MOB_LAYER + 1 mouse_opacity = 0 -/obj/structure/shower/attack_hand(mob/M as mob) +/obj/machinery/shower/attack_hand(mob/M as mob) on = !on update_icon() if(on && M.loc == loc) wash(M) + check_heat(M) -/obj/structure/shower/attackby(mob/M as mob) - attack_hand(M) +/obj/machinery/shower/attackby(var/obj/item/I, var/mob/user) + if(I.type == /obj/item/device/analyzer) + user << "The water temperature seems to be [watertemp]." + if(istype(I, /obj/item/weapon/wrench)) + user << "You begin to adjust the temperature valve with the [I]." + if(do_after(user, 50)) + switch(watertemp) + if("normal") + watertemp = "freezing" + if("freezing") + watertemp = "boiling" + if("boiling") + watertemp = "normal" + user.visible_message("[user] adjusts the shower with the [I].", "You adjust the shower with the [I].") -/obj/structure/shower/update_icon() - overlays = null +/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up + overlays = null //once it's been on for a while, in addition to handling the water overlay. if(mymist) del(mymist) if(on) overlays += image('watercloset.dmi', src, "water", MOB_LAYER + 1, dir) + if(watertemp == "freezing") + return if(!ismist) spawn(50) if(src && on) @@ -84,13 +137,20 @@ del(mymist) ismist = 0 -/obj/structure/shower/HasEntered(atom/movable/O as obj|mob) +/obj/machinery/shower/HasEntered(atom/movable/O) ..() wash(O) + if(ismob(O)) + mobpresent += 1 + check_heat(O) + +/obj/machinery/shower/Uncrossed(atom/movable/O) + if(ismob(O)) + mobpresent -= 1 + ..() //Yes, showers are super powerful as far as washing goes. -/obj/structure/shower/proc/wash(atom/movable/O as obj|mob) - ..() +/obj/machinery/shower/proc/wash(atom/movable/O as obj|mob) if(!on) return O.clean_blood() @@ -108,10 +168,10 @@ var/mob/living/carbon/human/washer = O if(washer.head) washer.head.clean_blood() - if(washer.w_uniform) - washer.w_uniform.clean_blood() if(washer.wear_suit) washer.wear_suit.clean_blood() + else if(washer.w_uniform) + washer.w_uniform.clean_blood() if(washer.shoes) washer.shoes.clean_blood() if(washer.gloves) @@ -129,6 +189,26 @@ for(var/obj/effect/overlay/R in tile) del(R) +/obj/machinery/shower/process() + if(!on || !mobpresent) return + for(var/mob/living/carbon/C in loc) + check_heat(C) + +/obj/machinery/shower/proc/check_heat(mob/M as mob) + if(!on || watertemp == "normal") return + if(iscarbon(M)) + var/mob/living/carbon/C = M + + if(watertemp == "freezing") + C.bodytemperature = min(100, C.bodytemperature - 80) + C << "The water is freezing!" + return + if(watertemp == "boiling") + C.bodytemperature = max(500, C.bodytemperature + 35) + C.adjustFireLoss(10) + C << "The water is searing!" + return + /obj/item/weapon/bikehorn/rubberducky diff --git a/icons/obj/library.dmi b/icons/obj/library.dmi index c502c2f523..1fbf68d176 100644 Binary files a/icons/obj/library.dmi and b/icons/obj/library.dmi differ diff --git a/maps/tgstation.2.0.9.dmm b/maps/tgstation.2.0.9.dmm index 75d55b500d..d5f52dd5e5 100644 --- a/maps/tgstation.2.0.9.dmm +++ b/maps/tgstation.2.0.9.dmm @@ -51,7 +51,7 @@ "aaY" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = "Streight"},/obj/machinery/atmospherics/pipe/simple{dir = 4},/turf/simulated/floor{icon_state = "floorgrime"},/area/security/prison) "aaZ" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = "90Curve"},/obj/structure/cable{d1 = 2; d2 = 8; icon_state = "2-8"; tag = "90Curve"},/obj/machinery/atmospherics/unary/outlet_injector{dir = 8; frequency = 1443; icon_state = "on"; id = "air_in"; on = 1},/obj/machinery/hologram/holopad,/turf/simulated/floor,/area/security/prison) "aba" = (/obj/machinery/light/small{dir = 1},/obj/structure/window/reinforced/tinted{dir = 8; icon_state = "twindow"; tag = ""},/turf/simulated/floor{icon_state = "freezerfloor"},/area/security/prison) -"abb" = (/obj/item/weapon/soap/nanotrasen,/obj/structure/shower{tag = "icon-shower (WEST)"; icon_state = "shower"; dir = 8},/obj/structure/sink{pixel_y = 30},/turf/simulated/floor{icon_state = "freezerfloor"},/area/security/prison) +"abb" = (/obj/item/weapon/soap/nanotrasen,/obj/machinery/shower{tag = "icon-shower (WEST)"; icon_state = "shower"; dir = 8},/obj/structure/sink{pixel_y = 30},/turf/simulated/floor{icon_state = "freezerfloor"},/area/security/prison) "abc" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 1},/turf/simulated/floor/plating,/area/security/range) "abd" = (/turf/simulated/floor,/area/security/range) "abe" = (/obj/machinery/atmospherics/pipe/simple,/obj/machinery/portable_atmospherics/scrubber/stationary,/turf/simulated/floor/plating,/area/security/prison) @@ -2513,9 +2513,9 @@ "aWq" = (/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor/plating,/area/maintenance/port) "aWr" = (/obj/machinery/door/airlock{name = "Unit 2"},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) "aWs" = (/obj/machinery/atmospherics/unary/vent_scrubber{dir = 1; on = 1; scrub_N2O = 0; scrub_Toxins = 0},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = "Streight"},/obj/structure/sink{dir = 4; icon_state = "sink"; pixel_x = 11; pixel_y = 0},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) -"aWt" = (/obj/structure/shower{tag = "icon-shower (EAST)"; icon_state = "shower"; dir = 4},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) +"aWt" = (/obj/machinery/shower{tag = "icon-shower (EAST)"; icon_state = "shower"; dir = 4},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) "aWu" = (/obj/effect/landmark{name = "blobstart"},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) -"aWv" = (/obj/structure/shower{tag = "icon-shower (WEST)"; icon_state = "shower"; dir = 8},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) +"aWv" = (/obj/machinery/shower{tag = "icon-shower (WEST)"; icon_state = "shower"; dir = 8},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/locker/locker_toilet) "aWw" = (/obj/machinery/portable_atmospherics/pump,/obj/machinery/camera{c_tag = "Locker Room South"; dir = 4; network = "SS13"},/turf/simulated/floor{icon_state = "delivery"},/area/crew_quarters/locker) "aWx" = (/obj/machinery/light{icon_state = "tube1"; dir = 4},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = "Streight"},/turf/simulated/floor,/area/crew_quarters/locker) "aWy" = (/obj/structure/closet/crate,/turf/simulated/floor{icon_state = "floorgrime"},/area/quartermaster/storage) @@ -4887,7 +4887,7 @@ "bPY" = (/obj/effect/sign/biohazard,/turf/simulated/wall/r_wall,/area/medical/virology) "bPZ" = (/obj/machinery/access_button{command = "cycle_exterior"; master_tag = "virology_airlock_control"; name = "Virology Access Button"; pixel_x = -23; pixel_y = -8; req_access_txt = "39"},/turf/simulated/floor{icon_state = "white"},/area/medical/virology) "bQa" = (/turf/simulated/floor{icon_state = "white"},/area/medical/virology) -"bQb" = (/obj/structure/shower{tag = "icon-shower (WEST)"; icon_state = "shower"; dir = 8},/turf/simulated/floor{icon_state = "white"},/area/medical/virology) +"bQb" = (/obj/machinery/shower{tag = "icon-shower (WEST)"; icon_state = "shower"; dir = 8},/turf/simulated/floor{icon_state = "white"},/area/medical/virology) "bQc" = (/obj/machinery/alarm{dir = 4; icon_state = "alarm0"; pixel_x = -22},/obj/machinery/light/small{dir = 8},/turf/simulated/floor,/area/medical/research{name = "Research Division"}) "bQd" = (/turf/simulated/floor,/area/medical/research{name = "Research Division"}) "bQe" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 5},/turf/simulated/floor,/area/medical/research{name = "Research Division"})