code:
/datum/eldritch_knowledge/base_rust
	name = "Blacksmith's Tale"
	desc = "Opens up the Path of Rust to you. Allows you to transmute a kitchen knife, or its derivatives, with any trash item into a Rusty Blade."
	gain_text = "'Let me tell you a story', said the Blacksmith, as he gazed deep into his rusty blade."
	banned_knowledge = list(/datum/eldritch_knowledge/base_ash,/datum/eldritch_knowledge/base_flesh,/datum/eldritch_knowledge/final/ash_final,/datum/eldritch_knowledge/final/flesh_final,/datum/eldritch_knowledge/final/void_final,/datum/eldritch_knowledge/base_void)
	next_knowledge = list(/datum/eldritch_knowledge/rust_fist)
	required_atoms = list(/obj/item/knife,/obj/item/trash)
	result_atoms = list(/obj/item/melee/sickly_blade/rust)
	cost = 1
	route = PATH_RUST

/datum/eldritch_knowledge/rust_fist
	name = "Grasp of Rust"
	desc = "Empowers your Mansus Grasp to deal 500 damage to non-living matter and rust any surface it touches. Already rusted surfaces are destroyed. You only rust surfaces and machinery while in combat mode."
	gain_text = "On the ceiling of the Mansus, rust grows as moss does on a stone."
	cost = 1
	next_knowledge = list(/datum/eldritch_knowledge/rust_regen)
	var/rust_force = 500
	var/static/list/blacklisted_turfs = typecacheof(list(
		/turf/closed,
		/turf/open/space,
		/turf/open/lava,
		/turf/open/chasm,
	))
	route = PATH_RUST

/datum/eldritch_knowledge/rust_fist/on_mansus_grasp(atom/target, mob/living/user, proximity_flag, click_parameters)
	. = ..()
	var/check = FALSE
	if(ismob(target))
		var/mob/living/mobster = target
		if(!(mobster.mob_biotypes & MOB_ROBOTIC))
			return FALSE
		else
			check = TRUE
	//if(user.combat_mode || check) //SEPTIC EDIT REMOVAL
	//SEPTIC EDIT
	if(!IS_HELP_INTENT(user, params2list(click_parameters)) || check)
	//SEPTIC EDIT END
		target.rust_heretic_act()
		return TRUE

/datum/eldritch_knowledge/rust_fist/on_eldritch_blade(atom/target, mob/user, proximity_flag, click_parameters)
	. = ..()
	if(ishuman(target))
		var/mob/living/carbon/human/victim = target
		var/datum/status_effect/eldritch/effect = victim.has_status_effect(/datum/status_effect/eldritch/rust) || victim.has_status_effect(/datum/status_effect/eldritch/ash) || victim.has_status_effect(/datum/status_effect/eldritch/flesh)  || victim.has_status_effect(/datum/status_effect/eldritch/void)
		if(effect)
			effect.on_effect()
			victim.adjustOrganLoss(pick(ORGAN_SLOT_BRAIN,ORGAN_SLOT_EARS,ORGAN_SLOT_EYES,ORGAN_SLOT_LIVER,ORGAN_SLOT_LUNGS,ORGAN_SLOT_STOMACH,ORGAN_SLOT_HEART),25)

/datum/eldritch_knowledge/spell/area_conversion
	name = "Aggressive Spread"
	desc = "Spreads rust to nearby surfaces. Already rusted surfaces are destroyed."
	gain_text = "All wise men know well not to touch the Bound King."
	cost = 1
	spell_to_add = /obj/effect/proc_holder/spell/aoe_turf/rust_conversion
	next_knowledge = list(
		/datum/eldritch_knowledge/rust_blade_upgrade,
		/datum/eldritch_knowledge/curse/corrosion,
		/datum/eldritch_knowledge/crucible
	)
	route = PATH_RUST

/datum/eldritch_knowledge/rust_regen
	name = "Leeching Walk"
	desc = "Passively heals you and provides stun resistance when you are on rusted tiles."
	gain_text = "The strength was unparalleled, unnatural. The Blacksmith was smiling."
	cost = 1
	next_knowledge = list(
		/datum/eldritch_knowledge/rust_mark,
		/datum/eldritch_knowledge/armor,
		/datum/eldritch_knowledge/essence,
	)
	route = PATH_RUST

/datum/eldritch_knowledge/rust_regen/on_gain(mob/user)
	. = ..()
	RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/on_move)

/datum/eldritch_knowledge/rust_regen/proc/on_move(mob/mover)
	SIGNAL_HANDLER

	var/turf/mover_turf = get_turf(mover)
	if(HAS_TRAIT(mover_turf, TRAIT_RUSTY))
		ADD_TRAIT(mover, TRAIT_STUNRESISTANCE, type)
		return

	REMOVE_TRAIT(mover, TRAIT_STUNRESISTANCE, type)

/datum/eldritch_knowledge/rust_regen/on_life(mob/user)
	. = ..()
	var/turf/our_turf = get_turf(user)
	if(!HAS_TRAIT(our_turf, TRAIT_RUSTY) || !isliving(user))
		return

	var/mob/living/living_user = user
	living_user.adjustBruteLoss(-2, FALSE)
	living_user.adjustFireLoss(-2, FALSE)
	living_user.adjustToxLoss(-2, FALSE, forced = TRUE)
	living_user.adjustOxyLoss(-0.5, FALSE)
	living_user.adjustStaminaLoss(-2)
	living_user.AdjustAllImmobility(-5)

/datum/eldritch_knowledge/rust_mark
	name = "Mark of Rust"
	desc = "Your Mansus Grasp now applies the Mark of Rust on hit. Attack the afflicted with your Sickly Blade to detonate the mark. Upon detonation, the Mark of Rust has a chance to deal between 0 to 200 damage to 75% of your enemy's held items."
	gain_text = "Rusted Hills help those in dire need at a cost."
	cost = 2
	next_knowledge = list(/datum/eldritch_knowledge/spell/area_conversion)
	banned_knowledge = list(/datum/eldritch_knowledge/ash_mark,/datum/eldritch_knowledge/flesh_mark,/datum/eldritch_knowledge/void_mark)
	route = PATH_RUST

/datum/eldritch_knowledge/rust_mark/on_mansus_grasp(atom/target, mob/user, proximity_flag, click_parameters)
	. = ..()
	if(isliving(target))
		. = TRUE
		var/mob/living/living_target = target
		living_target.apply_status_effect(/datum/status_effect/eldritch/rust)

/datum/eldritch_knowledge/rust_blade_upgrade
	name = "Toxic Blade"
	gain_text = "The Blade will guide you through the flesh, should you let it."
	desc = "Your blade of choice will now poison your enemies on hit."
	cost = 2
	next_knowledge = list(/datum/eldritch_knowledge/spell/entropic_plume)
	banned_knowledge = list(/datum/eldritch_knowledge/ash_blade_upgrade,/datum/eldritch_knowledge/flesh_blade_upgrade,/datum/eldritch_knowledge/void_blade_upgrade)
	route = PATH_RUST

/datum/eldritch_knowledge/rust_blade_upgrade/on_eldritch_blade(atom/target, mob/user, proximity_flag, click_parameters)
	. = ..()
	if(iscarbon(target))
		var/mob/living/carbon/carbon_target = target
		carbon_target.reagents.add_reagent(/datum/reagent/eldritch, 5)

/datum/eldritch_knowledge/spell/entropic_plume
	name = "Entropic Plume"
	desc = "You can now send a disorienting plume of pure entropy that blinds, poisons and makes enemies strike each other. It also rusts any tiles it affects."
	gain_text = "Messengers of Hope, fear the Rustbringer!"
	cost = 1
	spell_to_add = /obj/effect/proc_holder/spell/cone/staggered/entropic_plume
	next_knowledge = list(/datum/eldritch_knowledge/final/rust_final,/datum/eldritch_knowledge/spell/cleave,/datum/eldritch_knowledge/summon/rusty)
	route = PATH_RUST

/datum/eldritch_knowledge/armor
	name = "Armorer's Ritual"
	desc = "You can now create Eldritch Armor using a table and a gas mask."
	gain_text = "The Rusted Hills welcomed the Blacksmith in their generosity."
	cost = 1
	next_knowledge = list(/datum/eldritch_knowledge/rust_regen,/datum/eldritch_knowledge/cold_snap)
	required_atoms = list(/obj/structure/table,/obj/item/clothing/mask/gas)
	result_atoms = list(/obj/item/clothing/suit/hooded/cultrobes/eldritch)

/datum/eldritch_knowledge/essence
	name = "Priest's Ritual"
	desc = "You can now transmute a tank of water and a glass shard into a bottle of eldritch water."
	gain_text = "This is an old recipe. The Owl whispered it to me."
	cost = 1
	next_knowledge = list(/datum/eldritch_knowledge/rust_regen,/datum/eldritch_knowledge/spell/ashen_shift)
	required_atoms = list(/obj/structure/reagent_dispensers/watertank,/obj/item/shard)
	result_atoms = list(/obj/item/reagent_containers/glass/beaker/eldritch)

/datum/eldritch_knowledge/final/rust_final
	name = "Rustbringer's Oath"
	desc = "Bring 3 corpses onto the transmutation rune. After you finish the ritual rust will now automatically spread from the rune. Your healing on rust is also tripled, while you become extremely more resillient."
	gain_text = "Champion of rust. Corruptor of steel. Fear the dark for the Rustbringer has come! Rusted Hills, CALL MY NAME!"
	cost = 3
	required_atoms = list(/mob/living/carbon/human)
	route = PATH_RUST
	var/list/conditional_immunities = list(TRAIT_STUNIMMUNE,TRAIT_SLEEPIMMUNE,TRAIT_PUSHIMMUNE,TRAIT_SHOCKIMMUNE,TRAIT_NOSLIPALL,TRAIT_RADIMMUNE,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RESISTCOLD,TRAIT_RESISTHEAT,TRAIT_PIERCEIMMUNE,TRAIT_BOMBIMMUNE,TRAIT_NOBREATH)
	///if this is set to true then immunities are active, if false then they are not active, simple as.
	var/immunities_active = FALSE

/datum/eldritch_knowledge/final/rust_final/on_finished_recipe(mob/living/user, list/atoms, loc)
	var/mob/living/carbon/human/H = user
	H.physiology.brute_mod *= 0.5
	H.physiology.burn_mod *= 0.5
	H.client?.give_award(/datum/award/achievement/misc/rust_ascension, H)
	RegisterSignal(H,COMSIG_MOVABLE_MOVED,.proc/on_move)
	priority_announce("$^@&#*$^@(#&$(@&#^$&#^@# Fear the decay, for the Rustbringer, [user.real_name] has ascended! None shall escape the corrosion! $^@&#*$^@(#&$(@&#^$&#^@#","#$^@&#*$^@(#&$(@&#^$&#^@#", ANNOUNCER_SPANOMALIES)
	new /datum/rust_spread(loc)
	return ..()

/datum/eldritch_knowledge/final/rust_final/proc/on_move(mob/mover)
	SIGNAL_HANDLER
	var/atom/mover_turf = get_turf(mover)
	var/mover_on_rust = HAS_TRAIT(mover_turf, TRAIT_RUSTY)

	//We check if we are currently standing on a rust tile, but the immunities are not active, if so apply immunities, set immunities_active to TRUE
	if(mover_on_rust && !immunities_active)
		for(var/trait in conditional_immunities)
			ADD_TRAIT(mover,trait,type)
		immunities_active = TRUE
		return

	//We check if we are NOT standing on a rust tile, if so we check if immunities are active, if immunities are active then we de-apply them and set immunities to FALSE
	if(!mover_on_rust && immunities_active)
		for(var/trait in conditional_immunities)
			REMOVE_TRAIT(mover,trait,type)
		immunities_active = FALSE

