mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Cleaned up PDA code a litte more. Can again resize window. The close button is in the menu.
Toilets now work more like actual toilets. They will auto-flush when you insert a small object. You can also dunk people's heads into the toilet and try to choke them if you have a good grip. Fixed wiring near detective's office. Fixed larva and monkeys not being able to move on tables. Fixed larva not being able to crawl through vents. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1535 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
// Once full (~1 atm), uses air resv to flush items into the pipes
|
||||
// Automatically recharges air (unless off), will flush when ready if pre-set
|
||||
// Can hold items and human size things, no other draggables
|
||||
// Toilets are a type of disposal bin for small objects only and work on magic. By magic, I mean torque rotation
|
||||
|
||||
/obj/machinery/disposal
|
||||
name = "disposal unit"
|
||||
@@ -59,7 +60,6 @@
|
||||
C.show_message("\red [GM.name] has been placed in the [src] by [user].", 3)
|
||||
del(G)
|
||||
|
||||
|
||||
else
|
||||
user.drop_item()
|
||||
|
||||
@@ -273,10 +273,6 @@
|
||||
// otherwise charge
|
||||
use_power(500) // charging power usage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var/atom/L = loc // recharging from loc turf
|
||||
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
@@ -350,7 +346,92 @@
|
||||
H.vent_gas(loc)
|
||||
del(H)
|
||||
|
||||
//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.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)
|
||||
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',src,"toilet-handle",,dir)
|
||||
if( !(stat & NOPOWER) )
|
||||
overlays += image('disposal.dmi',src,"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/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
|
||||
@@ -369,8 +450,8 @@
|
||||
|
||||
// initialize a holder from the contents of a disposal unit
|
||||
proc/init(var/obj/machinery/disposal/D)
|
||||
gas = D.air_contents // transfer gas resv. into holder object
|
||||
|
||||
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
|
||||
|
||||
// now everything inside the disposal gets put into the holder
|
||||
// note AM since can contain mobs or objs
|
||||
@@ -388,8 +469,6 @@
|
||||
src.destinationTag = T.sortTag
|
||||
|
||||
|
||||
|
||||
|
||||
// start the movement process
|
||||
// argument is the disposal unit the holder started in
|
||||
proc/start(var/obj/machinery/disposal/D)
|
||||
|
||||
Reference in New Issue
Block a user