From 2e33ce98ef6677058172b0cd684050075161edfb Mon Sep 17 00:00:00 2001 From: dj-34 Date: Wed, 4 Oct 2023 21:52:13 +0500 Subject: [PATCH] Feat: Detective spy spiders (#290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Что этот PR делает Добавляет шпионские жучки детективу Ориг PR: https://github.com/ss220-space/Paradise/pull/956 ## Почему это хорошо для игры - ## Изображения изменений ![image](https://github.com/ss220club/Paradise-SS220/assets/20109643/9648e59f-97d1-400f-a867-3dd29cccb299) ## Тестирование В игре ## Changelog :cl: add: Шпионские жучки /:cl: --- goon/browserassets/css/browserOutput-dark.css | 1 + goon/browserassets/css/browserOutput.css | 1 + modular_ss220/modular_ss220.dme | 1 + modular_ss220/spy_spider/_spy_spider.dm | 9 + modular_ss220/spy_spider/_spy_spider.dme | 3 + modular_ss220/spy_spider/code/spy_spider.dm | 164 ++++++++++++++++++ modular_ss220/spy_spider/icons/spy_spider.dmi | Bin 0 -> 420 bytes 7 files changed, 179 insertions(+) create mode 100644 modular_ss220/spy_spider/_spy_spider.dm create mode 100644 modular_ss220/spy_spider/_spy_spider.dme create mode 100644 modular_ss220/spy_spider/code/spy_spider.dm create mode 100644 modular_ss220/spy_spider/icons/spy_spider.dmi diff --git a/goon/browserassets/css/browserOutput-dark.css b/goon/browserassets/css/browserOutput-dark.css index a18abd6ee2e1..89ed36b51ed0 100644 --- a/goon/browserassets/css/browserOutput-dark.css +++ b/goon/browserassets/css/browserOutput-dark.css @@ -272,6 +272,7 @@ em {font-style: normal;font-weight: bold;} .siliconsay {font-family: 'Courier New', Courier, monospace;} .deadsay {color: #e2c1ff;} .radio {color: #20b142;} +.spyradio {color: #776f96;} /* SS220 EDIT - ADDITION */ .deptradio {color: #993399;} .comradio {color: #5F5CFF;} .syndradio {color: #8f4a4b;} diff --git a/goon/browserassets/css/browserOutput.css b/goon/browserassets/css/browserOutput.css index a9560a4c3b3f..79bee990e2de 100644 --- a/goon/browserassets/css/browserOutput.css +++ b/goon/browserassets/css/browserOutput.css @@ -267,6 +267,7 @@ em {font-style: normal; font-weight: bold;} .siliconsay {font-family: 'Courier New', Courier, monospace;} .deadsay {color: #5c00e6;} .radio {color: #408010;} +.spyradio {color: #776f96;} /* SS220 EDIT - ADDITION */ .deptradio {color: #993399;} .comradio {color: #204090;} .syndradio {color: #6D3F40;} diff --git a/modular_ss220/modular_ss220.dme b/modular_ss220/modular_ss220.dme index c8fa37f5335e..9220c1e18d91 100644 --- a/modular_ss220/modular_ss220.dme +++ b/modular_ss220/modular_ss220.dme @@ -27,6 +27,7 @@ #include "hydroponics/hydroponics.dme" #include "objects/_objects.dme" #include "sechailer/sechailer.dme" +#include "spy_spider/_spy_spider.dme" #include "unique_objects/_unique_objects.dme" #include "vending/vending.dme" #include "wire_splicing/wiresplicing.dme" diff --git a/modular_ss220/spy_spider/_spy_spider.dm b/modular_ss220/spy_spider/_spy_spider.dm new file mode 100644 index 000000000000..82412e13b86f --- /dev/null +++ b/modular_ss220/spy_spider/_spy_spider.dm @@ -0,0 +1,9 @@ +/datum/modpack/spy_spider + name = "Шпионские жучки" + desc = "Шпионские жучки для детектива." + author = "dj-34, Vallat" + +#define SPY_SPIDER_FREQ 1251 + +/datum/modpack/spy_spider/initialize() + SSradio.radiochannels |= list("Spy Spider" = SPY_SPIDER_FREQ) diff --git a/modular_ss220/spy_spider/_spy_spider.dme b/modular_ss220/spy_spider/_spy_spider.dme new file mode 100644 index 000000000000..01178a77f1f6 --- /dev/null +++ b/modular_ss220/spy_spider/_spy_spider.dme @@ -0,0 +1,3 @@ +#include "_spy_spider.dm" + +#include "code/spy_spider.dm" diff --git a/modular_ss220/spy_spider/code/spy_spider.dm b/modular_ss220/spy_spider/code/spy_spider.dm new file mode 100644 index 000000000000..7bf84ad0f2e9 --- /dev/null +++ b/modular_ss220/spy_spider/code/spy_spider.dm @@ -0,0 +1,164 @@ +/datum/controller/subsystem/radio + var/list/syndicate_blacklist = list(SPY_SPIDER_FREQ) + +/datum/controller/subsystem/radio/frequency_span_class(frequency) + if(frequency == SPY_SPIDER_FREQ) + return "spyradio" + return ..() + +/obj/item/radio/spy_spider + name = "шпионский жучок" + desc = "Кажется, ты видел такого в фильмах про шпионов." + icon = 'modular_ss220/spy_spider/icons/spy_spider.dmi' + icon_state = "spy_spider" + frequency = SPY_SPIDER_FREQ + freqlock = SPY_SPIDER_FREQ + listening = FALSE + broadcasting = FALSE + canhear_range = 3 + +/obj/item/radio/spy_spider/examine(mob/user) + . = ..() + . += span_info("Сейчас он [broadcasting ? "включён" : "выключен"].") + +/obj/item/radio/spy_spider/attack_self(mob/user) + broadcasting = !broadcasting + if(broadcasting) + to_chat(user, span_info("Ты включаешь жучок.")) + else + to_chat(user, span_info("Ты выключил жучок.")) + return TRUE + +/obj/item/radio/receive_range(freq, level) + if(syndiekey && !(freq in SSradio.syndicate_blacklist)) + return -1 + . = ..() + +/obj/item/encryptionkey/spy_spider + name = "Spy Encryption Key" + icon = 'modular_ss220/spy_spider/icons/spy_spider.dmi' + icon_state = "spy_cypherkey" + channels = list("Spy Spider" = TRUE) + +/obj/item/storage/lockbox/spy_kit + name = "набор жучков" + desc = "Не самый легальный из способов достать информацию, но какая разница, если никто не узнает?" + storage_slots = 5 + req_access = list(ACCESS_FORENSICS_LOCKERS) + +/obj/item/storage/lockbox/spy_kit/Initialize(mapload) + . = ..() + new /obj/item/radio/spy_spider(src) + new /obj/item/radio/spy_spider(src) + new /obj/item/radio/spy_spider(src) + new /obj/item/encryptionkey/spy_spider(src) + new /obj/item/encryptionkey/spy_spider(src) + +/** + * CLOTHING PART + */ +/obj/item/clothing + var/obj/item/radio/spy_spider/spy_spider_attached + +/obj/item/clothing/Destroy() + QDEL_NULL(spy_spider_attached) + return ..() + +/obj/item/clothing/emp_act(severity) + . = ..() + spy_spider_attached?.emp_act(severity) + +/obj/item/clothing/hear_talk(mob/M, list/message_pieces) + . = ..() + spy_spider_attached?.hear_talk(M, message_pieces) + +/obj/item/clothing/attackby(obj/item/I, mob/user, params) + if(!istype(I, /obj/item/radio/spy_spider)) + return ..() + if(spy_spider_attached || !((slot_flags & SLOT_OCLOTHING) || (slot_flags & SLOT_ICLOTHING))) + to_chat(user, span_warning("Ты не находишь места для жучка!")) + return TRUE + var/obj/item/radio/spy_spider/spy_spider = I + + if(!spy_spider.broadcasting) + to_chat(user, span_warning("Жучок выключен!")) + return TRUE + + user.unEquip(spy_spider) + spy_spider.forceMove(src) + spy_spider_attached = spy_spider + to_chat(user, span_info("Ты незаметно прикрепляешь жучок к [src].")) + return TRUE + +/obj/item/clothing/proc/remove_spy_spider() + set name = "Снять жучок" + set category = "Object" + set src in range(1, usr) + + if(!ishuman(usr)) + return + var/mob/living/carbon/human/user = usr + + 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 + + verbs -= /obj/item/clothing/proc/remove_spy_spider + +/** + * HUMAN PART + */ +/mob/living/carbon/human/attackby(obj/item/I, mob/living/user, def_zone) + if(!istype(I, /obj/item/radio/spy_spider)) + return ..() + + if(!(w_uniform || wear_suit)) + to_chat(user, span_warning("У тебя нет желания лезть к [src] в трусы. Жучок надо крепить на одежду!")) + return TRUE + + var/obj/item/radio/spy_spider/spy_spider = I + var/obj/item/clothing/clothing_for_attach = wear_suit || w_uniform + if(clothing_for_attach.spy_spider_attached) + to_chat(user, span_warning("Ты не находишь места для жучка!")) + return TRUE + + if(!spy_spider.broadcasting) + to_chat(user, span_warning("Жучок выключен!")) + return TRUE + + var/attempt_cancel_message = span_warning("Ты не успеваешь установить жучок.") + if(!do_after_once(user, 3 SECONDS, TRUE, src, TRUE, attempt_cancel_message)) + return TRUE + + user.unEquip(spy_spider) + spy_spider.forceMove(clothing_for_attach) + clothing_for_attach.spy_spider_attached = spy_spider + to_chat(user, span_info("Ты незаметно прикрепляешь жучок к одежде [src].")) + return TRUE + +/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob, params) + if(istype(W, /obj/item/radio/spy_spider)) + return + . = ..() + +// Spy spider detection +/obj/item/detective_scanner/scan(atom/A, mob/user) + . = ..() + var/found_spy_device = FALSE + if(!scanning) + scanning = TRUE + + if(istype(A, /obj/item/clothing)) + var/obj/item/clothing/scanned_clothing = A + if(scanned_clothing.spy_spider_attached) + found_spy_device = TRUE + + if(found_spy_device) + sleep(1 SECONDS) + add_log(span_info("Найдено шпионское устройство!")) + if(!(/obj/item/clothing/proc/remove_spy_spider in A.verbs)) + A.verbs += /obj/item/clothing/proc/remove_spy_spider + + scanning = FALSE diff --git a/modular_ss220/spy_spider/icons/spy_spider.dmi b/modular_ss220/spy_spider/icons/spy_spider.dmi new file mode 100644 index 0000000000000000000000000000000000000000..85edd2915d11dfa9f90cb7df00c3ed988372e491 GIT binary patch literal 420 zcmV;V0bBlwP)nP1GQPMVGbOc1iHkEOv#1y-XvoExR+N~V3SpxtO|C4+NG-}vt;D5T zS;5uM1?&<4k^U-ry}Uew00029NklXkaa6tgga>d68A&yZ2d3FMpaF2e