Skip to content

Commit

Permalink
crate/closet deconstruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Gristlebee committed Jul 12, 2024
1 parent 6bf7ff0 commit 9e73722
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
32 changes: 14 additions & 18 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
var/max_mob_size = MOB_SIZE_HUMAN //Biggest mob_size accepted by the container
var/mob_storage_capacity = 3 // how many human sized mob/living can fit together inside a closet.
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
var/cutting_tool = /obj/item/weldingtool
// defaults to welder if null
var/cutting_tool = TOOL_WELDER
var/open_sound = 'sound/machines/closet_open.ogg'
var/close_sound = 'sound/machines/closet_close.ogg'
var/open_sound_volume = 35
Expand Down Expand Up @@ -261,27 +262,22 @@
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/user)//returns TRUE if attackBy call shouldnt be continued (because tool was used/closet was of wrong type), FALSE if otherwise
. = TRUE
if(opened)
if(istype(W, cutting_tool))
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=0))
return

to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
if(W.use_tool(src, user, 40, volume=50))
if(!opened)
return
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [W].</span>",
"<span class='hear'>You hear welding.</span>")
deconstruct(TRUE)
if(W.tool_behaviour == cutting_tool && user.a_intent != INTENT_HELP)
if(!W.tool_start_check(user, amount=0))
return
else // for example cardboard box is cut with wirecutters
user.visible_message("<span class='notice'>[user] cut apart \the [src].</span>", \
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")

to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
if(W.use_tool(src, user, 40, volume=50))
if(!opened)
return
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [W].</span>",
"<span class='hear'>You hear cutting.</span>")
deconstruct(TRUE)
return
return
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
return
return
else if(W.tool_behaviour == TOOL_WELDER && can_weld_shut)
if(!W.tool_start_check(user, amount=0))
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
max_integrity = 70
integrity_failure = 0
can_weld_shut = 0
cutting_tool = /obj/item/wirecutters
cutting_tool = TOOL_WIRECUTTER
material_drop = /obj/item/stack/sheet/cardboard
delivery_icon = "deliverybox"
anchorable = FALSE
Expand Down Expand Up @@ -70,7 +70,7 @@
mob_storage_capacity = 5
resistance_flags = NONE
move_speed_multiplier = 2
cutting_tool = /obj/item/weldingtool
cutting_tool = TOOL_WELDER
open_sound = 'sound/machines/crate_open.ogg'
close_sound = 'sound/machines/crate_close.ogg'
open_sound_volume = 35
Expand Down
6 changes: 3 additions & 3 deletions code/modules/ruins/lavalandruin_code/elephantgraveyard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
anchored = TRUE
locked = TRUE
breakout_time = 900
cutting_tool = /obj/item/shovel
cutting_tool = TOOL_SHOVEL
var/lead_tomb = FALSE
var/first_open = FALSE

Expand Down Expand Up @@ -142,7 +142,7 @@
/obj/structure/closet/crate/grave/tool_interact(obj/item/S, mob/living/carbon/user)
if(user.a_intent == INTENT_HELP) //checks to attempt to dig the grave, must be done on help intent only.
if(!opened)
if(istype(S,cutting_tool) && S.tool_behaviour == TOOL_SHOVEL)
if(S.tool_behaviour == cutting_tool)
to_chat(user, "<span class='notice'>You start start to dig open \the [src] with \the [S]...</span>")
if (do_after(user,20, target = src))
opened = TRUE
Expand All @@ -164,7 +164,7 @@
return 1

else if((user.a_intent != INTENT_HELP) && opened) //checks to attempt to remove the grave entirely.
if(istype(S,cutting_tool) && S.tool_behaviour == TOOL_SHOVEL)
if(S.tool_behaviour == cutting_tool)
to_chat(user, "<span class='notice'>You start to remove \the [src] with \the [S].</span>")
if (do_after(user,15, target = src))
to_chat(user, "<span class='notice'>You remove \the [src] completely.</span>")
Expand Down

0 comments on commit 9e73722

Please sign in to comment.