mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-31 12:33:08 +00:00
A few map fixes, plus new toilets, urinals, and showers.
All bathroom stuff is fairly WIP at the moment. The toilet path has changed from /obj/machinery/disposal/toilet to /obj/structure/toilet git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3586 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
72
code/game/objects/watercloset.dm
Normal file
72
code/game/objects/watercloset.dm
Normal file
@@ -0,0 +1,72 @@
|
||||
//todo: flushing, flushing heads, showers actually cleaning people
|
||||
|
||||
/obj/structure/toilet
|
||||
name = "toilet"
|
||||
desc = "The HT-451, a torque rotation-based, waste disposal unit for small matter. This one seems remarkably clean."
|
||||
icon = 'watercloset.dmi'
|
||||
icon_state = "toilet0"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/open = 0
|
||||
|
||||
/obj/structure/toilet/New()
|
||||
open = round(rand(0, 1))
|
||||
update_icon()
|
||||
|
||||
/obj/structure/toilet/attack_hand()
|
||||
open = !open
|
||||
update_icon()
|
||||
|
||||
/obj/structure/toilet/update_icon()
|
||||
icon_state = "toilet[open]"
|
||||
|
||||
|
||||
|
||||
/obj/structure/urinal
|
||||
name = "urinal"
|
||||
desc = "The HU-452, an experimental urinal."
|
||||
icon = 'watercloset.dmi'
|
||||
icon_state = "urinal"
|
||||
density = 0
|
||||
anchored = 1
|
||||
|
||||
|
||||
|
||||
/obj/structure/shower
|
||||
name = "shower"
|
||||
desc = "The HS-451. Installed in the 2550s by the Nanotrasen Hygiene Division."
|
||||
icon = 'watercloset.dmi'
|
||||
icon_state = "shower"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/on = 0
|
||||
var/mist = 0 //needs a var so we can make it linger~
|
||||
|
||||
//add heat controls? when emagged, you can freeze to death in it?
|
||||
|
||||
/obj/structure/shower/attack_hand()
|
||||
on = !on
|
||||
update_icon()
|
||||
|
||||
/obj/structure/shower/update_icon()
|
||||
overlays = null
|
||||
if(on)
|
||||
overlays += image('watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
|
||||
spawn(50)
|
||||
if(src && on)
|
||||
overlays += image('watercloset.dmi', src, "mist", MOB_LAYER + 1, dir)
|
||||
mist = 1
|
||||
else if(mist)
|
||||
overlays += image('watercloset.dmi', src, "mist", MOB_LAYER + 1, dir)
|
||||
spawn(100)
|
||||
if(src && !on)
|
||||
overlays = null
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/bikehorn/rubberducky
|
||||
name = "rubber ducky"
|
||||
desc = "Rubber ducky you're so fine, you make bathtime lots of fuuun. Rubber ducky I'm awfully fooooond of yooooouuuu~" //thanks doohl
|
||||
icon = 'watercloset.dmi'
|
||||
icon_state = "rubberducky"
|
||||
item_state = "rubberducky"
|
||||
@@ -403,96 +403,6 @@
|
||||
else
|
||||
return ..(mover, target, height, air_group)
|
||||
|
||||
//The toilet does not need to pressurized but can only handle small items.
|
||||
//You can also choke people by dunking them into the toilet.
|
||||
/obj/machinery/disposal/toilet
|
||||
name = "toilet"
|
||||
desc = "A torque rotation-based, waste disposal unit for small matter."
|
||||
icon_state = "toilet"
|
||||
density = 0//So you can stand on it.
|
||||
mode = 2
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if( !(stat & BROKEN) )
|
||||
if(istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(istype(G)) // handle grabbed mob
|
||||
if(ismob(G.affecting))
|
||||
var/mob/GM = G.affecting
|
||||
for (var/mob/V in viewers(usr))
|
||||
V.show_message("[user] dunks [GM.name] into the toilet!", 3)
|
||||
if(do_after(user, 30))
|
||||
if(G && G.state>1 && !GM.internal)
|
||||
GM.oxyloss += 5
|
||||
|
||||
else if(I.w_class < 4)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
user << "You place \the [I] into the [src]."
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user)
|
||||
continue
|
||||
M.show_message("[user.name] places \the [I] into the [src].", 3)
|
||||
else
|
||||
user << "\red That item cannot be placed into the toilet."
|
||||
return
|
||||
|
||||
MouseDrop_T(mob/target, mob/user)
|
||||
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
|
||||
return//Damn that list is long
|
||||
|
||||
for (var/mob/V in viewers(usr))
|
||||
if(target == user && !user.stat)
|
||||
V.show_message("[user] sits on the toilet.", 3)
|
||||
if(target != user && !user.restrained())
|
||||
V.show_message("[user] places [target.name] on the toilet.", 3)
|
||||
target.loc = loc
|
||||
return
|
||||
|
||||
interact(mob/user)
|
||||
if(isAI(user) || isrobot(user))
|
||||
return
|
||||
|
||||
add_fingerprint(user)
|
||||
for (var/mob/V in viewers(user))
|
||||
V.show_message("[user] eagerly drinks the toilet water!", 3)//Yum yum yum
|
||||
return
|
||||
|
||||
update()
|
||||
overlays = null
|
||||
if( !(stat & BROKEN) )
|
||||
if(flush)
|
||||
overlays += image('disposal.dmi',"toilet-handle",,dir)
|
||||
if( !(stat & NOPOWER) )
|
||||
overlays += image('disposal.dmi',"toilet-ready",,dir)
|
||||
else
|
||||
icon_state = "toilet-broken"
|
||||
mode = 0
|
||||
flush = 0
|
||||
return
|
||||
|
||||
process()
|
||||
if( !((stat & BROKEN)||(stat & NOPOWER)) )// nothing can happen if broken or not powered.
|
||||
updateDialog()
|
||||
if(!flush&&contents.len)
|
||||
flush++
|
||||
flush()
|
||||
use_power(100)// base power usage
|
||||
update()
|
||||
return
|
||||
|
||||
flush()
|
||||
flick("toilet-flush", src)
|
||||
var/obj/structure/disposalholder/H = new()
|
||||
H.init(src)
|
||||
sleep(10)
|
||||
playsound(src, 'disposalflush.ogg', 50, 0, 0)
|
||||
sleep(30) // To prevent spam.
|
||||
H.start(src)
|
||||
flush--
|
||||
update()
|
||||
return
|
||||
|
||||
// virtual disposal object
|
||||
// travels through pipes in lieu of actual items
|
||||
// contents will be items flushed by the disposal
|
||||
@@ -512,8 +422,7 @@
|
||||
|
||||
// initialize a holder from the contents of a disposal unit
|
||||
proc/init(var/obj/machinery/disposal/D)
|
||||
if(!istype(D, /obj/machinery/disposal/toilet))//So it does not drain gas from a toilet which does not function on it.
|
||||
gas = D.air_contents// transfer gas resv. into holder object
|
||||
gas = D.air_contents// transfer gas resv. into holder object
|
||||
|
||||
//Check for any living mobs trigger hasmob.
|
||||
//hasmob effects whether the package goes to cargo or its tagged destination.
|
||||
|
||||
Reference in New Issue
Block a user