diff --git a/code/__DEFINES/hud.dm b/code/__DEFINES/hud.dm index 0ac66f3092d..9ca921c0cda 100644 --- a/code/__DEFINES/hud.dm +++ b/code/__DEFINES/hud.dm @@ -32,3 +32,7 @@ #define ANTAG_HUD_SHADOW 10 #define ANTAG_HUD_HOG_BLUE 11 #define ANTAG_HUD_HOG_RED 12 +#define ANTAG_HUD_TRAITOR 13 +#define ANTAG_HUD_NINJA 14 +#define ANTAG_HUD_CHANGELING 15 +#define ANTAG_HUD_ABDUCTOR 16 diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 514c87c2baa..36cf5577192 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -14,6 +14,10 @@ var/datum/atom_hud/huds = list( \ ANTAG_HUD_SHADOW = new/datum/atom_hud/antag(), \ ANTAG_HUD_HOG_BLUE = new/datum/atom_hud/antag(),\ ANTAG_HUD_HOG_RED = new/datum/atom_hud/antag(),\ + ANTAG_HUD_TRAITOR = new/datum/atom_hud/antag(),\ + ANTAG_HUD_NINJA = new/datum/atom_hud/antag(),\ + ANTAG_HUD_CHANGELING = new/datum/atom_hud/antag(),\ + ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag(),\ ) /datum/atom_hud diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 54e5b3138a8..1a8e401399b 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -113,6 +113,7 @@ changeling = null special_role = null remove_antag_equip() + ticker.mode.update_changeling_icons_removed(src) /datum/mind/proc/remove_traitor() if(src in ticker.mode.traitors) @@ -126,6 +127,7 @@ qdel(A.malf_picker) special_role = null remove_antag_equip() + ticker.mode.update_traitor_icons_removed(src) /datum/mind/proc/remove_nukeop() if(src in ticker.mode.syndicates) @@ -198,6 +200,13 @@ remove_cultist() remove_rev() remove_gang() + ticker.mode.update_changeling_icons_removed(src) + ticker.mode.update_traitor_icons_removed(src) + ticker.mode.update_wiz_icons_removed(src) + ticker.mode.update_cult_icons_removed(src) + ticker.mode.update_rev_icons_removed(src) + gang_datum.remove_gang_hud(src) + /datum/mind/proc/show_memory(mob/recipient, window=1) if(!recipient) @@ -997,6 +1006,7 @@ remove_wizard() current << "You have been brainwashed! You are no longer a wizard!" log_admin("[key_name(usr)] has de-wizard'ed [current].") + ticker.mode.update_wiz_icons_removed(src) if("wizard") if(!(src in ticker.mode.wizards)) ticker.mode.wizards += src @@ -1005,6 +1015,7 @@ current << "You are the Space Wizard!" message_admins("[key_name_admin(usr)] has wizard'ed [current].") log_admin("[key_name(usr)] has wizard'ed [current].") + ticker.mode.update_wiz_icons_added(src) if("lair") current.loc = pick(wizardstart) if("dressup") @@ -1030,6 +1041,7 @@ current << "Your powers are awoken. A flash of memory returns to us...we are [changeling.changelingID], a changeling!" message_admins("[key_name_admin(usr)] has changeling'ed [current].") log_admin("[key_name(usr)] has changeling'ed [current].") + ticker.mode.update_changeling_icons_added(src) if("autoobjectives") ticker.mode.forge_changeling_objectives(src) usr << "The objectives for changeling [key] have been generated. You can edit them and anounce manually." @@ -1101,6 +1113,7 @@ current << "You have been brainwashed! You are no longer a traitor!" message_admins("[key_name_admin(usr)] has de-traitor'ed [current].") log_admin("[key_name(usr)] has de-traitor'ed [current].") + ticker.mode.update_traitor_icons_removed(src) if("traitor") if(!(src in ticker.mode.traitors)) @@ -1112,6 +1125,7 @@ if(isAI(current)) var/mob/living/silicon/ai/A = current ticker.mode.add_law_zero(A) + ticker.mode.update_traitor_icons_added(src) if("autoobjectives") ticker.mode.forge_traitor_objectives(src) @@ -1158,12 +1172,14 @@ switch(href_list["abductor"]) if("clear") usr << "Not implemented yet. Sorry!" + //ticker.mode.update_abductor_icons_removed(src) if("abductor") if(!ishuman(current)) usr << "This only works on humans!" return make_Abductor() log_admin("[key_name(usr)] turned [current] into abductor.") + ticker.mode.update_abductor_icons_added(src) if("equip") var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist") if(gear) @@ -1330,6 +1346,7 @@ special_role = "Changeling" ticker.mode.forge_changeling_objectives(src) ticker.mode.greet_changeling(src) + ticker.mode.update_changeling_icons_added(src) /datum/mind/proc/make_Wizard() if(!(src in ticker.mode.wizards)) diff --git a/code/game/gamemodes/antag_hud.dm b/code/game/gamemodes/antag_hud.dm index 399d613a92b..c4a8c4da9a1 100644 --- a/code/game/gamemodes/antag_hud.dm +++ b/code/game/gamemodes/antag_hud.dm @@ -1,13 +1,15 @@ /datum/atom_hud/antag hud_icons = list(ANTAG_HUD) -/datum/atom_hud/antag/proc/join_hud(mob/M) +/datum/atom_hud/antag/proc/join_hud(mob/M, var/sees_hud = 1) + //sees_hud should be set to 0 if the mob does not get to see it's own hud type. 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) - add_hud_to(M) + if(sees_hud) + add_hud_to(M) M.mind.antag_hud = src /datum/atom_hud/antag/proc/leave_hud(mob/M) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 6a23763a639..e324640e5d9 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -97,6 +97,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas changeling.special_role = "Changeling" forge_changeling_objectives(changeling) greet_changeling(changeling) + ticker.mode.update_changeling_icons_added(changeling) ..() return @@ -500,3 +501,13 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas newprofile.underwear = underwear newprofile.undershirt = undershirt newprofile.socks = socks + +/datum/game_mode/proc/update_changeling_icons_added(datum/mind/changling_mind) + var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_CHANGELING] + hud.join_hud(changling_mind.current, 0) + set_antag_hud(changling_mind.current, "changling") + +/datum/game_mode/proc/update_changeling_icons_removed(datum/mind/changling_mind) + var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_CHANGELING] + hud.leave_hud(changling_mind.current) + set_antag_hud(changling_mind.current, null) diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index bfb25e12699..e787e88b95c 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -342,6 +342,16 @@ return 0 return 0 +/datum/game_mode/proc/update_abductor_icons_added(datum/mind/alien_mind) + var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] + hud.join_hud(alien_mind.current, 0) + set_antag_hud(alien_mind.current, ((alien_mind in abductors) ? "abductor" : "abductee")) + +/datum/game_mode/proc/update_abductor_icons_removed(datum/mind/alien_mind) + var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] + hud.leave_hud(alien_mind.current) + set_antag_hud(alien_mind.current, null) + /datum/objective/abductee dangerrating = 5 completed = 1 diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm index 9458a61adc7..5dde76b4c00 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm @@ -164,6 +164,7 @@ for(var/datum/objective/objective in H.mind.objectives) H << "Objective #[obj_count]: [objective.explanation_text]" obj_count++ + ticker.mode.update_abductor_icons_added(H.mind) for(var/obj/item/organ/internal/gland/G in H.internal_organs) G.Start() diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index dfa6e09affd..64bd43c8bea 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -306,7 +306,7 @@ Made by Xhuis shadow_hud.join_hud(shadow_mind.current) set_antag_hud(shadow_mind.current, ((shadow_mind in shadows) ? "shadowling" : "thrall")) -/datum/game_mode/proc/update_shadow_icons_removed(datum/mind/shadow_mind) //This should never actually occur, but it's here anyway. +/datum/game_mode/proc/update_shadow_icons_removed(datum/mind/shadow_mind) var/datum/atom_hud/antag/shadow_hud = huds[ANTAG_HUD_SHADOW] shadow_hud.leave_hud(shadow_mind.current) set_antag_hud(shadow_mind.current, null) diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 1ca929d9c03..8439ba2bd66 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -206,6 +206,7 @@ add_law_zero(traitor.current) else equip_traitor(traitor.current) + ticker.mode.update_traitor_icons_added(traitor) return @@ -373,3 +374,14 @@ where = "In your [equipped_slot]" mob << "