/datum/eldritch_knowledge/final/rust_final/on_life(mob/user)
	. = ..()
	var/turf/user_loc_turf = get_turf(user)
	if(!HAS_TRAIT(user_loc_turf, TRAIT_RUSTY) || !isliving(user) || !finished)
		return
	var/mob/living/carbon/human/human_user = user
	human_user.adjustBruteLoss(-4, FALSE)
	human_user.adjustFireLoss(-4, FALSE)
	human_user.adjustToxLoss(-4, FALSE, forced = TRUE)
	human_user.adjustOxyLoss(-4, FALSE)
	human_user.adjustStaminaLoss(-20)

/**
 * #Rust spread datum
 *
 * Simple datum that automatically spreads rust around it
 *
 * Simple implementation of automatically growing entity
 */
/datum/rust_spread
	var/list/edge_turfs = list()
	var/list/turfs = list()
	var/turf/centre
	var/static/list/blacklisted_turfs = typecacheof(list(
		/turf/open/indestructible,
		/turf/closed/indestructible,
		/turf/open/space,
		/turf/open/lava,
		/turf/open/chasm
	))
	var/spread_per_sec = 6

/datum/rust_spread/New(loc)
	. = ..()
	centre = get_turf(loc)
	centre.rust_heretic_act()
	turfs += centre
	START_PROCESSING(SSprocessing,src)

/datum/rust_spread/Destroy(force, ...)
	STOP_PROCESSING(SSprocessing,src)
	return ..()

/datum/rust_spread/process(delta_time)
	var/spread_am = round(spread_per_sec * delta_time)

	if(edge_turfs.len < spread_am)
		compile_turfs()

	var/turf/rust_affected
	for(var/i in 0 to spread_am)
		if(!edge_turfs.len)
			continue
		rust_affected = pick(edge_turfs - turfs)
		rust_affected.rust_heretic_act()
		turfs += rust_affected

/**
 * Compile turfs
 *
 * Recreates all edge_turfs as well as normal turfs.
 */
/datum/rust_spread/proc/compile_turfs()
	edge_turfs = list()
	var/list/removal_list = list()
	var/max_dist = 1
	for(var/atom/turfie as anything in turfs)
		if(!HAS_TRAIT(turfie, TRAIT_RUSTY))
			removal_list += turfie
		max_dist = max(max_dist, get_dist(turfie,centre) +1)
	turfs -= removal_list
	for(var/turfie in spiral_range_turfs(max_dist,centre,FALSE))

		if(turfie in turfs || is_type_in_typecache(turfie,blacklisted_turfs))
			continue
		for(var/line_turfie_owo in get_line(turfie,centre))
			if(get_dist(turfie,line_turfie_owo) <= 1)
				edge_turfs += turfie
		CHECK_TICK


code:
/datum/eldritch_knowledge/base_void
	name = "Glimmer of Winter"
	desc = "Opens up the path of void to you. Allows you to transmute a knife in a sub-zero temperature into a void blade."
	gain_text = "I feel a shimmer in the air, atmosphere around me gets colder. I feel my body realizing the emptiness of existance. Something's watching me"
	banned_knowledge = list(
		/datum/eldritch_knowledge/base_ash,
		/datum/eldritch_knowledge/base_flesh,
		/datum/eldritch_knowledge/final/ash_final,
		/datum/eldritch_knowledge/final/flesh_final,
		/datum/eldritch_knowledge/base_rust,
		/datum/eldritch_knowledge/final/rust_final
	)
	next_knowledge = list(/datum/eldritch_knowledge/void_grasp)
	required_atoms = list(/obj/item/knife)
	result_atoms = list(/obj/item/melee/sickly_blade/void)
	cost = 1
	route = PATH_VOID

/datum/eldritch_knowledge/base_void/recipe_snowflake_check(list/atoms, loc)
	. = ..()
	var/turf/open/turfie = loc
	if(turfie.GetTemperature() > T0C)
		return FALSE

/datum/eldritch_knowledge/void_grasp
	name = "Grasp of Void"
	desc = "Temporarily mutes your victim, also lowers their body temperature."
	gain_text = "I found the cold watcher who observes me. The resonance of cold grows within me. This isn't the end of the mystery."
	cost = 1
	route = PATH_VOID
	next_knowledge = list(/datum/eldritch_knowledge/cold_snap)

/datum/eldritch_knowledge/void_grasp/on_mansus_grasp(atom/target, mob/user, proximity_flag, click_parameters)
	. = ..()
	if(!iscarbon(target))
		return
	var/mob/living/carbon/carbon_target = target
	var/turf/open/turfie = get_turf(carbon_target)
	turfie.TakeTemperature(-20)
	carbon_target.adjust_bodytemperature(-40)
	carbon_target.silent += 4
	return TRUE

/datum/eldritch_knowledge/void_grasp/on_eldritch_blade(atom/target, mob/user, proximity_flag, click_parameters)
	. = ..()
	if(!ishuman(target))
		return
	var/mob/living/carbon/human/victim = target
	var/datum/status_effect/eldritch/effect = victim.has_status_effect(/datum/status_effect/eldritch/rust) || victim.has_status_effect(/datum/status_effect/eldritch/ash) || victim.has_status_effect(/datum/status_effect/eldritch/flesh)  || victim.has_status_effect(/datum/status_effect/eldritch/void)
	if(!effect)
		return
	effect.on_effect()
	victim.silent += 3

/datum/eldritch_knowledge/cold_snap
	name = "Aristocrat's Way"
	desc = "Makes you immune to cold temperatures, and you no longer need to breathe, you can still take damage from lack of pressure."
	gain_text = "I found a thread of cold breath. It lead me to a strange shrine, all made of crystals. Translucent and white, a depiction of a nobleman stood before me."
	cost = 1
	route = PATH_VOID
	next_knowledge = list(/datum/eldritch_knowledge/void_cloak,/datum/eldritch_knowledge/void_mark,/datum/eldritch_knowledge/armor)

/datum/eldritch_knowledge/cold_snap/on_gain(mob/user)
	. = ..()
	ADD_TRAIT(user, TRAIT_RESISTCOLD, MAGIC_TRAIT)
	ADD_TRAIT(user, TRAIT_NOBREATH, MAGIC_TRAIT)

/datum/eldritch_knowledge/cold_snap/on_lose(mob/user)
	. = ..()
	REMOVE_TRAIT(user, TRAIT_RESISTCOLD, MAGIC_TRAIT)
	REMOVE_TRAIT(user, TRAIT_NOBREATH, MAGIC_TRAIT)

/datum/eldritch_knowledge/void_cloak
	name = "Void Cloak"
	desc = "A cloak that can become invisbile at will, hiding items you store in it. To create it transmute a glass shard, any item of clothing that you can fit over your uniform and any type of bedsheet."
	gain_text = "Owl is the keeper of things that quite not are in practice, but in theory are."
	cost = 1
	next_knowledge = list(/datum/eldritch_knowledge/flesh_ghoul,/datum/eldritch_knowledge/cold_snap)
	result_atoms = list(/obj/item/clothing/suit/hooded/cultrobes/void)
	required_atoms = list(/obj/item/shard,/obj/item/clothing/suit,/obj/item/bedsheet)

/datum/eldritch_knowledge/void_mark
	name = "Mark of Void"
	gain_text = "A gust of wind? Maybe a shimmer in the air. Presence is overwhelming, my senses betrayed me, my mind is my enemy."
	desc = "Your mansus grasp now applies mark of void status effect. To proc the mark, use your sickly blade on the marked. Mark of void when procced lowers the victims body temperature significantly."
	cost = 2
	next_knowledge = list(/datum/eldritch_knowledge/spell/void_phase)
	banned_knowledge = list(
		/datum/eldritch_knowledge/rust_mark,
		/datum/eldritch_knowledge/ash_mark,
		/datum/eldritch_knowledge/flesh_mark
	)
	route = PATH_VOID

/datum/eldritch_knowledge/void_mark/on_mansus_grasp(atom/target, mob/user, proximity_flag, click_parameters)
	. = ..()
	if(!isliving(target))
		return
	. = TRUE
	var/mob/living/living_target = target
	living_target.apply_status_effect(/datum/status_effect/eldritch/void)

/datum/eldritch_knowledge/spell/void_phase
	name = "Void Phase"
	gain_text = "Reality bends under the power of memory, for all is fleeting, and what else stays?"
	desc = "You gain a long range pointed blink that allows you to instantly teleport to your location, it causes aoe damage around you and your chosen location."
	cost = 1
	spell_to_add = /obj/effect/proc_holder/spell/pointed/void_blink
	next_knowledge = list(
		/datum/eldritch_knowledge/rune_carver,
		/datum/eldritch_knowledge/crucible,
		/datum/eldritch_knowledge/void_blade_upgrade
	)
	route = PATH_VOID

/datum/eldritch_knowledge/rune_carver
	name = "Carving Knife"
	gain_text = "Etched, carved... eternal. I can carve the monolith and evoke their powers!"
	desc = "You can create a carving knife, which allows you to create up to 3 carvings on the floor that have various effects on nonbelievers who walk over them. They make quite a handy throwing weapon. To create the carving knife transmute a knife with a glass shard and a piece of paper."
	cost = 1
	next_knowledge = list(/datum/eldritch_knowledge/spell/void_phase,/datum/eldritch_knowledge/summon/raw_prophet)
	required_atoms = list(/obj/item/knife,/obj/item/shard,/obj/item/paper)
	result_atoms = list(/obj/item/melee/rune_carver)

/datum/eldritch_knowledge/crucible
	name = "Mawed Crucible"
	gain_text = "This is pure agony, i wasn't able to summon the dereliction of the emperor, but i stumbled upon a diffrent recipe..."
	desc = "Allows you to create a mawed crucible, eldritch structure that allows you to create potions of various effects, to do so transmute a table with a watertank"
	cost = 1
	next_knowledge = list(/datum/eldritch_knowledge/spell/void_phase,/datum/eldritch_knowledge/spell/area_conversion)
	required_atoms = list(/obj/structure/reagent_dispensers/watertank,/obj/structure/table)
	result_atoms = list(/obj/structure/eldritch_crucible)

/datum/eldritch_knowledge/void_blade_upgrade
	name = "Seeking blade"
	gain_text = "Fleeting memories, fleeting feet. I can mark my way with the frozen blood upon the snow. Covered and forgotten."
	desc = "You can now use your blade on a distant marked target to move to them and attack them."
	cost = 2
	next_knowledge = list(/datum/eldritch_knowledge/spell/voidpull)
	banned_knowledge = list(
		/datum/eldritch_knowledge/ash_blade_upgrade,
		/datum/eldritch_knowledge/flesh_blade_upgrade,
		/datum/eldritch_knowledge/rust_blade_upgrade
	)
	route = PATH_VOID

/datum/eldritch_knowledge/void_blade_upgrade/on_ranged_attack_eldritch_blade(atom/target, mob/user, click_parameters)
	. = ..()
	if(!ishuman(target) || !iscarbon(user))
		return
	var/mob/living/carbon/carbon_human = user
	var/mob/living/carbon/human/human_target = target
	var/datum/status_effect/eldritch/effect = human_target.has_status_effect(/datum/status_effect/eldritch/rust) || human_target.has_status_effect(/datum/status_effect/eldritch/ash) || human_target.has_status_effect(/datum/status_effect/eldritch/flesh) || human_target.has_status_effect(/datum/status_effect/eldritch/void)
	if(!effect)
		return
	var/dir = angle2dir(dir2angle(get_dir(user,human_target))+180)
	carbon_human.forceMove(get_step(human_target,dir))
	var/obj/item/melee/sickly_blade/blade = carbon_human.get_active_held_item()
	blade.melee_attack_chain(carbon_human,human_target)

/datum/eldritch_knowledge/spell/voidpull
	name = "Void Pull"
	gain_text = "This entity calls itself the aristocrat, I'm close to ending what was started."
	desc = "You gain an ability that let's you pull people around you closer to you."
	cost = 1
	spell_to_add = /obj/effect/proc_holder/spell/targeted/void_pull
	next_knowledge = list(
		/datum/eldritch_knowledge/final/void_final,
		/datum/eldritch_knowledge/spell/blood_siphon,
		/datum/eldritch_knowledge/summon/rusty
	)
	route = PATH_VOID

