diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 4e908808c66..59eba9bdb4b 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -46,6 +46,17 @@ user << "\blue You add cables to the frame." state = 2 icon_state = "box_1" + if(istype(P, /obj/item/stack/sheet/glass)) + var/obj/item/stack/sheet/glass/G=P + if(G.amount<1) + user << "\red How...?" + return + G.use(1) + user << "\blue You add the glass to the frame." + playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1) + new /obj/structure/displaycase_frame(src.loc) + del(src) + return else if(istype(P, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 11712a7f4c2..b4d063ba82c 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -1,3 +1,57 @@ +/obj/structure/displaycase_frame + name = "display case frame" + icon = 'icons/obj/stock_parts.dmi' + icon_state="box_glass" + var/obj/item/weapon/circuitboard/airlock/circuit=null + var/state=0 + +/obj/structure/displaycase_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) + var/pstate=state + var/turf/T=get_turf(src) + switch(state) + if(0) + if(istype(W, /obj/item/weapon/circuitboard/airlock)) + user.drop_item() + circuit=W + circuit.loc=src + state++ + playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1) + if(istype(W, /obj/item/weapon/crowbar)) + new /obj/machinery/constructable_frame(T) + new /obj/item/stack/sheet/glass(T) + del(src) + playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1) + return + + if(1) + if(isscrewdriver(W)) + var/obj/structure/displaycase/C=new(T) + if(circuit.one_access) + C.req_access = null + C.req_one_access = circuit.conf_access + else + C.req_access = circuit.conf_access + C.req_one_access = null + playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1) + del(src) + return + if(istype(W, /obj/item/weapon/crowbar)) + circuit.loc=T + circuit=null + state-- + playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1) + if(pstate!=state) + pstate=state + update_icon() + +/obj/structure/displaycase_frame/update_icon() + switch(state) + if(1) + icon_state="box_glass_circuit" + else + icon_state="box_glass" + + /obj/structure/displaycase name = "Display Case" icon = 'icons/obj/stationobjs.dmi' @@ -13,6 +67,8 @@ var/ue=null var/icon/occupant_overlay=null + var/obj/item/weapon/circuitboard/airlock/circuit + /obj/structure/displaycase/captains_laser/New() occupant=new /obj/item/weapon/gun/energy/laser/captain(src) locked=1 @@ -28,8 +84,9 @@ usr << "Nothing." /obj/structure/displaycase/proc/dump() - occupant.loc=get_turf(src) - occupant=null + if(occupant) + occupant.loc=get_turf(src) + occupant=null occupant_overlay=null /obj/structure/displaycase/ex_act(severity) @@ -75,7 +132,7 @@ src.density = 0 src.destroyed = 1 new /obj/item/weapon/shard( src.loc ) - playsound(src, "shatter", 70, 1) + playsound(get_turf(src), "shatter", 70, 1) update_icon() else playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) @@ -110,7 +167,33 @@ user << "\icon[src] \blue You close \the [src] and swipe your card, locking it." update_icon() return - if(user.a_intent == "harm") + if(istype(W,/obj/item/weapon/crowbar) && (!locked || destroyed)) + user.visible_message("[user.name] pries \the [src] apart.", \ + "You pry \the [src] apart.", \ + "You hear something pop.") + var/turf/T=get_turf(src) + playsound(T, 'sound/items/Crowbar.ogg', 50, 1) + dump() + var/obj/item/weapon/circuitboard/airlock/C=circuit + if(!C) + C=new (src) + C.one_access=!(req_access && req_access.len>0) + if(!C.one_access) + C.conf_access=req_access + else + C.conf_access=req_one_access + if(!destroyed) + var/obj/structure/displaycase_frame/F=new(T) + F.state=1 + F.circuit=C + F.circuit.loc=F + F.update_icon() + else + C.loc=T + circuit=null + new /obj/machinery/constructable_frame(T) + del(src) + if(user.a_intent == "hurt") src.health -= W.force src.healthcheck() ..() @@ -139,7 +222,7 @@ src.add_fingerprint(user) update_icon() else - if(user.a_intent == "harm") + if(user.a_intent == "hurt") user.visible_message("\red [user.name] kicks \the [src]!", \ "\red You kick \the [src]!", \ "You hear glass crack.") diff --git a/icons/obj/stock_parts.dmi b/icons/obj/stock_parts.dmi index 9e93128a698..bf9c6363063 100644 Binary files a/icons/obj/stock_parts.dmi and b/icons/obj/stock_parts.dmi differ