From a780eccdaf4b13d547602a1d4e4253e5ce0e91f5 Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Wed, 18 Feb 2015 16:02:25 -0500 Subject: [PATCH 1/2] Check Antagonist Rev Extra Head Bug --- code/modules/admin/player_panel.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 082553f3092..2f1d523bb65 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -455,6 +455,16 @@ dat += "[mob_loc.loc]" else dat += "Head not found!" + if(ticker.mode.num_players_started() >= 30 + for(var/datum/mind/N in ticker.mode.get_extra_living_heads()) + var/mob/M = N.current + if(M) + dat += "[M.real_name][M.client ? "" : " (logged out)"][M.stat == 2 ? " (DEAD)" : ""]" + dat += "PM" + var/turf/mob_loc = get_turf_loc(M) + dat += "[mob_loc.loc]" + else + dat += "Head not found!" dat += "" if(ticker.mode.name == "nations") From 69a7d19380e90c9d3c2e7fb67112ce0259754662 Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Wed, 18 Feb 2015 16:27:46 -0500 Subject: [PATCH 2/2] Compile fix & Latejoin heads get added to target lists --- code/game/gamemodes/revolution/revolution.dm | 41 ++++++++++++++++++++ code/modules/admin/player_panel.dm | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) 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 2f1d523bb65..49274720ed1 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -455,7 +455,7 @@ dat += "[mob_loc.loc]" else dat += "Head not found!" - if(ticker.mode.num_players_started() >= 30 + if(ticker.mode.num_players_started() >= 30) for(var/datum/mind/N in ticker.mode.get_extra_living_heads()) var/mob/M = N.current if(M)