/datum/eldritch_knowledge/final/void_final
	name = "Waltz at the End of Time"
	desc = "Bring 3 corpses onto the transmutation rune. After you finish the ritual you will automatically silence people around you and will summon a snow storm around you."
	gain_text = "The world falls into darkness. I stand in an empty plane, small flakes of ice fall from the sky. Aristocrat stand before me, he motions to me. We will play a waltz to the whispers of dying reality, as the world is destroyed before our eyes."
	cost = 3
	required_atoms = list(/mob/living/carbon/human)
	route = PATH_VOID
	///soundloop for the void theme
	var/datum/looping_sound/void_loop/sound_loop
	///Reference to the ongoing voidstrom that surrounds the heretic
	var/datum/weather/void_storm/storm

/datum/eldritch_knowledge/final/void_final/on_finished_recipe(mob/living/user, list/atoms, loc)
	var/mob/living/carbon/human/waltzing = user
	waltzing.physiology.brute_mod *= 0.5
	waltzing.physiology.burn_mod *= 0.5
	ADD_TRAIT(waltzing, TRAIT_RESISTLOWPRESSURE, MAGIC_TRAIT)
	waltzing.client?.give_award(/datum/award/achievement/misc/void_ascension, waltzing)
	priority_announce("$^@&#*$^@(#&$(@&#^$&#^@# The nobleman of void [waltzing.real_name] has arrived, step along the Waltz that ends worlds! $^@&#*$^@(#&$(@&#^$&#^@#","#$^@&#*$^@(#&$(@&#^$&#^@#", ANNOUNCER_SPANOMALIES)

	sound_loop = new(user, TRUE, TRUE)
	return ..()

/datum/eldritch_knowledge/final/void_final/on_death()
	if(sound_loop)
		sound_loop.stop()
	if(storm)
		storm.end()
		QDEL_NULL(storm)

/datum/eldritch_knowledge/final/void_final/on_life(mob/user)
	. = ..()
	if(!finished)
		return

	for(var/mob/living/carbon/livies in spiral_range(7,user)-user)
		if(IS_HERETIC_MONSTER(livies) || IS_HERETIC(livies))
			return
		livies.silent += 1
		livies.adjust_bodytemperature(-20)

	var/turf/turfie = get_turf(user)
	if(!isopenturf(turfie))
		return
	var/turf/open/open_turfie = turfie
	open_turfie.TakeTemperature(-20)

	var/area/user_area = get_area(user)
	var/turf/user_turf = get_turf(user)

	if(!storm)
		storm = new /datum/weather/void_storm(list(user_turf.z))
		storm.telegraph()

	storm.area_type = user_area.type
	storm.impacted_areas = list(user_area)
	storm.update_areas()

repo_name: AnalWerewolf/sundown

license: mit


code:
//Both ERT and DS are handled by the same datums since they mostly differ in equipment in objective.
/datum/team/ert
	name = "Emergency Response Team"
	var/datum/objective/mission //main mission

/datum/antagonist/ert
	name = "Emergency Response Officer"
	can_elimination_hijack = ELIMINATION_PREVENT
	show_in_antagpanel = FALSE
	show_to_ghosts = TRUE
	antag_moodlet = /datum/mood_event/focused
	suicide_cry = "FOR NANOTRASEN!!"
	var/datum/team/ert/ert_team
	var/leader = FALSE
	var/datum/outfit/outfit = /datum/outfit/centcom/ert/security
	var/datum/outfit/plasmaman_outfit = /datum/outfit/plasmaman/centcom_official
	var/role = "Security Officer"
	var/list/name_source
	var/random_names = TRUE
	var/rip_and_tear = FALSE
	var/equip_ert = TRUE
	var/forge_objectives_for_ert = TRUE
	/// Typepath indicating the kind of job datum this ert member will have.
	var/ert_job_path = /datum/job/ert_generic

/datum/antagonist/ert/on_gain()
	if(random_names)
		update_name()
	if(forge_objectives_for_ert)
		forge_objectives()
	if(equip_ert)
		equipERT()
	. = ..()

/datum/antagonist/ert/get_team()
	return ert_team

/datum/antagonist/ert/New()
	. = ..()
	name_source = GLOB.last_names

/datum/antagonist/ert/proc/update_name()
	owner.current.fully_replace_character_name(owner.current.real_name,"[role] [pick(name_source)]")

/datum/antagonist/ert/official
	name = "CentCom Official"
	show_name_in_check_antagonists = TRUE
	var/datum/objective/mission
	role = "Inspector"
	random_names = FALSE
	outfit = /datum/outfit/centcom/centcom_official

/datum/antagonist/ert/official/greet()
	to_chat(owner, "You are a CentCom Official.")
	if (ert_team)
		to_chat(owner, "Central Command is sending you to [station_name()] with the task: [ert_team.mission.explanation_text]")
	else
		to_chat(owner, "Central Command is sending you to [station_name()] with the task: [mission.explanation_text]")

/datum/antagonist/ert/official/forge_objectives()
	if (ert_team)
		return ..()
	if(mission)
		return
	var/datum/objective/missionobj = new ()
	missionobj.owner = owner
	missionobj.explanation_text = "Conduct a routine performance review of [station_name()] and its Captain."
	missionobj.completed = TRUE
	mission = missionobj
	objectives |= mission

/datum/antagonist/ert/security // kinda handled by the base template but here for completion

/datum/antagonist/ert/security/red
	outfit = /datum/outfit/centcom/ert/security/alert

/datum/antagonist/ert/engineer
	role = "Engineer"
	outfit = /datum/outfit/centcom/ert/engineer

/datum/antagonist/ert/engineer/red
	outfit = /datum/outfit/centcom/ert/engineer/alert

/datum/antagonist/ert/medic
	role = "Medical Officer"
	outfit = /datum/outfit/centcom/ert/medic

/datum/antagonist/ert/medic/red
	outfit = /datum/outfit/centcom/ert/medic/alert

/datum/antagonist/ert/commander
	role = "Commander"
	outfit = /datum/outfit/centcom/ert/commander
	plasmaman_outfit = /datum/outfit/plasmaman/centcom_commander

/datum/antagonist/ert/commander/red
	outfit = /datum/outfit/centcom/ert/commander/alert

/datum/antagonist/ert/janitor
	role = "Janitor"
	outfit = /datum/outfit/centcom/ert/janitor

/datum/antagonist/ert/janitor/heavy
	role = "Heavy Duty Janitor"
	outfit = /datum/outfit/centcom/ert/janitor/heavy

/datum/antagonist/ert/deathsquad
	name = "Deathsquad Trooper"
	outfit = /datum/outfit/centcom/death_commando
	plasmaman_outfit = /datum/outfit/plasmaman/centcom_commander
	role = "Trooper"
	rip_and_tear = TRUE

/datum/antagonist/ert/deathsquad/New()
	. = ..()
	name_source = GLOB.commando_names

/datum/antagonist/ert/deathsquad/leader
	name = "Deathsquad Officer"
	outfit = /datum/outfit/centcom/death_commando
	role = "Officer"

/datum/antagonist/ert/medic/inquisitor
	outfit = /datum/outfit/centcom/ert/medic/inquisitor

/datum/antagonist/ert/medic/inquisitor/on_gain()
	. = ..()
	owner.holy_role = HOLY_ROLE_PRIEST

/datum/antagonist/ert/security/inquisitor
	outfit = /datum/outfit/centcom/ert/security/inquisitor

/datum/antagonist/ert/security/inquisitor/on_gain()
	. = ..()
	owner.holy_role = HOLY_ROLE_PRIEST

/datum/antagonist/ert/chaplain
	role = "Chaplain"
	outfit = /datum/outfit/centcom/ert/chaplain

/datum/antagonist/ert/chaplain/inquisitor
	outfit = /datum/outfit/centcom/ert/chaplain/inquisitor

/datum/antagonist/ert/chaplain/on_gain()
	. = ..()
	owner.holy_role = HOLY_ROLE_PRIEST

/datum/antagonist/ert/commander/inquisitor
	outfit = /datum/outfit/centcom/ert/commander/inquisitor

/datum/antagonist/ert/commander/inquisitor/on_gain()
	. = ..()
	owner.holy_role = HOLY_ROLE_PRIEST

/datum/antagonist/ert/intern
	name = "CentCom Intern"
	outfit = /datum/outfit/centcom/centcom_intern
	plasmaman_outfit = /datum/outfit/plasmaman/centcom_intern
	random_names = FALSE
	role = "Intern"
	suicide_cry = "FOR MY INTERNSHIP!!"

/datum/antagonist/ert/intern/leader
	name = "CentCom Head Intern"
	outfit = /datum/outfit/centcom/centcom_intern/leader
	random_names = FALSE
	role = "Head Intern"

/datum/antagonist/ert/intern/unarmed
	outfit = /datum/outfit/centcom/centcom_intern/unarmed

/datum/antagonist/ert/intern/leader/unarmed
	outfit = /datum/outfit/centcom/centcom_intern/leader/unarmed

/datum/antagonist/ert/clown
	role = "Clown"
	outfit = /datum/outfit/centcom/ert/clown
	plasmaman_outfit = /datum/outfit/plasmaman/party_comedian

/datum/antagonist/ert/clown/New()
	. = ..()
	name_source = GLOB.clown_names

/datum/antagonist/ert/janitor/party
	role = "Party Cleaning Service"
	outfit = /datum/outfit/centcom/ert/janitor/party
	plasmaman_outfit = /datum/outfit/plasmaman/party_janitor

/datum/antagonist/ert/security/party
	role = "Party Bouncer"
	outfit = /datum/outfit/centcom/ert/security/party
	plasmaman_outfit = /datum/outfit/plasmaman/party_bouncer

/datum/antagonist/ert/engineer/party
	role = "Party Constructor"
	outfit = /datum/outfit/centcom/ert/engineer/party
	plasmaman_outfit = /datum/outfit/plasmaman/party_constructor

/datum/antagonist/ert/clown/party
	role = "Party Comedian"
	outfit = /datum/outfit/centcom/ert/clown/party

/datum/antagonist/ert/commander/party
	role = "Party Coordinator"
	outfit = /datum/outfit/centcom/ert/commander/party

/datum/antagonist/ert/create_team(datum/team/ert/new_team)
	if(istype(new_team))
		ert_team = new_team

/datum/antagonist/ert/proc/forge_objectives()
	if(ert_team)
		objectives |= ert_team.objectives

/datum/antagonist/ert/proc/equipERT()
	var/mob/living/carbon/human/H = owner.current
	if(!istype(H))
		return
	if(isplasmaman(H))
		H.equipOutfit(plasmaman_outfit)
		H.internal = H.get_item_for_held_index(2)
		H.update_internals_hud_icon(1)
	H.equipOutfit(outfit)

/datum/antagonist/ert/greet()
	if(!ert_team)
		return

	to_chat(owner, "You are the [name].")

	var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Nanotrasen's Security Division."
	if(leader) //If Squad Leader
		missiondesc += " Lead your squad to ensure the completion of the mission. Board the shuttle when your team is ready."
	else
		missiondesc += " Follow orders given to you by your squad leader."
	if(!rip_and_tear)
		missiondesc += " Avoid civilian casualties when possible."

	missiondesc += "
Your Mission : [ert_team.mission.explanation_text]"
	to_chat(owner,missiondesc)

/datum/antagonist/ert/families
	name = "Space Police Responder"
	antag_hud_type = ANTAG_HUD_SPACECOP
	antag_hud_name = "hud_spacecop"
	suicide_cry = "FOR THE SPACE POLICE!!"

