Merge branch 'ghost-rad-hud' of https://github.com/chafla/Paradise into ghost-rad-hud

This commit is contained in:
chafla
2021-07-13 15:43:22 -07:00
251 changed files with 4085 additions and 4488 deletions
+13 -71
View File
@@ -27,7 +27,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
var/ghostvision = TRUE //is the ghost able to see things humans can't?
var/seedarkness = TRUE
var/seerads = FALSE // can the ghost see radiation?
var/data_hud_seen = FALSE //this should one of the defines in __DEFINES/hud.dm
/// Defines from __DEFINES/hud.dm go here based on which huds the ghost has activated.
var/list/data_hud_seen = list()
var/ghost_orbit = GHOST_ORBIT_CIRCLE
var/health_scan = FALSE //does the ghost have health scanner mode on? by default it should be off
var/datum/orbit_menu/orbit_menu
@@ -87,7 +88,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
real_name = name
//starts ghosts off with all HUDs.
toggle_medHUD()
toggle_all_huds_on()
..()
/mob/dead/observer/Destroy()
@@ -169,8 +170,6 @@ Works together with spawning an observer, noted above.
else
GLOB.non_respawnable_keys[ckey] = 1
ghost.key = key
if(!(ghost.client && ghost.client.holder) && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed.
ghost.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing!
return ghost
/*
@@ -317,82 +316,24 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/proc/show_me_the_hud(hud_index)
var/datum/atom_hud/H = GLOB.huds[hud_index]
H.add_hud_to(src)
data_hud_seen |= hud_index
/mob/dead/observer/proc/remove_the_hud(hud_index) //remove old huds
var/datum/atom_hud/H = GLOB.huds[hud_index]
H.remove_hud_from(src)
data_hud_seen -= hud_index
/mob/dead/observer/verb/toggle_medHUD()
/mob/dead/observer/verb/open_hud_panel()
set category = "Ghost"
set name = "Toggle All/Sec/Med/Diag HUDs"
set desc = "Toggles the HUDs."
set name = "Ghost HUD Panel"
if(!client)
return
GLOB.ghost_hud_panel.ui_interact(src)
switch(data_hud_seen) //give new huds
if(FALSE)
data_hud_seen = DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED
show_me_the_hud(DATA_HUD_DIAGNOSTIC)
show_me_the_hud(DATA_HUD_SECURITY_ADVANCED)
show_me_the_hud(DATA_HUD_MEDICAL_ADVANCED)
to_chat(src, "<span class='notice'>All HUDs enabled.</span>")
if(DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED)
data_hud_seen = DATA_HUD_SECURITY_ADVANCED
remove_the_hud(DATA_HUD_DIAGNOSTIC)
remove_the_hud(DATA_HUD_MEDICAL_ADVANCED)
to_chat(src, "<span class='notice'>Security HUD set.</span>")
if(DATA_HUD_SECURITY_ADVANCED)
data_hud_seen = DATA_HUD_MEDICAL_ADVANCED
remove_the_hud(DATA_HUD_SECURITY_ADVANCED)
show_me_the_hud(DATA_HUD_MEDICAL_ADVANCED)
to_chat(src, "<span class='notice'>Medical HUD set.</span>")
if(DATA_HUD_MEDICAL_ADVANCED)
data_hud_seen = DATA_HUD_DIAGNOSTIC
remove_the_hud(DATA_HUD_MEDICAL_ADVANCED)
show_me_the_hud(DATA_HUD_DIAGNOSTIC)
to_chat(src, "<span class='notice'>Diagnostic HUD set.</span>")
else
data_hud_seen = FALSE
remove_the_hud(DATA_HUD_MEDICAL_ADVANCED)
to_chat(src, "<span class='notice'>HUDs disabled.</span>")
/mob/dead/observer/verb/toggle_antagHUD()
set category = "Ghost"
set name = "Toggle AntagHUD"
set desc = "Toggles AntagHUD allowing you to see who is the antagonist"
if(!config.antag_hud_allowed && !client.holder)
to_chat(src, "<span class='warning'>Admins have disabled this for this round.</span>")
return
if(!client)
return
var/mob/dead/observer/M = src
if(jobban_isbanned(M, "AntagHUD"))
to_chat(src, "<span class='danger'>You have been banned from using this feature</span>")
return
if(config.antag_hud_restricted && !M.has_enabled_antagHUD && !check_rights(R_ADMIN|R_MOD,0))
var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No")
if(response == "No") return
M.can_reenter_corpse = 0
if(M in GLOB.respawnable_list)
GLOB.respawnable_list -= M
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/antag/H in (GLOB.huds))
if(!M.antagHUD)
H.add_hud_to(usr)
else
H.remove_hud_from(usr)
if(!M.antagHUD)
to_chat(usr, "AntagHud Toggled ON")
M.antagHUD = TRUE
else
to_chat(usr, "AntagHud Toggled OFF")
M.antagHUD = FALSE
/mob/dead/observer/proc/toggle_all_huds_on()
show_me_the_hud(DATA_HUD_DIAGNOSTIC)
show_me_the_hud(DATA_HUD_SECURITY_ADVANCED)
show_me_the_hud(DATA_HUD_MEDICAL_ADVANCED)
/mob/dead/observer/verb/toggle_rad_view()
set category = "Ghost"
@@ -431,6 +372,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/choice = alert(src, "If you enable this, your body will be unrevivable for the remainder of the round.", "Are you sure?", "Yes", "No")
if(choice == "Yes")
to_chat(src, "<span class='boldnotice'>Do Not Revive state enabled.</span>")
create_log(MISC_LOG, "DNR Enabled")
can_reenter_corpse = FALSE
if(!QDELETED(mind.current)) // Could change while they're choosing
mind.current.med_hud_set_status()