mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-10 23:47:16 +01:00
Merge pull request #773 from DragonTrance/deconstructing
Adds the Ability to deconstruct various objects
This commit is contained in:
@@ -38,8 +38,10 @@
|
||||
playsound(src, 'sound/effects/bubbles.ogg', 50, TRUE)
|
||||
|
||||
/obj/structure/fermenting_barrel/attackby(obj/item/I, mob/user, params)
|
||||
var/obj/item/reagent_containers/food/snacks/grown/fruit = I
|
||||
if(istype(fruit))
|
||||
if (user.a_intent != INTENT_HELP)
|
||||
return ..()
|
||||
if (istype(I, /obj/item/reagent_containers/food/snacks/grown))
|
||||
var/obj/item/reagent_containers/food/snacks/grown/fruit = I
|
||||
if(!fruit.can_distill)
|
||||
to_chat(user, "<span class='warning'>You can't distill this into anything...</span>")
|
||||
return TRUE
|
||||
@@ -50,7 +52,32 @@
|
||||
addtimer(CALLBACK(src, .proc/makeWine, fruit), rand(80, 120) * speed_multiplier)
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
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>")
|
||||
var/reagent_calculation = 1
|
||||
if (reagents.total_volume)
|
||||
user.visible_message("<span class='warning'>Liquid starts pouring out [src] as [user] starts disassembling it!</span>",
|
||||
"<span class='warning'>Liquid starts pouring out [src], maybe you should think about this...</span>")
|
||||
reagent_calculation += 2+round(reagents.total_volume/100)/2
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 30*reagent_calculation))
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
if (reagents.total_volume)
|
||||
chem_splash(loc, round(reagent_calculation*0.75), list(reagents))
|
||||
deconstruct(TRUE)
|
||||
else if (reagents.total_volume)
|
||||
visible_message("<span class='info'>[user] stops disassembling [src].</span>")
|
||||
if (TOOL_WRENCH)
|
||||
if (anchored) //Imaginary bolts on the ground, just like anything else that can get wrenched
|
||||
to_chat(user, "<span class='notice'>You unsecure [src].</span>")
|
||||
I.play_tool_sound(src)
|
||||
anchored = FALSE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You secure [src].</span>")
|
||||
I.play_tool_sound(src)
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/fermenting_barrel/attack_hand(mob/user)
|
||||
open = !open
|
||||
@@ -69,3 +96,7 @@
|
||||
icon_state = "barrel_open"
|
||||
else
|
||||
icon_state = "barrel"
|
||||
|
||||
/obj/structure/fermenting_barrel/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/mineral/wood (get_turf(src), 10)
|
||||
qdel(src)
|
||||
|
||||
Reference in New Issue
Block a user