The welder can be used to fix the display case and fire axe cabinet. (#20920)

* Fixes #20747.
You may now use your ID to unlock the display case.
Fireaxe cabinet and display case may now be repaired with the welder.

* Welder amount.

* Fire axe welder amount.

* Adds comments to the display case

* Captains display case now requires specops access
This commit is contained in:
TheCarlSaganExpress
2016-10-18 09:08:42 +13:00
committed by oranges
parent b014ded568
commit 4a93709088
2 changed files with 41 additions and 10 deletions
+28 -10
View File
@@ -115,14 +115,26 @@
return
/obj/structure/displaycase/attackby(obj/item/weapon/W, mob/user, params)
if(W.GetID() && electronics && !broken)
if(W.GetID() && !broken)
if(allowed(user))
user << "<span class='notice'>You [open ? "close":"open"] the [src]</span>"
open = !open
update_icon()
toggle_lock(user)
else
user << "<span class='warning'>Access denied.</span>"
else if(!alert && istype(W,/obj/item/weapon/crowbar))
else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == "help" && !broken)
var/obj/item/weapon/weldingtool/WT = W
if(obj_integrity < max_integrity && WT.remove_fuel(5, user))
user << "<span class='notice'>You begin repairing [src].</span>"
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user, 40/W.toolspeed, target = src))
obj_integrity = max_integrity
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
update_icon()
user << "<span class='notice'>You repair [src].</span>"
else
user << "<span class='warning'>[src] is already in good condition!</span>"
return
else if(!alert && istype(W,/obj/item/weapon/crowbar)) //Only applies to the lab cage and player made display cases
if(broken)
if(showpiece)
user << "<span class='notice'>Remove the displayed object first.</span>"
@@ -133,8 +145,7 @@
user << "<span class='notice'>You start to [open ? "close":"open"] the [src]</span>"
if(do_after(user, 20/W.toolspeed, target = src))
user << "<span class='notice'>You [open ? "close":"open"] the [src]</span>"
open = !open
update_icon()
toggle_lock(user)
else if(open && !showpiece)
if(user.drop_item())
W.loc = src
@@ -155,6 +166,10 @@
else
return ..()
/obj/structure/displaycase/proc/toggle_lock(mob/user)
open = !open
update_icon()
/obj/structure/displaycase/attack_paw(mob/user)
return src.attack_hand(user)
@@ -188,7 +203,7 @@
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/wrench))
if(istype(I, /obj/item/weapon/wrench)) //The player can only deconstruct the wooden frame
user << "<span class='notice'>You start disassembling [src]...</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 30/I.toolspeed, target = src))
@@ -224,13 +239,16 @@
else
return ..()
//The captains display case requiring specops ID access is intentional.
//The lab cage and captains display case do not spawn with electronics, which is why req_access is needed.
/obj/structure/displaycase/captain
alert = 1
start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain
req_access = list(access_cent_specops)
/obj/structure/displaycase/labcage
name = "lab cage"
desc = "A glass lab container for storing interesting creatures."
start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr
req_access = list(access_rd)
+13
View File
@@ -26,6 +26,19 @@
/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/user, params)
if(iscyborg(user) || istype(I,/obj/item/device/multitool))
toggle_lock(user)
else if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent == "help" && !broken)
var/obj/item/weapon/weldingtool/WT = I
if(obj_integrity < max_integrity && WT.remove_fuel(2, user))
user << "<span class='notice'>You begin repairing [src].</span>"
playsound(loc, 'sound/items/Welder.ogg', 40, 1)
if(do_after(user, 40/I.toolspeed, target = src))
obj_integrity = max_integrity
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
update_icon()
user << "<span class='notice'>You repair [src].</span>"
else
user << "<span class='warning'>[src] is already in good condition!</span>"
return
else if(istype(I, /obj/item/stack/sheet/glass) && broken)
var/obj/item/stack/sheet/glass/G = I
if(G.get_amount() < 2)