From dc73e7b5e42eeefb0a943b68f6300efc6bed80bb Mon Sep 17 00:00:00 2001 From: Geeves Date: Tue, 29 Sep 2020 01:40:50 +0200 Subject: [PATCH] Hacktool Buff (#10087) --- code/datums/uplink/devices and tools.dm | 2 +- code/game/objects/items/devices/hacktool.dm | 45 +++++++++++---------- html/changelogs/geeves-hacktool_buff.yml | 7 ++++ 3 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 html/changelogs/geeves-hacktool_buff.yml diff --git a/code/datums/uplink/devices and tools.dm b/code/datums/uplink/devices and tools.dm index ac31a96a810..87a1edca96e 100644 --- a/code/datums/uplink/devices and tools.dm +++ b/code/datums/uplink/devices and tools.dm @@ -79,7 +79,7 @@ item_cost = 6 path = /obj/item/device/multitool/hacktool desc = "Appears and functions as a standard multitool until the mode is toggled by applying a screwdriver appropriately. \ - When in hacking mode this device will grant full access to any standard airlock within 20 to 40 seconds. \ + When in hacking mode this device will grant full access to any standard airlock within 7 to 13 seconds. \ This device will also be able to immediately access the last 6 to 8 hacked airlocks." /datum/uplink_item/item/tools/space_suit diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm index d917004def6..0ea4709fbea 100644 --- a/code/game/objects/items/devices/hacktool.dm +++ b/code/game/objects/items/devices/hacktool.dm @@ -7,7 +7,7 @@ var/list/supported_types var/datum/topic_state/default/must_hack/hack_state - var/hack_time = 30 SECONDS + var/hack_time = 10 SECONDS var/max_known_targets = 7 var/silent = FALSE var/multihack = FALSE @@ -32,66 +32,67 @@ /obj/item/device/multitool/hacktool/attackby(var/obj/item/W, var/mob/user) if(W.isscrewdriver()) in_hack_mode = !in_hack_mode - playsound(src.loc, 'sound/items/screwdriver.ogg', 50, 1) + playsound(src.loc, 'sound/items/screwdriver.ogg', 50, TRUE) else ..() /obj/item/device/multitool/hacktool/resolve_attackby(atom/A, mob/user) sanity_check() - if(!in_hack_mode) + if(!in_hack_mode || istype(A, /obj/item/storage)) return ..() if(!attempt_hack(user, A)) - return 0 + return FALSE if(A.Adjacent(user)) A.ui_interact(user) - return 1 + return TRUE /obj/item/device/multitool/hacktool/proc/attempt_hack(var/mob/user, var/atom/target) if(is_hacking && !multihack) - to_chat(user, "You are already hacking!") - return 0 + to_chat(user, SPAN_WARNING("You are already hacking!")) + return FALSE if(target in current_hacks) to_chat(user, SPAN_WARNING("You are already hacking this door!")) - return 0 + return FALSE if(!is_type_in_list(target, supported_types)) to_chat(user, "[icon2html(src, user)] Unable to hack this target!") - return 0 + return FALSE if(istype(target, /obj/machinery/door/airlock)) var/obj/machinery/door/airlock/door = target if(door.hackProof) to_chat(user, SPAN_WARNING("Hacking [target] is beyond the capabilities of this device!")) - return 0 + return FALSE var/found = known_targets.Find(target) if(found) known_targets.Swap(1, found) // Move the last hacked item first - return 1 + return TRUE - to_chat(user, "You begin hacking \the [target]...") - is_hacking = 1 + to_chat(user, SPAN_NOTICE("You begin hacking \the [target]...")) + is_hacking = TRUE current_hacks += target - // On average hackin takes ~30 seconds. Fairly small random span to avoid people simply aborting and trying again - var/hack_result = do_after(user, hack_time + rand(-5,5), use_user_turf = (allow_movement ? -1 : FALSE)) - is_hacking = 0 + // On average hackin takes ~10 seconds. Fairly small random span to avoid people simply aborting and trying again + var/hack_result = do_after(user, hack_time + rand(-3 SECONDS, 3 SECONDS), use_user_turf = (allow_movement ? -1 : FALSE)) + is_hacking = FALSE current_hacks -= target if(hack_result && in_hack_mode) - to_chat(user, "Your hacking attempt was succesful!") + to_chat(user, SPAN_NOTICE("Your hacking attempt was successful!")) if(!silent) playsound(src.loc, 'sound/piano/A#6.ogg', 75) else - to_chat(user, "Your hacking attempt failed!") - return 0 + to_chat(user, SPAN_WARNING("Your hacking attempt failed!")) + return FALSE known_targets.Insert(1, target) // Insert the newly hacked target first, destroyed_event.register(target, src, /obj/item/device/multitool/hacktool/proc/on_target_destroy) - return 1 + return TRUE /obj/item/device/multitool/hacktool/proc/sanity_check() - if(max_known_targets < 1) max_known_targets = 1 + if(max_known_targets < 1) + max_known_targets = 1 // Cut away the oldest items if the capacity has been reached if(known_targets.len > max_known_targets) for(var/i = (max_known_targets + 1) to known_targets.len) @@ -103,7 +104,7 @@ known_targets -= target /obj/item/device/multitool/hacktool/rig //For ninjas; Credits to BurgerBB - hack_time = 50 + hack_time = 5 SECONDS max_known_targets = 10 in_hack_mode = TRUE silent = TRUE diff --git a/html/changelogs/geeves-hacktool_buff.yml b/html/changelogs/geeves-hacktool_buff.yml new file mode 100644 index 00000000000..50846618e90 --- /dev/null +++ b/html/changelogs/geeves-hacktool_buff.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - tweak: "Hacktools now hack in 10 seconds on average, rather than 30 seconds." + - bugfix: "Hacktools can now be put into storage items while in hacking mode." \ No newline at end of file