mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Merge pull request #15924 from lordpidey/adminantaghud
Adds admin antag-hud
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='userdanger'>You have been brainwashed! You are no longer a wizard!</span>"
|
||||
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 << "<span class='boldannounce'>You are the Space Wizard!</span>"
|
||||
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 << "<span class='boldannounce'>Your powers are awoken. A flash of memory returns to us...we are [changeling.changelingID], a changeling!</span>"
|
||||
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 << "<span class='notice'>The objectives for changeling [key] have been generated. You can edit them and anounce manually.</span>"
|
||||
@@ -1101,6 +1113,7 @@
|
||||
current << "<span class='userdanger'>You have been brainwashed! You are no longer a traitor!</span>"
|
||||
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 << "<span class='warning'>This only works on humans!</span>"
|
||||
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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -164,6 +164,7 @@
|
||||
for(var/datum/objective/objective in H.mind.objectives)
|
||||
H << "<B>Objective #[obj_count]</B>: [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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 << "<BR><BR><span class='info'>[where] is a folder containing <b>secret documents</b> 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.</span><BR>"
|
||||
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)
|
||||
|
||||
|
||||
@@ -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"].")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 10 KiB |
Reference in New Issue
Block a user