diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index dc223fd1403..56ae8c531a0 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -110,6 +110,47 @@ checkwin_counter = 0 return 0 +/proc/get_rev_mode() + if(!ticker || !istype(ticker.mode, /datum/game_mode/revolution)) + return null + +/** + * LateSpawn hook. + * Called in newplayer.dm when a humanoid character joins the round after it started. + * Parameters: var/mob/living/carbon/human, var/rank + */ +/hook/latespawn/proc/add_latejoiner_heads(var/mob/living/carbon/human/H) + var/datum/game_mode/revolution/mode = get_rev_mode() + if (!mode) return 1 + + var/list/heads = list() + var/list/alt_positions = list("Warden", "Magistrate", "Blueshield", "Nanotrasen Representative") + + if(H.stat!=2 && H.mind && (H.mind.assigned_role in command_positions)) + heads += H + + if(mode.extra_heads) + if(H.stat!=2 && H.mind && (H.mind.assigned_role in alt_positions)) + heads += H + + for(var/datum/mind/rev_mind in mode.head_revolutionaries) + for(var/datum/mind/head_mind in heads) + var/datum/objective/mutiny/rev_obj = new + rev_obj.owner = rev_mind + rev_obj.target = head_mind + rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]." + rev_mind.objectives += rev_obj + rev_mind.current << "Additional Objective: Assassinate [head_mind.name], the [head_mind.assigned_role]." + + for(var/datum/mind/rev_mind in mode.revolutionaries) + for(var/datum/mind/head_mind in heads) + var/datum/objective/mutiny/rev_obj = new + rev_obj.owner = rev_mind + rev_obj.target = head_mind + rev_obj.explanation_text = "Assassinate [head_mind.name], the [head_mind.assigned_role]." + rev_mind.objectives += rev_obj + rev_mind.current << "Additional Objective: Assassinate [head_mind.name], the [head_mind.assigned_role]." + /datum/game_mode/proc/forge_revolutionary_objectives(var/datum/mind/rev_mind) var/list/heads = get_living_heads() diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 082553f3092..49274720ed1 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -455,6 +455,16 @@ dat += "