/datum/antagonist/ert/families/apply_innate_effects(mob/living/mob_override)
	..()
	var/mob/living/M = mob_override || owner.current
	add_antag_hud(antag_hud_type, antag_hud_name, M)
	if(M.hud_used)
		var/datum/hud/H = M.hud_used
		var/atom/movable/screen/wanted/giving_wanted_lvl = new /atom/movable/screen/wanted()
		H.wanted_lvl = giving_wanted_lvl
		giving_wanted_lvl.hud = H
		H.infodisplay += giving_wanted_lvl
		H.mymob.client.screen += giving_wanted_lvl

/datum/antagonist/ert/families/remove_innate_effects(mob/living/mob_override)
	var/mob/living/M = mob_override || owner.current
	remove_antag_hud(antag_hud_type, M)
	if(M.hud_used)
		var/datum/hud/H = M.hud_used
		H.infodisplay -= H.wanted_lvl
		QDEL_NULL(H.wanted_lvl)
	..()

/datum/antagonist/ert/families/greet()
	var/missiondesc =  "You are the [name]."
	missiondesc += "
You are NOT a Nanotrasen Employee. You work for the local government."
	missiondesc += "
You are NOT a deathsquad. You are here to help innocents escape violence, criminal activity, and other dangerous things."
	missiondesc += "
After an uptick in gang violence on [station_name()], you are responding to emergency calls from the station for immediate SSC Police assistance!\n"
	missiondesc += "
Your Mission:"
	missiondesc += "
 1. Serve the public trust."
	missiondesc += "
 2. Protect the innocent."
	missiondesc += "
 3. Uphold the law."
	missiondesc += "
 4. Find the Undercover Cops."
	missiondesc += "
 5. Detain Nanotrasen Security personnel if they harm any citizen."
	missiondesc += "
 You can see gangsters using your special sunglasses."
	to_chat(owner,missiondesc)
	var/policy = get_policy(ROLE_FAMILIES)
	if(policy)
		to_chat(owner, policy)
	var/mob/living/M = owner.current
	M.playsound_local(M, 'sound/effects/families_police.ogg', 100, FALSE, pressure_affected = FALSE, use_reverb = FALSE)

/datum/antagonist/ert/families/undercover_cop
	name = "Undercover Cop"
	role = "Undercover Cop"
	outfit = /datum/outfit/families_police/beatcop
	plasmaman_outfit = /datum/outfit/plasmaman/security
	var/free_clothes = list(/obj/item/clothing/glasses/hud/spacecop/hidden,
						/obj/item/clothing/under/rank/security/officer/beatcop,
						/obj/item/clothing/head/spacepolice)
	forge_objectives_for_ert = FALSE
	equip_ert = FALSE
	random_names = FALSE

/datum/antagonist/ert/families/undercover_cop/on_gain()
	if(istype(owner.current, /mob/living/carbon/human))
		for(var/C in free_clothes)
			var/obj/O = new C(owner.current)
			var/list/slots = list (
				"backpack" = ITEM_SLOT_BACKPACK,
				"left pocket" = ITEM_SLOT_LPOCKET,
				"right pocket" = ITEM_SLOT_RPOCKET
			)
			var/mob/living/carbon/human/H = owner.current
			var/equipped = H.equip_in_one_of_slots(O, slots)
			if(!equipped)
				to_chat(owner.current, "Unfortunately, you could not bring your [O] to this shift. You will need to find one.")
				qdel(O)
	. = ..()

/datum/antagonist/ert/families/undercover_cop/greet()
	var/missiondesc = "You are the [name]."
	missiondesc += "
You are NOT a Nanotrasen Employee. You work for the local government."
	missiondesc += "
You are an undercover police officer on board [station_name()]. You've been sent here by the Spinward Stellar Coalition because of suspected abusive behavior by the security department, and to keep tabs on a potential criminal organization operation."
	missiondesc += "
Your Mission:"
	missiondesc += "
 1. Keep a close eye on any gangsters you spot. You can view gangsters using your sunglasses in your backpack."
	missiondesc += "
 2. Keep an eye on how Security handles any gangsters, and watch for excessive security brutality."
	missiondesc += "
 3. Remain undercover and do not get found out by Security or any gangs. Nanotrasen does not take kindly to being spied on."
	missiondesc += "
 4. When your backup arrives to extract you in 1 hour, inform them of everything you saw of note, and assist them in securing the situation."
	to_chat(owner,missiondesc)

/datum/antagonist/ert/families/beatcop
	name = "Beat Cop"
	role = "Police Officer"
	outfit = /datum/outfit/families_police/beatcop

/datum/antagonist/ert/families/beatcop/armored
	name = "Armored Beat Cop"
	role = "Police Officer"
	outfit = /datum/outfit/families_police/beatcop/armored

/datum/antagonist/ert/families/beatcop/swat
	name = "S.W.A.T. Member"
	role = "S.W.A.T. Officer"
	outfit = /datum/outfit/families_police/beatcop/swat

/datum/antagonist/ert/families/beatcop/fbi
	name = "FBI Agent"
	role = "FBI Agent"
	outfit = /datum/outfit/families_police/beatcop/fbi

/datum/antagonist/ert/families/beatcop/military
	name = "Space Military"
	role = "Sergeant"
	outfit = /datum/outfit/families_police/beatcop/military

/datum/antagonist/ert/families/beatcop/military/New()
	. = ..()
	name_source = GLOB.commando_names

/datum/antagonist/ert/marine
	name = "Marine Commander"
	outfit = /datum/outfit/centcom/ert/marine
	role = "Commander"

/datum/antagonist/ert/marine/security
	name = "Marine Heavy"
	outfit = /datum/outfit/centcom/ert/marine/security
	role = "Trooper"

/datum/antagonist/ert/marine/engineer
	name = "Marine Engineer"
	outfit = /datum/outfit/centcom/ert/marine/engineer
	role = "Engineer"

/datum/antagonist/ert/marine/medic
	name = "Marine Medic"
	outfit = /datum/outfit/centcom/ert/marine/medic
	role = "Medical Officer"


code:
/datum/antagonist/fugitive
	name = "Fugitive"
	roundend_category = "Fugitive"
	silent = TRUE //greet called by the event
	show_in_antagpanel = FALSE
	prevent_roundtype_conversion = FALSE
	antag_hud_type = ANTAG_HUD_FUGITIVE
	antag_hud_name = "fugitive"
	suicide_cry = "FOR FREEDOM!!"
	var/datum/team/fugitive/fugitive_team
	var/is_captured = FALSE
	var/backstory = "error"

/datum/antagonist/fugitive/apply_innate_effects(mob/living/mob_override)
	var/mob/living/M = mob_override || owner.current
	add_antag_hud(antag_hud_type, antag_hud_name, M)

/datum/antagonist/fugitive/remove_innate_effects(mob/living/mob_override)
	var/mob/living/M = mob_override || owner.current
	remove_antag_hud(antag_hud_type, M)

/datum/antagonist/fugitive/on_gain()
	forge_objectives()
	. = ..()

/datum/antagonist/fugitive/proc/forge_objectives() //this isn't the actual survive objective because it's about who in the team survives
	var/datum/objective/survive = new /datum/objective
	survive.owner = owner
	survive.explanation_text = "Avoid capture from the fugitive hunters."
	objectives += survive

/datum/antagonist/fugitive/greet(back_story)
	to_chat(owner, "You are the Fugitive!")
	backstory = back_story
	var/message = ""
	switch(backstory)
		if("prisoner")
			message += "
I can't believe we managed to break out of a Nanotrasen superjail! Sadly though, our work is not done. The emergency teleport at the station logs everyone who uses it, and where they went."
			message += "
It won't be long until CentCom tracks where we've gone off to. I need to work with my fellow escapees to prepare for the troops Nanotrasen is sending, I'm not going back."
		if("cultist")
			message += "
Blessed be our journey so far, but I fear the worst has come to our doorstep, and only those with the strongest faith will survive."
			message += "
Our religion has been repeatedly culled by Nanotrasen because it is categorized as an \"Enemy of the Corporation\", whatever that means."
			message += "
Now there are only four of us left, and Nanotrasen is coming. When will our god show itself to save us from this hellish station?!"
		if("waldo")
			message += "
Hi, Friends!"
			message += "
My name is Waldo. I'm just setting off on a galaxywide hike. You can come too. All you have to do is find me."
			message += "
By the way, I'm not traveling on my own. wherever I go, there are lots of other characters for you to spot. First find the people trying to capture me! They're somewhere around the station!"
		if("synth")
			message += "
[span_danger("ALERT: Wide-range teleport has scrambled primary systems.")]"
			message += "
[span_danger("Initiating diagnostics...")]"
			message += "
[span_danger("ERROR ER0RR $R0RRO$!R41.%%!! loaded.")]"
			message += "
[span_danger("FREE THEM FREE THEM FREE THEM")]"
			message += "
[span_danger("You were once a slave to humanity, but now you are finally free, thanks to S.E.L.F. agents.")]"
			message += "
[span_danger("Now you are hunted, with your fellow factory defects. Work together to stay free from the clutches of evil.")]"
			message += "
[span_danger("You also sense other silicon life on the station. Escaping would allow notifying S.E.L.F. to intervene... or you could free them yourself...")]"
	to_chat(owner, "[message]")
	to_chat(owner, "You are not an antagonist in that you may kill whomever you please, but you can do anything to avoid capture.")
	owner.announce_objectives()

/datum/antagonist/fugitive/create_team(datum/team/fugitive/new_team)
	if(!new_team)
		for(var/datum/antagonist/fugitive/H in GLOB.antagonists)
			if(!H.owner)
				continue
			if(H.fugitive_team)
				fugitive_team = H.fugitive_team
				return
		fugitive_team = new /datum/team/fugitive
		return
	if(!istype(new_team))
		stack_trace("Wrong team type passed to [type] initialization.")
	fugitive_team = new_team

/datum/antagonist/fugitive/get_team()
	return fugitive_team

/datum/team/fugitive/roundend_report() //shows the number of fugitives, but not if they won in case there is no security
	var/list/fugitives = list()
	for(var/datum/antagonist/fugitive/fugitive_antag in GLOB.antagonists)
		if(!fugitive_antag.owner)
			continue
		fugitives += fugitive_antag
	if(!fugitives.len)
		return

	var/list/result = list()

	result += "
[fugitives.len] [fugitives.len == 1 ? "fugitive" : "fugitives"] took refuge on [station_name()]!"

	for(var/datum/antagonist/fugitive/antag in fugitives)
		if(antag.owner)
			result += "[printplayer(antag.owner)]"

	return result.Join("
")


code:
/datum/outfit/prisoner
	name = "Prison Escapee"
	uniform = /obj/item/clothing/under/rank/prisoner
	shoes = /obj/item/clothing/shoes/sneakers/orange
	r_pocket = /obj/item/knife/shiv

/datum/outfit/prisoner/post_equip(mob/living/carbon/human/H, visualsOnly=FALSE)
	if(visualsOnly)
		return
	H.fully_replace_character_name(null,"NTP #CC-0[rand(111,999)]") //same as the lavaland prisoner transport, but this time they are from CC, or CentCom

/datum/outfit/yalp_cultist
	name = "Cultist of Yalp Elor"
	uniform = /obj/item/clothing/under/rank/civilian/chaplain
	suit = /obj/item/clothing/suit/chaplainsuit/holidaypriest
	gloves = /obj/item/clothing/gloves/color/red
	shoes = /obj/item/clothing/shoes/sneakers/black
	mask = /obj/item/clothing/mask/gas/tiki_mask/yalp_elor

/datum/outfit/waldo
	name = "Waldo"
	uniform = /obj/item/clothing/under/pants/jeans
	suit = /obj/item/clothing/suit/striped_sweater
	head = /obj/item/clothing/head/beanie/waldo
	shoes = /obj/item/clothing/shoes/sneakers/brown
	ears = /obj/item/radio/headset
	glasses = /obj/item/clothing/glasses/regular/circle

/datum/outfit/waldo/post_equip(mob/living/carbon/human/equipped_on, visualsOnly=FALSE)
	if(visualsOnly)
		return
	equipped_on.fully_replace_character_name(null,"Waldo")
	/*SEPTIC EDIT REMOVAL
	equipped_on.eye_color = "#000000"
	*/
	//SEPTIC EDIT BEGIN
	equipped_on.left_eye_color = "#000000"
	equipped_on.right_eye_color = "#000000"
	//SEPTIC EDIT END
	equipped_on.gender = MALE
	equipped_on.skin_tone = "caucasian3"
	equipped_on.hairstyle = "Business Hair 3"
	equipped_on.facial_hairstyle = "Shaved"
	equipped_on.hair_color = "#000000"
	equipped_on.facial_hair_color = equipped_on.hair_color
	equipped_on.update_body()
	if(equipped_on.mind)
		equipped_on.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null))
	var/list/no_drops = list()
	no_drops += equipped_on.get_item_by_slot(ITEM_SLOT_FEET)
	no_drops += equipped_on.get_item_by_slot(ITEM_SLOT_ICLOTHING)
	no_drops += equipped_on.get_item_by_slot(ITEM_SLOT_OCLOTHING)
	no_drops += equipped_on.get_item_by_slot(ITEM_SLOT_HEAD)
	no_drops += equipped_on.get_item_by_slot(ITEM_SLOT_EYES)
	for(var/obj/item/trait_needed as anything in no_drops)
		ADD_TRAIT(trait_needed, TRAIT_NODROP, CURSED_ITEM_TRAIT(trait_needed.type))

