From 4d2829d8c3427522f4a2bf9e113799b614d7672e Mon Sep 17 00:00:00 2001 From: Rune Knight <30399783+Runian@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:54:35 -0700 Subject: [PATCH 1/4] steals this cm feature --- code/__DEFINES/cooldowns.dm | 1 + code/game/objects/items/multitool.dm | 40 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/code/__DEFINES/cooldowns.dm b/code/__DEFINES/cooldowns.dm index bc654295430f1..ede781721ba2d 100644 --- a/code/__DEFINES/cooldowns.dm +++ b/code/__DEFINES/cooldowns.dm @@ -57,6 +57,7 @@ #define COOLDOWN_WHISTLE_BLOW "cooldown_whistle_blow" #define COOLDOWN_WHISTLE_WARCRY "cooldown_whistle_warcry" #define COOLDOWN_ARMORED_SMOKE "cooldown_armored_smoke" +#define COOLDOWN_LOCATE_APC "cooldown_locate_apc" //Mecha cooldowns #define COOLDOWN_MECHA "mecha" diff --git a/code/game/objects/items/multitool.dm b/code/game/objects/items/multitool.dm index a97dea728da00..effebe754c63c 100644 --- a/code/game/objects/items/multitool.dm +++ b/code/game/objects/items/multitool.dm @@ -18,3 +18,43 @@ tool_behaviour = TOOL_MULTITOOL var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage + +/obj/item/tool/multitool/attack_self(mob/user) + ..() + + if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_LOCATE_APC) || !ishuman(user) || user.skills.getRating(SKILL_ENGINEER) < SKILL_ENGINEER_METAL || !user.client) + return + + var/area/current_area = get_area(src) + var/atom/area_apc = current_area ? current_area.get_apc() : null + if(!area_apc) + to_chat(user, span_warning("ERROR: Could not locate local APC.")) + user.balloon_alert(user, "could not locate!") + return + + var/dist = get_dist(src, area_apc) + var/direction = angle_to_dir(Get_Angle(get_turf(src), get_turf(area_apc))) + to_chat(user, span_notice("The local APC is located at [span_bold("[dist] units [dir2text(direction)]")].")) + user.balloon_alert(user, "[dist] units [dir2text(direction)]") + + //Create the appearance so we have something to apply the filter to. + var/mutable_appearance/apc_appearance = new(area_apc) + apc_appearance.filters += list("type" = "outline", "size" = 1, "color" = COLOR_GREEN) + //Make it an image we can give to the client + var/image/final_image = image(apc_appearance) + + final_image.layer = WALL_OBJ_LAYER + final_image.plane = GAME_PLANE + final_image.loc = get_turf(area_apc) + final_image.dir = apc_appearance.dir + final_image.alpha = 225 + user.client.images += final_image + + TIMER_COOLDOWN_START(src, COOLDOWN_LOCATE_APC, 1.5 SECONDS) + addtimer(CALLBACK(src, PROC_REF(remove_apc_highlight), user.client, final_image), 1.4 SECONDS) + + +/obj/item/tool/multitool/proc/remove_apc_highlight(client/user_client, image/highlight_image) + if(!user_client) + return + user_client.images -= highlight_image From c243dbd92d8ef99c6b09710d1131ee28710bca3f Mon Sep 17 00:00:00 2001 From: Rune Knight <30399783+Runian@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:05:24 -0700 Subject: [PATCH 2/4] extra space cringe --- code/game/objects/items/multitool.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/objects/items/multitool.dm b/code/game/objects/items/multitool.dm index effebe754c63c..42dab978b35b9 100644 --- a/code/game/objects/items/multitool.dm +++ b/code/game/objects/items/multitool.dm @@ -53,7 +53,6 @@ TIMER_COOLDOWN_START(src, COOLDOWN_LOCATE_APC, 1.5 SECONDS) addtimer(CALLBACK(src, PROC_REF(remove_apc_highlight), user.client, final_image), 1.4 SECONDS) - /obj/item/tool/multitool/proc/remove_apc_highlight(client/user_client, image/highlight_image) if(!user_client) return From fba04d8ab18c71bd54dc8e36d9effeab3025d304 Mon Sep 17 00:00:00 2001 From: Rune Knight <30399783+Runian@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:28:14 -0700 Subject: [PATCH 3/4] Update code/game/objects/items/multitool.dm Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com> --- code/game/objects/items/multitool.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/multitool.dm b/code/game/objects/items/multitool.dm index 42dab978b35b9..a35055f37f3ea 100644 --- a/code/game/objects/items/multitool.dm +++ b/code/game/objects/items/multitool.dm @@ -20,7 +20,7 @@ var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage /obj/item/tool/multitool/attack_self(mob/user) - ..() + . = ..() if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_LOCATE_APC) || !ishuman(user) || user.skills.getRating(SKILL_ENGINEER) < SKILL_ENGINEER_METAL || !user.client) return From fa4dd73811e06facdb19a8c71d5419ffa41f6004 Mon Sep 17 00:00:00 2001 From: Rune Knight <30399783+Runian@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:29:29 -0700 Subject: [PATCH 4/4] autodoc --- code/game/objects/items/multitool.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/objects/items/multitool.dm b/code/game/objects/items/multitool.dm index 42dab978b35b9..2bed4385b69c3 100644 --- a/code/game/objects/items/multitool.dm +++ b/code/game/objects/items/multitool.dm @@ -53,6 +53,7 @@ TIMER_COOLDOWN_START(src, COOLDOWN_LOCATE_APC, 1.5 SECONDS) addtimer(CALLBACK(src, PROC_REF(remove_apc_highlight), user.client, final_image), 1.4 SECONDS) +/// Removes the highlight from the APC. /obj/item/tool/multitool/proc/remove_apc_highlight(client/user_client, image/highlight_image) if(!user_client) return