Skip to content

Commit

Permalink
Revert "tweak: Assigns jobs first, antags second (#6334)"
Browse files Browse the repository at this point in the history
This reverts commit d4842cb.
  • Loading branch information
BeebBeebBoob authored Jan 11, 2025
1 parent 7e3acfa commit f84b5b5
Show file tree
Hide file tree
Showing 29 changed files with 51 additions and 56 deletions.
21 changes: 17 additions & 4 deletions code/controllers/subsystem/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ SUBSYSTEM_DEF(jobs)
Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
var/list/candidates = list()
for(var/mob/new_player/player in unassigned)
Debug(" - Player: [player] Banned: [jobban_isbanned(player, job.title)] Old Enough: [!job.player_old_enough(player.client)] AvInPlaytime: [job.available_in_playtime(player.client)] Job Department: [player.client.prefs.GetJobDepartment(job, level)] Job Flag: [job.flag] Job Department Flag = [job.department_flag]")
Debug(" - Player: [player] Banned: [jobban_isbanned(player, job.title)] Old Enough: [!job.player_old_enough(player.client)] AvInPlaytime: [job.available_in_playtime(player.client)] Flag && Be Special: [flag] && [player.client.prefs.be_special] Job Department: [player.client.prefs.GetJobDepartment(job, level)] Job Flag: [job.flag] Job Department Flag = [job.department_flag]")
if(jobban_isbanned(player, job.title))
Debug("FOC isbanned failed, Player: [player]")
continue
Expand All @@ -154,6 +154,9 @@ SUBSYSTEM_DEF(jobs)
if(!job.character_old_enough(player.client))
Debug("FOC player character not old enough rendering them ineligible for job, Player: [player]")
continue
if(flag && !(flag in player.client.prefs.be_special))
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
if(player.mind && (job.title in player.mind.restricted_roles))
Debug("FOC incompatbile with antagonist role, Player: [player]")
continue
Expand Down Expand Up @@ -410,14 +413,24 @@ SUBSYSTEM_DEF(jobs)

Debug("DO, Running AC2")

// And now we assign assistants and return to lobbies.
// Antags, who have to get in, come first
for(var/mob/new_player/player in unassigned)
if(player.mind.special_role)
if(player.client.prefs.alternate_option != BE_ASSISTANT)
GiveRandomJob(player)
if(player in unassigned)
AssignRole(player, JOB_TITLE_CIVILIAN)
else
AssignRole(player, JOB_TITLE_CIVILIAN)

// Then we assign what we can to everyone else.
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == BE_ASSISTANT)
Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, JOB_TITLE_CIVILIAN)
else if(player.client.prefs.alternate_option == RETURN_TO_LOBBY)
to_chat(player, span_danger("Unfortunately, none of the round start roles you selected had a free slot. Please join the game by using \"Join Game!\" button and selecting a role with a free slot."))
player.ready = FALSE
to_chat(player, "<span class='danger'>Unfortunately, none of the round start roles you selected had a free slot. Please join the game by using \"Join Game!\" button and selecting a role with a free slot.</span>")
player.ready = 0
unassigned -= player

log_debug("Dividing Occupations took [stop_watch(watch)]s")
Expand Down
25 changes: 10 additions & 15 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,16 @@ SUBSYSTEM_DEF(ticker)

P.ready = FALSE

// Pre setup for non-station special modes eg: wizards
mode.pre_setup()
var/can_continue = FALSE
can_continue = mode.pre_setup() //Setup special modes
if(!can_continue)
QDEL_NULL(mode)
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
current_state = GAME_STATE_PREGAME
force_start = FALSE
SSjobs.ResetOccupations()
Master.SetRunLevel(RUNLEVEL_LOBBY)
return FALSE

// Enable highpop slots just before we distribute jobs.
var/playercount = length(GLOB.clients)
Expand All @@ -258,19 +266,6 @@ SUBSYSTEM_DEF(ticker)

SSjobs.DivideOccupations() //Distribute jobs

// Now set station-wide special roles after job assignment.
// We unready players who haven't got a job, so they're unqualified to get special here.
var/can_continue = FALSE
can_continue = mode.mid_setup() //Setup special modes
if(!can_continue)
QDEL_NULL(mode)
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
current_state = GAME_STATE_PREGAME
force_start = FALSE
SSjobs.ResetOccupations()
Master.SetRunLevel(RUNLEVEL_LOBBY)
return FALSE

