mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Added washing machines.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2216 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
/obj/machinery/washing_machine
|
||||
name = "Washing Machine"
|
||||
icon = 'washing_machine.dmi'
|
||||
icon_state = "wm_10"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/state = 1
|
||||
//1 = empty, open door
|
||||
//2 = empty, closed door
|
||||
//3 = full, open door
|
||||
//4 = full, closed door
|
||||
//5 = running
|
||||
//6 = blood, open door
|
||||
//7 = blood, closed door
|
||||
//8 = blood, running
|
||||
var/panel = 0
|
||||
//0 = closed
|
||||
//1 = open
|
||||
var/hacked = 1 //Bleh, screw hacking, let's have it hacked by default.
|
||||
//0 = not hacked
|
||||
//1 = hacked
|
||||
var/gibs_ready = 0
|
||||
|
||||
/obj/machinery/washing_machine/verb/start()
|
||||
set name = "Start Washing"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if( state != 4 )
|
||||
usr << "The washing machine cannot run in this state."
|
||||
return
|
||||
|
||||
if( locate(/mob,contents) )
|
||||
state = 8
|
||||
else
|
||||
state = 5
|
||||
update_icon()
|
||||
sleep(200)
|
||||
for(var/atom/A in contents)
|
||||
A.clean_blood()
|
||||
if( locate(/mob,contents) )
|
||||
state = 7
|
||||
gibs_ready = 1
|
||||
else
|
||||
state = 4
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/washing_machine/verb/climb_out()
|
||||
set name = "Climb out"
|
||||
set category = "Object"
|
||||
set src in usr.loc
|
||||
|
||||
sleep(20)
|
||||
if(state in list(1,3,6) )
|
||||
usr.loc = src.loc
|
||||
|
||||
|
||||
/obj/machinery/washing_machine/update_icon()
|
||||
icon_state = "wm_[state][panel]"
|
||||
|
||||
/obj/machinery/washing_machine/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
/*if(istype(W,/obj/item/weapon/screwdriver))
|
||||
panel = !panel
|
||||
user << "\blue you [panel ? "open" : "close"] the [src]'s maintenance panel"*/
|
||||
if(istype(W,/obj/item/weapon/grab))
|
||||
if( (state == 1) && hacked)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
if(ishuman(G.assailant) && iscorgi(G.affecting))
|
||||
G.affecting.loc = src
|
||||
del(G)
|
||||
state = 3
|
||||
else
|
||||
..()
|
||||
if(istype(W,/obj/item/clothing/under) || istype(W,/obj/item/clothing/mask) || istype(W,/obj/item/clothing/head) || istype(W,/obj/item/clothing/gloves) || istype(W,/obj/item/clothing/shoes) || istype(W,/obj/item/clothing/suit))
|
||||
|
||||
//YES, it's hardcoded... saves a var/can_be_washed for every single clothing item.
|
||||
if ( istype(W,/obj/item/clothing/suit/space ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/suit/syndicatefake ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/suit/powered ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/suit/cyborg_suit ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/suit/bomb_suit ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/suit/armor ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/suit/armor ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/mask/gas ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/mask/cigarette ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/head/syndicatefake ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/head/powered ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
if ( istype(W,/obj/item/clothing/head/helmet ) )
|
||||
user << "This item does not fit."
|
||||
return
|
||||
|
||||
if(contents.len < 5)
|
||||
if ( state in list(1, 3) )
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
state = 3
|
||||
else
|
||||
user << "\blue You can't put the item in right now."
|
||||
else
|
||||
user << "\blue The washing machine is full."
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/washing_machine/attack_hand(mob/user as mob)
|
||||
switch(state)
|
||||
if(1)
|
||||
state = 2
|
||||
if(2)
|
||||
state = 1
|
||||
for(var/atom/movable/O in contents)
|
||||
O.loc = src.loc
|
||||
if(3)
|
||||
state = 4
|
||||
if(4)
|
||||
state = 3
|
||||
for(var/atom/movable/O in contents)
|
||||
O.loc = src.loc
|
||||
state = 1
|
||||
if(5)
|
||||
user << "\red The [src] is busy."
|
||||
if(6)
|
||||
state = 7
|
||||
if(7)
|
||||
if(gibs_ready)
|
||||
gibs_ready = 0
|
||||
if(locate(/mob,contents))
|
||||
var/mob/M = locate(/mob,contents)
|
||||
M.gib()
|
||||
for(var/atom/movable/O in contents)
|
||||
O.loc = src.loc
|
||||
state = 1
|
||||
|
||||
|
||||
update_icon()
|
||||
Reference in New Issue
Block a user