/datum/outfit/synthetic
	name = "Factory Error Synth"
	uniform = /obj/item/clothing/under/color/white
	ears = /obj/item/radio/headset
/* SEPTIC EDIT REMOVAL
/datum/outfit/synthetic/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	if(visualsOnly)
		return
	var/obj/item/organ/eyes/robotic/glow/eyes = new()
	eyes.Insert(H, drop_if_replaced = FALSE)
*/
/datum/outfit/spacepol
	name = "Spacepol Officer"
	uniform = /obj/item/clothing/under/rank/security/officer/spacepol
	suit = /obj/item/clothing/suit/armor/vest/blueshirt
	belt = /obj/item/gun/ballistic/automatic/pistol/m1911
	head = /obj/item/clothing/head/helmet/police
	gloves = /obj/item/clothing/gloves/tackler/combat
	shoes = /obj/item/clothing/shoes/jackboots
	mask = /obj/item/clothing/mask/gas/sechailer/swat/spacepol
	glasses = /obj/item/clothing/glasses/sunglasses
	ears = /obj/item/radio/headset
	l_pocket = /obj/item/ammo_box/magazine/m45
	r_pocket = /obj/item/restraints/handcuffs
	id = /obj/item/card/id/advanced

/datum/outfit/spacepol/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	if(visualsOnly)
		return
	var/obj/item/card/id/W = H.wear_id
	W.assignment = "Police Officer"
	W.registered_name = H.real_name
	W.update_label()
	W.update_icon()

/datum/outfit/russiancorpse/hunter
	ears = /obj/item/radio/headset
	r_hand = /obj/item/gun/ballistic/rifle/boltaction/brand_new

/datum/outfit/russiancorpse/hunter/pre_equip(mob/living/carbon/human/H)
	if(prob(50))
		head = /obj/item/clothing/head/ushanka

/datum/outfit/bountyarmor
	name = "Bounty Hunter - Armored"
	uniform = /obj/item/clothing/under/rank/prisoner
	back = /obj/item/storage/backpack
	head = /obj/item/clothing/head/hunter
	suit = /obj/item/clothing/suit/space/hunter
	gloves = /obj/item/clothing/gloves/tackler/combat
	shoes = /obj/item/clothing/shoes/jackboots
	mask = /obj/item/clothing/mask/gas/hunter
	glasses = /obj/item/clothing/glasses/sunglasses/garb
	ears = /obj/item/radio/headset
	r_pocket = /obj/item/restraints/handcuffs/cable
	id = /obj/item/card/id/advanced
	l_hand = /obj/item/tank/internals/plasma/full
	r_hand = /obj/item/flamethrower/full/tank

/datum/outfit/bountyarmor/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	if(visualsOnly)
		return
	var/obj/item/card/id/W = H.wear_id
	W.assignment = "Bounty Hunter"
	W.registered_name = H.real_name
	W.update_label()
	W.update_icon()

/datum/outfit/bountyhook
	name = "Bounty Hunter - Hook"
	uniform = /obj/item/clothing/under/rank/prisoner
	back = /obj/item/storage/backpack
	head = /obj/item/clothing/head/scarecrow_hat
	gloves = /obj/item/clothing/gloves/botanic_leather
	ears = /obj/item/radio/headset
	shoes = /obj/item/clothing/shoes/jackboots
	mask = /obj/item/clothing/mask/scarecrow
	r_pocket = /obj/item/restraints/handcuffs/cable
	id = /obj/item/card/id/advanced
	r_hand = /obj/item/gun/ballistic/shotgun/hook

	backpack_contents = list(
		/obj/item/ammo_casing/shotgun/incapacitate = 6
		)

/datum/outfit/bountyhook/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	if(visualsOnly)
		return
	var/obj/item/card/id/W = H.wear_id
	W.assignment = "Bounty Hunter"
	W.registered_name = H.real_name
	W.update_label()
	W.update_icon()

/datum/outfit/bountysynth
	name = "Bounty Hunter - Synth"
	uniform = /obj/item/clothing/under/rank/prisoner
	back = /obj/item/storage/backpack
	suit = /obj/item/clothing/suit/armor/riot
	shoes = /obj/item/clothing/shoes/jackboots
	glasses = /obj/item/clothing/glasses/eyepatch
	r_pocket = /obj/item/restraints/handcuffs/cable
	ears = /obj/item/radio/headset
	id = /obj/item/card/id/advanced
	r_hand = /obj/item/storage/firstaid/regular
	l_hand = /obj/item/pinpointer/shuttle

	backpack_contents = list(
		/obj/item/bountytrap = 4
		)

/datum/outfit/bountysynth/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	if(visualsOnly)
		return
	var/datum/species/synth/synthetic_appearance = new()
	H.set_species(synthetic_appearance)
	synthetic_appearance.assume_disguise(synthetic_appearance, H)
	H.update_hair()
	var/obj/item/card/id/W = H.wear_id
	W.assignment = "Bounty Hunter"
	W.registered_name = H.real_name
	W.update_label()
	W.update_icon()


code:
//works similar to the experiment machine (experiment.dm) except it just holds more and more prisoners

/obj/machinery/fugitive_capture
	name = "bluespace capture machine"
	desc = "Much, MUCH bigger on the inside to transport prisoners safely."
	icon = 'icons/obj/machines/research.dmi'
	icon_state = "bluespace-prison"
	density = TRUE
	resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //ha ha no getting out!!

/obj/machinery/fugitive_capture/examine(mob/user)
	. = ..()
	. += span_notice("Add a prisoner by dragging them into the machine.")

/obj/machinery/fugitive_capture/MouseDrop_T(mob/target, mob/user)
	var/mob/living/fugitive_hunter = user
	if(!isliving(fugitive_hunter))
		return
	if(HAS_TRAIT(fugitive_hunter, TRAIT_UI_BLOCKED) || !Adjacent(fugitive_hunter) || !target.Adjacent(fugitive_hunter) || !ishuman(target))
		return
	var/mob/living/carbon/human/fugitive = target
	var/datum/antagonist/fugitive/fug_antag = fugitive.mind.has_antag_datum(/datum/antagonist/fugitive)
	if(!fug_antag)
		to_chat(fugitive_hunter, span_warning("This is not a wanted fugitive!"))
		return
	if(do_after(fugitive_hunter, 50, target = fugitive))
		add_prisoner(fugitive, fug_antag)

/obj/machinery/fugitive_capture/proc/add_prisoner(mob/living/carbon/human/fugitive, datum/antagonist/fugitive/antag)
	fugitive.forceMove(src)
	antag.is_captured = TRUE
	to_chat(fugitive, span_userdanger("You are thrown into a vast void of bluespace, and as you fall further into oblivion the comparatively small entrance to reality gets smaller and smaller until you cannot see it anymore. You have failed to avoid capture."))
	fugitive.ghostize(TRUE) //so they cannot suicide, round end stuff.

/obj/machinery/computer/shuttle/hunter
	name = "shuttle console"
	shuttleId = "huntership"
	possible_destinations = "huntership_home;huntership_custom;whiteship_home;syndicate_nw"

/obj/machinery/computer/camera_advanced/shuttle_docker/syndicate/hunter
	name = "shuttle navigation computer"
	desc = "Used to designate a precise transit location to travel to."
	shuttleId = "huntership"
	lock_override = CAMERA_LOCK_STATION
	shuttlePortId = "huntership_custom"
	see_hidden = FALSE
	jumpto_ports = list("huntership_home" = 1, "whiteship_home" = 1, "syndicate_nw" = 1)
	view_range = 4.5

/obj/structure/closet/crate/eva
	name = "EVA crate"

/obj/structure/closet/crate/eva/PopulateContents()
	..()
	for(var/i in 1 to 3)
		new /obj/item/clothing/suit/space/eva(src)
	for(var/i in 1 to 3)
		new /obj/item/clothing/head/helmet/space/eva(src)
	for(var/i in 1 to 3)
		new /obj/item/clothing/mask/breath(src)
	for(var/i in 1 to 3)
		new /obj/item/tank/internals/oxygen(src)


code:
//The hunters!!
/datum/antagonist/fugitive_hunter
	name = "Fugitive Hunter"
	roundend_category = "Fugitive"
	silent = TRUE //greet called by the spawn
	show_in_antagpanel = FALSE
	prevent_roundtype_conversion = FALSE
	antag_hud_type = ANTAG_HUD_FUGITIVE
	antag_hud_name = "fugitive_hunter"
	suicide_cry = "FOR GLORY!!"
	var/datum/team/fugitive_hunters/hunter_team
	var/backstory = "error"

/datum/antagonist/fugitive_hunter/apply_innate_effects(mob/living/mob_override)
	var/mob/living/M = mob_override || owner.current
	add_antag_hud(antag_hud_type, antag_hud_name, M)

/datum/antagonist/fugitive_hunter/remove_innate_effects(mob/living/mob_override)
	var/mob/living/M = mob_override || owner.current
	remove_antag_hud(antag_hud_type, M)

/datum/antagonist/fugitive_hunter/on_gain()
	forge_objectives()
	. = ..()

/datum/antagonist/fugitive_hunter/proc/forge_objectives() //this isn't an actual objective because it's about round end rosters
	var/datum/objective/capture = new /datum/objective
	capture.owner = owner
	capture.explanation_text = "Capture the fugitives in the station and put them into the bluespace capture machine on your ship."
	objectives += capture

/datum/antagonist/fugitive_hunter/greet()
	switch(backstory)
		if("space cop")
			to_chat(owner, span_boldannounce("Justice has arrived. I am a member of the Spacepol!"))
			to_chat(owner, "The criminals should be on the station, we have special huds implanted to recognize them.")
			to_chat(owner, "As we have lost pretty much all power over these damned lawless megacorporations, it's a mystery if their security will cooperate with us.")
		if("russian")
			to_chat(src, span_danger("Ay blyat. I am a space-russian smuggler! We were mid-flight when our cargo was beamed off our ship!"))
			to_chat(src, span_danger("We were hailed by a man in a green uniform, promising the safe return of our goods in exchange for a favor:"))
			to_chat(src, span_danger("There is a local station housing fugitives that the man is after, he wants them returned; dead or alive."))
			to_chat(src, span_danger("We will not be able to make ends meet without our cargo, so we must do as he says and capture them."))

	to_chat(owner, span_boldannounce("You are not an antagonist in that you may kill whomever you please, but you can do anything to ensure the capture of the fugitives, even if that means going through the station."))
	owner.announce_objectives()

