From 1549761f159bead9369608d13b6174ec8702e104 Mon Sep 17 00:00:00 2001 From: Drsmail Date: Fri, 22 Nov 2024 14:15:16 +0300 Subject: [PATCH] embed --- modular_ss220/spy_spider/code/spy_spider.dm | 37 +++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/modular_ss220/spy_spider/code/spy_spider.dm b/modular_ss220/spy_spider/code/spy_spider.dm index 8e568041fe81..a278ab02cd5d 100644 --- a/modular_ss220/spy_spider/code/spy_spider.dm +++ b/modular_ss220/spy_spider/code/spy_spider.dm @@ -51,6 +51,12 @@ */ /obj/item/clothing var/obj/item/radio/spy_spider/spy_spider_attached + var/mob/living/carbon/human/found_by = null + +/obj/item/clothing/examine(mob/user) + . = ..() + if (found_by == user) + . += "\tСнять жучок" /obj/item/clothing/Destroy() QDEL_NULL(spy_spider_attached) @@ -82,16 +88,27 @@ to_chat(user, span_info("Ты незаметно прикрепляешь жучок к [src].")) return TRUE -/obj/item/clothing/proc/remove_spy_spider() - if(!ishuman(usr)) - return - var/mob/living/carbon/human/user = usr +/obj/item/clothing/proc/on_spy_spider_detect() + var/obj/item/clothing/I = src + I.found_by = usr + +/obj/item/clothing/Topic(href, href_list) + + if(!usr.stat && !HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) && !usr.restrained()) + if(!in_range(src, usr)) + to_chat(usr, span_info("Тебе нужно подойти ближе, чтобы снять жучок с [src].")) + return + if(href_list["remove_spy_spider"]) + var/time_taken = 5 + var/obj/item/I = locate(href_list["remove_spy_spider"]) + if(do_after(usr, time_taken, needhand = 1, target = src)) + I.forceMove(get_turf(src)) + usr.put_in_hands(I) + usr.emote("scream") // remove + usr.visible_message("[usr] Что-то снимает с [src] !","Вы успешно снимаете жучок с [src].") + src.spy_spider_attached = null + src.found_by = null - if(spy_spider_attached) - if(!user.put_in_any_hand_if_possible(spy_spider_attached, del_on_fail = FALSE)) - var/turf/user_loc = get_turf(user) - spy_spider_attached.forceMove(user_loc) - spy_spider_attached = null /** * HUMAN PART @@ -141,6 +158,6 @@ if(scanned_clothing.spy_spider_attached) sleep(1 SECONDS) add_log(span_info("Найдено шпионское устройство!")) - scanned_clothing.remove_spy_spider() + scanned_clothing.on_spy_spider_detect() scanning = FALSE