diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 35e7f4850ce..2c5cd3e8c6d 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -9,6 +9,7 @@ var/global/list/player_list = list() //List of all mobs **with clients attach var/global/list/mob_list = list() //List of all mobs, including clientless var/global/list/living_mob_list = list() //List of all alive mobs, including clientless. Excludes /mob/new_player var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless. Excludes /mob/new_player +var/global/list/joined_player_list = list() //List of all clients that have joined the game at round-start or as a latejoin. var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions @@ -73,4 +74,4 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel") for(var/path in typesof(prototype)) if(path == prototype) continue L += new path() - return L + return L diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 1a05634742e..c646abec4c1 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -86,6 +86,8 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" return /datum/game_mode/changeling/make_antag_chance(var/mob/living/carbon/human/character) //Assigns changeling to latejoiners + if(changelings.len >= round(joined_player_list.len / changeling_scaling_coeff) + 1) //Caps number of latejoin antagonists + return if (prob(100/changeling_scaling_coeff)) if(character.client.prefs.be_special & BE_CHANGELING) if(!jobban_isbanned(character.client, "changeling") && !jobban_isbanned(character.client, "Syndicate")) diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index 384e2639767..197ca4e22cd 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -54,6 +54,8 @@ return /datum/game_mode/traitor/changeling/make_antag_chance(var/mob/living/carbon/human/character) //Assigns changeling to latejoiners + if(changelings.len >= round(joined_player_list.len / changeling_scaling_coeff) + 1) //Caps number of latejoin antagonists + return if (prob(100/changeling_scaling_coeff)) if(character.client.prefs.be_special & BE_CHANGELING) if(!jobban_isbanned(character.client, "changeling") && !jobban_isbanned(character.client, "Syndicate")) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 0d4634fe21e..46be2282c17 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -236,6 +236,7 @@ var/global/datum/controller/gameticker/ticker proc/create_characters() for(var/mob/new_player/player in player_list) if(player.ready && player.mind) + joined_player_list += player.ckey if(player.mind.assigned_role=="AI") player.close_spawn_windows() player.AIize() diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index e29c86bebb1..0dd7ea3d4a6 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -76,6 +76,8 @@ return 1 /datum/game_mode/traitor/make_antag_chance(var/mob/living/carbon/human/character) //Assigns traitor to latejoiners + if(traitors.len >= round(joined_player_list.len / traitor_scaling_coeff) + 2) //Caps number of latejoin antagonists + return if (prob(100/traitor_scaling_coeff)) if(character.client.prefs.be_special & BE_TRAITOR) if(!jobban_isbanned(character.client, "traitor") && !jobban_isbanned(character.client, "Syndicate")) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 6cb18b9ec7d..a5c69088047 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1053,7 +1053,7 @@ var/global/list/g_fancy_list_of_safe_types = null set name = "Debug Mob Lists" set desc = "For when you just gotta know" - switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients")) + switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients")) if("Players") usr << dd_list2text(player_list,",") if("Admins") @@ -1066,3 +1066,5 @@ var/global/list/g_fancy_list_of_safe_types = null usr << dd_list2text(dead_mob_list,",") if("Clients") usr << dd_list2text(clients,",") + if("Joined Clients") + usr << dd_list2text(joined_player_list,",") \ No newline at end of file diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 91bc626956c..5cf5c483656 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -265,6 +265,8 @@ else character.Robotize() + joined_player_list += character.ckey + if(config.allow_latejoin_antagonists && emergency_shuttle.timeleft() > 300) //Don't make them antags if the station is evacuating ticker.mode.make_antag_chance(character) del(src)