[where] is a folder containing secret documents that another Syndicate group wants. We have set up a meeting with one of their agents on station to make an exchange. Exercise extreme caution as they cannot be trusted and may be hostile.
" mob.update_icons() + +/datum/game_mode/proc/update_traitor_icons_added(datum/mind/traitor_mind) + var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + traitorhud.join_hud(traitor_mind.current, 0) + set_antag_hud(traitor_mind.current, "traitor") + +/datum/game_mode/proc/update_traitor_icons_removed(datum/mind/traitor_mind) + var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + traitorhud.leave_hud(traitor_mind.current) + set_antag_hud(traitor_mind.current, null) + diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index b8e13b38bb8..1f3482ed530 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -976,6 +976,10 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits 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) + + for(var/datum/gang/G in ticker.mode.gangs) + var/datum/atom_hud/antag/H = G.ganghud + (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) usr << "You toggled your admin antag HUD [adding_hud ? "ON" : "OFF"]." message_admins("[key_name_admin(usr)] toggled their admin antag HUD [adding_hud ? "ON" : "OFF"].") diff --git a/code/modules/ninja/ninja_event.dm b/code/modules/ninja/ninja_event.dm index 1ef8d0a23e0..812607851f4 100644 --- a/code/modules/ninja/ninja_event.dm +++ b/code/modules/ninja/ninja_event.dm @@ -158,7 +158,7 @@ Contents: return Ninja << sound('sound/effects/ninja_greeting.ogg') //so ninja you probably wouldn't even know if you were made one - + ticker.mode.update_ninja_icons_added(Mind) success_spawn = 1 @@ -213,3 +213,13 @@ Contents: var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(src) E.implant(src) return 1 + +/datum/game_mode/proc/update_ninja_icons_added(var/mob/living/carbon/human/ninja) + var/datum/atom_hud/antag/ninjahud = huds[ANTAG_HUD_TRAITOR] + ninjahud.join_hud(ninja, 0) + set_antag_hud(ninja, "traitor") + +/datum/game_mode/proc/update_ninja_icons_removed(datum/mind/ninja_mind) + var/datum/atom_hud/antag/ninjahud = huds[ANTAG_HUD_NINJA] + ninjahud.leave_hud(ninja_mind.current) + set_antag_hud(ninja_mind.current, null) diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index 8e7724e96e1..f0675db88a6 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