if(hide_mode)
var/list/modes = new
for(var/datum/game_mode/M in runnable_modes)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/antag_paradise/antag_paradise.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
break


/datum/game_mode/antag_paradise/mid_setup()
/datum/game_mode/antag_paradise/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/blob/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
var/players_per_core = BLOB_PLAYERS_PER_CORE


/datum/game_mode/blob/mid_setup()
/datum/game_mode/blob/pre_setup()

var/list/possible_blobs = get_players_for_role(ROLE_BLOB)

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/changeling/changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
to_chat(world, "<B>There are alien changelings on the station. Do not let the changelings succeed!</B>")


/datum/game_mode/changeling/mid_setup()
/datum/game_mode/changeling/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/changeling/thief_chan.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров и генокрадов. Не дайте генокрадам достичь успеха и скрыться, и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/thief/changeling/mid_setup()
/datum/game_mode/thief/changeling/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/changeling/traitor_chan.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
to_chat(world, "<B>There is an alien creature on the station along with some syndicate operatives out for their own gain! Do not let the changeling and the traitors succeed!</B>")


/datum/game_mode/traitor/changeling/mid_setup()
/datum/game_mode/traitor/changeling/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/clockwork/clockwork.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GLOBAL_LIST_EMPTY(all_clockers)
to_chat(world, "<B>The current game mode is - Clockwork Cult!</B>")
to_chat(world, "<B>Some crewmembers are attempting to start a clockwork cult!<BR>\nClockers - complete your objectives. Convert crewmembers to your cause by using the credence structure. Remember - there is no you, there is only the cult.<BR>\nPersonnel - Do not let the cult succeed in its mission. Brainwashing them with holy water reverts them to whatever CentComm-allowed faith they had.</B>")

/datum/game_mode/clockwork/mid_setup()
/datum/game_mode/clockwork/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(all_cults)
to_chat(world, "<B>The current game mode is - Cult!</B>")
to_chat(world, "<B>Some crewmembers are attempting to start a cult!<BR>\nCultists - complete your objectives. Convert crewmembers to your cause by using the offer rune. Remember - there is no you, there is only the cult.<BR>\nPersonnel - Do not let the cult succeed in its mission. Brainwashing them with holy water reverts them to whatever CentComm-allowed faith they had.</B>")

/datum/game_mode/cult/mid_setup()
/datum/game_mode/cult/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/extended/extended.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
to_chat(world, "<B>Just have fun and role-play!</B>")


/datum/game_mode/extended/mid_setup()
/datum/game_mode/extended/pre_setup()
return TRUE

8 changes: 1 addition & 7 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,11 @@


/**
* Selects players for special roles not affected by job assignment. Ex: Nuke, Wizard, Mouse blob
* Attempts to select players for special roles the mode might have.
*/
/datum/game_mode/proc/pre_setup()
return TRUE

/**
* After station jobs distributed, attempts to select players for special roles the mode might have.
* It also needs to return TRUE if game_mode is ready(antag roles assigned properly)
*/
/datum/game_mode/proc/mid_setup()
return TRUE

