Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
Update large_storage_parent.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredoChicken authored Feb 25, 2020
1 parent 2ff72b1 commit 8b93214
Showing 1 changed file with 30 additions and 21 deletions.
51 changes: 30 additions & 21 deletions code/obj/storage/large_storage_parent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
var/made_stuff
New()
..()
SPAWN_DBG(1 DECI SECOND)
SPAWN_DBG(1)
src.update_icon()
//I wonder what it would do for world initialization time to do this when the locker is opened instead.
//src.make_my_stuff()
Expand Down Expand Up @@ -133,7 +133,7 @@
sleep(1)
src.pixel_x = 0
src.pixel_y = 0
SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
src.jiggled = 0

if (prob(10) && src.can_flip_bust)
Expand Down Expand Up @@ -161,7 +161,7 @@
if (src.welded)
user.show_text("It won't open!", "red")
return
else if (!src.toggle())
else if (!src.toggle(user))
return src.attackby(null, user)

attackby(obj/item/W as obj, mob/user as mob)
Expand Down Expand Up @@ -214,7 +214,8 @@
I.setMaterial(M)
src.visible_message("<span style='color:red'>[user] takes apart [src] with [W].</span>")
qdel(src)
return
return

else if (!issilicon(user))
if (istype(W, /obj/item/grab))
return src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
Expand Down Expand Up @@ -359,7 +360,7 @@
user.u_equip(O)
O.set_loc(get_turf(user))

SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
if (istype(O, /obj/item/raw_material/))
user.visible_message("<span style='color:blue'>[user] begins quickly stuffing materials into [src]!</span>",\
"<span style='color:blue'>You begin quickly stuffing materials into [src]!</span>")
Expand Down Expand Up @@ -387,7 +388,7 @@
if (user.loc != staystill)
break
user.show_text("You finish stuffing materials into [src]!", "blue")
SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
if (src.open)
src.close()

Expand Down Expand Up @@ -418,7 +419,7 @@
if (user.loc != staystill)
break
user.show_text("You finish stuffing produce into [src]!", "blue")
SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
if (src.open)
src.close()

Expand All @@ -428,7 +429,7 @@
if (user != O)
user.visible_message("<span style='color:red'>[user] stuffs [O] into [src]!</span>",\
"<span style='color:red'>You stuff [O] into [src]!</span>")
SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
if (src.open)
src.close()
return ..()
Expand Down Expand Up @@ -483,7 +484,7 @@
return 1

var/obj/storage/entangled
proc/open(var/entangleLogic)
proc/open(var/entangleLogic, var/mob/user)
if (src.open)
return 0
if (!src.can_open())
Expand All @@ -500,8 +501,10 @@
entangled.close(1)
contents = entangled.contents


src.dump_contents()
if (user)
src.dump_contents(user)
else
src.dump_contents()
src.open = 1
src.update_icon()
p_class = initial(p_class)
Expand Down Expand Up @@ -583,20 +586,26 @@
return 0
return 1

proc/dump_contents()
proc/dump_contents(var/mob/user)
if(src.spawn_contents && make_my_stuff()) //Make the stuff when the locker is first opened.
spawn_contents = null

var/newloc = get_turf(src)
for (var/obj/O in src)
O.set_loc(newloc)

if(istype(O,/obj/item/mousetrap))
var/obj/item/mousetrap/m = O
if(m.armed && user)
m.triggered(user)

for (var/mob/M in src)
M.set_loc(newloc)

proc/toggle()
proc/toggle(var/mob/user)
if (src.open)
return src.close()
if (user)
return src.open(null,user)
return src.open()

proc/bust_out()
Expand All @@ -606,7 +615,7 @@
if (src.health <= 0)
src.visible_message("<span style='color:red'>[src] breaks apart!</span>")
src.dump_contents()
SPAWN_DBG(1 DECI SECOND)
SPAWN_DBG(1)
var/newloc = get_turf(src)
make_cleanable( /obj/decal/cleanable/machine_debris,newloc)
qdel(src)
Expand Down Expand Up @@ -635,7 +644,7 @@
return
else
M.show_text("Is it getting... smaller in here?", "red")
SPAWN_DBG(5 SECONDS)
SPAWN_DBG(50)

var/found = 0
for (var/mob/contained_mob in src.contents)
Expand Down Expand Up @@ -727,7 +736,7 @@

New()
..()
SPAWN_DBG(1 SECOND)
SPAWN_DBG(10)
if (isnum(src.radio_control) && radio_controller)
radio_control = max(1000, min(round(radio_control), 1500))
src.net_id = generate_net_id(src)
Expand Down Expand Up @@ -799,7 +808,7 @@
else
reply.data = list("address_1" = sender, "command" = "nack", "data" = "badpass", "sender" = src.net_id)

SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
src.radio_control.post_signal(src, reply, 2)
return //todo

Expand All @@ -811,7 +820,7 @@
reply.data["command"] = "ping_reply"
reply.data["device"] = "WNET_SECLOCKER"
reply.data["netid"] = src.net_id
SPAWN_DBG(5 DECI SECONDS)
SPAWN_DBG(5)
src.radio_control.post_signal(src, reply, 2)
return
return
Expand Down Expand Up @@ -843,4 +852,4 @@
user.show_text("<span style=\"color:red\">[src] [pick("cracks","bends","shakes","groans")].</span>")
src.bust_out()

#undef RELAYMOVE_DELAY
#undef RELAYMOVE_DELAY

0 comments on commit 8b93214

Please sign in to comment.