-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathwatercloset.dm
458 lines (391 loc) · 14.7 KB
/
watercloset.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
/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 = 'icons/obj/watercloset.dmi'
icon_state = "toilet00"
density = FALSE
anchored = TRUE
var/open = FALSE //if the lid is up
var/cistern = 0 //if the cistern bit is open
var/w_items = 0 //the combined w_class of all the items in the cistern
var/mob/living/swirlie = null //the mob being given a swirlie
/obj/structure/toilet/Initialize(mapload)
. = ..()
open = round(rand(0, 1))
update_appearance(UPDATE_ICON)
/obj/structure/toilet/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(swirlie && user.combat_mode)
user.changeNext_move(CLICK_CD_MELEE)
playsound(src.loc, "swing_hit", 25, 1)
swirlie.visible_message(span_danger("[user] slams the toilet seat onto [swirlie]'s head!"), span_userdanger("[user] slams the toilet seat onto your head!"), span_italics("You hear reverberating porcelain."))
swirlie.adjustBruteLoss(5)
else if(user.pulling && isliving(user.pulling) && user.combat_mode)
user.changeNext_move(CLICK_CD_MELEE)
var/mob/living/GM = user.pulling
if(user.grab_state >= GRAB_AGGRESSIVE)
if(GM.loc != get_turf(src))
to_chat(user, span_warning("[GM] needs to be on [src]!"))
return
if(!swirlie)
if(open)
GM.visible_message(span_danger("[user] starts to give [GM] a swirlie!"), span_userdanger("[user] starts to give you a swirlie..."))
swirlie = GM
if(do_after(user, 3 SECONDS, src, timed_action_flags = IGNORE_HELD_ITEM))
GM.visible_message(span_danger("[user] gives [GM] a swirlie!"), span_userdanger("[user] gives you a swirlie!"), span_italics("You hear a toilet flushing."))
if(iscarbon(GM))
var/mob/living/carbon/C = GM
if(!C.internal)
C.adjustOxyLoss(5)
else
GM.adjustOxyLoss(5)
swirlie = null
else
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
GM.visible_message(span_danger("[user] slams [GM.name] into [src]!"), span_userdanger("[user] slams you into [src]!"))
GM.adjustBruteLoss(5)
else
to_chat(user, span_warning("You need a tighter grip!"))
else if(cistern && !open && user.CanReach(src))
if(!contents.len)
to_chat(user, span_notice("The cistern is empty."))
else
var/obj/item/I = pick(contents)
if(ishuman(user))
user.put_in_hands(I)
else
I.forceMove(drop_location())
to_chat(user, span_notice("You find [I] in the cistern."))
w_items -= I.w_class
else
open = !open
update_appearance(UPDATE_ICON)
/obj/structure/toilet/update_icon_state()
. = ..()
icon_state = "toilet[open][cistern]"
/obj/structure/toilet/attackby(obj/item/I, mob/living/user, params)
if(I.tool_behaviour == TOOL_CROWBAR)
to_chat(user, span_notice("You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]..."))
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
if(I.use_tool(src, user, 30))
user.visible_message("[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!", span_notice("You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!"), span_italics("You hear grinding porcelain."))
cistern = !cistern
update_appearance(UPDATE_ICON)
else if(cistern && !user.combat_mode)
if(I.w_class > WEIGHT_CLASS_NORMAL)
to_chat(user, span_warning("[I] does not fit!"))
return
if(w_items + I.w_class > WEIGHT_CLASS_HUGE)
to_chat(user, span_warning("The cistern is full!"))
return
if(!user.transferItemToLoc(I, src))
to_chat(user, span_warning("\The [I] is stuck to your hand, you cannot put it in the cistern!"))
return
w_items += I.w_class
to_chat(user, span_notice("You carefully place [I] into the cistern."))
else if(istype(I, /obj/item/reagent_containers) && !user.combat_mode)
if (!open)
return
var/obj/item/reagent_containers/RG = I
RG.reagents.add_reagent(/datum/reagent/water, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
to_chat(user, span_notice("You fill [RG] from [src]. Gross."))
else
return ..()
/obj/structure/toilet/secret
var/obj/item/secret
var/secret_type = null
/obj/structure/toilet/secret/Initialize(mapload)
. = ..()
if (secret_type)
secret = new secret_type(src)
secret.desc += " It's a secret!"
w_items += secret.w_class
contents += secret
/obj/structure/urinal
name = "urinal"
desc = "The HU-452, an experimental urinal. Comes complete with experimental urinal cake."
icon = 'icons/obj/watercloset.dmi'
icon_state = "urinal"
density = FALSE
anchored = TRUE
var/exposed = 0 // can you currently put an item inside
var/obj/item/hiddenitem = null // what's in the urinal
/obj/structure/urinal/Initialize(mapload)
. = ..()
hiddenitem = new /obj/item/reagent_containers/food/snacks/urinalcake
/obj/structure/urinal/attack_hand(mob/living/user, modifiers)
. = ..()
if(.)
return
if(user.pulling && isliving(user.pulling))
var/mob/living/GM = user.pulling
if(user.grab_state >= GRAB_AGGRESSIVE)
if(GM.loc != get_turf(src))
to_chat(user, span_notice("[GM.name] needs to be on [src]."))
return
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message(span_danger("[user] slams [GM] into [src]!"), span_danger("You slam [GM] into [src]!"))
GM.adjustBruteLoss(8)
else
to_chat(user, span_warning("You need a tighter grip!"))
else if(exposed)
if(!hiddenitem)
to_chat(user, span_notice("There is nothing in the drain holder."))
else
if(ishuman(user))
user.put_in_hands(hiddenitem)
else
hiddenitem.forceMove(get_turf(src))
to_chat(user, span_notice("You fish [hiddenitem] out of the drain enclosure."))
hiddenitem = null
else
return ..()
/obj/structure/urinal/attackby(obj/item/I, mob/living/user, params)
if(exposed)
if (hiddenitem)
to_chat(user, span_warning("There is already something in the drain enclosure."))
return
if(I.w_class > 1)
to_chat(user, span_warning("[I] is too large for the drain enclosure."))
return
if(!user.transferItemToLoc(I, src))
to_chat(user, span_warning("\[I] is stuck to your hand, you cannot put it in the drain enclosure!"))
return
hiddenitem = I
to_chat(user, span_notice("You place [I] into the drain enclosure."))
else
return ..()
/obj/structure/urinal/screwdriver_act(mob/living/user, obj/item/I)
if(..())
return TRUE
to_chat(user, span_notice("You start to [exposed ? "screw the cap back into place" : "unscrew the cap to the drain protector"]..."))
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
if(I.use_tool(src, user, 20))
user.visible_message("[user] [exposed ? "screws the cap back into place" : "unscrew the cap to the drain protector"]!",
span_notice("You [exposed ? "screw the cap back into place" : "unscrew the cap on the drain"]!"),
span_italics("You hear metal and squishing noises."))
exposed = !exposed
return TRUE
/obj/item/reagent_containers/food/snacks/urinalcake
name = "urinal cake"
desc = "The noble urinal cake, protecting the station's pipes from the station's pee. Do not eat."
icon = 'icons/obj/misc.dmi'
icon_state = "urinalcake"
item_state = "urinalcake"
w_class = WEIGHT_CLASS_TINY
list_reagents = list(/datum/reagent/chlorine = 10, /datum/reagent/ammonia = 5)
foodtype = TOXIC | GROSS
/obj/item/reagent_containers/food/snacks/urinalcake/attack_self(mob/living/user)
user.visible_message(span_notice("[user] squishes [src]!"), span_notice("You squish [src]."), "<i>You hear a squish.</i>")
icon = 'icons/obj/misc.dmi'
icon_state = "urinalcake_squish"
addtimer(VARSET_CALLBACK(src, icon_state, "urinalcake"), 8)
/obj/item/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 = 'icons/obj/watercloset.dmi'
icon_state = "rubberducky"
item_state = "rubberducky"
/obj/structure/sink
name = "sink"
icon = 'icons/obj/watercloset.dmi'
icon_state = "sink"
desc = "A sink used for washing one's hands and face."
anchored = TRUE
var/busy = FALSE //Something's being washed at the moment
var/dispensedreagent = /datum/reagent/water // for whenever plumbing happens
/obj/structure/sink/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!user || !istype(user))
return
if(!iscarbon(user))
return
if(!Adjacent(user))
return
if(busy)
to_chat(user, span_notice("Someone's already washing here."))
return
var/selected_area = parse_zone(user.zone_selected)
var/washing_face = 0
if(selected_area in list(BODY_ZONE_HEAD, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_PRECISE_EYES))
washing_face = 1
user.visible_message(span_notice("[user] starts washing [user.p_their()] [washing_face ? "face" : "hands"]..."), \
span_notice("You start washing your [washing_face ? "face" : "hands"]..."))
busy = TRUE
if(!do_after(user, 4 SECONDS, src))
busy = FALSE
return
busy = FALSE
if(washing_face)
SEND_SIGNAL(user, COMSIG_COMPONENT_CLEAN_FACE_ACT, CLEAN_WASH)
user.adjust_drowsiness_up_to(-rand(2,3), 0) //Washing your face wakes you up if you're falling asleep
user.wash_cream()
else if(ishuman(user))
var/mob/living/carbon/human/human_user = user
if(!human_user.wash_hands(CLEAN_WASH))
to_chat(user, span_warning("Your hands are covered by something!"))
return
else
user.wash(CLEAN_WASH)
user.visible_message(span_notice("[user] washes [user.p_their()] [washing_face ? "face" : "hands"] using [src]."), \
span_notice("You wash your [washing_face ? "face" : "hands"] using [src]."))
/obj/structure/sink/attackby(obj/item/O, mob/living/user, params)
if(busy)
to_chat(user, span_warning("Someone's already washing here!"))
return
// If it's refillable, fill it up
if(O.is_refillable())
if(!O.reagents.holder_full())
var/transfer_amount = 10
if(istype(O, /obj/item/reagent_containers))
var/obj/item/reagent_containers/R = O
transfer_amount = R.amount_per_transfer_from_this
O.reagents.add_reagent(dispensedreagent, min(O.reagents.maximum_volume - O.reagents.total_volume, transfer_amount))
to_chat(user, span_notice("You fill [O] from [src]."))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return TRUE
to_chat(user, span_notice("\The [O] is full."))
return FALSE
if(istype(O, /obj/item/melee/baton))
var/obj/item/melee/baton/B = O
if(B.cell)
if(B.cell.charge > 0 && B.status == 1)
flick("baton_active", src)
var/stunforce = B.stunforce
user.Paralyze(stunforce)
user.adjust_stutter(stunforce/(2 SECONDS))
B.deductcharge(B.hitcost)
user.visible_message(span_warning("[user] shocks [user.p_them()]self while attempting to wash the active [B.name]!"), \
span_userdanger("You unwisely attempt to wash [B] while it's still on."))
playsound(src, "sparks", 50, 1)
return
if(istype(O, /obj/item/stack/medical/gauze))
var/obj/item/stack/medical/gauze/G = O
new /obj/item/reagent_containers/glass/rag(src.loc)
to_chat(user, span_notice("You tear off a strip of gauze and make a rag."))
G.use(1)
return
//yogs start - BANDAGES
if(istype(O, /obj/item/medical/bandage/))
var/obj/item/medical/bandage/B = O
B.wash2(O, user)
return
//yogs end
if(!istype(O))
return
if(O.item_flags & ABSTRACT) //Abstract items like grabs won't wash. No-drop items will though because it's still technically an item in your hand.
return
if(!user.combat_mode)
to_chat(user, span_notice("You start washing [O]..."))
busy = TRUE
if(!do_after(user, 4 SECONDS, src))
busy = FALSE
return 1
busy = FALSE
O.wash(CLEAN_WASH)
O.acid_level = 0
create_reagents(5)
reagents.add_reagent(dispensedreagent, 5)
reagents.reaction(O, TOUCH)
user.visible_message(span_notice("[user] washes [O] using [src]."), \
span_notice("You wash [O] using [src]."))
return 1
else
return ..()
/obj/structure/sink/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 3)
qdel(src)
/obj/structure/sink/kitchen
name = "kitchen sink"
icon_state = "sink_alt"
/obj/structure/sink/puddle //splishy splashy ^_^
name = "puddle"
desc = "A puddle used for washing one's hands and face."
icon_state = "puddle"
resistance_flags = UNACIDABLE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/sink/puddle/attack_hand(mob/M)
icon_state = "puddle-splash"
. = ..()
icon_state = "puddle"
/obj/structure/sink/puddle/attackby(obj/item/O, mob/user, params)
icon_state = "puddle-splash"
. = ..()
icon_state = "puddle"
/obj/structure/sink/puddle/deconstruct(disassembled = TRUE)
qdel(src)
//Shower Curtains//
//Defines used are pre-existing in layers.dm//
/obj/structure/curtain
name = "curtain"
desc = "Contains less than 1% mercury."
icon = 'icons/obj/watercloset.dmi'
icon_state = "open"
color = "#ACD1E9" //Default color, didn't bother hardcoding other colors, mappers can and should easily change it.
alpha = 200 //Mappers can also just set this to 255 if they want curtains that can't be seen through
layer = SIGN_LAYER
anchored = TRUE
opacity = FALSE
density = FALSE
var/open = TRUE
/// if it can be seen through when closed
var/opaque_closed = FALSE
/obj/structure/curtain/Initialize(mapload)
// see-through curtains should let emissives shine through
if(!opaque_closed)
blocks_emissive = EMISSIVE_BLOCK_NONE
return ..()
/obj/structure/curtain/proc/toggle()
open = !open
if(open)
layer = SIGN_LAYER
set_opacity(FALSE)
else
layer = WALL_OBJ_LAYER
if(opaque_closed)
set_opacity(TRUE)
update_appearance()
/obj/structure/curtain/update_icon_state()
icon_state = "[open ? "open" : "closed"]"
return ..()
/obj/structure/curtain/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/toy/crayon))
color = input(user,"","Choose Color",color) as color
else
return ..()
/obj/structure/curtain/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 50)
return TRUE
/obj/structure/curtain/wirecutter_act(mob/living/user, obj/item/I)
if(anchored)
return TRUE
user.visible_message(span_warning("[user] cuts apart [src]."),
span_notice("You start to cut apart [src]."), "You hear cutting.")
if(I.use_tool(src, user, 50, volume=100) && !anchored)
to_chat(user, span_notice("You cut apart [src]."))
deconstruct()
return TRUE
/obj/structure/curtain/attack_hand(mob/user)
. = ..()
if(.)
return
playsound(loc, 'sound/effects/curtain.ogg', 50, 1)
toggle()
/obj/structure/curtain/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/cloth (loc, 2)
new /obj/item/stack/sheet/plastic (loc, 2)
new /obj/item/stack/rods (loc, 1)
qdel(src)
/obj/structure/curtain/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
if(damage_amount)
playsound(src.loc, 'sound/weapons/slash.ogg', 80, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
playsound(loc, 'sound/items/welder.ogg', 80, 1)