<commit_before>////////////////////////////////////////
//Singularity beacon
////////////////////////////////////////
/obj/machinery/power/singularity_beacon
	name = "ominous beacon"
	desc = "This looks suspicious..."
	icon = 'icons/obj/singularity.dmi'
	icon_state = "beacon"

	anchored = 0
	density = 1
	layer = BELOW_MOB_LAYER //so people can't hide it and it's REALLY OBVIOUS
	stat = 0
	verb_say = "states"
	var/cooldown = 0

	var/active = 0
	var/icontype = "beacon"


/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
	if(surplus() < 1500)
		if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>"
		return
	for(var/obj/singularity/singulo in singularities)
		if(singulo.z == z)
			singulo.target = src
	icon_state = "[icontype]1"
	active = 1
	machines |= src
	START_PROCESSING(SSobj, src)
	if(user)
		user << "<span class='notice'>You activate the beacon.</span>"


/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
	for(var/obj/singularity/singulo in singularities)
		if(singulo.target == src)
			singulo.target = null
	icon_state = "[icontype]0"
	active = 0
	if(user)
		user << "<span class='notice'>You deactivate the beacon.</span>"


/obj/machinery/power/singularity_beacon/attack_ai(mob/user)
	return


/obj/machinery/power/singularity_beacon/attack_hand(mob/user)
	if(anchored)
		return active ? Deactivate(user) : Activate(user)
	else
		user << "<span class='warning'>You need to screw the beacon to the floor first!</span>"
		return


/obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W, mob/user, params)
	if(istype(W,/obj/item/weapon/screwdriver))
		if(active)
			user << "<span class='warning'>You need to deactivate the beacon first!</span>"
			return

		if(anchored)
			anchored = 0
			user << "<span class='notice'>You unscrew the beacon from the floor.</span>"
			disconnect_from_network()
			return
		else
			if(!connect_to_network())
				user << "<span class='warning'>This device must be placed over an exposed, powered cable node!</span>"
				return
			anchored = 1
			user << "<span class='notice'>You screw the beacon to the floor and attach the cable.</span>"
			return
	else
		return ..()

/obj/machinery/power/singularity_beacon/Destroy()
	if(active)
		Deactivate()
	return ..()

//stealth direct power usage
/obj/machinery/power/singularity_beacon/process()
	if(!active)
		return PROCESS_KILL
	else
		if(surplus() > 1500)
			add_load(1500)
			if(cooldown <= world.time)
				cooldown = world.time + 100
				for(var/obj/singularity/singulo in singularities)
					if(singulo.z == z)
						say("The [singulo] is now [get_dist(src,singulo)] standard lengths away to the [dir2text(get_dir(src,singulo))]")
		else
			Deactivate()
			say("Insufficient charge detected - powering down")
		

/obj/machinery/power/singularity_beacon/syndicate
	icontype = "beaconsynd"
	icon_state = "beaconsynd0"

// SINGULO BEACON SPAWNER
/obj/item/device/sbeacondrop
	name = "suspicious beacon"
	icon = 'icons/obj/radio.dmi'
	icon_state = "beacon"
	desc = "A label on it reads: <i>Warning: Activating this device will send a special beacon to your location</i>."
	origin_tech = "bluespace=6;syndicate=5"
	w_class = WEIGHT_CLASS_SMALL
	var/droptype = /obj/machinery/power/singularity_beacon/syndicate


/obj/item/device/sbeacondrop/attack_self(mob/user)
	if(user)
		user << "<span class='notice'>Locked In.</span>"
		new droptype( user.loc )
		playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
		qdel(src)
	return<commit_msg>Fixes syndibeacons using the wrong processor (#24612)<commit_after>////////////////////////////////////////
//Singularity beacon
////////////////////////////////////////
/obj/machinery/power/singularity_beacon
	name = "ominous beacon"
	desc = "This looks suspicious..."
	icon = 'icons/obj/singularity.dmi'
	icon_state = "beacon"

	anchored = 0
	density = 1
	layer = BELOW_MOB_LAYER //so people can't hide it and it's REALLY OBVIOUS
	stat = 0
	verb_say = "states"
	var/cooldown = 0

	var/active = 0
	var/icontype = "beacon"


/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
	if(surplus() < 1500)
		if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>"
		return
	for(var/obj/singularity/singulo in singularities)
		if(singulo.z == z)
			singulo.target = src
	icon_state = "[icontype]1"
	active = 1
	if(user)
		user << "<span class='notice'>You activate the beacon.</span>"


/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
	for(var/obj/singularity/singulo in singularities)
		if(singulo.target == src)
			singulo.target = null
	icon_state = "[icontype]0"
	active = 0
	if(user)
		user << "<span class='notice'>You deactivate the beacon.</span>"


/obj/machinery/power/singularity_beacon/attack_ai(mob/user)
	return


/obj/machinery/power/singularity_beacon/attack_hand(mob/user)
	if(anchored)
		return active ? Deactivate(user) : Activate(user)
	else
		user << "<span class='warning'>You need to screw the beacon to the floor first!</span>"
		return


/obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W, mob/user, params)
	if(istype(W,/obj/item/weapon/screwdriver))
		if(active)
			user << "<span class='warning'>You need to deactivate the beacon first!</span>"
			return

		if(anchored)
			anchored = 0
			user << "<span class='notice'>You unscrew the beacon from the floor.</span>"
			disconnect_from_network()
			return
		else
			if(!connect_to_network())
				user << "<span class='warning'>This device must be placed over an exposed, powered cable node!</span>"
				return
			anchored = 1
			user << "<span class='notice'>You screw the beacon to the floor and attach the cable.</span>"
			return
	else
		return ..()

/obj/machinery/power/singularity_beacon/Destroy()
	if(active)
		Deactivate()
	return ..()

//stealth direct power usage
/obj/machinery/power/singularity_beacon/process()
	if(!active)
		return

	if(surplus() > 1500)
		add_load(1500)
		if(cooldown <= world.time)
			cooldown = world.time + 100
			for(var/obj/singularity/singulo in singularities)
				if(singulo.z == z)
					say("The [singulo] is now [get_dist(src,singulo)] standard lengths away to the [dir2text(get_dir(src,singulo))]")
	else
		Deactivate()
		say("Insufficient charge detected - powering down")
		

/obj/machinery/power/singularity_beacon/syndicate
	icontype = "beaconsynd"
	icon_state = "beaconsynd0"

// SINGULO BEACON SPAWNER
/obj/item/device/sbeacondrop
	name = "suspicious beacon"
	icon = 'icons/obj/radio.dmi'
	icon_state = "beacon"
	desc = "A label on it reads: <i>Warning: Activating this device will send a special beacon to your location</i>."
	origin_tech = "bluespace=6;syndicate=5"
	w_class = WEIGHT_CLASS_SMALL
	var/droptype = /obj/machinery/power/singularity_beacon/syndicate


/obj/item/device/sbeacondrop/attack_self(mob/user)
	if(user)
		user << "<span class='notice'>Locked In.</span>"
		new droptype( user.loc )
		playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
		qdel(src)
	return
{'fraction_non_alphanumeric': 0.15264132137263278, 'fraction_numerical': 0.010679196924391286, 'mean_word_length': 3.8109589041095893, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 45, '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': '3938021', 'n_tokens_mistral': 2763, 'n_tokens_neox': 2453, 'n_words': 563}