diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index f29c0899cf67..19aa147f8bb7 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -1,31 +1,38 @@ /obj/structure/fireaxecabinet name = "fire axe cabinet" - desc = "There is a small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if." + desc = "There is a small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if.
There are bolts under it's glass cover for easy disassembly using a wrench." icon = 'icons/obj/wallmounts.dmi' icon_state = "fireaxe" anchored = TRUE density = FALSE armor = list("melee" = 50, "bullet" = 20, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 50) - max_integrity = 150 + max_integrity = 200//yogs - increase durability to 200 integrity_failure = 50 var/locked = TRUE var/open = FALSE var/obj/item/twohanded/fireaxe/fireaxe +//yogs NOTICE - Initialize() function MIRRORED to yogstation/code/game/objects/structure/fireaxe.dm +//changes made to the below function will have no effect /obj/structure/fireaxecabinet/Initialize() . = ..() fireaxe = new update_icon() +//yogs NOTICE - Destroy() function MIRRORED to yogstation/code/game/objects/structure/fireaxe.dm +//changes made to the below function will have no effect /obj/structure/fireaxecabinet/Destroy() if(fireaxe) QDEL_NULL(fireaxe) return ..() /obj/structure/fireaxecabinet/attackby(obj/item/I, mob/user, params) + check_deconstruct(I, user)//yogs - deconstructible cabinet + if(iscyborg(user) || I.tool_behaviour == TOOL_MULTITOOL) - toggle_lock(user) + reset_lock(user) //yogs - adds reset option else if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken) + //Repairing light damage with a welder if(obj_integrity < max_integrity) if(!I.tool_start_check(user, amount=2)) return @@ -38,17 +45,23 @@ else to_chat(user, "[src] is already in good condition!") return - else if(istype(I, /obj/item/stack/sheet/glass) && broken) - var/obj/item/stack/sheet/glass/G = I + else if(istype(I, /obj/item/stack/sheet/rglass) && broken)//yogs - change to reinforced glass + //Repairing a heavily damaged fireaxe cabinet with glass + var/obj/item/stack/sheet/rglass/G = I//yogs - change to reinforced glass if(G.get_amount() < 2) - to_chat(user, "You need two glass sheets to fix [src]!") + to_chat(user, "You need two reinforced glass sheets to fix [src]!")//yogs - change to reinforced glass return to_chat(user, "You start fixing [src]...") if(do_after(user, 20, target = src) && G.use(2)) broken = 0 obj_integrity = max_integrity update_icon() + //yogs start - warn user if they use the wrong type of glass to repair + else if(istype(I, /obj/item/stack/sheet/glass) && broken) + to_chat(user, "You need reinforced glass sheets to fix [src]!") + //yogs end else if(open || broken) + //Fireaxe cabinet is open or broken, so we can access it's axe slot if(istype(I, /obj/item/twohanded/fireaxe) && !fireaxe) var/obj/item/twohanded/fireaxe/F = I if(F.wielded) @@ -61,7 +74,18 @@ update_icon() return else if(!broken) + //open the cabinet normally. toggle_open() + //yogs start - adds unlock if authorized + else if (I.GetID()) + if(obj_flags & EMAGGED) + to_chat(user, "The [name]'s locking modules are unresponsive.") + return + if (allowed(user)) + toggle_lock(user) + else + to_chat(user, "Access denied.") + //yogs end else return ..() @@ -76,6 +100,10 @@ playsound(src.loc, 'sound/items/welder.ogg', 100, 1) /obj/structure/fireaxecabinet/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) + //yogs start - adds sparks on damage + if(prob(30)) + spark_system.start() + //yogs end if(open) return . = ..() @@ -89,6 +117,8 @@ playsound(src, 'sound/effects/glassbr3.ogg', 100, 1) new /obj/item/shard(loc) new /obj/item/shard(loc) + new /obj/item/stack/rods(loc)//yogs - adds metal rods for reinforced glass + new /obj/item/stack/rods(loc)//yogs - adds metal rods for reinforced glass /obj/structure/fireaxecabinet/deconstruct(disassembled = TRUE) if(!(flags_1 & NODECONSTRUCT_1)) @@ -116,13 +146,8 @@ src.add_fingerprint(user) update_icon() return - if(locked) - to_chat(user, "The [name] won't budge!") - return - else - open = !open - update_icon() - return + toggle_open()//yogs - consolidates opening code + return /obj/structure/fireaxecabinet/attack_paw(mob/living/user) return attack_hand(user) @@ -132,13 +157,8 @@ return /obj/structure/fireaxecabinet/attack_tk(mob/user) - if(locked) - to_chat(user, "The [name] won't budge!") - return - else - open = !open - update_icon() - return + toggle_open()//yogs - consolidates opening code + return /obj/structure/fireaxecabinet/update_icon() cut_overlays() @@ -165,6 +185,8 @@ else add_overlay("glass_raised") +//yogs NOTICE - toggle_lock() function MIRRORED to yogstation/code/game/objects/structure/fireaxe.dm +//changes made to the below function will have no effect /obj/structure/fireaxecabinet/proc/toggle_lock(mob/user) to_chat(user, " Resetting circuitry...") playsound(src, 'sound/machines/locktoggle.ogg', 50, 1) @@ -182,6 +204,7 @@ to_chat(usr, "The [name] won't budge!") return else + playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)//yogs - adds open/close sound open = !open update_icon() return diff --git a/yogstation.dme b/yogstation.dme index 26eedf4896bc..e8d3eca81662 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -2905,6 +2905,7 @@ #include "yogstation\code\game\objects\items\storage\toolbox.dm" #include "yogstation\code\game\objects\items\storage\uplink_kits.dm" #include "yogstation\code\game\objects\structures\bedsheet_bin.dm" +#include "yogstation\code\game\objects\structures\fireaxe.dm" #include "yogstation\code\game\objects\structures\ghost_role_spawners.dm" #include "yogstation\code\game\objects\structures\table_frames.dm" #include "yogstation\code\game\objects\structures\tables_racks.dm" diff --git a/yogstation/code/game/objects/structures/fireaxe.dm b/yogstation/code/game/objects/structures/fireaxe.dm new file mode 100644 index 000000000000..6e89898b516b --- /dev/null +++ b/yogstation/code/game/objects/structures/fireaxe.dm @@ -0,0 +1,103 @@ +/obj/structure/fireaxecabinet + req_access = list(ACCESS_ATMOSPHERICS) //adds ATMOSPHERICS access requirement for the lock on the cabinet. + var/datum/effect_system/spark_spread/spark_system //the spark system, used for generating... sparks? + +/obj/structure/fireaxecabinet/Initialize()//<-- mirrored/overwritten proc + . = ..() + fireaxe = new + update_icon() + //Sets up a spark system + spark_system = new /datum/effect_system/spark_spread + spark_system.set_up(2, 1, src) + spark_system.attach(src) + +/obj/structure/fireaxecabinet/Destroy()//<-- mirrored/overwritten proc + if(fireaxe) + QDEL_NULL(fireaxe) + QDEL_NULL(spark_system) + return ..() + +/obj/structure/fireaxecabinet/proc/check_deconstruct(obj/item/I, mob/user) + if(istype(I, /obj/item/wrench) && !(flags_1 & NODECONSTRUCT_1) && !fireaxe && (open || broken || obj_integrity >= max_integrity)) + //User is attempting to wrench an open/broken fireaxe cabinet with NO fireaxe in it + user.visible_message("[user] disassembles the [name].", \ + "You start to disassemble the [name]...", \ + "You hear wrenching.") + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + if(do_after(user, 40/I.toolspeed, target = src)) + to_chat(user, "You disassemble the [name].") + var/obj/item/stack/sheet/metal/M = new (loc, 3)//spawn three metal for deconstruction + if (prob(50)) + M.add_fingerprint(user) + var/obj/item/stack/sheet/rglass/G = new (loc, 2)//spawn two reinforced glass for it's window + if (prob(50)) + G.add_fingerprint(user) + deconstruct()//deconstruct then spawns an additional 2 metal, so you recover more mats using a wrench to decon than just destroying it. + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + return + else if(istype(I, /obj/item/wrench) && !(flags_1 & NODECONSTRUCT_1) && !broken && !open) + //User is attempting to wrench a closed & non-broken fireaxe cab + to_chat(user, "You need to open the door first to access the [src]'s bolts!") + //Still allow damage to pass through, in case they are trying to destroy the cab's window with the wrench. + return ..() + else if(istype(I, /obj/item/wrench) && !(flags_1 & NODECONSTRUCT_1) && (open || broken) && fireaxe) + //User is attempting to wrench an open and ready fireaxe cabinet, but the axe is still in it's slot. + to_chat(user, "You need to remove the fireaxe first to deconstruct the [src]!") + return + +/obj/structure/fireaxecabinet/proc/reset_lock(mob/user) + //this happens when you hack the lock as a synthetic/AI, or with a multitool. + if(obj_flags & EMAGGED) + to_chat(user, "You try to reset the [name]'s circuits, but they're completely burnt out.") + return + if(!open) + to_chat(user, "Resetting circuitry...") + if(do_after(user, 100, target = src)) + to_chat(user, "You [locked ? "disable" : "re-enable"] the locking modules.") + src.add_fingerprint(user) + toggle_lock(user) + + +/obj/structure/fireaxecabinet/AltClick(mob/user) + //Alt-Click can be used to unlock without swiping your ID (assuming you have access), or open/close an unlocked cabinet + //This has the side-effect of allowing borgs to open it, once they unlock it. They still can't remove the axe from it though. + if(!broken) + if (locked) + if (allowed(user)) + toggle_lock() + else + to_chat(user, "Access denied.") + else + //open the cabinet normally. + toggle_open() + +/obj/structure/fireaxecabinet/toggle_lock(mob/user)//<-- mirrored/overwritten proc + //this happens when you actuate the lock status. + if(obj_flags & EMAGGED) + to_chat(user, "The [name]'s locking modules are unresponsive.") + return + if(!open) + audible_message("You hear an audible clunk as the [name]'s bolt [locked ? "retracts" : "locks into place"].") + playsound(loc, "sound/machines/locktoggle.ogg", 30, 1, -3) + locked = !locked + update_icon() + +/obj/structure/fireaxecabinet/emag_act(mob/user) + //this allows you to emag the fireaxe cabinet, unlocking it immediately. + if(obj_flags & EMAGGED) + return + if(!open && locked) + user.visible_message("Sparks fly out of the [src]'s locking modules!", \ + "You short out the [name]'s locking modules.", \ + "You hear electricity arcing.") + spark_system.start() + + src.add_fingerprint(user) + obj_flags |= EMAGGED + desc += "
Its access panel is smoking slightly." + + playsound(loc, "sound/machines/locktoggle.ogg", 30, 1, -3) + locked = 0 + audible_message("You hear an audible clunk as the [name]'s bolt retracts.") + update_icon() + //Fireaxe Cabinet is now permanently unlocked. \ No newline at end of file