Skip to content

Commit

Permalink
embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Drsmail committed Nov 22, 2024
1 parent a815d5e commit 1549761
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions modular_ss220/spy_spider/code/spy_spider.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 58 in modular_ss220/spy_spider/code/spy_spider.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Grep

modular_ss220/spy_spider/code/spy_spider.dm:58: Found a conditional statement matching the format "if (thing)" (irregular spacing), please use "if(thing)" instead.
. += "\t<a href='byond://?src=[UID()];remove_spy_spider=[spy_spider_attached.UID()];' class='warning'>Снять жучок</a>"

/obj/item/clothing/Destroy()
QDEL_NULL(spy_spider_attached)
Expand Down Expand Up @@ -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] !","<span class='notice'>Вы успешно снимаете жучок с [src].</span>")
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
Expand Down Expand Up @@ -141,6 +158,6 @@
if(scanned_clothing.spy_spider_attached)
sleep(1 SECONDS)
add_log(span_info("<B>Найдено шпионское устройство!</B>"))
scanned_clothing.remove_spy_spider()
scanned_clothing.on_spy_spider_detect()

scanning = FALSE

0 comments on commit 1549761

Please sign in to comment.