mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-10 15:36:56 +01:00
constructible showers, loom, sinks & barrels now deconstruct
Deconstruction: Loom - Screwdriver Wooden Barrel - Screwdriver Sink - Wrench Shower - Screwdriver > Wrench Securing: Loom - Wrench Wooden Barrel - Wrench Shower - Screwdriver Adds showers as craftable objects when using metal sheets. Also organizes some things in the metal sheet crafting menu
This commit is contained in:
@@ -8,14 +8,45 @@
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/loom/attackby(obj/item/stack/sheet/W, mob/user)
|
||||
if(W.is_fabric && W.amount > 1)
|
||||
user.show_message("<span class='notice'>You start weaving the [W.name] through the loom..</span>", 1)
|
||||
if(W.use_tool(src, user, W.pull_effort))
|
||||
new W.loom_result(drop_location())
|
||||
user.show_message("<span class='notice'>You weave the [W.name] into a workable fabric.</span>", 1)
|
||||
W.amount = (W.amount - 2)
|
||||
if(W.amount < 1)
|
||||
qdel(W)
|
||||
/obj/structure/loom/attackby(obj/item/I, mob/user)
|
||||
if (user.a_intent != INTENT_HELP)
|
||||
return ..()
|
||||
if (istype(I, /obj/item/stack/sheet))
|
||||
if (!anchored)
|
||||
return to_chat(user, "<span class='notice'>You have to anchor [src] first!</span>")
|
||||
|
||||
var/obj/item/stack/sheet/W = I
|
||||
if(W.is_fabric && W.amount > 1)
|
||||
user.visible_message("<span class='notice'[user] starts weaving [W.name] through the loom.</span>",
|
||||
"<span class='notice'>You start weaving the [W.name] through the loom.</span>")
|
||||
|
||||
if(W.use_tool(src, user, W.pull_effort))
|
||||
new W.loom_result(drop_location())
|
||||
to_chat(user, "<span class='notice'>You weave the [W.name] into a workable fabric.</span>")
|
||||
W.amount = (W.amount - 2)
|
||||
if(W.amount < 1)
|
||||
qdel(W)
|
||||
else
|
||||
to_chat("<span class='notice'>You need at least 2 [W.name] to loom into fabric!</span>")
|
||||
else
|
||||
user.show_message("<span class='notice'>You need a valid fabric and at least 2 of said fabric before using this.</span>", 1)
|
||||
switch (I.tool_behaviour)
|
||||
if (TOOL_SCREWDRIVER)
|
||||
user.visible_message("<span class='info'>[user] starts disassembling [src]...</span>",
|
||||
"<span class='info'>You start disassembling [src]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 60))
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
deconstruct(TRUE)
|
||||
if (TOOL_WRENCH)
|
||||
if (anchored)
|
||||
to_chat(user, "<span class='notice'>You unsecure the [src].</span>")
|
||||
I.play_tool_sound(src)
|
||||
anchored = FALSE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You secure the [src].</span>")
|
||||
I.play_tool_sound(src)
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/loom/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/mineral/wood (get_turf(src), 10)
|
||||
qdel(src)
|
||||
|
||||
@@ -219,6 +219,9 @@
|
||||
var/watertemp = "normal" //freezing, normal, or boiling
|
||||
var/datum/looping_sound/showering/soundloop
|
||||
|
||||
/obj/machinery/shower/crafted //When created from sheets of metal
|
||||
anchored = FALSE
|
||||
|
||||
/obj/machinery/shower/Initialize()
|
||||
. = ..()
|
||||
soundloop = new(list(src), FALSE)
|
||||
@@ -227,6 +230,29 @@
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/shower/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (get_turf(src), 2)
|
||||
Destroy()
|
||||
|
||||
//Copy from /obj/structure/chair
|
||||
/obj/machinery/shower/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE, CALLBACK(src, .proc/can_user_rotate),CALLBACK(src, .proc/can_be_rotated),null)
|
||||
|
||||
/obj/machinery/shower/proc/can_be_rotated(mob/user)
|
||||
return !anchored
|
||||
|
||||
/obj/machinery/shower/proc/can_user_rotate(mob/user)
|
||||
if(istype(user, /mob/living))
|
||||
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return FALSE
|
||||
else
|
||||
return TRUE
|
||||
else if(isobserver(user) && CONFIG_GET(flag/ghost_interaction))
|
||||
return TRUE
|
||||
return FALSE
|
||||
////
|
||||
|
||||
/obj/effect/mist
|
||||
name = "mist"
|
||||
icon = 'icons/obj/watercloset.dmi'
|
||||
@@ -236,6 +262,8 @@
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
|
||||
/obj/machinery/shower/interact(mob/M)
|
||||
if (!anchored)
|
||||
return to_chat(M, "<span class='warning'>You have to connect [src] to the floor first!</span>")
|
||||
on = !on
|
||||
update_icon()
|
||||
add_fingerprint(M)
|
||||
@@ -258,25 +286,56 @@
|
||||
|
||||
/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
|
||||
if(I.type == /obj/item/analyzer)
|
||||
to_chat(user, "<span class='notice'>The water temperature seems to be [watertemp].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The water temperature seems to be <span class='bold'>[watertemp]</span>.</span>")
|
||||
return
|
||||
|
||||
if (user.a_intent != INTENT_HELP)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/shower/wrench_act(mob/living/user, obj/item/I)
|
||||
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with \the [I]...</span>")
|
||||
if(I.use_tool(src, user, 50))
|
||||
switch(watertemp)
|
||||
if("normal")
|
||||
watertemp = "freezing"
|
||||
if("freezing")
|
||||
watertemp = "boiling"
|
||||
if("boiling")
|
||||
watertemp = "normal"
|
||||
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I] to [watertemp] temperature.</span>")
|
||||
log_game("[key_name(user)] has wrenched a shower to [watertemp] at ([x],[y],[z])")
|
||||
add_hiddenprint(user)
|
||||
return TRUE
|
||||
switch (I.tool_behaviour)
|
||||
if (TOOL_WRENCH)
|
||||
if (!anchored)
|
||||
user.visible_message("<span class='notice'>[user] starts to take apart [src]...</span>", "<span class='notice'>You start dismantling [src]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 20))
|
||||
deconstruct(TRUE)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with \the [I]...</span>")
|
||||
if(I.use_tool(src, user, 50))
|
||||
switch(watertemp)
|
||||
if("normal")
|
||||
watertemp = "freezing"
|
||||
if("freezing")
|
||||
watertemp = "boiling"
|
||||
if("boiling")
|
||||
watertemp = "normal"
|
||||
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I] to [watertemp] temperature.</span>")
|
||||
log_game("[key_name(user)] has wrenched a shower to [watertemp] at ([x],[y],[z])")
|
||||
add_hiddenprint(user)
|
||||
|
||||
if (TOOL_SCREWDRIVER)
|
||||
if (!anchored)
|
||||
to_chat(user, "<span class='notice'>You begin screwing in [src] to the floor...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 30))
|
||||
user.visible_message("<span class='notice'>[user] connects [src] to the floor.</span>", "<span class='notice'>You connect [src] to the floor.</span>")
|
||||
anchored = TRUE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You start to take out [src]'s screws...</span>")
|
||||
on = FALSE
|
||||
soundloop.stop()
|
||||
update_icon()
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 20))
|
||||
user.visible_message("<span class='notice'>[user] disconnects [src] from the floor.</span>", "<span class='notice'>You disconnect [src] from the floor.</span>")
|
||||
anchored = FALSE
|
||||
|
||||
/obj/machinery/shower/examine()
|
||||
. += ..()
|
||||
if (anchored)
|
||||
. += "<span class='info'>It looks like it can be taken apart with a <span class='bold'>screwdriver</span>...</span>"
|
||||
else
|
||||
. += "<span class='info'>Its <span class='bold'>screws</span> are out of place, allowing it to be <span class='bold'>dismantled with a wrench</span>.</span>"
|
||||
|
||||
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
|
||||
cut_overlays() //once it's been on for a while, in addition to handling the water overlay.
|
||||
@@ -463,6 +522,27 @@
|
||||
anchored = TRUE
|
||||
var/busy = FALSE //Something's being washed at the moment
|
||||
var/dispensedreagent = /datum/reagent/water // for whenever plumbing happens
|
||||
layer = WALL_OBJ_LAYER
|
||||
|
||||
/*/obj/structure/sink/Initialize() //This doesn't work in the slightest. It used to at some point through development, but that made it so you cant interact with the object whatsoever. I hate this.
|
||||
. = ..()
|
||||
switch (dir) //Thinking about moving this into its own construction sequence so it can actually work, like using a screwdriver will set its pixel offset, but I feel like that's too much
|
||||
if (NORTH) //Or maybe putting it in lateinit... but that's sloppy and I feel like it wont work when spawning it in after the round starts
|
||||
pixel_x = pixel_y = 0
|
||||
layer = WALL_OBJ_LAYER
|
||||
if (EAST)
|
||||
pixel_x = 12
|
||||
pixel_y = 3
|
||||
layer = WALL_OBJ_LAYER
|
||||
if (SOUTH)
|
||||
pixel_y = 24
|
||||
pixel_x = 0
|
||||
layer = ABOVE_OBJ_LAYER
|
||||
if (WEST)
|
||||
pixel_x = -12
|
||||
pixel_y = 3
|
||||
layer = WALL_OBJ_LAYER
|
||||
*/
|
||||
|
||||
|
||||
/obj/structure/sink/attack_hand(mob/living/user)
|
||||
@@ -509,7 +589,16 @@
|
||||
|
||||
/obj/structure/sink/attackby(obj/item/O, mob/living/user, params)
|
||||
if(busy)
|
||||
to_chat(user, "<span class='warning'>Someone's already washing here!</span>")
|
||||
to_chat(user, "<span class='warning'>Someone's already washing here.</span>")
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/wrench) && user.a_intent == INTENT_HELP)
|
||||
to_chat(user, "<span class='notice'>You start deconstructing [src]...</span>")
|
||||
O.play_tool_sound(src)
|
||||
|
||||
if(O.use_tool(src, user, 20))
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/reagent_containers))
|
||||
@@ -574,16 +663,13 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/sink/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal (loc, 3)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
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."
|
||||
|
||||
Reference in New Issue
Block a user