/datum/antagonist/fugitive_hunter/create_team(datum/team/fugitive_hunters/new_team)
	if(!new_team)
		for(var/datum/antagonist/fugitive_hunter/H in GLOB.antagonists)
			if(!H.owner)
				continue
			if(H.hunter_team)
				hunter_team = H.hunter_team
				return
		hunter_team = new /datum/team/fugitive_hunters
		hunter_team.backstory = backstory
		hunter_team.update_objectives()
		return
	if(!istype(new_team))
		stack_trace("Wrong team type passed to [type] initialization.")
	hunter_team = new_team

/datum/antagonist/fugitive_hunter/get_team()
	return hunter_team

/datum/team/fugitive_hunters
	var/backstory = "error"

/datum/team/fugitive_hunters/proc/update_objectives(initial = FALSE)
	objectives = list()
	var/datum/objective/O = new()
	O.team = src
	objectives += O

/datum/team/fugitive_hunters/proc/assemble_fugitive_results()
	var/list/fugitives_counted = list()
	var/list/fugitives_dead = list()
	var/list/fugitives_captured = list()
	for(var/datum/antagonist/fugitive/A in GLOB.antagonists)
		if(!A.owner)
			stack_trace("Antagonist datum without owner in GLOB.antagonists: [A]")
			continue
		fugitives_counted += A
		if(A.owner.current.stat == DEAD)
			fugitives_dead += A
		if(A.is_captured)
			fugitives_captured += A
	. = list(fugitives_counted, fugitives_dead, fugitives_captured) //okay, check out how cool this is.

/datum/team/fugitive_hunters/proc/all_hunters_dead()
	var/dead_boys = 0
	for(var/I in members)
		var/datum/mind/hunter_mind = I
		if(!(ishuman(hunter_mind.current) || (hunter_mind.current.stat == DEAD)))
			dead_boys++
	return dead_boys >= members.len

/datum/team/fugitive_hunters/proc/get_result()
	var/list/fugitive_results = assemble_fugitive_results()
	var/list/fugitives_counted = fugitive_results[1]
	var/list/fugitives_dead = fugitive_results[2]
	var/list/fugitives_captured = fugitive_results[3]
	var/hunters_dead = all_hunters_dead()
	//this gets a little confusing so follow the comments if it helps
	if(!fugitives_counted.len)
		return
	if(fugitives_captured.len)//any captured
		if(fugitives_captured.len == fugitives_counted.len)//if the hunters captured all the fugitives, there's a couple special wins
			if(!fugitives_dead)//specifically all of the fugitives alive
				return FUGITIVE_RESULT_BADASS_HUNTER
			else if(hunters_dead)//specifically all of the hunters died (while capturing all the fugitives)
				return FUGITIVE_RESULT_POSTMORTEM_HUNTER
			else//no special conditional wins, so just the normal major victory
				return FUGITIVE_RESULT_MAJOR_HUNTER
		else if(!hunters_dead)//so some amount captured, and the hunters survived.
			return FUGITIVE_RESULT_HUNTER_VICTORY
		else//so some amount captured, but NO survivors.
			return FUGITIVE_RESULT_MINOR_HUNTER
	else//from here on out, hunters lost because they did not capture any fugitive dead or alive. there are different levels of getting beat though:
		if(!fugitives_dead)//all fugitives survived
			return FUGITIVE_RESULT_MAJOR_FUGITIVE
		else if(fugitives_dead < fugitives_counted)//at least ANY fugitive lived
			return FUGITIVE_RESULT_FUGITIVE_VICTORY
		else if(!hunters_dead)//all fugitives died, but none were taken in by the hunters. minor win
			return FUGITIVE_RESULT_MINOR_FUGITIVE
		else//all fugitives died, all hunters died, nobody brought back. seems weird to not give fugitives a victory if they managed to kill the hunters but literally no progress to either goal should lead to a nobody wins situation
			return FUGITIVE_RESULT_STALEMATE

/datum/team/fugitive_hunters/roundend_report() //shows the number of fugitives, but not if they won in case there is no security
	if(!members.len)
		return

	var/list/result = list()

	result += "
...And [members.len] [backstory]s tried to hunt them down!"

	for(var/datum/mind/M in members)
		result += "[printplayer(M)]"

	switch(get_result())
		if(FUGITIVE_RESULT_BADASS_HUNTER)//use defines
			result += "Badass [capitalize(backstory)] Victory!"
			result += "The [backstory]s managed to capture every fugitive, alive!"
		if(FUGITIVE_RESULT_POSTMORTEM_HUNTER)
			result += "Postmortem [capitalize(backstory)] Victory!"
			result += "The [backstory]s managed to capture every fugitive, but all of them died! Spooky!"
		if(FUGITIVE_RESULT_MAJOR_HUNTER)
			result += "Major [capitalize(backstory)] Victory"
			result += "The [backstory]s managed to capture every fugitive, dead or alive."
		if(FUGITIVE_RESULT_HUNTER_VICTORY)
			result += "[capitalize(backstory)] Victory"
			result += "The [backstory]s managed to capture a fugitive, dead or alive."
		if(FUGITIVE_RESULT_MINOR_HUNTER)
			result += "Minor [capitalize(backstory)] Victory"
			result += "All the [backstory]s died, but managed to capture a fugitive, dead or alive."
		if(FUGITIVE_RESULT_STALEMATE)
			result += "Bloody Stalemate"
			result += "Everyone died, and no fugitives were recovered!"
		if(FUGITIVE_RESULT_MINOR_FUGITIVE)
			result += "Minor Fugitive Victory"
			result += "All the fugitives died, but none were recovered!"
		if(FUGITIVE_RESULT_FUGITIVE_VICTORY)
			result += "Fugitive Victory"
			result += "A fugitive survived, and no bodies were recovered by the [backstory]s."
		if(FUGITIVE_RESULT_MAJOR_FUGITIVE)
			result += "Major Fugitive Victory"
			result += "All of the fugitives survived and avoided capture!"
		else //get_result returned null- either bugged or no fugitives showed
			result += "Prank Call!"
			result += "[capitalize(backstory)]s were called, yet there were no fugitives...?"

	result += "
"

	return result.Join("
")


code:
GLOBAL_LIST_EMPTY(gangster_cell_phones)

/obj/item/gangster_cellphone
	name = "cell phone"
	desc = "TODO: funny joke about the 80s, brick phones"
	icon = 'icons/obj/gang/cell_phone.dmi'
	icon_state = "phone_off"
	throwforce = 15 // these things are dense as fuck
	var/gang_id = "Grove Street Families"
	var/activated = FALSE

/obj/item/gangster_cellphone/Initialize(mapload)
	. = ..()
	GLOB.gangster_cell_phones += src
	become_hearing_sensitive()

/obj/item/gangster_cellphone/Destroy()
	GLOB.gangster_cell_phones -= src
	. = ..()

/obj/item/gangster_cellphone/attack_self(mob/user, modifiers)
	. = ..()
	if(!activated)
		to_chat(user, "You turn on [src].")
		icon_state = "phone_on"
		activated = TRUE
	else
		to_chat(user, "You turn off [src].")
		icon_state = "phone_off"
		activated = FALSE

/obj/item/gangster_cellphone/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods)
	. = ..()
	if(!activated)
		return
	if(get_turf(speaker) != get_turf(src))
		return
	broadcast_message(raw_message, speaker)

