<commit_before>/*
	The equivalent of the server, for PDA and request console messages.
	Without it, PDA and request console messages cannot be transmitted.
	PDAs require the rest of the telecomms setup, but request consoles only
	require the message server.
*/

// A decorational representation of SSblackbox, usually placed alongside the message server. Also contains a traitor theft item.
/obj/machinery/blackbox_recorder
	icon = 'icons/obj/stationobjs.dmi'
	icon_state = "blackbox"
	name = "Blackbox Recorder"
	density = TRUE
	use_power = IDLE_POWER_USE
	idle_power_usage = 10
	active_power_usage = 100
	armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70)
	var/obj/item/stored

/obj/machinery/blackbox_recorder/Initialize()
	. = ..()
	stored = new /obj/item/blackbox(src)

/obj/machinery/blackbox_recorder/attack_hand(mob/living/user)
	. = ..()
	if(stored)
		user.put_in_hands(stored)
		stored = null
		to_chat(user, "<span class='notice'>You remove [stored] from [src]. The tapes stop spinning.</span>")
		update_icon()
		return
	else
		to_chat(user, "<span class='warning'>It seems that the blackbox is missing...</span>")
		return

/obj/machinery/blackbox_recorder/attackby(obj/item/I, mob/living/user, params)
	. = ..()
	if(istype(I, /obj/item/blackbox))
		if(HAS_TRAIT(I, TRAIT_NODROP) || !user.transferItemToLoc(I, src))
			to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
			return
		user.visible_message("<span class='notice'>[user] clicks [I] into [src]!</span>", \
		"<span class='notice'>You press [I] into [src], and it clicks into place. The tapes begin spinning again.</span>")
		playsound(src, 'sound/machines/click.ogg', 50, TRUE)
		stored = I
		update_icon()
		return ..()
	return ..()

/obj/machinery/blackbox_recorder/Destroy()
	if(stored)
		stored.forceMove(loc)
		new /obj/effect/decal/cleanable/oil(loc)
	return ..()

/obj/machinery/blackbox_recorder/update_icon()
	. = ..()
	if(!stored)
		icon_state = "blackbox_b"
	else
		icon_state = "blackbox"

/obj/item/blackbox
	name = "the blackbox"
	desc = "A strange relic, capable of recording data on extradimensional vertices. It lives inside the blackbox recorder for safe keeping."
	icon = 'icons/obj/stationobjs.dmi'
	icon_state = "blackcube"
	w_class = WEIGHT_CLASS_BULKY
	resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
<commit_msg>No tanner I can explain I can spell the words good<commit_after>/*
	The equivalent of the server, for PDA and request console messages.
	Without it, PDA and request console messages cannot be transmitted.
	PDAs require the rest of the telecomms setup, but request consoles only
	require the message server.
*/

// A decorational representation of SSblackbox, usually placed alongside the message server. Also contains a traitor theft item.
/obj/machinery/blackbox_recorder
	icon = 'icons/obj/stationobjs.dmi'
	icon_state = "blackbox"
	name = "Blackbox Recorder"
	density = TRUE
	use_power = IDLE_POWER_USE
	idle_power_usage = 10
	active_power_usage = 100
	armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70)
	var/obj/item/stored

/obj/machinery/blackbox_recorder/Initialize()
	. = ..()
	stored = new /obj/item/blackbox(src)

/obj/machinery/blackbox_recorder/attack_hand(mob/living/user)
	. = ..()
	if(stored)
		user.put_in_hands(stored)
		stored = null
		to_chat(user, "<span class='notice'>You remove the blackbox from [src]. The tapes stop spinning.</span>")
		update_icon()
		return
	else
		to_chat(user, "<span class='warning'>It seems that the blackbox is missing...</span>")
		return

/obj/machinery/blackbox_recorder/attackby(obj/item/I, mob/living/user, params)
	. = ..()
	if(istype(I, /obj/item/blackbox))
		if(HAS_TRAIT(I, TRAIT_NODROP) || !user.transferItemToLoc(I, src))
			to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
			return
		user.visible_message("<span class='notice'>[user] clicks [I] into [src]!</span>", \
		"<span class='notice'>You press the device into [src], and it clicks into place. The tapes begin spinning again.</span>")
		playsound(src, 'sound/machines/click.ogg', 50, TRUE)
		stored = I
		update_icon()
		return ..()
	return ..()

/obj/machinery/blackbox_recorder/Destroy()
	if(stored)
		stored.forceMove(loc)
		new /obj/effect/decal/cleanable/oil(loc)
	return ..()

/obj/machinery/blackbox_recorder/update_icon()
	. = ..()
	if(!stored)
		icon_state = "blackbox_b"
	else
		icon_state = "blackbox"

/obj/item/blackbox
	name = "the blackbox"
	desc = "A strange relic, capable of recording data on extradimensional vertices. It lives inside the blackbox recorder for safe keeping."
	icon = 'icons/obj/stationobjs.dmi'
	icon_state = "blackcube"
	w_class = WEIGHT_CLASS_BULKY
	resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF

{'fraction_non_alphanumeric': 0.13582757218381455, 'fraction_numerical': 0.00854005693371289, 'mean_word_length': 4.352557127312296, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '933124', 'n_tokens_mistral': 1880, 'n_tokens_neox': 1769, 'n_words': 456}