<commit_before>/datum/AI_Module
	var/uses = 0
	var/module_name
	var/mod_pick_name
	var/description = ""
	var/engaged = 0
	var/cost = 5
	var/one_time = 0

	var/power_type

/datum/AI_Module/large/
	uses = 1

/datum/AI_Module/small/
	uses = 5

/datum/AI_Module/large/nuke_station
	module_name = "Doomsday Device"
	mod_pick_name = "nukestation"
	description = "Activate a weapon that will disintegrate all organic life on the station after a 450 second delay."
	cost = 130
	one_time = 1

	power_type = /mob/living/silicon/ai/proc/nuke_station

/mob/living/silicon/ai/proc/nuke_station()
	set category = "Malfunction"
	set name = "Doomsday Device"

	for(var/N in nuke_tiles)
		var/turf/T = N
		T.icon_state = "rcircuitanim" //This causes all blue "circuit" tiles on the map to change to animated red icon state.

	src << "<span class='notice'>Nuclear device armed.</span>"
	priority_announce("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert", 'sound/AI/aimalf.ogg')
	set_security_level("delta")
	nuking = 1
	var/obj/machinery/doomsday_device/DOOM = new /obj/machinery/doomsday_device(src)
	doomsday_device = DOOM
	doomsday_device.start()
	verbs -= /mob/living/silicon/ai/proc/nuke_station
	for(var/obj/item/weapon/pinpointer/P in pinpointer_list)
		P.switch_mode_to(TRACK_MALF_AI) //Pinpointers start tracking the AI wherever it goes

/obj/machinery/doomsday_device
	icon = 'icons/obj/machines/nuke_terminal.dmi'
	name = "doomsday device"
	icon_state = "nuclearbomb_base"
	desc = "A weapon which disintegrates all organic life in a large area."
	anchored = 1
	density = 1
	verb_exclaim = "blares"
	var/timing = FALSE
	var/default_timer = 4500
	var/obj/effect/countdown/doomsday/countdown
	var/detonation_timer
	var/list/milestones = list()

/obj/machinery/doomsday_device/New()
	..()
	countdown = new(src)

/obj/machinery/doomsday_device/Destroy()
	if(countdown)
		qdel(countdown)
		countdown = null
	STOP_PROCESSING(SSfastprocess, src)
	SSshuttle.clearHostileEnvironment(src)
	. = ..()

/obj/machinery/doomsday_device/proc/start()
	detonation_timer = world.time + default_timer
	timing = TRUE
	countdown.start()
	START_PROCESSING(SSfastprocess, src)
	SSshuttle.registerHostileEnvironment(src)

/obj/machinery/doomsday_device/proc/seconds_remaining()
	. = max(0, (round(detonation_timer - world.time) / 10))

/obj/machinery/doomsday_device/process()
	var/turf/T = get_turf(src)
	if(!T || T.z != ZLEVEL_STATION)
		minor_announce("DOOMSDAY DEVICE OUT OF STATION RANGE, ABORTING", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 1)
		SSshuttle.clearHostileEnvironment(src)
		qdel(src)
	if(!timing)
		STOP_PROCESSING(SSfastprocess, src)
		return
	var/sec_left = seconds_remaining()
	if(sec_left <= 0)
		timing = FALSE
		detonate(T.z)
		qdel(src)
	else<commit_msg>clears doomsday var from ai<commit_after>/datum/AI_Module
	var/uses = 0
	var/module_name
	var/mod_pick_name
	var/description = ""
	var/engaged = 0
	var/cost = 5
	var/one_time = 0

	var/power_type

/datum/AI_Module/large/
	uses = 1

/datum/AI_Module/small/
	uses = 5

/datum/AI_Module/large/nuke_station
	module_name = "Doomsday Device"
	mod_pick_name = "nukestation"
	description = "Activate a weapon that will disintegrate all organic life on the station after a 450 second delay."
	cost = 130
	one_time = 1

	power_type = /mob/living/silicon/ai/proc/nuke_station

/mob/living/silicon/ai/proc/nuke_station()
	set category = "Malfunction"
	set name = "Doomsday Device"

	for(var/N in nuke_tiles)
		var/turf/T = N
		T.icon_state = "rcircuitanim" //This causes all blue "circuit" tiles on the map to change to animated red icon state.

	src << "<span class='notice'>Nuclear device armed.</span>"
	priority_announce("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert", 'sound/AI/aimalf.ogg')
	set_security_level("delta")
	nuking = 1
	var/obj/machinery/doomsday_device/DOOM = new /obj/machinery/doomsday_device(src)
	doomsday_device = DOOM
	doomsday_device.start()
	verbs -= /mob/living/silicon/ai/proc/nuke_station
	for(var/obj/item/weapon/pinpointer/P in pinpointer_list)
		P.switch_mode_to(TRACK_MALF_AI) //Pinpointers start tracking the AI wherever it goes

/obj/machinery/doomsday_device
	icon = 'icons/obj/machines/nuke_terminal.dmi'
	name = "doomsday device"
	icon_state = "nuclearbomb_base"
	desc = "A weapon which disintegrates all organic life in a large area."
	anchored = 1
	density = 1
	verb_exclaim = "blares"
	var/timing = FALSE
	var/default_timer = 4500
	var/obj/effect/countdown/doomsday/countdown
	var/detonation_timer
	var/list/milestones = list()

/obj/machinery/doomsday_device/New()
	..()
	countdown = new(src)

/obj/machinery/doomsday_device/Destroy()
	if(countdown)
		qdel(countdown)
		countdown = null
	STOP_PROCESSING(SSfastprocess, src)
	SSshuttle.clearHostileEnvironment(src)
	for(var/A in ai_list)
		var/mob/living/silicon/ai/Mlf = A
		if(Mlf.doomsday_device == src)
			Mlf.doomsday_device = null
	. = ..()

/obj/machinery/doomsday_device/proc/start()
	detonation_timer = world.time + default_timer
	timing = TRUE
	countdown.start()
	START_PROCESSING(SSfastprocess, src)
	SSshuttle.registerHostileEnvironment(src)

/obj/machinery/doomsday_device/proc/seconds_remaining()
	. = max(0, (round(detonation_timer - world.time) / 10))

/obj/machinery/doomsday_device/process()
	var/turf/T = get_turf(src)
	if(!T || T.z != ZLEVEL_STATION)
		minor_announce("DOOMSDAY DEVICE OUT OF STATION RANGE, ABORTING", "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 1)
		SSshuttle.clearHostileEnvironment(src)
		qdel(src)
	if(!timing)
		STOP_PROCESSING(SSfastprocess, src)
		return
	var/sec_left = seconds_remaining()
	if(sec_left <= 0)
		timing = FALSE
		detonate(T.z)
		qdel(src)
	else
{'fraction_non_alphanumeric': 0.1169811320754717, 'fraction_numerical': 0.010634648370497428, 'mean_word_length': 4.612127045235804, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, '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': '2759220', 'n_tokens_mistral': 2374, 'n_tokens_neox': 2237, 'n_words': 458}