[MIRROR] subsystem antag (#12599)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-03-26 19:40:03 -07:00
committed by GitHub
parent 9d7e5e7cf7
commit 092c641c3c
48 changed files with 234 additions and 242 deletions
-82
View File
@@ -140,85 +140,3 @@ GLOBAL_VAR(syndicate_name)
GLOB.syndicate_name = name
return name
//Traitors and traitor silicons will get these. Revs will not.
GLOBAL_VAR(syndicate_code_phrase) //Code phrase for traitors.
GLOBAL_VAR(syndicate_code_response) //Code response for traitors.
/*
Should be expanded.
How this works:
Instead of "I'm looking for James Smith," the traitor would say "James Smith" as part of a conversation.
Another traitor may then respond with: "They enjoy running through the void-filled vacuum of the derelict."
The phrase should then have the words: James Smith.
The response should then have the words: run, void, and derelict.
This way assures that the code is suited to the conversation and is unpredicatable.
Obviously, some people will be better at this than others but in theory, everyone should be able to do it and it only enhances roleplay.
Can probably be done through "{ }" but I don't really see the practical benefit.
One example of an earlier system is commented below.
-N
*/
/proc/generate_code_phrase()//Proc is used for phrase and response in master_controller.dm
var/code_phrase = ""//What is returned when the proc finishes.
var/words = pick(//How many words there will be. Minimum of two. 2, 4 and 5 have a lesser chance of being selected. 3 is the most likely.
50; 2,
200; 3,
50; 4,
25; 5
)
var/safety[] = list(1,2,3)//Tells the proc which options to remove later on.
var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation")
var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","redwine","moonshine")
var/locations[] = GLOB.teleportlocs.len ? GLOB.teleportlocs : drinks//if null, defaults to drinks instead.
var/names[] = list()
for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest.
names += t.fields["name"]
var/maxwords = words//Extra var to check for duplicates.
for(words,words>0,words--)//Randomly picks from one of the choices below.
if(words==1&&(1 in safety)&&(2 in safety))//If there is only one word remaining and choice 1 or 2 have not been selected.
safety = list(pick(1,2))//Select choice 1 or 2.
else if(words==1&&maxwords==2)//Else if there is only one word remaining (and there were two originally), and 1 or 2 were chosen,
safety = list(3)//Default to list 3
switch(pick(safety))//Chance based on the safety list.
if(1)//1 and 2 can only be selected once each to prevent more than two specific names/places/etc.
switch(rand(1,2))//Mainly to add more options later.
if(1)
if(names.len&&prob(70))
code_phrase += pick(names)
else
code_phrase += pick(pick(GLOB.first_names_male, GLOB.first_names_female))
code_phrase += " "
code_phrase += pick(GLOB.last_names)
if(2)
code_phrase += pick(GLOB.joblist)//Returns a job.
safety -= 1
if(2)
switch(rand(1,2))//Places or things.
if(1)
code_phrase += pick(drinks)
if(2)
code_phrase += pick(locations)
safety -= 2
if(3)
switch(rand(1,3))//Nouns, adjectives, verbs. Can be selected more than once.
if(1)
code_phrase += pick(nouns)
if(2)
code_phrase += pick(GLOB.adjectives)
if(3)
code_phrase += pick(GLOB.verbs)
if(words==1)
code_phrase += "."
else
code_phrase += ", "
return code_phrase
+2 -2
View File
@@ -53,8 +53,8 @@ ADMIN_VERB(restart_controller, R_DEBUG, "Restart Controller", "Restart one of th
message_admins("Admin [key_name_admin(user)] has restarted the [controller] controller.")
ADMIN_VERB(debug_antagonist_template, R_DEBUG, "Debug Antagonist", "Debug an antagonist template", ADMIN_CATEGORY_DEBUG_GAME, antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
ADMIN_VERB(debug_antagonist_template, R_DEBUG, "Debug Antagonist", "Debug an antagonist template", ADMIN_CATEGORY_DEBUG_GAME, antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
if(antag)
user.debug_variables(antag)
message_admins("Admin [key_name_admin(user)] is debugging the [antag.role_text] template.")
-12
View File
@@ -24,15 +24,7 @@ GLOBAL_DATUM(master_controller, /datum/controller/game_controller) //Set in worl
GLOB.job_master.LoadJobs("config/jobs.txt")
admin_notice(span_danger("Job setup complete"), R_DEBUG)
if(!GLOB.syndicate_code_phrase)
GLOB.syndicate_code_phrase = generate_code_phrase()
if(!GLOB.syndicate_code_response)
GLOB.syndicate_code_response = generate_code_phrase()
/datum/controller/game_controller/proc/setup()
setup_objects()
// setupgenetics() Moved to SSatoms
// SetupXenoarch() - Moved to SSxenoarch
@@ -43,7 +35,3 @@ GLOBAL_DATUM(master_controller, /datum/controller/game_controller) //Set in worl
// #else
// # define CHECK_SLEEP_MASTER if(++initialized_objects > 500) { initialized_objects=0;sleep(world.tick_lag); }
// #endif
/datum/controller/game_controller/proc/setup_objects()
// Set up antagonists.
populate_antag_type_list()
+156
View File
@@ -0,0 +1,156 @@
SUBSYSTEM_DEF(antag_job)
name = "Antag Job"
flags = SS_NO_FIRE
//List of all jobs
var/list/occupations = list()
var/list/syndicate_code_phrase
var/list/syndicate_code_response
var/list/all_antag_types = list()
var/list/all_antag_spawnpoints = list()
VAR_PRIVATE/list/antag_names_to_ids = list()
/datum/controller/subsystem/antag_job/Initialize()
populate_antag_type_list()
syndicate_code_phrase = generate_code_phrase()
syndicate_code_response = generate_code_phrase()
return SS_INIT_SUCCESS
//Traitors and traitor silicons will get these. Revs will not.
/*
Should be expanded.
How this works:
Instead of "I'm looking for James Smith," the traitor would say "James Smith" as part of a conversation.
Another traitor may then respond with: "They enjoy running through the void-filled vacuum of the derelict."
The phrase should then have the words: James Smith.
The response should then have the words: run, void, and derelict.
This way assures that the code is suited to the conversation and is unpredicatable.
Obviously, some people will be better at this than others but in theory, everyone should be able to do it and it only enhances roleplay.
Can probably be done through "{ }" but I don't really see the practical benefit.
One example of an earlier system is commented below.
-N
*/
/datum/controller/subsystem/antag_job/proc/generate_code_phrase()//Proc is used for phrase and response in master_controller.dm
var/code_phrase = ""//What is returned when the proc finishes.
var/words = pick(//How many words there will be. Minimum of two. 2, 4 and 5 have a lesser chance of being selected. 3 is the most likely.
50; 2,
200; 3,
50; 4,
25; 5
)
var/list/safety = list(1,2,3)//Tells the proc which options to remove later on.
var/list/nouns = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation")
var/list/drinks = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","redwine","moonshine")
var/list/locations = GLOB.teleportlocs.len ? GLOB.teleportlocs : drinks//if null, defaults to drinks instead.
var/list/names = list()
for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest.
names += t.fields["name"]
var/maxwords = words//Extra var to check for duplicates.
for(words,words>0,words--)//Randomly picks from one of the choices below.
if(words==1&&(1 in safety)&&(2 in safety))//If there is only one word remaining and choice 1 or 2 have not been selected.
safety = list(pick(1,2))//Select choice 1 or 2.
else if(words==1&&maxwords==2)//Else if there is only one word remaining (and there were two originally), and 1 or 2 were chosen,
safety = list(3)//Default to list 3
switch(pick(safety))//Chance based on the safety list.
if(1)//1 and 2 can only be selected once each to prevent more than two specific names/places/etc.
switch(rand(1,2))//Mainly to add more options later.
if(1)
if(names.len&&prob(70))
code_phrase += pick(names)
else
code_phrase += pick(pick(GLOB.first_names_male, GLOB.first_names_female))
code_phrase += " "
code_phrase += pick(GLOB.last_names)
if(2)
code_phrase += pick(GLOB.joblist)//Returns a job.
safety -= 1
if(2)
switch(rand(1,2))//Places or things.
if(1)
code_phrase += pick(drinks)
if(2)
code_phrase += pick(locations)
safety -= 2
if(3)
switch(rand(1,3))//Nouns, adjectives, verbs. Can be selected more than once.
if(1)
code_phrase += pick(nouns)
if(2)
code_phrase += pick(GLOB.adjectives)
if(3)
code_phrase += pick(GLOB.verbs)
if(words==1)
code_phrase += "."
else
code_phrase += ", "
return code_phrase
/*
MODULAR ANTAGONIST SYSTEM
Attempts to move all the bullshit snowflake antag tracking code into its own system, which
has the added bonus of making the display procs consistent. Still needs work/adjustment/cleanup
but should be fairly self-explanatory with a review of the procs. Will supply a few examples
of common tasks that the system will be expected to perform below. ~Z
To use:
- Get the appropriate datum via get_antag_data("antagonist id")
using the id var of the desired /datum/antagonist ie. var/datum/antagonist/A = get_antag_data("traitor")
- Call add_antagonist() on the desired target mind ie. A.add_antagonist(mob.mind)
- To ignore protected roles, supply a positive second argument.
- To skip equipping with appropriate gear, supply a positive third argument.
*/
/datum/controller/subsystem/antag_job/proc/get_antag_data(antag_type)
return all_antag_types[antag_type]
/datum/controller/subsystem/antag_job/proc/clear_antag_roles(datum/mind/player, implanted)
for(var/antag_type, value in all_antag_types)
var/datum/antagonist/antag = value
if(!implanted || !(antag.flags & ANTAG_IMPLANT_IMMUNE))
antag.remove_antagonist(player, 1, implanted)
/datum/controller/subsystem/antag_job/proc/update_antag_icons(datum/mind/player)
for(var/antag_type, value in all_antag_types)
var/datum/antagonist/antag = value
if(player)
antag.update_icons_removed(player)
if(antag.is_antagonist(player))
antag.update_icons_added(player)
else
antag.update_all_icons()
/datum/controller/subsystem/antag_job/proc/populate_antag_type_list()
for(var/antag_type in subtypesof(/datum/antagonist))
var/datum/antagonist/antag_daturn = new antag_type
all_antag_types[antag_daturn.id] = antag_daturn
all_antag_spawnpoints[antag_daturn.landmark_id] = list()
antag_names_to_ids[antag_daturn.role_text] = antag_daturn.id
/datum/controller/subsystem/antag_job/proc/get_antags(atype)
var/datum/antagonist/antag = all_antag_types[atype]
if(antag && islist(antag.current_antagonists))
return antag.current_antagonists
return list()
/datum/controller/subsystem/antag_job/proc/player_is_antag(datum/mind/player, only_offstation_roles = FALSE)
for(var/antag_type, value in all_antag_types)
var/datum/antagonist/antag = value
if(only_offstation_roles && !(antag.flags & ANTAG_OVERRIDE_JOB))
continue
if(player in antag.current_antagonists)
return TRUE
if(player in antag.pending_antagonists)
return TRUE
return FALSE
+1 -1
View File
@@ -25,7 +25,7 @@ SUBSYSTEM_DEF(mail)
// Collect recipients
var/list/mail_recipients = list()
for(var/mob/living/carbon/human/player_human in GLOB.player_list)
if(player_human.stat != DEAD && player_human.client && player_human.client.inactivity <= 10 MINUTES && !(player_human.job in banned_jobs) && !player_is_antag(player_human.mind) && !isbelly(player_human.loc)) // Only alive, active and NT employeers should be getting mail.
if(player_human.stat != DEAD && player_human.client && player_human.client.inactivity <= 10 MINUTES && !(player_human.job in banned_jobs) && !SSantag_job.player_is_antag(player_human.mind) && !isbelly(player_human.loc)) // Only alive, active and NT employeers should be getting mail.
mail_recipients += player_human
// Creates mail for all the mail waiting to arrive, if there's nobody to receive it, it will be a chance of junk mail.
+1 -1
View File
@@ -403,7 +403,7 @@ SUBSYSTEM_DEF(ticker)
if(player && player.mind && player.mind.assigned_role)
if(player.mind.assigned_role == JOB_SITE_MANAGER)
captainless=0
if(!player_is_antag(player.mind, only_offstation_roles = 1))
if(!SSantag_job.player_is_antag(player.mind, only_offstation_roles = 1))
GLOB.job_master.EquipRank(player, player.mind.assigned_role, 0)
UpdateFactionList(player)
//equip_custom_items(player) //VOREStation Removal
+1 -1
View File
@@ -333,7 +333,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
foundrecord.fields["real_rank"] = real_title
/datum/datacore/proc/manifest_inject(var/mob/living/carbon/human/H)
if(H.mind && !player_is_antag(H.mind, only_offstation_roles = 1))
if(H.mind && !SSantag_job.player_is_antag(H.mind, only_offstation_roles = 1))
var/assignment = GetAssignment(H)
var/hidden
var/datum/job/J = SSjob.get_job(H.mind.assigned_role)
+9 -9
View File
@@ -102,7 +102,7 @@
if(new_character.client)
new_character.client.init_verbs() // re-initialize character specific verbs
update_antag_icons(src)
SSantag_job.update_antag_icons(src)
/datum/mind/proc/store_memory(new_text)
@@ -137,8 +137,8 @@
out += "Assigned role: [assigned_role]. <a href='byond://?src=\ref[src];[HrefToken()];role_edit=1'>Edit</a><br>"
out += "<hr>"
out += "Factions and special roles:<br><table>"
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
out += "[antag.get_panel_entry(src)]"
out += "</table><hr>"
out += span_bold("Objectives") + "</br>"
@@ -170,7 +170,7 @@
return
if(href_list["add_antagonist"])
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["add_antagonist"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["add_antagonist"]]
if(antag)
if(antag.add_antagonist(src, 1, 1, 0, 1, 1)) // Ignore equipment and role type for this.
log_admin("[key_name_admin(usr)] made [key_name(src)] into a [antag.role_text].")
@@ -178,19 +178,19 @@
to_chat(usr, span_warning("[src] could not be made into a [antag.role_text]!"))
else if(href_list["remove_antagonist"])
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["remove_antagonist"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["remove_antagonist"]]
if(antag) antag.remove_antagonist(src)
else if(href_list["equip_antagonist"])
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["equip_antagonist"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["equip_antagonist"]]
if(antag) antag.equip(src.current)
else if(href_list["unequip_antagonist"])
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["unequip_antagonist"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["unequip_antagonist"]]
if(antag) antag.unequip(src.current)
else if(href_list["move_antag_to_spawn"])
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["move_antag_to_spawn"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["move_antag_to_spawn"]]
if(antag) antag.place_mob(src.current)
else if (href_list["role_edit"])
@@ -527,7 +527,7 @@
log_world("## DEBUG: mind_initialize(): No ticker ready yet! Please inform Carn")
if(!mind.name) mind.name = real_name
mind.current = src
if(player_is_antag(mind))
if(SSantag_job.player_is_antag(mind))
add_verb(src.client, /client/proc/aooc)
//HUMAN
-70
View File
@@ -1,70 +0,0 @@
/*
MODULAR ANTAGONIST SYSTEM
Attempts to move all the bullshit snowflake antag tracking code into its own system, which
has the added bonus of making the display procs consistent. Still needs work/adjustment/cleanup
but should be fairly self-explanatory with a review of the procs. Will supply a few examples
of common tasks that the system will be expected to perform below. ~Z
To use:
- Get the appropriate datum via get_antag_data("antagonist id")
using the id var of the desired /datum/antagonist ie. var/datum/antagonist/A = get_antag_data("traitor")
- Call add_antagonist() on the desired target mind ie. A.add_antagonist(mob.mind)
- To ignore protected roles, supply a positive second argument.
- To skip equipping with appropriate gear, supply a positive third argument.
*/
// Globals.
GLOBAL_LIST_EMPTY(all_antag_types)
GLOBAL_LIST_EMPTY(all_antag_spawnpoints)
GLOBAL_LIST_EMPTY(antag_names_to_ids)
// Global procs.
/proc/get_antag_data(var/antag_type)
if(GLOB.all_antag_types[antag_type])
return GLOB.all_antag_types[antag_type]
else
for(var/cur_antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[cur_antag_type]
if(antag && antag.is_type(antag_type))
return antag
/proc/clear_antag_roles(var/datum/mind/player, var/implanted)
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(!implanted || !(antag.flags & ANTAG_IMPLANT_IMMUNE))
antag.remove_antagonist(player, 1, implanted)
/proc/update_antag_icons(var/datum/mind/player)
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(player)
antag.update_icons_removed(player)
if(antag.is_antagonist(player))
antag.update_icons_added(player)
else
antag.update_all_icons()
/proc/populate_antag_type_list()
for(var/antag_type in subtypesof(/datum/antagonist))
var/datum/antagonist/A = new antag_type
GLOB.all_antag_types[A.id] = A
GLOB.all_antag_spawnpoints[A.landmark_id] = list()
GLOB.antag_names_to_ids[A.role_text] = A.id
/proc/get_antags(var/atype)
var/datum/antagonist/antag = GLOB.all_antag_types[atype]
if(antag && islist(antag.current_antagonists))
return antag.current_antagonists
return list()
/proc/player_is_antag(var/datum/mind/player, var/only_offstation_roles = 0)
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(only_offstation_roles && !(antag.flags & ANTAG_OVERRIDE_JOB))
continue
if(player in antag.current_antagonists)
return 1
if(player in antag.pending_antagonists)
return 1
return 0
+1 -1
View File
@@ -124,7 +124,7 @@
else if(!can_become_antag(player))
candidates -= player
log_game("[key_name(player)] is not eligible to become a [role_text]: They are blacklisted for this role! They have been removed from the draft.")
else if(player_is_antag(player))
else if(SSantag_job.player_is_antag(player))
candidates -= player
log_game("[key_name(player)] is not eligible to become a [role_text]: They are already an antagonist! They have been removed from the draft.")
+1 -1
View File
@@ -17,7 +17,7 @@
to_chat(src, span_warning("\The [player.current] already serves the [faction.faction_descriptor]."))
return
if(player_is_antag(player))
if(SSantag_job.player_is_antag(player))
to_chat(src, span_warning("\The [player.current]'s loyalties seem to be elsewhere..."))
return
+4 -4
View File
@@ -102,10 +102,10 @@ GLOBAL_DATUM(traitors, /datum/antagonist/traitor)
/datum/antagonist/traitor/proc/give_codewords(mob/living/traitor_mob)
to_chat(traitor_mob, span_underline(span_bold("Your employers provided you with the following information on how to identify possible allies:")))
to_chat(traitor_mob, span_bold("Code Phrase") + ": " + span_danger("[GLOB.syndicate_code_phrase]"))
to_chat(traitor_mob, span_bold("Code Response") + ": " + span_danger("[GLOB.syndicate_code_response]"))
traitor_mob.mind.store_memory(span_bold("Code Phrase") + ": [GLOB.syndicate_code_phrase]")
traitor_mob.mind.store_memory(span_bold("Code Response") + ": [GLOB.syndicate_code_response]")
to_chat(traitor_mob, span_bold("Code Phrase") + ": " + span_danger("[SSantag_job.syndicate_code_phrase]"))
to_chat(traitor_mob, span_bold("Code Response") + ": " + span_danger("[SSantag_job.syndicate_code_response]"))
traitor_mob.mind.store_memory(span_bold("Code Phrase") + ": [SSantag_job.syndicate_code_phrase]")
traitor_mob.mind.store_memory(span_bold("Code Response") + ": [SSantag_job.syndicate_code_response]")
to_chat(traitor_mob, "Use the code words, preferably in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe.")
/datum/antagonist/traitor/proc/spawn_uplink(var/mob/living/carbon/human/traitor_mob)
+2 -2
View File
@@ -12,10 +12,10 @@
/datum/game_mode/calamity/create_antagonists()
shuffle(GLOB.all_antag_types) // This is probably the only instance in the game where the order will be important.
shuffle(SSantag_job.all_antag_types) // This is probably the only instance in the game where the order will be important.
var/i = 1
var/grab_antags = round(num_players()/ANTAG_TYPE_RATIO)+1
for(var/antag_id in GLOB.all_antag_types)
for(var/antag_id in SSantag_job.all_antag_types)
if(i > grab_antags)
break
antag_tags |= antag_id
@@ -138,4 +138,4 @@ GLOBAL_VAR_INIT(universe_has_ended, 0)
M.current.Weaken(10)
M.current.flash_eyes()
clear_antag_roles(M)
SSantag_job.clear_antag_roles(M)
+8 -8
View File
@@ -85,7 +85,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types)
if(href_list["debug_antag"] == "self")
usr.client.debug_variables(src)
return
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["debug_antag"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["debug_antag"]]
if(antag)
usr.client.debug_variables(antag)
message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.")
@@ -93,16 +93,16 @@ GLOBAL_LIST_EMPTY(additional_antag_types)
if(antag_tags && (href_list["remove_antag_type"] in antag_tags))
to_chat(usr, "Cannot remove core mode antag type.")
return
var/datum/antagonist/antag = GLOB.all_antag_types[href_list["remove_antag_type"]]
var/datum/antagonist/antag = SSantag_job.all_antag_types[href_list["remove_antag_type"]]
if(antag_templates && antag_templates.len && antag && (antag in antag_templates) && (antag.id in GLOB.additional_antag_types))
antag_templates -= antag
GLOB.additional_antag_types -= antag.id
message_admins("Admin [key_name_admin(usr)] removed [antag.role_text] template from game mode.")
else if(href_list["add_antag_type"])
var/choice = tgui_input_list(usr, "Which type do you wish to add?", "Select Antag Type", GLOB.all_antag_types)
var/choice = tgui_input_list(usr, "Which type do you wish to add?", "Select Antag Type", SSantag_job.all_antag_types)
if(!choice)
return
var/datum/antagonist/antag = GLOB.all_antag_types[choice]
var/datum/antagonist/antag = SSantag_job.all_antag_types[choice]
if(antag)
if(!islist(SSticker.mode.antag_templates))
SSticker.mode.antag_templates = list()
@@ -155,7 +155,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types)
var/enemy_count = 0
if(antag_tags && antag_tags.len)
for(var/antag_tag in antag_tags)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_tag]
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_tag]
if(!antag)
continue
var/list/potential = list()
@@ -403,7 +403,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types)
var/list/players = list()
var/list/candidates = list()
var/datum/antagonist/antag_template = GLOB.all_antag_types[antag_id]
var/datum/antagonist/antag_template = SSantag_job.all_antag_types[antag_id]
if(!antag_template)
return candidates
@@ -465,7 +465,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types)
if(antag_tags && antag_tags.len)
antag_templates = list()
for(var/antag_tag in antag_tags)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_tag]
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_tag]
if(antag)
antag_templates |= antag
@@ -473,7 +473,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types)
if(!antag_templates)
antag_templates = list()
for(var/antag_type in GLOB.additional_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
if(antag)
antag_templates |= antag
+1 -1
View File
@@ -787,7 +787,7 @@ GLOBAL_LIST_EMPTY(all_objectives)
/datum/objective/ninja_highlander/check_completion()
if(owner)
for(var/datum/mind/ninja in get_antags("ninja"))
for(var/datum/mind/ninja in SSantag_job.get_antags("ninja"))
if(ninja != owner)
if(ninja.current.stat < 2) return 0
return 1
+1 -1
View File
@@ -143,7 +143,7 @@
return
if(M.brainmob.mind)
clear_antag_roles(M.brainmob.mind, 1)
SSantag_job.clear_antag_roles(M.brainmob.mind, 1)
user.drop_item()
P.loc = src
+1 -1
View File
@@ -249,7 +249,7 @@
if(P.mind)
P.mind.loaded_from_ckey = picked_ckey
P.mind.loaded_from_slot = picked_slot
var/datum/antagonist/antag_data = get_antag_data(P.mind.special_role)
var/datum/antagonist/antag_data = SSantag_job.get_antag_data(P.mind.special_role)
if(antag_data)
antag_data.add_antagonist(P.mind)
antag_data.place_mob(P)
+2 -2
View File
@@ -18,10 +18,10 @@
/obj/effect/landmark/late_antag/Initialize(mapload)
. = ..()
var/datum/antagonist/A = GLOB.all_antag_types[antag_id]
var/datum/antagonist/A = SSantag_job.all_antag_types[antag_id]
if(istype(A))
A.starting_locations |= get_turf(src)
var/list/allpoints = GLOB.all_antag_spawnpoints[A.landmark_id]
var/list/allpoints = SSantag_job.all_antag_spawnpoints[A.landmark_id]
allpoints |= get_turf(src)
/obj/effect/landmark/late_antag/ert
+1 -1
View File
@@ -90,7 +90,7 @@
qdel(src)
/obj/item/antag_spawner/technomancer_apprentice/equip_antag(mob/technomancer_mob)
var/datum/antagonist/technomancer/antag_datum = GLOB.all_antag_types[MODE_TECHNOMANCER]
var/datum/antagonist/technomancer/antag_datum = SSantag_job.all_antag_types[MODE_TECHNOMANCER]
antag_datum.equip_apprentice(technomancer_mob)
@@ -108,8 +108,8 @@ GLOBAL_DATUM_INIT(all_uplink_selection, /datum/uplink_random_selection/all, new)
#ifdef DEBUG
/proc/debug_uplink_purchage_log()
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/A = SSantag_job.all_antag_types[antag_type]
A.print_player_summary()
/proc/debug_uplink_item_assoc_list()
+1 -1
View File
@@ -523,7 +523,7 @@
var/list/players = list()
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(!player.mind || player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > 10 MINUTES)
if(!player.mind || SSantag_job.player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > 10 MINUTES)
continue
players += player.real_name
@@ -30,7 +30,7 @@
if(istype(O, /obj/item/card/id))
var/obj/item/card/id/I = O
src.access |= I.GetAccess()
if(player_is_antag(user.mind) || registered_user == user)
if(SSantag_job.player_is_antag(user.mind) || registered_user == user)
to_chat(user, span_notice("The microscanner activates as you pass it over the ID, copying its access."))
/obj/item/card/id/syndicate/attack_self(mob/user)
@@ -446,14 +446,14 @@ the implant may become unstable and either pre-maturely inject the subject or si
if(!ishuman(M))
. = FALSE
var/mob/living/carbon/human/H = M
var/datum/antagonist/antag_data = get_antag_data(H.mind.special_role)
var/datum/antagonist/antag_data = SSantag_job.get_antag_data(H.mind.special_role)
if(antag_data && (antag_data.flags & ANTAG_IMPLANT_IMMUNE))
H.visible_message("[H] seems to resist the implant!", "You feel the corporate tendrils of [using_map.company_name] try to invade your mind!")
. = FALSE
/obj/item/implant/loyalty/post_implant(mob/M)
var/mob/living/carbon/human/H = M
clear_antag_roles(H.mind, 1)
SSantag_job.clear_antag_roles(H.mind, 1)
to_chat(H, span_notice("You feel a surge of loyalty towards [using_map.company_name]."))
//////////////////////////////
+1 -1
View File
@@ -112,7 +112,7 @@
var/list/recipients = list()
var/mob/living/recipient_mob
for(var/mob/living/player in GLOB.player_list)
if(!player_is_antag(player.mind) && player.mind.show_in_directory)
if(!SSantag_job.player_is_antag(player.mind) && player.mind.show_in_directory)
recipients += player
recipient_mob = tgui_input_list(usr, "Choose recipient", "Recipients", recipients, recipients)
@@ -111,7 +111,7 @@
H.forceMove(T)
if(make_antag)
var/datum/antagonist/antag = GLOB.all_antag_types[make_antag]
var/datum/antagonist/antag = SSantag_job.all_antag_types[make_antag]
if(antag)
if(antag.add_antagonist(H.mind, 1, 1, 0, 1, 1))
log_admin("\The [src] made [key_name(src)] into a [antag.role_text].")
@@ -233,7 +233,7 @@
H.forceMove(T)
if(make_antag)
var/datum/antagonist/antag = GLOB.all_antag_types[make_antag]
var/datum/antagonist/antag = SSantag_job.all_antag_types[make_antag]
if(antag)
if(antag.add_antagonist(H.mind, 1, 1, 0, 1, 1))
log_admin("\The [src] made [key_name(src)] into a [antag.role_text].")
@@ -122,7 +122,7 @@
H.forceMove(T)
if(special_role)
var/datum/antagonist/role = GLOB.all_antag_types[special_role] //Explicitly NOT an antagonist.
var/datum/antagonist/role = SSantag_job.all_antag_types[special_role] //Explicitly NOT an antagonist.
if(role)
if(role.add_antagonist(H.mind, 1, 1, 0, 1, 1))
log_admin("\The [src] made [key_name(src)] into a [role.role_text].")
+2 -2
View File
@@ -34,8 +34,8 @@
/datum/tgui_ban_panel/tgui_static_data(mob/user)
var/list/bantypes = list("traitor","changeling","operative","revolutionary","cultist","wizard") //For legacy bans.
for(var/antag_type in GLOB.all_antag_types) // Grab other bans.
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types) // Grab other bans.
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
bantypes |= antag.bantype
var/list/data = list(
+3 -3
View File
@@ -1262,12 +1262,12 @@ ADMIN_VERB(force_antag_latespawn, R_ADMIN|R_EVENT|R_FUN, "Force Template Spawn",
to_chat(user, span_warning("Mode has not started."))
return
var/antag_type = tgui_input_list(user, "Choose a template.","Force Latespawn", GLOB.all_antag_types)
if(!antag_type || !GLOB.all_antag_types[antag_type])
var/antag_type = tgui_input_list(user, "Choose a template.","Force Latespawn", SSantag_job.all_antag_types)
if(!antag_type || !SSantag_job.all_antag_types[antag_type])
to_chat(user, span_warning("Aborting."))
return
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
message_admins("[key_name(user)] attempting to force latespawn with template [antag.id].")
antag.attempt_late_spawn()
+2 -2
View File
@@ -412,8 +412,8 @@
dat += "<a href='byond://?src=\ref[src];[HrefToken()];delay_round_end=1'>[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
dat += "<hr>"
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/A = SSantag_job.all_antag_types[antag_type]
dat += A.get_check_antag_output(src)
dat += "</body></html>"
user << browse(dat, "window=roundstatus;size=400x500")
+3 -3
View File
@@ -485,11 +485,11 @@
counter = 0
var/isbanned_dept = jobban_isbanned(M, JOB_SYNDICATE)
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ffeeaa'><th colspan='[length(GLOB.all_antag_types)]'><a href='byond://?src=\ref[src];[HrefToken()];jobban3=Syndicate;jobban4=\ref[M]'>Antagonist Positions</a></th></tr><tr align='center'>"
jobs += "<tr bgcolor='ffeeaa'><th colspan='[length(SSantag_job.all_antag_types)]'><a href='byond://?src=\ref[src];[HrefToken()];jobban3=Syndicate;jobban4=\ref[M]'>Antagonist Positions</a></th></tr><tr align='center'>"
// Antagonists.
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
if(!antag || !antag.bantype)
continue
+2 -2
View File
@@ -11,7 +11,7 @@
return
else if(is_antag && !is_admin) // Is an antag, and not an admin, meaning we need to check if their antag type allows AOOC.
var/datum/antagonist/A = get_antag_data(src.mob.mind.special_role)
var/datum/antagonist/A = SSantag_job.get_antag_data(src.mob.mind.special_role)
if(!A || !A.can_speak_aooc || !A.can_hear_aooc)
to_chat(src, span_warning("Sorry, but your antagonist type is not allowed to speak in AOOC."))
return
@@ -35,7 +35,7 @@
else if(M.client) // Players can only see AOOC if observing, or if they are an antag type allowed to use AOOC.
var/datum/antagonist/A = null
if(M.mind) // Observers don't have minds, but they should still see AOOC.
A = get_antag_data(M.mind.special_role)
A = SSantag_job.get_antag_data(M.mind.special_role)
if((M.mind && M.mind.special_role && A && A.can_hear_aooc) || isobserver(M)) // Antags must have their type be allowed to AOOC to see AOOC. This prevents, say, ERT from seeing AOOC.
to_chat(M, span_ooc(span_aooc("[create_text_tag("aooc", "Antag-OOC:", M.client)] <EM>[player_display]:</EM> " + span_message("[msg]"))))
+1 -1
View File
@@ -499,7 +499,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
new_character.key = player_key
//Were they any particular special role? If so, copy.
if(new_character.mind)
var/datum/antagonist/antag_data = get_antag_data(new_character.mind.special_role)
var/datum/antagonist/antag_data = SSantag_job.get_antag_data(new_character.mind.special_role)
if(antag_data)
antag_data.add_antagonist(new_character.mind)
antag_data.place_mob(new_character)
+1 -1
View File
@@ -34,7 +34,7 @@ GLOBAL_LIST_EMPTY(current_pending_diseases)
var/list/candidates = list()
for(var/mob/living/carbon/human/G in GLOB.human_mob_list)
if(G.mind && G.stat != DEAD && G.is_client_active(5) && !player_is_antag(G.mind))
if(G.mind && G.stat != DEAD && G.is_client_active(5) && !SSantag_job.player_is_antag(G.mind))
var/area/A = get_area(G)
if(!A)
continue
+1 -1
View File
@@ -27,7 +27,7 @@
/datum/event/ionstorm/start()
for (var/mob/living/carbon/human/player in GLOB.player_list)
if( !player.mind || player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > 10 MINUTES)
if( !player.mind || SSantag_job.player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > 10 MINUTES)
continue
players += player.real_name
+2 -2
View File
@@ -4,8 +4,8 @@
/datum/event/random_antag/start()
var/list/valid_types = list()
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
if(antag.flags & ANTAG_RANDSPAWN)
valid_types |= antag
if(valid_types.len)
@@ -22,8 +22,8 @@
// The random spawn proc on the antag datum will handle announcing the spawn and whatnot, in theory.
/datum/event2/event/random_antagonist/start()
var/list/valid_types = list()
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
for(var/antag_type in SSantag_job.all_antag_types)
var/datum/antagonist/antag = SSantag_job.all_antag_types[antag_type]
if(antag.flags & ANTAG_RANDSPAWN)
valid_types |= antag
if(valid_types.len)
@@ -23,7 +23,7 @@
continue
// Or antags / bellied.
if(player_is_antag(H.mind) || isbelly(H.loc))
if(SSantag_job.player_is_antag(H.mind) || isbelly(H.loc))
continue
// Or doctors (otherwise it could be possible for the only surgeon to need surgery).
+1 -1
View File
@@ -59,7 +59,7 @@
/datum/metric/proc/get_all_antags(cutoff = 75)
. = list()
for(var/mob/living/L in GLOB.player_list)
if(L.mind && player_is_antag(L.mind) && assess_player_activity(L) >= cutoff)
if(L.mind && SSantag_job.player_is_antag(L.mind) && assess_player_activity(L) >= cutoff)
. += L
/datum/metric/proc/count_all_antags(cutoff = 75)
+1 -1
View File
@@ -4,7 +4,7 @@
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
mind.active = 1 //indicates that the mind is currently synced with a client
//If they're SSD, remove it so they can wake back up.
update_antag_icons(mind)
SSantag_job.update_antag_icons(mind)
client.screen |= GLOB.global_hud.darksight
client.images |= dsoverlay
+1 -1
View File
@@ -137,7 +137,7 @@
var/list/players = list()
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(!player.mind || player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > 10 MINUTES)
if(!player.mind || SSantag_job.player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > 10 MINUTES)
continue
players += player.real_name
+1 -1
View File
@@ -416,7 +416,7 @@
qdel(mind.objectives)
mind.special_role = null
clear_antag_roles(mind)
SSantag_job.clear_antag_roles(mind)
ghostize(0)
qdel(src)
+2 -2
View File
@@ -189,9 +189,9 @@ ADMIN_VERB(call_drop_pod, R_FUN, "Call Drop Pod", "Call an immediate drop pod on
// Equip them, if they are human and it is desirable.
if(ishuman(spawned_mob))
var/antag_type = tgui_input_list(user, "Select an equipment template to use or cancel for nude.", GLOB.all_antag_types)
var/antag_type = tgui_input_list(user, "Select an equipment template to use or cancel for nude.", SSantag_job.all_antag_types)
if(antag_type)
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
var/datum/antagonist/A = SSantag_job.all_antag_types[antag_type]
A.equip(spawned_mob)
if(tgui_alert(user, "Are you SURE you wish to deploy this drop pod? It will cause a sizable explosion and gib anyone underneath it.","Danger!",list("No","Yes")) != "Yes")
+1 -1
View File
@@ -182,7 +182,7 @@ GLOBAL_LIST_EMPTY(active_autoresleevers)
if(new_character.mind)
new_character.mind.loaded_from_ckey = picked_ckey
new_character.mind.loaded_from_slot = picked_slot
var/datum/antagonist/antag_data = get_antag_data(new_character.mind.special_role)
var/datum/antagonist/antag_data = SSantag_job.get_antag_data(new_character.mind.special_role)
if(antag_data)
antag_data.add_antagonist(new_character.mind)
antag_data.place_mob(new_character)
+1 -1
View File
@@ -499,7 +499,7 @@
if(occupant.mind)
if(occupant.original_player && ckey(occupant.mind.key) != occupant.original_player)
log_and_message_admins("is now a cross-sleeved character. Body originally belonged to [occupant.real_name]. Mind is now [occupant.mind.name].",occupant)
var/datum/antagonist/antag_data = get_antag_data(occupant.mind.special_role)
var/datum/antagonist/antag_data = SSantag_job.get_antag_data(occupant.mind.special_role)
if(antag_data)
antag_data.add_antagonist(occupant.mind)
antag_data.place_mob(occupant)
+1 -1
View File
@@ -85,7 +85,7 @@
new_character.initialize_vessel()
new_character.key = player_key
if(new_character.mind)
var/datum/antagonist/antag_data = get_antag_data(new_character.mind.special_role)
var/datum/antagonist/antag_data = SSantag_job.get_antag_data(new_character.mind.special_role)
if(antag_data)
antag_data.add_antagonist(new_character.mind)
antag_data.place_mob(new_character)
@@ -4,7 +4,7 @@
if(!A)
continue
// Dont give bellied people and antags cancer
if(player_is_antag(H.mind) || isbelly(H.loc))
if(SSantag_job.player_is_antag(H.mind) || isbelly(H.loc))
continue
if(H.species.virus_immune)
continue
+1 -1
View File
@@ -579,6 +579,7 @@
#include "code\controllers\subsystems\air_traffic.dm"
#include "code\controllers\subsystems\airflow.dm"
#include "code\controllers\subsystems\alarm.dm"
#include "code\controllers\subsystems\antag_job.dm"
#include "code\controllers\subsystems\asset_loading.dm"
#include "code\controllers\subsystems\assets.dm"
#include "code\controllers\subsystems\atoms.dm"
@@ -1066,7 +1067,6 @@
#include "code\game\skincmd.dm"
#include "code\game\sound.dm"
#include "code\game\world.dm"
#include "code\game\antagonist\_antagonist_setup.dm"
#include "code\game\antagonist\antagonist.dm"
#include "code\game\antagonist\antagonist_add.dm"
#include "code\game\antagonist\antagonist_create.dm"