From 514222b6d7a8ce4598227cdd34d1f749d5a286d0 Mon Sep 17 00:00:00 2001 From: Markolie Date: Sun, 9 Oct 2016 16:36:09 +0200 Subject: [PATCH] Fixes silicons not having their antag powers/antagHUD removed properly. Fixes traitors/abductors not having their antagHUD added at roundstart. --- code/game/gamemodes/changeling/changeling.dm | 2 +- .../miniantags/abduction/abduction.dm | 17 ++++++- code/game/gamemodes/nuclear/nuclear.dm | 14 +++++- code/game/gamemodes/traitor/traitor.dm | 49 ++++++++++++------- code/game/gamemodes/vampire/vampire.dm | 16 ++++++ code/game/gamemodes/wizard/wizard.dm | 15 +++++- code/modules/mob/living/silicon/login.dm | 11 ++++- .../modules/mob/living/silicon/robot/login.dm | 6 --- 8 files changed, 101 insertions(+), 29 deletions(-) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 9fb2402f889..805db2be393 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -152,7 +152,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" changeling_mind.current.remove_changeling_powers() changeling_mind.memory = "" changeling_mind.special_role = null - if(issilicon(changeling_mind)) + if(issilicon(changeling_mind.current)) to_chat(changeling_mind.current, "You have been robotized!") to_chat(changeling_mind.current, "You must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.") else diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index 3e969af60c2..32e4b081e94 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -119,6 +119,7 @@ equip_common(H,team_number) equip_agent(H,team_number) greet_agent(agent,team_number) + update_abductor_icons_added(agent) scientist = scientists[team_number] H = scientist.current @@ -132,6 +133,8 @@ equip_common(H,team_number) equip_scientist(H,team_number) greet_scientist(scientist,team_number) + update_abductor_icons_added(scientist) + return ..() //Used for create antag buttons @@ -165,7 +168,7 @@ equip_common(H,team_number) equip_agent(H,team_number) greet_agent(agent,team_number) - + update_abductor_icons_added(agent) scientist = scientists[team_number] H = scientist.current @@ -179,6 +182,7 @@ equip_common(H,team_number) equip_scientist(H,team_number) greet_scientist(scientist,team_number) + update_abductor_icons_added(scientist) /datum/abductor //stores abductor's team and whether they're a scientist or agent; since species datums are global, we have to use this, instead. @@ -337,6 +341,17 @@ else return 0 return 0 + +/datum/game_mode/proc/remove_abductor(datum/mind/abductor_mind) + if(abductor_mind in abductors) + ticker.mode.abductors -= abductor_mind + abductor_mind.special_role = null + abductor_mind.current.attack_log += "\[[time_stamp()]\] No longer abductor" + if(issilicon(abductor_mind.current)) + to_chat(abductor_mind.current, "You have been turned into a robot! You are no longer an abductor.") + else + to_chat(abductor_mind.current, "You have been brainwashed! You are no longer an abductor.") + ticker.mode.update_abductor_icons_added(abductor_mind) /datum/game_mode/proc/update_abductor_icons_added(datum/mind/alien_mind) var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 1a607bea3ca..28a5ad2c922 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -57,7 +57,19 @@ proc/issyndicate(mob/living/M as mob) /datum/game_mode/nuclear/pre_setup() return 1 - +/datum/game_mode/proc/remove_operative(datum/mind/operative_mind) + if(operative_mind in syndicates) + ticker.mode.syndicates -= operative_mind + operative_mind.special_role = null + for(var/datum/objective/nuclear/O in operative_mind.objectives) + operative_mind.objectives -= O + operative_mind.current.attack_log += "\[[time_stamp()]\] No longer nuclear operative" + if(issilicon(operative_mind.current)) + to_chat(operative_mind.current, "You have been turned into a robot! You are no longer a Syndicate operative.") + else + to_chat(operative_mind.current, "You have been brainwashed! You are no longer a Syndicate operative.") + ticker.mode.update_synd_icons_removed(operative_mind) + //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 9474526655e..60a90b70638 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -63,6 +63,7 @@ /datum/game_mode/traitor/post_setup() for(var/datum/mind/traitor in traitors) forge_traitor_objectives(traitor) + update_traitor_icons_added(traitor) spawn(rand(10,100)) finalize_traitor(traitor) greet_traitor(traitor) @@ -345,9 +346,19 @@ to_chat(traitor_mob, "We have received credible reports that [M.real_name] might be willing to help our cause. If you need assistance, consider contacting them.") traitor_mob.mind.store_memory("Potential Collaborator: [M.real_name]") +/datum/game_mode/proc/remove_traitor(datum/mind/traitor_mind) + if(traitor_mind in traitors) + ticker.mode.traitors -= traitor_mind + traitor_mind.special_role = null + traitor_mind.current.attack_log += "\[[time_stamp()]\] De-traitored" + if(issilicon(traitor_mind.current)) + to_chat(traitor_mind.current, "You have been turned into a robot! You are no longer a traitor.") + else + to_chat(traitor_mind.current, "You have been brainwashed! You are no longer a traitor.") + ticker.mode.update_traitor_icons_removed(traitor_mind) + /datum/game_mode/proc/update_traitor_icons_added(datum/mind/traitor_mind) var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR] - //var/ref = "\ref[traitor_mind]" tatorhud.join_hud(traitor_mind.current) set_antag_hud(traitor_mind.current, "hudsyndicate") @@ -358,23 +369,27 @@ /datum/game_mode/proc/remove_traitor_mind(datum/mind/traitor_mind, datum/mind/head) - //var/list/removal - var/ref = "\ref[head]" - if(ref in implanter) - implanter[ref] -= traitor_mind - implanted -= traitor_mind - traitors -= traitor_mind - if(traitor_mind.som) - var/datum/mindslaves/slaved = traitor_mind.som - slaved.serv -= traitor_mind - traitor_mind.special_role = null - traitor_mind.som = null - slaved.leave_serv_hud(traitor_mind) - for(var/datum/objective/protect/mindslave/MS in traitor_mind.objectives) - traitor_mind.objectives -= MS + if(traitor_mind in implanted) + //var/list/removal + var/ref = "\ref[head]" + if(ref in implanter) + implanter[ref] -= traitor_mind + implanted -= traitor_mind + traitors -= traitor_mind + if(traitor_mind.som) + var/datum/mindslaves/slaved = traitor_mind.som + slaved.serv -= traitor_mind + traitor_mind.special_role = null + traitor_mind.som = null + slaved.leave_serv_hud(traitor_mind) + for(var/datum/objective/protect/mindslave/MS in traitor_mind.objectives) + traitor_mind.objectives -= MS - update_traitor_icons_removed(traitor_mind) - to_chat(traitor_mind.current, "You are no longer a mindslave; you have complete and free control of your own faculties, once more!") + update_traitor_icons_removed(traitor_mind) + if(issilicon(traitor_mind.current)) + to_chat(traitor_mind.current, "You have been turned into a robot! You are no longer a mindslave.") + else + to_chat(traitor_mind.current, "You are no longer a mindslave: you have complete and free control of your own faculties, once more!") /datum/game_mode/proc/assign_exchange_role(var/datum/mind/owner) //set faction diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index 5a78826ab0c..dd40a6817b6 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -325,6 +325,22 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha else if(istype(p, /datum/vampire_passive)) var/datum/vampire_passive/power = p to_chat(owner, "[power.gain_desc]") + + +/datum/game_mode/proc/remove_vampire(datum/mind/vampire_mind) + if(vampire_mind in vampires) + ticker.mode.vampires -= vampire_mind + vampire_mind.special_role = null + vampire_mind.current.attack_log += "\[[time_stamp()]\] De-vampired" + if(vampire_mind.vampire) + vampire_mind.vampire.remove_vampire_powers() + qdel(vampire_mind.vampire) + vampire_mind.vampire = null + if(issilicon(vampire_mind.current)) + to_chat(vampire_mind.current, "You have been turned into a robot! You can feel your powers fading away...") + else + to_chat(vampire_mind.current, "You have been brainwashed! You are no longer a vampire.") + ticker.mode.update_vampire_icons_removed(vampire_mind) //prepare for copypaste /datum/game_mode/proc/update_vampire_icons_added(datum/mind/vampire_mind) diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index b98d97d790e..a38e7dc5541 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -54,7 +54,20 @@ update_wiz_icons_added(wizard) ..() - + +/datum/game_mode/proc/remove_wizard(datum/mind/wizard_mind) + if(wizard_mind in wizards) + ticker.mode.wizards -= wizard_mind + wizard_mind.special_role = null + wizard_mind.current.attack_log += "\[[time_stamp()]\] De-wizarded" + wizard_mind.current.spellremove(wizard_mind.current) + wizard_mind.current.faction = list("Station") + if(issilicon(wizard_mind.current)) + to_chat(wizard_mind.current, "You have been turned into a robot! You can feel your magical powers fading away...") + else + to_chat(wizard_mind.current, "You have been brainwashed! You are no longer a wizard.") + ticker.mode.update_wiz_icons_removed(wizard_mind) + /datum/game_mode/proc/update_wiz_icons_added(datum/mind/wiz_mind) var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ] wizhud.join_hud(wiz_mind.current) diff --git a/code/modules/mob/living/silicon/login.dm b/code/modules/mob/living/silicon/login.dm index cc2cb3e8435..fa71b48232e 100644 --- a/code/modules/mob/living/silicon/login.dm +++ b/code/modules/mob/living/silicon/login.dm @@ -1,8 +1,15 @@ /mob/living/silicon/Login() sleeping = 0 if(mind && ticker && ticker.mode) - ticker.mode.remove_cultist(mind, 1) + ticker.mode.remove_traitor(mind) + ticker.mode.remove_traitor_mind(mind) ticker.mode.remove_revolutionary(mind, 1) - ticker.mode.remove_thrall(mind,0) + ticker.mode.remove_cultist(mind, 1) + ticker.mode.remove_wizard(mind) + ticker.mode.remove_changeling(mind) + ticker.mode.remove_vampire(mind) + ticker.mode.remove_thrall(mind, 0) + ticker.mode.remove_operative(mind) ticker.mode.remove_shadowling(mind) + ticker.mode.remove_abductor(mind) ..() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/login.dm b/code/modules/mob/living/silicon/robot/login.dm index 84fcd64f849..2dd61d9a2ce 100644 --- a/code/modules/mob/living/silicon/robot/login.dm +++ b/code/modules/mob/living/silicon/robot/login.dm @@ -4,9 +4,3 @@ client.hotkeytype = "Cyborg" regenerate_icons() show_laws(0) - if(mind) ticker.mode.remove_cultist(mind) - if(mind) ticker.mode.remove_revolutionary(mind) - if(mind) ticker.mode.remove_thrall(mind,0) - if(mind) ticker.mode.remove_shadowling(mind) - if(mind) ticker.mode.remove_changeling(mind) - return