Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #53290, puddles are now infinite again. #53311

Merged
merged 17 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@
/turf/open/floor/plating/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors)
"do" = (
/obj/structure/sink/puddle{
/obj/structure/legacysink/puddle{
pixel_x = -3;
pixel_y = 1
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/LavaRuins/lavaland_surface_hermit.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
/area/ruin/powered)
"j" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/turf/open/floor/plating/asteroid{
name = "dirt"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/clownplanet.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
/area/ruin/powered/clownplanet)
"as" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/turf/open/floor/grass{
color = "#1eff00"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/gondolaasteroid.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
/turf/open/floor/grass,
/area/ruin/space/has_grav)
"u" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/turf/open/floor/grass,
/area/ruin/space/has_grav)
"v" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -75076,7 +75076,7 @@
/turf/open/floor/plating,
/area/maintenance/starboard)
"tgQ" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/obj/structure/flora/junglebush/large{
pixel_y = 0
},
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/PubbyStation/PubbyStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -26713,7 +26713,7 @@
/turf/open/floor/grass,
/area/medical/medbay/zone2)
"bqU" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/obj/structure/flora/ausbushes/reedbush{
pixel_y = 6
},
Expand Down Expand Up @@ -43224,7 +43224,7 @@
/turf/open/floor/grass,
/area/hydroponics/garden/monastery)
"chk" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/obj/item/reagent_containers/glass/bucket,
/obj/effect/landmark/event_spawn,
/turf/open/floor/grass,
Expand Down Expand Up @@ -51954,7 +51954,7 @@
/turf/closed/wall/r_wall,
/area/medical/medbay/zone2)
"llS" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/obj/structure/window/reinforced{
dir = 1
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@
/turf/open/floor/holofloor,
/area/holodeck/rec_center/dodgeball)
"cD" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/turf/open/floor/holofloor/grass,
/area/holodeck/rec_center/pet_lounge)
"cE" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_nature.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/turf/open/floor/grass,
/area/shuttle/escape)
"au" = (
/obj/structure/sink/puddle,
/obj/structure/legacysink/puddle,
/turf/open/floor/grass,
/area/shuttle/escape)
"ay" = (
Expand Down
190 changes: 169 additions & 21 deletions code/game/objects/structures/watercloset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -426,27 +426,6 @@
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)

/obj/structure/sink/greyscale
icon_state = "sink_greyscale"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
Expand Down Expand Up @@ -480,6 +459,175 @@
return
return ..()

//Legacy sink and puddles, use the type legacysink for unlimited water sources like classic sinks.
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
/obj/structure/legacysink
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
var/buildstacktype = /obj/item/stack/sheet/metal
var/buildstackamount = 1

/obj/structure/legacysink/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!user || !istype(user))
return
if(!iscarbon(user))
return
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
if(!Adjacent(user))
return

if(busy)
to_chat(user, "<span class='warning'>Someone's already washing here!</span>")
return
var/selected_area = parse_zone(user.zone_selected)
var/washing_face = 0
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
if(selected_area in list(BODY_ZONE_HEAD, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_PRECISE_EYES))
washing_face = 1
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
user.visible_message("<span class='notice'>[user] starts washing [user.p_their()] [washing_face ? "face" : "hands"]...</span>", \
"<span class='notice'>You start washing your [washing_face ? "face" : "hands"]...</span>")
busy = TRUE

if(!do_after(user, 40, target = src))
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
busy = FALSE
return

busy = FALSE

if(washing_face)
SEND_SIGNAL(user, COMSIG_COMPONENT_CLEAN_FACE_ACT, CLEAN_WASH)
user.drowsyness = max(user.drowsyness - rand(2,3), 0) //Washing your face wakes you up if you're falling asleep
else if(ishuman(user))
var/mob/living/carbon/human/human_user = user
if(!human_user.wash_hands(CLEAN_WASH))
to_chat(user, "<span class='warning'>Your hands are covered by something!</span>")
return
else
user.wash(CLEAN_WASH)

user.visible_message("<span class='notice'>[user] washes [user.p_their()] [washing_face ? "face" : "hands"] using [src].</span>", \
"<span class='notice'>You wash your [washing_face ? "face" : "hands"] using [src].</span>")

/obj/structure/legacysink/attackby(obj/item/O, mob/living/user, params)
if(busy)
to_chat(user, "<span class='warning'>Someone's already washing here!</span>")
return

if(istype(O, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RG = O
if(RG.is_refillable())
if(!RG.reagents.holder_full())
RG.reagents.add_reagent(dispensedreagent, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
to_chat(user, "<span class='notice'>You fill [RG] from [src].</span>")
return TRUE
to_chat(user, "<span class='notice'>\The [RG] is full.</span>")
return FALSE
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved

if(istype(O, /obj/item/melee/baton))
var/obj/item/melee/baton/B = O
if(B.cell && B.cell.charge && B.turned_on)
flick("baton_active", src)
user.Paralyze(B.stun_time)
user.stuttering = B.stun_time/20
B.deductcharge(B.cell_hit_cost)
user.visible_message("<span class='warning'>[user] shocks [user.p_them()]self while attempting to wash the active [B.name]!</span>", \
"<span class='userdanger'>You unwisely attempt to wash [B] while it's still on.</span>")
playsound(src, B.stun_sound, 50, TRUE)
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
return

if(istype(O, /obj/item/mop))
O.reagents.add_reagent(dispensedreagent, 5)
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
return

if(O.tool_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
O.play_tool_sound(src)
deconstruct()
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)
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, "<span class='notice'>You tear off a strip of gauze and make a rag.</span>")
G.use(1)
return

if(istype(O, /obj/item/stack/ore/glass))
new /obj/item/stack/sheet/sandblock(loc)
to_chat(user, "<span class='notice'>You wet the sand in the sink and form it into a block.</span>")
O.use(1)
return

if(!istype(O))
return
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
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.a_intent != INTENT_HARM)
to_chat(user, "<span class='notice'>You start washing [O]...</span>")
busy = TRUE
if(!do_after(user, 40, target = src))
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
busy = FALSE
return 1
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
busy = FALSE
O.wash(CLEAN_WASH)
O.acid_level = 0
create_reagents(5)
reagents.add_reagent(dispensedreagent, 5)
reagents.expose(O, TOUCH)
user.visible_message("<span class='notice'>[user] washes [O] using [src].</span>", \
"<span class='notice'>You wash [O] using [src].</span>")
return 1
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
else
return ..()
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/legacysink/deconstruct()
if(!(flags_1 & NODECONSTRUCT_1))
drop_materials()
..()

/obj/structure/legacysink/proc/drop_materials()
if(buildstacktype)
new buildstacktype(loc,buildstackamount)
else
for(var/i in custom_materials)
var/datum/material/M = i
new M.sheet_type(loc, FLOOR(custom_materials[M] / MINERAL_MATERIAL_AMOUNT, 1))

/obj/structure/legacysink/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/legacysink/puddle/attack_hand(mob/M)
icon_state = "puddle-splash"
. = ..()
icon_state = "puddle"

/obj/structure/legacysink/puddle/attackby(obj/item/O, mob/user, params)
icon_state = "puddle-splash"
. = ..()
icon_state = "puddle"

/obj/structure/legacysink/puddle/deconstruct(disassembled = TRUE)
qdel(src)

/obj/structure/legacysink/greyscale
Jack7D1 marked this conversation as resolved.
Show resolved Hide resolved
icon_state = "sink_greyscale"
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
buildstacktype = null

//End legacy sink


//Shower Curtains//
//Defines used are pre-existing in layers.dm//

Expand Down