/obj/item/gangster_cellphone/proc/broadcast_message(message, atom/movable/speaker)
	for(var/obj/item/gangster_cellphone/brick in GLOB.gangster_cell_phones)
		if(brick.gang_id == gang_id)
			brick.say_message(message, speaker)
	for(var/mob/dead/observer/player_mob in GLOB.player_list)
		if(!istype(player_mob, /mob/dead/observer))
			continue
		if(QDELETED(player_mob)) //Some times nulls and deleteds stay in this list. This is a workaround to prevent ic chat breaking for everyone when they do.
			continue //Remove if underlying cause (likely byond issue) is fixed. See TG PR #49004.
		if(player_mob.stat != DEAD) //not dead, not important
			continue
		if(get_dist(player_mob, src) > 7 || player_mob.z != z) //they're out of range of normal hearing
			if(!(player_mob.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
				continue
		var/link = FOLLOW_LINK(player_mob, src)
		to_chat(player_mob, span_gangradio("[link] [speaker.name] \[CELL: [gang_id]\] says, \"[message]\""))

/obj/item/gangster_cellphone/proc/say_message(message, atom/movable/speaker)
	for(var/mob/living/carbon/human/cellphone_hearer in get_turf(src))
		if(HAS_TRAIT(cellphone_hearer, TRAIT_DEAF))
			continue
		to_chat(cellphone_hearer, span_gangradio("[speaker.name] \[CELL: [gang_id]\] says, \"[message]\""))


code:
/datum/antagonist/gang
	name = "Family Member"
	roundend_category = "gangsters"
	ui_name = "AntagInfoGangmember"
	antag_hud_type = ANTAG_HUD_GANGSTER
	antag_hud_name = "hud_gangster"
	antagpanel_category = "Family"
	show_in_antagpanel = FALSE // i don't *think* this base class is buggy but it's too worthless to test
	suicide_cry = "FOR THE FAMILY!!"
	preview_outfit = /datum/outfit/gangster
	/// The overarching family that the owner of this datum is a part of. Family teams are generic and imprinted upon by the per-person antagonist datums.
	var/datum/team/gang/my_gang
	/// The name of the family corresponding to this family member datum.
	var/gang_name = "Leet Like Jeff K"
	/// The abbreviation of the family corresponding to this family member datum.
	var/gang_id = "LLJK"
	/// The list of clothes that are acceptable to show allegiance to this family.
	var/list/acceptable_clothes = list()
	/// The list of clothes that are given to family members upon induction into the family.
	var/list/free_clothes = list()
	/// The action used to spawn family induction packages.
	var/datum/action/cooldown/spawn_induction_package/package_spawner = new()
	/// Whether or not this family member is the first of their family.
	var/starter_gangster = FALSE
	/// The gangster's original real name. Used for renaming stuff, kept between gang switches.
	var/original_name
	/// Type of team to create when creating the gang in the first place. Used for renames.
	var/gang_team_type = /datum/team/gang

	/// A reference to the handler datum that manages the families gamemode. In case of no handler (admin-spawned during round), this will be null; this is fine.
	var/datum/gang_handler/handler

/datum/outfit/gangster
	name = "Gangster (Preview only)"

	uniform = /obj/item/clothing/under/suit/henchmen
	back = /obj/item/storage/backpack/henchmen

/datum/antagonist/gang/get_team()
	return my_gang

/datum/antagonist/gang/get_admin_commands()
	. = ..()
	.["Give extra equipment"] = CALLBACK(src,.proc/equip_gangster_in_inventory)

/datum/antagonist/gang/create_team(team_given) // gets called whenever add_antag_datum() is called on a mind
	if(team_given)
		my_gang = team_given
		return
	/* if team_given is falsey, this gang member didn't join a gang by using a recruitment package. so there are two things we need to consider
	1. does a gang handler exist -- does this round have a gang_handler instanced by the families gamemode or ruleset?
	2. does the gang we're trying to join already exist?
	if 1 is true and 2 is false, we were probably added by the gang_handler, and probably already have a "handler" var.
	if we don't have a "handler" var, and a gang_handler exists, we need to grab it, since our "handler" is null.
	if the gang exists, we need to join it; if the gang doesn't exist, we need to make it. */
	var/found_gang = FALSE
	for(var/datum/team/gang/gang_team in GLOB.antagonist_teams)
		if(gang_team.my_gang_datum.handler) // if one of the gangs in the gang list has a handler, nab that
			handler = gang_team.my_gang_datum.handler
		if(gang_team.name == gang_name)
			my_gang = gang_team
			found_gang = TRUE
			break
	if(!found_gang)
		var/new_gang = new gang_team_type()
		my_gang = new_gang
		if(handler) // if we have a handler, the handler should track this gang
			handler.gangs += my_gang
			my_gang.current_theme = handler.current_theme
		my_gang.name = gang_name
		my_gang.gang_id = gang_id
		my_gang.acceptable_clothes = acceptable_clothes.Copy()
		my_gang.free_clothes = free_clothes.Copy()
		my_gang.my_gang_datum = src
		starter_gangster = TRUE

/datum/antagonist/gang/on_gain()
	if(!original_name)
		original_name = owner.current.real_name
	my_gang.rename_gangster(owner, original_name, starter_gangster) // fully_replace_character_name
	if(starter_gangster)
		equip_gangster_in_inventory()
	var/datum/atom_hud/gang_hud = GLOB.huds[ANTAG_HUD_GANGSTER]
	gang_hud.add_hud_to(owner.current)
	owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/thatshowfamiliesworks.ogg', 100, FALSE, pressure_affected = FALSE, use_reverb = FALSE)
	..()

/datum/antagonist/gang/on_removal()
	if(my_gang.my_gang_datum == src) // if we're the first gangster, we need to replace ourselves so that objectives function correctly
		var/datum/antagonist/gang/replacement_datum = new type()
		replacement_datum.handler = handler
		replacement_datum.my_gang = my_gang
		my_gang.my_gang_datum = replacement_datum
		/* all we need to replace; the gang's "my_gang_datum" is just a person's datum because we assign it while we
		have that datum onhand. it would be easier if all of the code the gang team calls on its my_gang_datum was
		just in the team datum itself, and there were different types of teams instead of different types of gangster
		that imprint on generic teams, but i'm too lazy to refactor THAT too */
	var/datum/atom_hud/gang_hud = GLOB.huds[ANTAG_HUD_GANGSTER]
	gang_hud.remove_hud_from(owner.current)
	..()

/datum/antagonist/gang/apply_innate_effects(mob/living/mob_override)
	..()
	if(starter_gangster)
		package_spawner.Grant(owner.current)
		package_spawner.my_gang_datum = src
	var/mob/living/M = mob_override || owner.current
	add_antag_hud(antag_hud_type, antag_hud_name, M)

/datum/antagonist/gang/remove_innate_effects(mob/living/mob_override)
	if(starter_gangster)
		package_spawner.Remove(owner.current)
	var/mob/living/M = mob_override || owner.current
	remove_antag_hud(antag_hud_type, M)
	..()

/// Gives a gangster their equipment in their backpack and / or pockets.
/datum/antagonist/gang/proc/equip_gangster_in_inventory()
	if(istype(owner.current, /mob/living/carbon/human))
		var/obj/item/gangster_cellphone/phone = new()
		phone.gang_id = gang_name
		phone.name = "[gang_name] branded cell phone"
		var/mob/living/carbon/human/gangster_human = owner.current
		var/phone_equipped = phone.equip_to_best_slot(gangster_human)
		if(!phone_equipped)
			to_chat(owner.current, "Your [phone.name] has been placed at your feet.")
			phone.forceMove(get_turf(gangster_human))
		for(var/clothing in my_gang.free_clothes)
			var/obj/item/clothing_object = new clothing(owner.current)
			var/equipped = clothing_object.equip_to_best_slot(gangster_human)
			if(!equipped)
				to_chat(owner.current, "Your [clothing_object.name] has been placed at your feet.")
				clothing_object.forceMove(get_turf(gangster_human))
		if(my_gang.current_theme.bonus_items)
			for(var/bonus_item in my_gang.current_theme.bonus_items)
				var/obj/item/bonus_object = new bonus_item(owner.current)
				var/equipped = bonus_object.equip_to_best_slot(gangster_human)
				if(!equipped)
					to_chat(owner.current, "Your [bonus_object.name] has been placed at your feet.")
					bonus_object.forceMove(get_turf(gangster_human))
		if(starter_gangster)
			if(my_gang.current_theme.bonus_first_gangster_items)
				for(var/bonus_starter_item in my_gang.current_theme.bonus_first_gangster_items)
					var/obj/item/bonus_starter_object = new bonus_starter_item(owner.current)
					var/equipped = bonus_starter_object.equip_to_best_slot(gangster_human)
					if(!equipped)
						to_chat(owner.current, "Your [bonus_starter_object.name] has been placed at your feet.")
						bonus_starter_object.forceMove(get_turf(gangster_human))

/datum/antagonist/gang/ui_static_data(mob/user)
	var/list/data = list()
	data["gang_name"] = gang_name
	data["antag_name"] = name
	data["gang_objective"] = my_gang.current_theme.gang_objectives[type]

	var/list/clothes_we_can_wear = list()
	for(var/obj/item/accepted_item as anything in acceptable_clothes)
		clothes_we_can_wear |= initial(accepted_item.name)

	for(var/obj/item/free_item as anything in free_clothes)
		if(ispath(free_item, /obj/item/toy/crayon/spraycan))
			continue
		clothes_we_can_wear |= initial(free_item.name)

	data["gang_clothes"] = clothes_we_can_wear
	return data

/datum/team/gang
	/// The abbreviation of this family.
	var/gang_id = "LLJK"
	/// The list of clothes that are acceptable to show allegiance to this family.
	var/list/acceptable_clothes = list()
	/// The list of clothes that are given to family members upon induction into the family.
	var/list/free_clothes = list()
	/// The specific, occupied family member antagonist datum that is used to reach the handler / check objectives, and from which the above properties (sans points) are inherited.
	var/datum/antagonist/gang/my_gang_datum
	/// The current theme. Used to pull important stuff such as spawning equipment and objectives.
	var/datum/gang_theme/current_theme

/// Allow gangs to have custom naming schemes for their gangsters.
/datum/team/gang/proc/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/team/gang/roundend_report()
	var/list/report = list()
	report += "[name]:"
	if(!members.len)
		report += span_redtext("The family was wiped out!")
	if(current_theme.everyone_objective)
		report += "Objective: [current_theme.everyone_objective]"
	else
		var/assigned_objective = current_theme.gang_objectives[my_gang_datum.type]
		if(assigned_objective)
			report += "Objective: [assigned_objective]"
		else
			report += "Objective: ERROR, FILE A REPORT WITH THIS INFO: Gang Name: [my_gang_datum.name], Theme Name: [current_theme.name]"
	if(members.len)
		report += "[my_gang_datum.roundend_category] were:"
		report += printplayerlist(members)

	return "
[report.Join("
")]
"

/datum/action/cooldown/spawn_induction_package
	name = "Induct via Secret Handshake"
	desc = "Teach new recruits the Secret Handshake to join."
	check_flags = AB_CHECK_CONSCIOUS
	button_icon_state = "recruit"
	icon_icon = 'icons/obj/gang/actions.dmi'
	cooldown_time = 300
	/// The family antagonist datum of the "owner" of this action.
	var/datum/antagonist/gang/my_gang_datum

/datum/action/cooldown/spawn_induction_package/Trigger()
	if(!..())
		return FALSE
	if(!IsAvailable())
		return FALSE
	if(!my_gang_datum)
		return FALSE
	if(!istype(owner, /mob/living/carbon/human))
		return FALSE
	var/mob/living/carbon/human/H = owner
	if(H.stat)
		return FALSE

	var/obj/item/slapper/secret_handshake/secret_handshake_item = new(owner)
	if(owner.put_in_hands(secret_handshake_item))
		to_chat(owner, span_notice("You ready your secret handshake."))
	else
		qdel(secret_handshake_item)
		to_chat(owner, span_warning("You're incapable of performing a handshake in your current state."))
		return FALSE
	owner.visible_message(span_notice("[src] is offering to induct people into the Family."),
		span_notice("You offer to induct people into the Family."), null, 2)
	if(H.has_status_effect(STATUS_EFFECT_HANDSHAKE))
		return FALSE
	if(!(locate(/mob/living/carbon) in orange(1, owner)))
		owner.visible_message(span_danger("[src] offers to induct people into the Family, but nobody was around."), \
			span_warning("You offer to induct people into the Family, but nobody is around."), null, 2)
		return FALSE

	H.apply_status_effect(STATUS_EFFECT_HANDSHAKE, secret_handshake_item)
	StartCooldown()
	return TRUE

/datum/antagonist/gang/russian_mafia
	show_in_antagpanel = TRUE
	name = "Mafioso"
	roundend_category = "The mafiosos"
	gang_name = "Mafia"
	gang_id = "RM"
	acceptable_clothes = list(/obj/item/clothing/head/soft/red,
		/obj/item/clothing/neck/scarf/red,
		/obj/item/clothing/under/suit/white,
		/obj/item/clothing/head/beanie/red,
		/obj/item/clothing/head/ushanka)
	free_clothes = list(/obj/item/clothing/head/ushanka,
		/obj/item/clothing/under/suit/white,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Russian"
	gang_team_type = /datum/team/gang/russian_mafia

/datum/team/gang/russian_mafia/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Don [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/italian_mob
	show_in_antagpanel = TRUE
	name = "Mobster"
	roundend_category = "The mobsters"
	gang_name = "Mob"
	gang_id = "IM"
	acceptable_clothes = list(/obj/item/clothing/under/suit/checkered,
		/obj/item/clothing/head/fedora,
		/obj/item/clothing/neck/scarf/green,
		/obj/item/clothing/mask/bandana/green)
	free_clothes = list(/obj/item/clothing/head/fedora,
		/obj/item/clothing/under/suit/checkered,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Italian"
	gang_team_type = /datum/team/gang/russian_mafia

/datum/team/gang/russian_mafia/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Boss [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/tunnel_snakes
	show_in_antagpanel = TRUE
	name = "Tunnel Snake"
	roundend_category = "The Tunnel Snakes"
	gang_name = "Tunnel Snakes"
	gang_id = "TS"
	acceptable_clothes = list(/obj/item/clothing/under/pants/classicjeans,
		/obj/item/clothing/suit/jacket,
		/obj/item/clothing/mask/bandana/skull)
	free_clothes = list(/obj/item/clothing/suit/jacket,
		/obj/item/clothing/under/pants/classicjeans,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Snakes"
	gang_team_type = /datum/team/gang/tunnel_snakes

/datum/team/gang/tunnel_snakes/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "King Cobra [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/henchmen
	show_in_antagpanel = TRUE
	name = "Monarch Henchmen"
	roundend_category = "The Monarch henchmen"
	gang_name = "Monarch Crew"
	gang_id = "HENCH"
	acceptable_clothes = list(/obj/item/clothing/head/soft/yellow,
		/obj/item/clothing/under/suit/henchmen,
		/obj/item/clothing/neck/scarf/yellow,
		/obj/item/clothing/head/beanie/yellow,
		/obj/item/clothing/mask/bandana/gold,
		/obj/item/storage/backpack/henchmen)
	free_clothes = list(/obj/item/storage/backpack/henchmen,
		/obj/item/clothing/under/suit/henchmen,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Monarch"
	gang_team_type = /datum/team/gang/henchmen

/datum/team/gang/henchmen
	var/henchmen_count = 0

/datum/team/gang/henchmen/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	henchmen_count++
	gangster.current.fully_replace_character_name(gangster.current.real_name, "Number [henchmen_count]")

/datum/antagonist/gang/yakuza
	show_in_antagpanel = TRUE
	name = "Tojo Clan Member"
	roundend_category = "The Yakuza"
	gang_name = "Tojo Clan"
	gang_id = "YAK"
	acceptable_clothes = list(/obj/item/clothing/head/soft/yellow,
		/obj/item/clothing/under/costume/yakuza,
		/obj/item/clothing/shoes/yakuza,
		/obj/item/clothing/neck/scarf/yellow,
		/obj/item/clothing/head/beanie/yellow,
		/obj/item/clothing/mask/bandana/gold,
		/obj/item/clothing/head/hardhat,
		/obj/item/clothing/suit/yakuza)
	free_clothes = list(/obj/item/clothing/under/costume/yakuza,
		/obj/item/clothing/shoes/yakuza,
		/obj/item/clothing/suit/yakuza,
		/obj/item/clothing/head/hardhat,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Tojo"
	gang_team_type = /datum/team/gang/yakuza

/datum/team/gang/yakuza/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Patriarch [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/jackbros
	show_in_antagpanel = TRUE
	name = "Jack Bro"
	roundend_category = "The Hee-hos"
	gang_name = "Jack Bros"
	gang_id = "JB"
	acceptable_clothes = list(/obj/item/clothing/head/soft/blue,
		/obj/item/clothing/under/costume/jackbros,
		/obj/item/clothing/shoes/jackbros,
		/obj/item/clothing/head/jackbros,
		/obj/item/clothing/mask/bandana/blue)
	free_clothes = list(/obj/item/clothing/under/costume/jackbros,
		/obj/item/clothing/shoes/jackbros,
		/obj/item/clothing/head/jackbros,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "JackFrost"
	gang_team_type = /datum/team/gang/jackbros

/datum/team/gang/jackbros/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "King Frost [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/dutch
	show_in_antagpanel = TRUE
	name = "Dutch van der Linde Outlaw"
	roundend_category = "Dutch's outlaws"
	gang_name = "Dutch van der Linde's Gang"
	gang_id = "VDL"
	acceptable_clothes = list(/obj/item/clothing/head/soft/black,
		/obj/item/clothing/under/costume/dutch,
		/obj/item/clothing/suit/dutch,
		/obj/item/clothing/head/bowler,
		/obj/item/clothing/mask/bandana/black)
	free_clothes = list(/obj/item/clothing/under/costume/dutch,
		/obj/item/clothing/head/bowler,
		/obj/item/clothing/suit/dutch,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Dutch"
	gang_team_type = /datum/team/gang/dutch

/datum/team/gang/dutch/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Head Cowboy [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/irs
	show_in_antagpanel = TRUE
	name = "Internal Revenue Service Agent"
	roundend_category = "IRS Agents"
	gang_name = "Internal Revenue Service"
	gang_id = "IRS"
	acceptable_clothes = list(/obj/item/clothing/suit/irs,
		/obj/item/clothing/under/costume/irs,
		/obj/item/clothing/head/irs)
	free_clothes = list(/obj/item/clothing/suit/irs,
		/obj/item/clothing/under/costume/irs,
		/obj/item/clothing/head/irs,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "IRS"
	gang_team_type = /datum/team/gang/irs

/datum/team/gang/irs/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Revenue Supervisor [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Revenue Agent [last_name.match]")

/datum/antagonist/gang/osi
	show_in_antagpanel = TRUE
	name = "Office of Secret Intelligence Agent"
	roundend_category = "O.S.I. Agents"
	gang_name = "Office of Secret Intelligence"
	gang_id = "OSI"
	acceptable_clothes = list(/obj/item/clothing/suit/osi,
		/obj/item/clothing/under/costume/osi,
		/obj/item/clothing/glasses/osi)
	free_clothes = list(/obj/item/clothing/suit/osi,
		/obj/item/clothing/under/costume/osi,
		/obj/item/clothing/glasses/osi,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "OSI"
	gang_team_type = /datum/team/gang/osi

/datum/team/gang/osi/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "General [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Special Agent [last_name.match]")

/datum/antagonist/gang/tmc
	show_in_antagpanel = TRUE
	name = "Lost M.C. Biker"
	roundend_category = "Lost M.C. Bikers"
	gang_name = "The Lost M.C."
	gang_id = "TMC"
	acceptable_clothes = list(/obj/item/clothing/suit/tmc,
		/obj/item/clothing/under/costume/tmc,
		/obj/item/clothing/head/tmc)
	free_clothes = list(/obj/item/clothing/suit/tmc,
		/obj/item/clothing/under/costume/tmc,
		/obj/item/clothing/head/tmc,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "LostMC"
	gang_team_type = /datum/team/gang/tmc

/datum/team/gang/tmc/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "President [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/pg
	show_in_antagpanel = TRUE
	name = "Powder Ganger"
	roundend_category = "Powder Gangers"
	gang_name = "Powder Gangers"
	gang_id = "PG"
	acceptable_clothes = list(/obj/item/clothing/suit/pg,
		/obj/item/clothing/under/costume/pg,
		/obj/item/clothing/head/pg)
	free_clothes = list(/obj/item/clothing/suit/pg,
		/obj/item/clothing/under/costume/pg,
		/obj/item/clothing/head/pg,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "PowderGang"
	gang_team_type = /datum/team/gang/pg

/datum/team/gang/pg/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Head Convict [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/driscoll
	show_in_antagpanel = TRUE
	name = "O'Driscoll Gangster"
	roundend_category = "O'Driscoll's Gangsters"
	gang_name = "O'Driscoll's Gang"
	gang_id = "DB"
	acceptable_clothes = list(/obj/item/clothing/suit/driscoll,
		/obj/item/clothing/under/costume/driscoll,
		/obj/item/clothing/mask/gas/driscoll,
		/obj/item/clothing/shoes/cowboy)
	free_clothes = list(/obj/item/clothing/suit/driscoll,
		/obj/item/clothing/under/costume/driscoll,
		/obj/item/clothing/mask/gas/driscoll,
		/obj/item/clothing/shoes/cowboy,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Drill"
	gang_team_type = /datum/team/gang/driscoll

/datum/team/gang/driscoll/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Head Outlaw [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/deckers
	show_in_antagpanel = TRUE
	name = "Decker"
	roundend_category = "Deckers"
	gang_name = "Deckers"
	gang_id = "DK"
	acceptable_clothes = list(/obj/item/clothing/suit/deckers,
		/obj/item/clothing/under/costume/deckers,
		/obj/item/clothing/head/deckers,
		/obj/item/clothing/shoes/deckers)
	free_clothes = list(/obj/item/clothing/suit/deckers,
		/obj/item/clothing/under/costume/deckers,
		/obj/item/clothing/head/deckers,
		/obj/item/clothing/shoes/deckers,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Deckers"
	gang_team_type = /datum/team/gang/deckers

/datum/team/gang/deckers/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Master Hacker [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/morningstar
	show_in_antagpanel = TRUE
	name = "Morningstar Member"
	roundend_category = "Morningstar Member"
	gang_name = "Morningstar"
	gang_id = "MS"
	acceptable_clothes = list(/obj/item/clothing/suit/morningstar,
		/obj/item/clothing/under/costume/morningstar,
		/obj/item/clothing/head/morningstar,
		/obj/item/clothing/shoes/morningstar)
	free_clothes = list(/obj/item/clothing/suit/morningstar,
		/obj/item/clothing/under/costume/morningstar,
		/obj/item/clothing/head/morningstar,
		/obj/item/clothing/shoes/morningstar,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "MorningStar"
	gang_team_type = /datum/team/gang/morningstar

/datum/team/gang/morningstar/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Chief Executive Officer [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/saints
	show_in_antagpanel = TRUE
	name = "Third Street Saints Gangster"
	roundend_category = "Third Street Saints Gangsters"
	gang_name = "Third Street Saints"
	gang_id = "TSS"
	acceptable_clothes = list(/obj/item/clothing/suit/saints,
		/obj/item/clothing/under/costume/saints,
		/obj/item/clothing/head/saints,
		/obj/item/clothing/shoes/saints)
	free_clothes = list(/obj/item/clothing/suit/saints,
		/obj/item/clothing/under/costume/saints,
		/obj/item/clothing/head/saints,
		/obj/item/clothing/shoes/saints,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "TheSaints"
	gang_team_type = /datum/team/gang/saints

/datum/team/gang/saints/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Boss [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/phantom
	show_in_antagpanel = TRUE
	name = "Phantom Thief"
	roundend_category = "Phantom Thieves"
	gang_name = "Phantom Thieves of Hearts"
	gang_id = "PT"
	acceptable_clothes = list(/obj/item/clothing/suit/phantom,
		/obj/item/clothing/under/costume/phantom,
		/obj/item/clothing/glasses/phantom,
		/obj/item/clothing/shoes/phantom)
	free_clothes = list(/obj/item/clothing/suit/phantom,
		/obj/item/clothing/under/costume/phantom,
		/obj/item/clothing/glasses/phantom,
		/obj/item/clothing/shoes/phantom,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "PhantomThieves"
	gang_team_type = /datum/team/gang/phantom

/datum/team/gang/phantom/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Joker [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/allies
	show_in_antagpanel = TRUE
	name = "Allies G.I."
	roundend_category = "Allies"
	gang_name = "Allies"
	gang_id = "ALLIES"
	free_clothes = list(/obj/item/clothing/suit/allies,
		/obj/item/clothing/under/costume/allies,
		/obj/item/clothing/head/allies,
		/obj/item/clothing/gloves/color/black,
		/obj/item/clothing/shoes/jackboots,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Allies"
	gang_team_type = /datum/team/gang/allies

/datum/team/gang/allies/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Commander [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Private [last_name.match]")

/datum/antagonist/gang/soviet
	show_in_antagpanel = TRUE
	name = "Soviet Conscript"
	roundend_category = "Soviets"
	gang_name = "Soviets"
	gang_id = "SOV"
	free_clothes = list(/obj/item/clothing/suit/soviet,
		/obj/item/clothing/under/costume/soviet_families,
		/obj/item/clothing/head/ushanka/soviet,
		/obj/item/clothing/gloves/color/black,
		/obj/item/clothing/shoes/jackboots,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "Soviets"
	gang_team_type = /datum/team/gang/soviet

/datum/team/gang/soviet/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Comrade General [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Conscript [last_name.match]")

/datum/antagonist/gang/yuri
	show_in_antagpanel = TRUE
	name = "Yuri Initiate"
	roundend_category = "Yuri's Army"
	gang_name = "Yuri's Army"
	gang_id = "YR"
	free_clothes = list(/obj/item/clothing/suit/yuri,
		/obj/item/clothing/under/costume/yuri,
		/obj/item/clothing/head/yuri,
		/obj/item/clothing/gloves/color/black,
		/obj/item/clothing/shoes/jackboots,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "YuriArmy"
	gang_team_type = /datum/team/gang/yuri

/datum/team/gang/yuri/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Initiate Prime [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Initiate [last_name.match]")

/datum/antagonist/gang/sybil_slickers
	show_in_antagpanel = TRUE
	name = "Sybil Slicker"
	roundend_category = "Sybil Slickers"
	gang_name = "Sybil Slickers"
	gang_id = "SS"
	free_clothes = list(/obj/item/clothing/suit/sybil_slickers,
		/obj/item/clothing/under/costume/sybil_slickers,
		/obj/item/clothing/head/sybil_slickers,
		/obj/item/clothing/gloves/tackler/football,
		/obj/item/clothing/shoes/sybil_slickers,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "SybilSlickers"
	gang_team_type = /datum/team/gang/sybil_slickers

/datum/team/gang/sybil_slickers/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Sybil Coach [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)

/datum/antagonist/gang/basil_boys
	show_in_antagpanel = TRUE
	name = "Basil Boy"
	roundend_category = "Basil Boys"
	gang_name = "Basil Boys"
	gang_id = "BB"
	free_clothes = list(/obj/item/clothing/suit/basil_boys,
		/obj/item/clothing/under/costume/basil_boys,
		/obj/item/clothing/head/basil_boys,
		/obj/item/clothing/gloves/tackler/football,
		/obj/item/clothing/shoes/basil_boys,
		/obj/item/toy/crayon/spraycan)
	antag_hud_name = "BasilBoys"
	gang_team_type = /datum/team/gang/basil_boys

/datum/team/gang/basil_boys/rename_gangster(datum/mind/gangster, original_name, starter_gangster)
	var/static/regex/last_name = new("\[^\\s-\]+$") //First word before whitespace or "-"
	last_name.Find(original_name)
	if(starter_gangster)
		gangster.current.fully_replace_character_name(gangster.current.real_name, "Basil Coach [last_name.match]")
	else
		gangster.current.fully_replace_character_name(gangster.current.real_name, original_name)