From 52e43c4d2d3d76fa9859d932536916db2688112a Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Thu, 17 Dec 2015 01:29:21 -0500 Subject: [PATCH] good news everyone! It works! --- code/__DEFINES/hud.dm | 3 +- code/datums/hud.dm | 1 + code/datums/mind.dm | 2 ++ code/game/gamemodes/antag_hud.dm | 11 +++++- .../game/gamemodes/autotraitor/autotraitor.dm | 2 ++ code/game/gamemodes/changeling/changeling.dm | 14 ++++++-- code/game/gamemodes/cult/cult.dm | 34 ++++++++++++------ code/game/gamemodes/traitor/traitor.dm | 35 ++++--------------- code/game/gamemodes/vampire/vampire.dm | 8 ++--- code/game/mecha/medical/odysseus.dm | 4 +-- code/modules/mob/dead/observer/observer.dm | 24 +++---------- code/modules/mob/transform_procs.dm | 4 +-- 12 files changed, 72 insertions(+), 70 deletions(-) diff --git a/code/__DEFINES/hud.dm b/code/__DEFINES/hud.dm index fe429df3eca..ab41a74ecd3 100644 --- a/code/__DEFINES/hud.dm +++ b/code/__DEFINES/hud.dm @@ -35,4 +35,5 @@ #define ANTAG_HUD_OPS 9 #define ANTAG_HUD_WIZ 10 #define ANTAG_HUD_SHADOW 11 -#define ANTAG_HUD_VAMPIRE 12 +#define ANTAG_HUD_SOLO 12 + diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 238553dc9ca..f25d18ab255 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -13,6 +13,7 @@ var/datum/atom_hud/huds = list( \ ANTAG_HUD_OPS = new/datum/atom_hud/antag(), \ ANTAG_HUD_WIZ = new/datum/atom_hud/antag(), \ ANTAG_HUD_SHADOW = new/datum/atom_hud/antag(), \ + ANTAG_HUD_SOLO = new/datum/atom_hud/antag(), \ ) /datum/atom_hud diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 30921ceadcc..96ff6d7710e 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -854,6 +854,7 @@ ticker.mode.changelings -= src special_role = null current.remove_changeling_powers() + ticker.mode.update_change_icons_removed(src) if(changeling) qdel(changeling) current << "You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!" log_admin("[key_name(usr)] has de-changelinged [key_name(current)]") @@ -862,6 +863,7 @@ if(!(src in ticker.mode.changelings)) ticker.mode.changelings += src ticker.mode.grant_changeling_powers(current) + ticker.mode.update_change_icons_added(src) special_role = "Changeling" current << "Your powers are awoken. A flash of memory returns to us...we are a changeling!" log_admin("[key_name(usr)] has changelinged [key_name(current)]") diff --git a/code/game/gamemodes/antag_hud.dm b/code/game/gamemodes/antag_hud.dm index f0c4c905f7b..f9336c1cd1b 100644 --- a/code/game/gamemodes/antag_hud.dm +++ b/code/game/gamemodes/antag_hud.dm @@ -6,10 +6,19 @@ CRASH("join_hud(): [M] ([M.type]) is not a mob!") if(M.mind.antag_hud) //note: please let this runtime if a mob has no mind, as mindless mobs shouldn't be getting antagged M.mind.antag_hud.leave_hud(M) - add_to_hud(M) + if(!ismask(M))//FUCK YOU MASK OF NARNAR! + add_to_hud(M) add_hud_to(M) M.mind.antag_hud = src +/datum/atom_hud/antag/proc/join_solo_hud(mob/M)//for non team antags and for observer huds + if(!istype(M)) + CRASH("join_hud(): [M] ([M.type]) is not a mob!") + if(M.mind.antag_hud) //note: please let this runtime if a mob has no mind, as mindless mobs shouldn't be getting antagged + M.mind.antag_hud.leave_hud(M) + add_to_hud(M) + M.mind.antag_hud = src + /datum/atom_hud/antag/proc/leave_hud(mob/M) if(!istype(M)) CRASH("leave_hud(): [M] ([M.type]) is not a mob!") diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 421aadf17ef..7f2abc90b0d 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -137,6 +137,8 @@ newtraitor << "\red ATTENTION: \black It is time to pay your debt to the Syndicate..." newtraitor << "You are now a traitor." newtraitor.mind.special_role = "traitor" + var/datum/atom_hud/antag/tatorhud = huds[SPECIALROLE_HUD] + tatorhud.join_solo_hud(newtraitor) set_antag_hud(src, "hudsyndicate") var/obj_count = 1 diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index cfd7abf254d..251c2223fb3 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -68,6 +68,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" grant_changeling_powers(changeling.current) forge_changeling_objectives(changeling) greet_changeling(changeling) + update_change_icons_added(changeling) ..() @@ -145,10 +146,19 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" for(var/datum/objective/objective in changeling.objectives) changeling.current << "Objective #[obj_count]: [objective.explanation_text]" obj_count++ - - set_antag_hud(changeling.current, "hudchangeling") return +/datum/game_mode/proc/update_change_icons_added(datum/mind/changeling) + var/datum/atom_hud/antag/linghud = huds[ANTAG_HUD_SOLO] + linghud.join_solo_hud(changeling.current) + set_antag_hud(changeling.current, "hudchangeling") + +/datum/game_mode/proc/update_change_icons_removed(datum/mind/changeling) + var/datum/atom_hud/antag/linghud = huds[ANTAG_HUD_SOLO] + linghud.leave_hud(changeling.current) + set_antag_hud(changeling.current, null) + + /*/datum/game_mode/changeling/check_finished() var/changelings_alive = 0 for(var/datum/mind/changeling in changelings) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 7208213d903..457a9d85995 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -211,12 +211,27 @@ M << "[cult_mind.current] looks like they just reverted to their old faith!" +/datum/game_mode/proc/add_cult_icon_to_spirit(mob/spirit/currentSpirit) + if(!istype(currentSpirit)) + return FALSE + if (currentSpirit.client) + var/datum/atom_hud/antag/maskhud = huds[ANTAG_HUD_CULT] + maskhud.join_hud(currentSpirit) + set_antag_hud(currentSpirit,"hudcultist") + + +/datum/game_mode/proc/remove_cult_icon_from_spirit(mob/spirit/currentSpirit) + if(!istype(currentSpirit)) + return FALSE + if (currentSpirit.client) + var/datum/atom_hud/antag/maskhud = huds[ANTAG_HUD_CULT] + maskhud.leave_hud(currentSpirit) + set_antag_hud(currentSpirit, null) + + /datum/game_mode/proc/update_cult_icons_added(datum/mind/cult_mind) - //spawn(0) - // for(var/datum/mind/cultist in cult) - // cult_icon_pair_link(cultist,cult_mind) - // for(var/mob/spirit/currentSpirit in spirits) - // add_cult_icon_to_spirit(currentSpirit,cult_mind) + for(var/mob/spirit/currentSpirit in spirits) + add_cult_icon_to_spirit(currentSpirit,cult_mind) var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT] culthud.join_hud(cult_mind.current) @@ -224,11 +239,10 @@ /datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind) - //spawn(0) - // for(var/datum/mind/cultist in cult) - // cult_icon_pair_unlink(cultist,cult_mind) - // for(var/mob/spirit/currentSpirit in spirits) - // remove_cult_icon_from_spirit(currentSpirit,cult_mind) + + for(var/mob/spirit/currentSpirit in spirits) + remove_cult_icon_from_spirit(currentSpirit,cult_mind) + var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT] culthud.leave_hud(cult_mind.current) set_antag_hud(cult_mind.current, null) diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 8b3456a94b5..a94cda0f3cf 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -337,36 +337,15 @@ traitor_mob.mind.store_memory("Potential Collaborator: [M.real_name]") /datum/game_mode/proc/update_traitor_icons_added(datum/mind/traitor_mind) - var/ref = "\ref[traitor_mind]" - if(ref in implanter) - if(traitor_mind.current) - set_antag_hud(traitor_mind.current, "hudsyndicate") - for(var/headref in implanter) - for(var/datum/mind/t_mind in implanter[headref]) - var/datum/mind/head = locate(headref) - if(head) - if(head.current) - if(head.current.client) - set_antag_hud(head.current, "hudsyndicate") - if(t_mind.current) - if(t_mind.current.client) - set_antag_hud(t_mind.current, "hudsyndicate") + //var/ref = "\ref[traitor_mind]" + var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_SOLO] + tatorhud.join_solo_hud(traitor_mind.current) + set_antag_hud(traitor_mind.current, "hudsyndicate") /datum/game_mode/proc/update_traitor_icons_removed(datum/mind/traitor_mind) - for(var/headref in implanter) - var/datum/mind/head = locate(headref) - for(var/datum/mind/t_mind in implanter[headref]) - if(t_mind.current) - if(t_mind.current.client) - set_antag_hud(t_mind.current, null) - - if(head) - //log_to_dd("found [head.name]") - if(head.current) - if(head.current.client) - set_antag_hud(head.current, null) - if(traitor_mind.current.client) - set_antag_hud(traitor_mind.current, null) + var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_SOLO] + tatorhud.leave_hud(traitor_mind.current) + set_antag_hud(traitor_mind.current, null) /datum/game_mode/proc/remove_traitor_mind(datum/mind/traitor_mind, datum/mind/head) //var/list/removal diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index 1a4dc67237a..5e90a19ff24 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -379,13 +379,13 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha //no verb //prepare for copypaste /datum/game_mode/proc/update_vampire_icons_added(datum/mind/vampire_mind) -// var/datum/atom_hud/antag/vamp_hud = huds[ANTAG_HUD_VAMPIRE] -// vamp_hud.join_hud(vampire_mind) + var/datum/atom_hud/antag/vamp_hud = huds[ANTAG_HUD_SOLO] + vamp_hud.join_solo_hud(vampire_mind.current) set_antag_hud(vampire_mind.current, ((vampire_mind in vampires) ? "hudvampire" : "hudvampirethrall")) /datum/game_mode/proc/update_vampire_icons_removed(datum/mind/vampire_mind) -// var/datum/atom_hud/antag/vampire_hud = huds[ANTAG_HUD_VAMPIRE] -// vampire_hud.leave_hud(vampire_mind) + var/datum/atom_hud/antag/vampire_hud = huds[ANTAG_HUD_SOLO] + vampire_hud.leave_hud(vampire_mind.current) set_antag_hud(vampire_mind.current, null) /datum/game_mode/proc/remove_vampire_mind(datum/mind/vampire_mind, datum/mind/head) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index de876b6c282..c288c09a299 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -24,7 +24,7 @@ else return 0 - pilot_mmi_hud(var/mob/living/carbon/brain/pilot) + mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc,var/mob/living/carbon/brain/pilot) //pilot.regular_hud_updates() //process_med_hud(pilot, 1) var/datum/atom_hud/data/human/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED] @@ -33,7 +33,7 @@ return ..() go_out() - if(ishuman(occupant) && builtin_hud_user) + if((ishuman(occupant) || pilot_is_mmi()) && builtin_hud_user) var/mob/living/carbon/human/H = occupant var/datum/atom_hud/data/human/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED] A.remove_hud_from(H) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 86e280aff1f..912631e05e8 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -291,26 +291,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!M.has_enabled_antagHUD && !check_rights(R_ADMIN|R_MOD,0)) M.has_enabled_antagHUD = 1 + var/datum/atom_hud/A = huds[DATA_HUD_SECURITY_ADVANCED] + var/adding_hud = (usr in A.hudusers) ? 0 : 1 + for(var/datum/atom_hud/H in huds) + if(istype(H, /datum/atom_hud/antag) || istype(H, /datum/atom_hud/data/human/security/advanced)) + (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) - var/datum/atom_hud/A = huds[SPECIALROLE_HUD] - if(M.has_enabled_antagHUD || check_rights(R_ADMIN|R_MOD)) - for(var/datum/atom_hud/H in huds) - if(istype(H, /datum/atom_hud/antag)) - (usr in A.hudusers) ? H.add_hud_to(usr) : H.remove_hud_from(usr) -/* - if(M.antagHUD) - M.antagHUD = 0 - for(var/datum/atom_hud/H in huds) - if(istype(H, /datum/atom_hud/antag)) - H.remove_hud_from(usr) - usr << "You toggled your antag HUD Off." - else - M.antagHUD = 1 - for(var/datum/atom_hud/H in huds) - if(istype(H, /datum/atom_hud/antag)) - H.add_hud_to(usr) - usr << "You toggled your antag HUD On." -*/ /mob/dead/observer/proc/dead_tele(A in ghostteleportlocs) set category = "Ghost" diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 90a9152df21..9c2913bf68e 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -97,7 +97,6 @@ if (should_gib) spawn(0) - ticker.mode.update_cult_icons_removed(src.mind.current) src.gib() // gib the body else spawn(0)//To prevent the proc from returning null. @@ -105,7 +104,6 @@ "[src] disappears into the shadows, never to be seen again.", \ "You disappear into the shadows, never to be seen again.", \ "You hear strange noise, you can't quite place it.") - ticker.mode.update_cult_icons_removed(src.mind.current) qdel(src) new_spirit << "You are a Mask of Nar'sie now. You are a tiny fragment of the unknowable entity that is the god." @@ -115,7 +113,7 @@ // let spirits identify cultists if(ticker.mode) - ticker.mode.update_cult_icons_added(new_spirit.mind.current) + ticker.mode.add_cult_icon_to_spirit(new_spirit) // highlander test there_can_be_only_one_mask(new_spirit)