diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 6c9b9254103..a12c51ed506 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -42,6 +42,7 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ new/datum/stack_recipe("apc frame", /obj/item/wallframe/apc, 2), \ new/datum/stack_recipe("air alarm frame", /obj/item/wallframe/airalarm, 2), \ new/datum/stack_recipe("fire alarm frame", /obj/item/wallframe/firealarm, 2), \ + new/datum/stack_recipe("extinguisher cabinet frame", /obj/item/wallframe/extinguisher_cabinet, 2), \ new/datum/stack_recipe("button frame", /obj/item/wallframe/button, 1), \ null, \ new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = 1, on_floor = 1), \ diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 8741c8698e0..e011d83fa6e 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -5,9 +5,19 @@ icon_state = "extinguisher_closed" anchored = 1 density = 0 - var/obj/item/weapon/extinguisher/has_extinguisher = new/obj/item/weapon/extinguisher + var/obj/item/weapon/extinguisher/has_extinguisher var/opened = 0 +/obj/structure/extinguisher_cabinet/New(loc, ndir, building) + ..() + if(building) + dir = ndir + pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27) + pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0 + opened = 1 + icon_state = "extinguisher_empty" + else + has_extinguisher = new /obj/item/weapon/extinguisher(src) /obj/structure/extinguisher_cabinet/ex_act(severity, target) switch(severity) @@ -24,16 +34,26 @@ return -/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user, params) +/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weapon/wrench) && !has_extinguisher) + user << "You start unsecuring [name]..." + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) + if(do_after(user, 60/I.toolspeed, target = src)) + playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) + user << "You unsecure [name]." + new /obj/item/wallframe/extinguisher_cabinet(loc) + qdel(src) + return + if(isrobot(user) || isalien(user)) return - if(istype(O, /obj/item/weapon/extinguisher)) + if(istype(I, /obj/item/weapon/extinguisher)) if(!has_extinguisher && opened) if(!user.drop_item()) return - contents += O - has_extinguisher = O - user << "You place [O] in [src]." + contents += I + has_extinguisher = I + user << "You place [I] in [src]." else opened = !opened else @@ -84,3 +104,10 @@ icon_state = "extinguisher_full" else icon_state = "extinguisher_empty" + +/obj/item/wallframe/extinguisher_cabinet + name = "extinguisher cabinet frame" + desc = "Used for building wall-mounted extinguisher cabinets." + icon = 'icons/obj/apc_repair.dmi' + icon_state = "extinguisher_frame" + result_path = /obj/structure/extinguisher_cabinet diff --git a/icons/obj/apc_repair.dmi b/icons/obj/apc_repair.dmi index 8f66aa27c86..220a267fe7a 100644 Binary files a/icons/obj/apc_repair.dmi and b/icons/obj/apc_repair.dmi differ