ok this is going to be a pain in the ass ain't it (#2458)
lets hope nothing blows up this time (Flags PR but it works!)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
desc = "It's a basic storage unit."
|
||||
icon = 'icons/obj/closet.dmi'
|
||||
icon_state = "generic"
|
||||
density = TRUE
|
||||
density = TRUE
|
||||
var/icon_door = null
|
||||
var/icon_door_override = FALSE //override to have open overlay use icon different to its base's
|
||||
var/secure = FALSE //secure locker or not, also used if overriding a non-secure locker with a secure door overlay to add fancy lights
|
||||
@@ -38,7 +38,7 @@
|
||||
/obj/structure/closet/Initialize(mapload)
|
||||
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
|
||||
addtimer(CALLBACK(src, .proc/take_contents), 0)
|
||||
. = ..()
|
||||
. = ..()
|
||||
update_icon()
|
||||
PopulateContents()
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
else if(secure && !opened)
|
||||
to_chat(user, "<span class='notice'>Alt-click to [locked ? "unlock" : "lock"].</span>")
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
if(wall_mounted)
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
if(wall_mounted)
|
||||
return 1
|
||||
return !density
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
playsound(loc, open_sound, 15, 1, -3)
|
||||
opened = 1
|
||||
if(!dense_when_open)
|
||||
density = FALSE
|
||||
density = FALSE
|
||||
climb_time *= 0.5 //it's faster to climb onto an open thing
|
||||
dump_contents()
|
||||
update_icon()
|
||||
@@ -164,7 +164,7 @@
|
||||
return
|
||||
if(!allow_dense && AM.density)
|
||||
return
|
||||
if(AM.anchored || AM.has_buckled_mobs() || (AM.flags & NODROP))
|
||||
if(AM.anchored || AM.has_buckled_mobs() || (AM.flags_1 & NODROP_1))
|
||||
return
|
||||
else
|
||||
return
|
||||
@@ -182,7 +182,7 @@
|
||||
playsound(loc, close_sound, 15, 1, -3)
|
||||
climb_time = initial(climb_time)
|
||||
opened = 0
|
||||
density = TRUE
|
||||
density = TRUE
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
@@ -193,12 +193,12 @@
|
||||
return open(user)
|
||||
|
||||
/obj/structure/closet/deconstruct(disassembled = TRUE)
|
||||
if(ispath(material_drop) && material_drop_amount && !(flags & NODECONSTRUCT))
|
||||
if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
|
||||
new material_drop(loc, material_drop_amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/obj_break(damage_flag)
|
||||
if(!broken && !(flags & NODECONSTRUCT))
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
bust_open()
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/weapon/W, mob/user, params)
|
||||
@@ -251,7 +251,7 @@
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
else if(user.a_intent != INTENT_HARM && !(W.flags & NOBLUDGEON))
|
||||
else if(user.a_intent != INTENT_HARM && !(W.flags_1 & NOBLUDGEON_1))
|
||||
if(W.GetID() || !toggle(user))
|
||||
togglelock(user)
|
||||
return 1
|
||||
@@ -381,8 +381,8 @@
|
||||
to_chat(user, "<span class='warning'>You fail to break out of [src]!</span>")
|
||||
|
||||
/obj/structure/closet/proc/bust_open()
|
||||
welded = FALSE //applies to all lockers
|
||||
locked = FALSE //applies to critter crates and secure lockers only
|
||||
welded = FALSE //applies to all lockers
|
||||
locked = FALSE //applies to critter crates and secure lockers only
|
||||
broken = 1 //applies to secure lockers only
|
||||
open()
|
||||
|
||||
@@ -415,9 +415,9 @@
|
||||
user.visible_message("<span class='warning'>Sparks fly from [src]!</span>",
|
||||
"<span class='warning'>You scramble [src]'s lock, breaking it open!</span>",
|
||||
"<span class='italics'>You hear a faint electrical spark.</span>")
|
||||
playsound(src, "sparks", 50, 1)
|
||||
playsound(src, "sparks", 50, 1)
|
||||
broken = 1
|
||||
locked = FALSE
|
||||
locked = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
diff a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm (rejected hunks)
|
||||
@@ -193,12 +193,12 @@
|
||||
return open(user)
|
||||
|
||||
/obj/structure/closet/deconstruct(disassembled = TRUE)
|
||||
- if(ispath(material_drop) && material_drop_amount && !(flags & NODECONSTRUCT))
|
||||
+ if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
|
||||
new material_drop(loc, material_drop_amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/obj_break(damage_flag)
|
||||
- if(!broken && !(flags & NODECONSTRUCT))
|
||||
+ if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
bust_open()
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
|
||||
Reference in New Issue
Block a user