/**
* Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things.
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/heist/heist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ GLOBAL_LIST_EMPTY(cortical_stacks) //Stacks for 'leave nobody behind' objective.

return TRUE

/datum/game_mode/heist/mid_setup()
/datum/game_mode/heist/pre_setup()
for(var/datum/mind/raider in raiders)
raider.assigned_role = SPECIAL_ROLE_RAIDER
raider.special_role = SPECIAL_ROLE_RAIDER
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/miniantags/abduction/abduction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
to_chat(world, "<b>Abductors</b> - kidnap the crew and replace their organs with experimental ones.")
to_chat(world, "<b>Crew</b> - don't get abducted and stop the abductors.")

/datum/game_mode/abduction/mid_setup()
/datum/game_mode/abduction/pre_setup()
possible_abductors = get_players_for_role(ROLE_ABDUCTOR)

if(!possible_abductors.len)
Expand Down
2 changes: 0 additions & 2 deletions code/game/gamemodes/nuclear/nuclear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
for(var/datum/mind/synd_mind in syndicates)
synd_mind.assigned_role = SPECIAL_ROLE_NUKEOPS //So they aren't chosen for other jobs.
synd_mind.special_role = SPECIAL_ROLE_NUKEOPS

/datum/game_mode/nuclear/mid_setup()
return TRUE

/datum/game_mode/proc/remove_operative(datum/mind/operative_mind)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/revolution/revolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
///////////////////////////////////////////////////////////////////////////////
//Gets the round setup, cancelling if there's not enough players at the start//
///////////////////////////////////////////////////////////////////////////////
/datum/game_mode/revolution/mid_setup()
/datum/game_mode/revolution/pre_setup()
var/list/possible_revolutionaries = get_players_for_role(ROLE_REV)

if(CONFIG_GET(flag/protect_roles_from_antagonist))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/shadowling/shadowling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Made by Xhuis
to_chat(world, "<b>The current game mode is - Shadowling!</b>")
to_chat(world, "<b>There are alien <span class='deadsay'>shadowlings</span> on the station. Crew: Kill the shadowlings before they can eat or enthrall the crew. Shadowlings: Enthrall the crew while remaining in hiding.</b>")

/datum/game_mode/shadowling/mid_setup()
/datum/game_mode/shadowling/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
3 changes: 0 additions & 3 deletions code/game/gamemodes/spaceninja/space_ninja.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
pre_ninja.set_original_mob(pre_ninja.current)
pre_ninja?.current.loc = pick(GLOB.ninjastart)
..()


/datum/game_mode/space_ninja/mid_setup()
return TRUE


Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/thief/changeling_thief.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров и генокрадов. Не дайте генокрадам достичь успеха и скрыться, и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/changeling/thief/mid_setup()
/datum/game_mode/changeling/thief/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/thief/thief.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров. Не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/thief/mid_setup()
/datum/game_mode/thief/pre_setup()

if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/thief/traitor_thief.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров и агентов Синдиката. Не дайте агентам Синдиката достичь успеха и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/traitor/thief/mid_setup()
/datum/game_mode/traitor/thief/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/thief/traitor_thief_chan.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров, генокрадов и агентов Синдиката. Не дайте агентам Синдиката и Генокрадам достичь успеха и скрыться, и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/traitor/thief/changeling/mid_setup()
/datum/game_mode/traitor/thief/changeling/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/thief/traitor_thief_vamp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров, вампиров и агентов Синдиката. Не дайте агентам Синдиката и Вампирам достичь успеха и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/traitor/thief/vampire/mid_setup()
/datum/game_mode/traitor/thief/vampire/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/thief/vampire_thief.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров и вампиров. Не дайте вампирам достичь успеха и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/vampire/thief/mid_setup()
/datum/game_mode/vampire/thief/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/traitor/traitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
to_chat(world, "<B>There is a syndicate traitor on the station. Do not let the traitor succeed!</B>")


/datum/game_mode/traitor/mid_setup()
/datum/game_mode/traitor/pre_setup()
. = FALSE

if(CONFIG_GET(flag/protect_roles_from_antagonist))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/vampire/goon_vampire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
to_chat(world, "<B>There are Bluespace Vampires infesting your fellow crewmates, keep your blood close and neck safe!</B>")


/datum/game_mode/goon_vampire/mid_setup()
/datum/game_mode/goon_vampire/pre_setup()

if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/vampire/thief_vamp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
to_chat(world, "<B>На станции зафиксирована деятельность гильдии воров и вампиров. Не дайте вампирам достичь успеха и не допустите кражу дорогостоящего оборудования!</B>")


/datum/game_mode/thief/vampire/mid_setup()
/datum/game_mode/thief/vampire/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/vampire/traitor_vamp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
to_chat(world, "<B>There is a Vampire from Space Transylvania on the station along with some syndicate operatives out for their own gain! Do not let the vampire and the traitors succeed!</B>")


/datum/game_mode/traitor/vampire/mid_setup()
/datum/game_mode/traitor/vampire/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/vampire/vampire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
to_chat(world, "<B>There are Bluespace Vampires infesting your fellow crewmates, keep your blood close and neck safe!</B>")


/datum/game_mode/vampire/mid_setup()
/datum/game_mode/vampire/pre_setup()

if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
Expand Down
2 changes: 0 additions & 2 deletions code/game/gamemodes/wizard/wizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
apprentice.set_original_mob(apprentice.current)
apprentice.current.loc = pick(GLOB.wizardstart)
..()

/datum/game_mode/wizard/mid_setup()
return TRUE

/datum/game_mode/wizard/post_setup()
Expand Down

0 comments on commit f84b5b5

Please sign in to comment.