From 876bd5506994f9479f7d7b58c3cbea55a9a21b77 Mon Sep 17 00:00:00 2001
From: Contrabang <91113370+Contrabang@users.noreply.github.com>
Date: Wed, 8 Jan 2025 09:20:08 -0500
Subject: [PATCH] Datumizes Abductors (#27726)
* oops
* *fucking rips abductors to shreds*
* shitcode begone
* sure why not
* and its ready!
* forgot this
* funnyman review
---
code/datums/mind.dm | 75 ++----
code/game/gamemodes/game_mode.dm | 2 +
.../miniantags/abduction/abduction.dm | 219 +++---------------
.../abduction/machinery/experiment.dm | 5 +-
code/modules/admin/misc_admin_procs.dm | 2 +-
.../antagonists/abductor/datum_abductor.dm | 51 ++++
.../antagonists/abductor/team_abductor.dm | 96 ++++++++
code/modules/events/abductor_event.dm | 52 ++---
code/modules/mob/dead/observer/orbit.dm | 3 +-
.../mob/living/silicon/silicon_login.dm | 2 +-
paradise.dme | 2 +
11 files changed, 219 insertions(+), 290 deletions(-)
create mode 100644 code/modules/antagonists/abductor/datum_abductor.dm
create mode 100644 code/modules/antagonists/abductor/team_abductor.dm
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 52393490b2e..63d5401e225 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -419,9 +419,8 @@
/datum/mind/proc/memory_edit_abductor(mob/living/carbon/human/H)
. = _memory_edit_header("abductor")
- if(src in SSticker.mode.abductors)
+ if(has_antag_datum(/datum/antagonist/abductor))
. += "ABDUCTOR|no"
- . += "|undress|equip"
else
. += "abductor|NO"
@@ -1489,28 +1488,15 @@
else if(href_list["abductor"])
switch(href_list["abductor"])
if("clear")
- to_chat(usr, "Not implemented yet. Sorry!")
- //ticker.mode.update_abductor_icons_removed(src)
+ to_chat(usr, "This will probably never be implemented. Sorry!")
if("abductor")
if(!ishuman(current))
to_chat(usr, "This only works on humans!")
return
make_Abductor()
log_admin("[key_name(usr)] turned [current] into an abductor.")
- SSticker.mode.update_abductor_icons_added(src)
+ message_admins("[key_name_admin(usr)] turned [key_name_admin(current)] into an abductor.")
current.create_log(MISC_LOG, "[current] was made into an abductor by [key_name_admin(usr)]")
- if("equip")
- if(!ishuman(current))
- to_chat(usr, "This only works on humans!")
- return
-
- var/mob/living/carbon/human/H = current
- var/gear = alert("Agent or Scientist Gear", "Gear", "Agent", "Scientist")
- if(gear)
- if(gear=="Agent")
- H.equipOutfit(/datum/outfit/abductor/agent)
- else
- H.equipOutfit(/datum/outfit/abductor/scientist)
else if(href_list["silicon"])
switch(href_list["silicon"])
@@ -1726,51 +1712,24 @@
SSticker.mode.mindflayers |= src
/datum/mind/proc/make_Abductor()
- var/role = alert("Abductor Role?", "Role", "Agent", "Scientist")
- var/team = input("Abductor Team?", "Team?") in list(1,2,3,4)
- var/teleport = alert("Teleport to ship?", "Teleport", "Yes", "No")
-
- if(!role || !team || !teleport)
+ if(alert(usr, "Are you sure you want to turn this person into an abductor? This can't be undone!", "New Abductor?", "Yes", "No") != "Yes")
return
- if(!ishuman(current))
+ for(var/datum/team/abductor/team in SSticker.mode.actual_abductor_teams)
+ if(length(team.members) < 2)
+ team.add_member(src)
+ team.create_agent()
+ team.create_scientist()
+ return
+ var/role = alert("Abductor Role?", "Role", "Agent", "Scientist", "Cancel")
+ if(!role || role == "Cancel")
return
+ var/datum/team/abductor/team = new /datum/team/abductor(list(src))
+ if(role == "Agent")
+ team.create_agent()
+ else
+ team.create_scientist()
- SSticker.mode.abductors |= src
-
- add_mind_objective(/datum/objective/stay_hidden)
- add_mind_objective(/datum/objective/experiment)
-
- var/mob/living/carbon/human/H = current
-
- H.set_species(/datum/species/abductor)
- var/datum/species/abductor/S = H.dna.species
-
- if(role == "Scientist")
- S.scientist = TRUE
-
- S.team = team
-
- var/list/obj/effect/landmark/abductor/agent_landmarks = list()
- var/list/obj/effect/landmark/abductor/scientist_landmarks = list()
- agent_landmarks.len = 4
- scientist_landmarks.len = 4
- for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
- if(istype(A, /obj/effect/landmark/abductor/agent))
- agent_landmarks[text2num(A.team)] = A
- else if(istype(A, /obj/effect/landmark/abductor/scientist))
- scientist_landmarks[text2num(A.team)] = A
-
- var/obj/effect/landmark/L
- if(teleport == "Yes")
- switch(role)
- if("Agent")
- L = agent_landmarks[team]
- if("Scientist")
- L = agent_landmarks[team]
- H.forceMove(L.loc)
- SEND_SOUND(H, sound('sound/ambience/antag/abductors.ogg'))
- H.create_log(MISC_LOG, "[H] was made into an abductor")
/datum/mind/proc/AddSpell(datum/spell/S)
spell_list += S
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index dea52357f81..39c7f0c0d56 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -81,6 +81,8 @@
var/list/datum/mind/abductors = list()
/// A list which contains the minds of all abductees
var/list/datum/mind/abductees = list()
+ /// A list which contains the all the abductor teams
+ var/list/datum/team/abductor/actual_abductor_teams = list()
/// A list of all the nuclear operatives' minds
var/list/datum/mind/syndicates = list()
diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm
index 2e9cd296707..7052199a26c 100644
--- a/code/game/gamemodes/miniantags/abduction/abduction.dm
+++ b/code/game/gamemodes/miniantags/abduction/abduction.dm
@@ -3,15 +3,10 @@
config_tag = "abduction"
recommended_enemies = 2
required_players = 15
- var/max_teams = 4
abductor_teams = 1
single_antag_positions = list()
- var/list/datum/mind/scientists = list()
- var/list/datum/mind/agents = list()
- var/list/datum/objective/team_objectives = list()
- var/list/team_names = list()
+ var/max_teams = 4
var/finished = FALSE
- var/list/datum/mind/possible_abductors = list()
/datum/game_mode/abduction/announce()
to_chat(world, "The current game mode is - Abduction!")
@@ -20,165 +15,36 @@
to_chat(world, "Crew - don't get abducted and stop the abductors.")
/datum/game_mode/abduction/pre_setup()
- possible_abductors = get_players_for_role(ROLE_ABDUCTOR)
-
+ var/possible_abductors = get_players_for_role(ROLE_ABDUCTOR)
if(!length(possible_abductors))
- return 0
+ return FALSE
- abductor_teams = max(1, min(max_teams,round(num_players()/15)))
- var/possible_teams = max(1,round(length(possible_abductors) / 2))
- abductor_teams = min(abductor_teams,possible_teams)
+ abductor_teams = clamp(min(round(num_players() / 15), round(length(possible_abductors) / 2)), 1, max_teams)
- abductors.len = 2*abductor_teams
- scientists.len = abductor_teams
- agents.len = abductor_teams
- team_objectives.len = abductor_teams
- team_names.len = abductor_teams
+ for(var/i in 1 to abductor_teams)
+ var/datum/mind/mind_1 = pick_n_take(possible_abductors)
+ var/datum/mind/mind_2 = pick_n_take(possible_abductors)
+ if(!mind_1 || !mind_2)
+ break
+ new /datum/team/abductor(list(mind_1, mind_2))
- for(var/i=1,i<=abductor_teams,i++)
- if(!make_abductor_team(i))
- return 0
+ // Add a special role so they dont pick up any other antagonist stuff
+ mind_1.assigned_role = SPECIAL_ROLE_ABDUCTOR_AGENT
+ mind_1.special_role = SPECIAL_ROLE_ABDUCTOR_AGENT
+ mind_1.offstation_role = TRUE
+
+ mind_2.assigned_role = SPECIAL_ROLE_ABDUCTOR_SCIENTIST
+ mind_2.special_role = SPECIAL_ROLE_ABDUCTOR_SCIENTIST
+ mind_2.offstation_role = TRUE
..()
- return 1
-
-/datum/game_mode/abduction/proc/make_abductor_team(team_number,preset_agent=null,preset_scientist=null)
- //Team Name
- team_names[team_number] = "Mothership [pick(GLOB.greek_letters)]" //TODO Ensure unique and actual alieny names
- //Team Objective
- var/datum/objective/experiment/team_objective = new
- team_objective.abductor_team_number = team_number
- team_objectives[team_number] = team_objective
- //Team Members
-
- if(!preset_agent || !preset_scientist)
- if(length(possible_abductors) <=2)
- return 0
-
- var/datum/mind/scientist
- var/datum/mind/agent
-
- if(!preset_scientist)
- scientist = pick(possible_abductors)
- possible_abductors -= scientist
- else
- scientist = preset_scientist
-
- if(!preset_agent)
- agent = pick(possible_abductors)
- possible_abductors -= agent
- else
- agent = preset_agent
-
-
- scientist.assigned_role = SPECIAL_ROLE_ABDUCTOR_SCIENTIST
- scientist.special_role = SPECIAL_ROLE_ABDUCTOR_SCIENTIST
- scientist.offstation_role = TRUE
- log_game("[key_name(scientist)] has been selected as an abductor team [team_number] scientist.")
-
- agent.assigned_role = SPECIAL_ROLE_ABDUCTOR_AGENT
- agent.special_role = SPECIAL_ROLE_ABDUCTOR_AGENT
- agent.offstation_role = TRUE
- log_game("[key_name(agent)] has been selected as an abductor team [team_number] agent.")
-
- abductors |= agent
- abductors |= scientist
- scientists[team_number] = scientist
- agents[team_number] = agent
- return 1
+ return TRUE
/datum/game_mode/abduction/post_setup()
- for(var/team_number=1,team_number<=abductor_teams,team_number++)
- post_setup_team(team_number)
+ for(var/datum/team/abductor/team in actual_abductor_teams)
+ team.create_agent()
+ team.create_scientist()
return ..()
-//Used for create antag buttons
-/datum/game_mode/abduction/proc/post_setup_team(team_number)
- var/list/obj/effect/landmark/abductor/agent_landmarks = list()
- var/list/obj/effect/landmark/abductor/scientist_landmarks = list()
- agent_landmarks.len = max_teams
- scientist_landmarks.len = max_teams
- for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
- if(istype(A,/obj/effect/landmark/abductor/agent))
- agent_landmarks[text2num(A.team)] = A
- else if(istype(A,/obj/effect/landmark/abductor/scientist))
- scientist_landmarks[text2num(A.team)] = A
-
- var/team_name = team_names[team_number]
-
- var/datum/mind/agent
- var/obj/effect/landmark/L
- var/datum/mind/scientist
- var/mob/living/carbon/human/H
- var/datum/species/abductor/S
-
- team_name = team_names[team_number]
- agent = agents[team_number]
- H = agent.current
- L = agent_landmarks[team_number]
- H.forceMove(get_turf(L))
- H.body_accessory = null
- H.set_species(/datum/species/abductor)
- S = H.dna.species
- S.team = team_number
- H.real_name = team_name + " Agent"
- H.cleanSE() //No fat/blind/colourblind/epileptic/whatever ayys.
- H.overeatduration = 0
- H.dna.flavor_text = null
- H.flavor_text = null
- H.equipOutfit(/datum/outfit/abductor/agent)
- greet_agent(agent,team_number)
- update_abductor_icons_added(agent)
-
- scientist = scientists[team_number]
- H = scientist.current
- L = scientist_landmarks[team_number]
- H.forceMove(get_turf(L))
- H.body_accessory = null
- H.set_species(/datum/species/abductor)
- S = H.dna.species
- S.scientist = TRUE
- S.team = team_number
- H.real_name = team_name + " Scientist"
- H.cleanSE() //No fat/blind/colourblind/epileptic/whatever ayys.
- H.overeatduration = 0
- H.dna.flavor_text = null
- H.flavor_text = null
- H.equipOutfit(/datum/outfit/abductor/scientist)
- greet_scientist(scientist,team_number)
- update_abductor_icons_added(scientist)
-
-/datum/game_mode/abduction/proc/greet_agent(datum/mind/abductor, team_number)
- var/datum/objective/stay_hidden/O = new
- abductor.add_mind_objective(O)
- abductor.objective_holder.add_objective(team_objectives[team_number]) // this needs to be changed when abductor teams are changed to actual antag teams
- var/team_name = team_names[team_number]
-
- SEND_SOUND(abductor.current, sound('sound/ambience/antag/abductors.ogg'))
- var/list/messages = list()
- messages.Add("You are an agent of [team_name]!")
- messages.Add("With the help of your teammate, kidnap and experiment on station crew members!")
- messages.Add("Use your stealth technology and equipment to incapacitate humans for your scientist to retrieve.")
- messages.Add("For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Abductor)")
- messages.Add(abductor.prepare_announce_objectives())
- to_chat(abductor.current, chat_box_red(messages.Join("
")))
- abductor.current.create_log(MISC_LOG, "[abductor.current] was made into an abductor agent")
-
-/datum/game_mode/abduction/proc/greet_scientist(datum/mind/abductor, team_number)
- var/datum/objective/stay_hidden/O = new
- abductor.add_mind_objective(O)
- abductor.objective_holder.add_objective(team_objectives[team_number]) // this needs to be changed when abductor teams are changed to actual antag teams
- var/team_name = team_names[team_number]
-
- SEND_SOUND(abductor.current, sound('sound/ambience/antag/abductors.ogg'))
- var/list/messages = list()
- messages.Add("You are a scientist of [team_name]!")
- messages.Add("With the help of your teammate, kidnap and experiment on station crew members!")
- messages.Add("Use your tool and ship consoles to support the agent and retrieve human specimens.")
- messages.Add("For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Abductor)")
- messages.Add(abductor.prepare_announce_objectives())
- to_chat(abductor.current, chat_box_red(messages.Join("
")))
- abductor.current.create_log(MISC_LOG, "[abductor.current] was made into an abductor scientist")
-
/datum/game_mode/abduction/proc/get_team_console(team_number)
for(var/obj/machinery/abductor/console/C in GLOB.machines)
if(C.team == team_number)
@@ -186,10 +52,9 @@
/datum/game_mode/abduction/check_finished()
if(!finished)
- for(var/team_number=1,team_number<=abductor_teams,team_number++)
- var/obj/machinery/abductor/console/con = get_team_console(team_number)
- var/datum/objective/objective = team_objectives[team_number]
- if(con.experiment.points >= objective.target_amount)
+ for(var/datum/team/abductor/team in actual_abductor_teams)
+ var/obj/machinery/abductor/console/con = get_team_console(team.team_number)
+ if(con.experiment.points >= team.experiment_objective.target_amount)
SSshuttle.emergency.request(null, 0.5, reason = "Large amount of abnormal thought patterns detected. All crew are recalled for mandatory evaluation and reconditioning.")
SSshuttle.emergency.canRecall = FALSE
finished = TRUE
@@ -197,14 +62,12 @@
return ..()
/datum/game_mode/abduction/declare_completion()
- for(var/team_number=1,team_number<=abductor_teams,team_number++)
- var/obj/machinery/abductor/console/console = get_team_console(team_number)
- var/datum/objective/objective = team_objectives[team_number]
- var/team_name = team_names[team_number]
- if(console.experiment.points >= objective.target_amount)
- to_chat(world, "[team_name] team fulfilled its mission!")
+ for(var/datum/team/abductor/team in actual_abductor_teams)
+ var/obj/machinery/abductor/console/console = get_team_console(team.team_number)
+ if(console.experiment.points >= team.experiment_objective.target_amount)
+ to_chat(world, "[team.name] team fulfilled its mission!")
else
- to_chat(world, "[team_name] team failed its mission.")
+ to_chat(world, "[team.name] team failed its mission.")
..()
return 1
@@ -271,25 +134,3 @@
else
return FALSE
return FALSE
-
-/datum/game_mode/proc/remove_abductor(datum/mind/abductor_mind)
- if(abductor_mind in abductors)
- SSticker.mode.abductors -= abductor_mind
- abductor_mind.special_role = null
- abductor_mind.current.create_attack_log("No longer abductor")
- abductor_mind.current.create_log(CONVERSION_LOG, "No longer abductor")
- if(issilicon(abductor_mind.current))
- to_chat(abductor_mind.current, "You have been turned into a robot! You are no longer an abductor.")
- else
- to_chat(abductor_mind.current, "You have been brainwashed! You are no longer an abductor.")
- SSticker.mode.update_abductor_icons_removed(abductor_mind)
-
-/datum/game_mode/proc/update_abductor_icons_added(datum/mind/alien_mind)
- var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
- hud.join_hud(alien_mind.current)
- set_antag_hud(alien_mind.current, ((alien_mind in abductors) ? "abductor" : "abductee"))
-
-/datum/game_mode/proc/update_abductor_icons_removed(datum/mind/alien_mind)
- var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
- hud.leave_hud(alien_mind.current)
- set_antag_hud(alien_mind.current, null)
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
index 339d4f4e773..2084fdab665 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
@@ -141,7 +141,10 @@
H.mind.add_mind_objective(O)
var/list/messages = H.mind.prepare_announce_objectives()
to_chat(H, chat_box_red(messages.Join("
"))) // let the player know they have a new objective
- SSticker.mode.update_abductor_icons_added(H.mind)
+
+ var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
+ hud.join_hud(H)
+ set_antag_hud(H, "abductee")
for(var/obj/item/organ/internal/heart/gland/G in H.internal_organs)
G.Start()
diff --git a/code/modules/admin/misc_admin_procs.dm b/code/modules/admin/misc_admin_procs.dm
index b3b3f1ac9f4..aee3772ced0 100644
--- a/code/modules/admin/misc_admin_procs.dm
+++ b/code/modules/admin/misc_admin_procs.dm
@@ -672,7 +672,7 @@ GLOBAL_VAR_INIT(disable_explosions, FALSE)
antag_list += "Wizard"
if(IS_CHANGELING(M))
antag_list += "Changeling"
- if(M.mind in SSticker.mode.abductors)
+ if(M.mind.has_antag_datum(/datum/antagonist/abductor))
antag_list += "Abductor"
if(M.mind.has_antag_datum(/datum/antagonist/vampire))
antag_list += "Vampire"
diff --git a/code/modules/antagonists/abductor/datum_abductor.dm b/code/modules/antagonists/abductor/datum_abductor.dm
new file mode 100644
index 00000000000..5a2365bf161
--- /dev/null
+++ b/code/modules/antagonists/abductor/datum_abductor.dm
@@ -0,0 +1,51 @@
+
+/datum/antagonist/abductor
+ name = "Abductor"
+ roundend_category = "abductors"
+ job_rank = ROLE_ABDUCTOR
+ special_role = SPECIAL_ROLE_ABDUCTOR_AGENT
+ give_objectives = FALSE
+ antag_hud_name = "abductor"
+ antag_hud_type = ANTAG_HUD_ABDUCTOR
+ clown_gain_text = "How are you a clown and an abductor? This is a bug!"
+ clown_removal_text = "How are you a clown and an abductor? This is a bug!"
+ wiki_page_name = "Abductor"
+ var/datum/team/abductor/our_team
+
+/datum/antagonist/abductor/on_gain()
+ . = ..()
+ owner.assigned_role = special_role
+ owner.offstation_role = TRUE
+ SEND_SOUND(owner.current, sound('sound/ambience/antag/abductors.ogg'))
+
+/datum/antagonist/abductor/greet()
+ var/list/messages = list()
+ messages.Add("You are an agent of [our_team.name]!")
+ messages.Add("With the help of your teammate, kidnap and experiment on station crew members! Use your stealth technology and equipment to incapacitate humanoids for your scientist to retrieve.")
+ return messages
+
+/datum/antagonist/abductor/add_owner_to_gamemode()
+ SSticker.mode.abductors |= owner
+
+/datum/antagonist/abductor/remove_owner_from_gamemode()
+ SSticker.mode.abductors -= owner
+
+/datum/antagonist/abductor/get_team()
+ return our_team
+
+/datum/antagonist/abductor/proc/equip_abductor()
+ var/mob/living/carbon/human/agent = owner.current
+ agent.equipOutfit(/datum/outfit/abductor/agent)
+
+/datum/antagonist/abductor/scientist
+ special_role = SPECIAL_ROLE_ABDUCTOR_SCIENTIST
+
+/datum/antagonist/abductor/scientist/equip_abductor()
+ var/mob/living/carbon/human/scientist = owner.current
+ scientist.equipOutfit(/datum/outfit/abductor/scientist)
+
+/datum/antagonist/abductor/scientist/greet()
+ var/list/messages = list()
+ messages.Add("You are a scientist of [our_team.name]!")
+ messages.Add("With the help of your teammate, kidnap and experiment on station crew members! Use your tool and ship consoles to support the agent and retrieve humanoid specimens.")
+ return messages
diff --git a/code/modules/antagonists/abductor/team_abductor.dm b/code/modules/antagonists/abductor/team_abductor.dm
new file mode 100644
index 00000000000..281bdd2fe57
--- /dev/null
+++ b/code/modules/antagonists/abductor/team_abductor.dm
@@ -0,0 +1,96 @@
+RESTRICT_TYPE(/datum/team/abductor)
+
+/datum/team/abductor
+ name = "Abductor"
+ var/team_number
+ var/datum/mind/agent
+ var/datum/mind/scientist
+ var/datum/objective/experiment/experiment_objective
+
+/datum/team/abductor/create_team(list/starting_members)
+ . = ..()
+ handle_team_number()
+ name = "Mothership [pick(GLOB.greek_letters)]" //TODO Ensure unique and actual alieny names
+
+ add_team_objective(/datum/objective/stay_hidden)
+ var/datum/objective/experiment/experiment = new
+ experiment.abductor_team_number = team_number
+ experiment_objective = experiment
+ add_team_objective(experiment)
+
+/datum/team/abductor/can_create_team()
+ return length(SSticker.mode.actual_abductor_teams) < 4
+
+/datum/team/abductor/assign_team(list/starting_members)
+ SSticker.mode.actual_abductor_teams |= src
+
+/datum/team/abductor/clear_team_reference()
+ SSticker.mode.actual_abductor_teams -= src
+
+/datum/team/abductor/get_admin_commands()
+ return list(
+ "Create Agent" = CALLBACK(src, PROC_REF(create_agent)),
+ "Create Scientist" = CALLBACK(src, PROC_REF(create_scientist))
+ )
+
+/datum/team/abductor/proc/handle_team_number()
+ // Maybe someday, make this more complex to make sure if a team is lost somehow, that we can recycle their number
+ team_number = length(SSticker.mode.actual_abductor_teams)
+
+/datum/team/abductor/proc/create_body(location, datum/mind/mind, is_scientist = FALSE)
+ var/mob/living/carbon/human/body = new /mob/living/carbon/human/abductor(location)
+ var/datum/species/abductor/abductor_species = body.dna.species
+ abductor_species.team = team_number
+ abductor_species.scientist = is_scientist
+ var/old_body = mind.current
+ mind.transfer_to(body)
+ if(old_body)
+ qdel(old_body)
+
+ var/datum_type = /datum/antagonist/abductor
+ body.real_name = name + " Agent"
+ if(is_scientist)
+ datum_type = /datum/antagonist/abductor/scientist
+ body.real_name = name + " Scientist"
+ mind.name = body.real_name
+ mind.set_original_mob(body)
+
+ var/datum/antagonist/abductor/antag = new datum_type()
+ antag.our_team = src
+ mind.add_antag_datum(antag)
+ antag.equip_abductor()
+
+ if(is_scientist)
+ scientist = mind
+ else
+ agent = mind
+
+/datum/team/abductor/proc/create_agent()
+ if(agent)
+ return
+ var/turf/target_loc
+ var/turf/backup
+ for(var/obj/effect/landmark/abductor/agent/A in GLOB.landmarks_list)
+ if(A.team == team_number)
+ target_loc = get_turf(A)
+ else
+ backup = get_turf(A)
+ var/list/available_minds = (members - scientist)
+ if(!length(available_minds))
+ return
+ create_body(target_loc || backup, pick(available_minds), is_scientist = FALSE)
+
+/datum/team/abductor/proc/create_scientist()
+ if(scientist)
+ return
+ var/turf/target_loc
+ var/turf/backup
+ for(var/obj/effect/landmark/abductor/scientist/A in GLOB.landmarks_list)
+ if(A.team == team_number)
+ target_loc = get_turf(A)
+ else
+ backup = get_turf(A)
+ var/list/available_minds = (members - agent)
+ if(!length(available_minds))
+ return
+ create_body(target_loc || backup, pick(available_minds), is_scientist = TRUE)
diff --git a/code/modules/events/abductor_event.dm b/code/modules/events/abductor_event.dm
index aef93f7ef78..a1fb43c30a0 100644
--- a/code/modules/events/abductor_event.dm
+++ b/code/modules/events/abductor_event.dm
@@ -10,44 +10,20 @@
/datum/event/abductor/proc/makeAbductorTeam()
var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you wish to be considered for an Abductor Team?", ROLE_ABDUCTOR, TRUE)
+ if(length(candidates) < 2)
+ return FALSE
- if(length(candidates) >= 2)
- //Oh god why we can't have static functions
- var/number = SSticker.mode.abductor_teams + 1
+ var/list/minds = list()
+ for(var/i in 1 to 2)
+ var/mob/ghost = pick_n_take(candidates)
+ var/list/key = ghost.key
+ dust_if_respawnable(ghost)
- var/datum/game_mode/abduction/temp
- if(SSticker.mode.config_tag == "abduction")
- temp = SSticker.mode
- else
- temp = new
+ var/datum/mind/mind = new /datum/mind(key)
+ mind.active = TRUE
+ minds += mind
- var/mob/agent_mind = pick(candidates)
- candidates -= agent_mind
- var/mob/scientist_mind = pick(candidates)
-
- var/mob/living/carbon/human/agent=makeBody(agent_mind)
- var/mob/living/carbon/human/scientist=makeBody(scientist_mind)
-
- agent_mind = agent.mind
- scientist_mind = scientist.mind
-
- temp.scientists.len = number
- temp.agents.len = number
- temp.abductors.len = 2*number
- temp.team_objectives.len = number
- temp.team_names.len = number
- temp.scientists[number] = scientist_mind
- temp.agents[number] = agent_mind
- temp.abductors |= list(agent_mind,scientist_mind)
- temp.make_abductor_team(number,preset_scientist=scientist_mind,preset_agent=agent_mind)
- temp.post_setup_team(number)
- dust_if_respawnable(agent_mind)
- dust_if_respawnable(scientist)
-
- SSticker.mode.abductor_teams++
-
- if(SSticker.mode.config_tag != "abduction")
- SSticker.mode.abductors |= temp.abductors
- return 1
- else
- return 0
+ var/datum/team/abductor/ayys = new /datum/team/abductor(minds)
+ ayys.create_agent()
+ ayys.create_scientist()
+ return TRUE
diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm
index c83753cb1ad..53bb48cb309 100644
--- a/code/modules/mob/dead/observer/orbit.dm
+++ b/code/modules/mob/dead/observer/orbit.dm
@@ -121,8 +121,7 @@ GLOBAL_DATUM_INIT(orbit_menu, /datum/orbit_menu, new)
if(SSticker && SSticker.mode)
other_antags += list(
"Blob" = (mind.special_role == SPECIAL_ROLE_BLOB),
- "Nuclear Operative" = (mind in SSticker.mode.syndicates),
- "Abductor" = (mind in SSticker.mode.abductors)
+ "Nuclear Operative" = (mind in SSticker.mode.syndicates)
)
for(var/antag_name in other_antags)
diff --git a/code/modules/mob/living/silicon/silicon_login.dm b/code/modules/mob/living/silicon/silicon_login.dm
index 3786144abc6..6cc2f4f72af 100644
--- a/code/modules/mob/living/silicon/silicon_login.dm
+++ b/code/modules/mob/living/silicon/silicon_login.dm
@@ -6,5 +6,5 @@
mind.remove_antag_datum(/datum/antagonist/wizard)
mind.remove_antag_datum(/datum/antagonist/changeling)
mind.remove_antag_datum(/datum/antagonist/vampire)
- SSticker.mode.remove_abductor(mind)
+ mind.remove_antag_datum(/datum/antagonist/abductor)
..()
diff --git a/paradise.dme b/paradise.dme
index 8b3a447dd44..00410929ad3 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -1518,6 +1518,8 @@
#include "code\modules\antagonists\_common\antag_hud.dm"
#include "code\modules\antagonists\_common\antag_spawner.dm"
#include "code\modules\antagonists\_common\antag_team.dm"
+#include "code\modules\antagonists\abductor\team_abductor.dm"
+#include "code\modules\antagonists\abductor\datum_abductor.dm"
#include "code\modules\antagonists\antag_org\antag_org_datum.dm"
#include "code\modules\antagonists\antag_org\antag_org_syndicate.dm"
#include "code\modules\antagonists\changeling\changeling_power.dm"