<commit_before>#define PINPOINTER_MINIMUM_RANGE 15
#define PINPOINTER_EXTRA_RANDOM_RANGE 10
#define PINPOINTER_PING_TIME 40
#define PROB_ACTUAL_TRAITOR 20
#define TRAITOR_AGENT_ROLE "Syndicate External Affairs Agent"

/datum/antagonist/traitor/internal_affairs
	name = "<NAME> Agent"
	employer = "Nanotrasen"
	special_role = "internal affairs agent"
	antagpanel_category = "IAA"
	var/syndicate = FALSE
	var/last_man_standing = FALSE
	var/list/datum/mind/targets_stolen


/datum/antagonist/traitor/internal_affairs/proc/give_pinpointer()
	if(owner && owner.current)
		owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer)

/datum/antagonist/traitor/internal_affairs/apply_innate_effects()
	.=..() //in case the base is used in future
	if(owner && owner.current)
		give_pinpointer(owner.current)

/datum/antagonist/traitor/internal_affairs/remove_innate_effects()
	.=..()
	if(owner && owner.current)
		owner.current.remove_status_effect(/datum/status_effect/agent_pinpointer)

/datum/antagonist/traitor/internal_affairs/on_gain()
	START_PROCESSING(SSprocessing, src)
	
	//Gives Cyanide dental implant
	var/obj/item/reagent_containers/pill/cyanide/cyan = new
	owner.current.transferItemToLoc(cyan, owner, TRUE)
	var/datum/action/item_action/hands_free/activate_pill/P = new(cyan)
	P.button.name = "Activate [cyan.name]"
	P.target = cyan
	P.Grant(owner.current)//The pill never actually goes in an inventory slot, so the owner doesn't inherit actions from it
	
	.=..()
/datum/antagonist/traitor/internal_affairs/on_removal()
	STOP_PROCESSING(SSprocessing,src)
	.=..()
/datum/antagonist/traitor/internal_affairs/process()
	iaa_process()


/datum/status_effect/agent_pinpointer
	id = "agent_pinpointer"
	duration = -1
	tick_interval = PINPOINTER_PING_TIME
	alert_type = /obj/screen/alert/status_effect/agent_pinpointer
	var/minimum_range = PINPOINTER_MINIMUM_RANGE
	var/range_fuzz_factor = PINPOINTER_EXTRA_RANDOM_RANGE
	var/mob/scan_target = null
	var/range_mid = 8
	var/range_far = 16

/obj/screen/alert/status_effect/agent_pinpointer
	name = "Internal Affairs Integrated Pinpointer"
	desc = "Even stealthier than a normal implant."
	icon = 'icons/obj/device.dmi'
	icon_state = "pinon"

/datum/status_effect/agent_pinpointer/proc/point_to_target() //If we found what we're looking for, show the distance and direction
	if(!scan_target)
		linked_alert.icon_state = "pinonnull"
		return
	var/turf/here = get_turf(owner)<commit_msg>mint boi bad<commit_after>#define PINPOINTER_MINIMUM_RANGE 15
#define PINPOINTER_EXTRA_RANDOM_RANGE 10
#define PINPOINTER_PING_TIME 40
#define PROB_ACTUAL_TRAITOR 20
#define TRAITOR_AGENT_ROLE "Syndicate External Affairs Agent"

/datum/antagonist/traitor/internal_affairs
	name = "Internal Affairs Agent"
	employer = "Nanotrasen"
	special_role = "internal affairs agent"
	antagpanel_category = "IAA"
	var/syndicate = FALSE
	var/last_man_standing = FALSE
	var/list/datum/mind/targets_stolen


/datum/antagonist/traitor/internal_affairs/proc/give_pinpointer()
	if(owner && owner.current)
		owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer)

/datum/antagonist/traitor/internal_affairs/apply_innate_effects()
	.=..() //in case the base is used in future
	if(owner && owner.current)
		give_pinpointer(owner.current)

/datum/antagonist/traitor/internal_affairs/remove_innate_effects()
	.=..()
	if(owner && owner.current)
		owner.current.remove_status_effect(/datum/status_effect/agent_pinpointer)

/datum/antagonist/traitor/internal_affairs/on_gain()
	START_PROCESSING(SSprocessing, src)
	
	if(ishuman(owner.current)
		//Gives Cyanide dental implant
		var/obj/item/reagent_containers/pill/cyanide/cyan = new
		owner.current.transferItemToLoc(cyan, owner, TRUE)
		var/datum/action/item_action/hands_free/activate_pill/P = new(cyan)
		P.button.name = "Activate [cyan.name]"
		P.target = cyan
		P.Grant(owner.current)//The pill never actually goes in an inventory slot, so the owner doesn't inherit actions from it
	
	.=..()
/datum/antagonist/traitor/internal_affairs/on_removal()
	STOP_PROCESSING(SSprocessing,src)
	.=..()
/datum/antagonist/traitor/internal_affairs/process()
	iaa_process()


/datum/status_effect/agent_pinpointer
	id = "agent_pinpointer"
	duration = -1
	tick_interval = PINPOINTER_PING_TIME
	alert_type = /obj/screen/alert/status_effect/agent_pinpointer
	var/minimum_range = PINPOINTER_MINIMUM_RANGE
	var/range_fuzz_factor = PINPOINTER_EXTRA_RANDOM_RANGE
	var/mob/scan_target = null
	var/range_mid = 8
	var/range_far = 16

/obj/screen/alert/status_effect/agent_pinpointer
	name = "Internal Affairs Integrated Pinpointer"
	desc = "Even stealthier than a normal implant."
	icon = 'icons/obj/device.dmi'
	icon_state = "pinon"

/datum/status_effect/agent_pinpointer/proc/point_to_target() //If we found what we're looking for, show the distance and direction
	if(!scan_target)
		linked_alert.icon_state = "pinonnull"
		return
	var/turf/here = get_turf(owner)
{'fraction_non_alphanumeric': 0.10464408842019875, 'fraction_numerical': 0.004867166903265057, 'mean_word_length': 5.523809523809524, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '370084', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1778, 'n_words': 303}