mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Merge pull request #4061 from Aurorablade/AntagHudUpdates
Antag Hud updates
This commit is contained in:
@@ -36,5 +36,8 @@
|
||||
#define ANTAG_HUD_OPS 9
|
||||
#define ANTAG_HUD_WIZ 10
|
||||
#define ANTAG_HUD_SHADOW 11
|
||||
#define ANTAG_HUD_SOLO 12
|
||||
|
||||
#define ANTAG_HUD_TRAITOR 12
|
||||
#define ANTAG_HUD_NINJA 13 //For Daves Rework
|
||||
#define ANTAG_HUD_CHANGELING 14
|
||||
#define ANTAG_HUD_VAMPIRE 15
|
||||
#define ANTAG_HUD_ABDUCTOR 16 //For Fox
|
||||
|
||||
+6
-2
@@ -13,7 +13,11 @@ 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(), \
|
||||
ANTAG_HUD_TRAITOR = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_NINJA = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_CHANGELING = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_VAMPIRE = new/datum/atom_hud/antag/hidden(),\
|
||||
ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden(),\
|
||||
)
|
||||
|
||||
/datum/atom_hud
|
||||
@@ -24,7 +28,7 @@ var/datum/atom_hud/huds = list( \
|
||||
/datum/atom_hud/proc/remove_hud_from(mob/M)
|
||||
if(!M)
|
||||
return
|
||||
if(src in M.permanent_huds)//I will deal with you later -Fethas
|
||||
if(src in M.permanent_huds)
|
||||
return
|
||||
for(var/atom/A in hudatoms)
|
||||
remove_from_single_hud(M, A)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
/datum/atom_hud/antag
|
||||
hud_icons = list(SPECIALROLE_HUD,NATIONS_HUD)
|
||||
var/self_visible = 1
|
||||
|
||||
/datum/atom_hud/antag/hidden
|
||||
self_visible = 0
|
||||
|
||||
/datum/atom_hud/antag/proc/join_hud(mob/M,var/slave)
|
||||
if(!istype(M))
|
||||
@@ -8,15 +12,8 @@
|
||||
M.mind.antag_hud.leave_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,var/slave)//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 && !slave) //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(self_visible)
|
||||
add_hud_to(M)
|
||||
M.mind.antag_hud = src
|
||||
|
||||
/datum/atom_hud/antag/proc/leave_hud(mob/M)
|
||||
@@ -49,22 +46,13 @@
|
||||
if(M.mind || new_icon_state) //in mindless mobs, only null is acceptable, otherwise we're antagging a mindless mob, meaning we should runtime
|
||||
M.mind.antag_hud_icon_state = new_icon_state
|
||||
|
||||
/datum/atom_hud/antag/proc/is_solo_antag(mob/M)
|
||||
if(M.mind.special_role == "traitor" || M.mind.special_role == "vampire" || M.mind.special_role == "Changeling")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
//MIND PROCS
|
||||
//these are called by mind.transfer_to()
|
||||
/datum/mind/proc/transfer_antag_huds(var/datum/atom_hud/antag/newhud)
|
||||
leave_all_huds()
|
||||
ticker.mode.set_antag_hud(current, antag_hud_icon_state)
|
||||
if(newhud)
|
||||
if(newhud.is_solo_antag(current))
|
||||
newhud.join_solo_hud(current)
|
||||
else
|
||||
newhud.join_hud(current)
|
||||
newhud.join_hud(current)
|
||||
|
||||
/datum/mind/proc/leave_all_huds()
|
||||
for(var/datum/atom_hud/antag/hud in huds)
|
||||
|
||||
@@ -136,8 +136,8 @@
|
||||
newtraitor << "\red <B>ATTENTION:</B> \black It is time to pay your debt to the Syndicate..."
|
||||
newtraitor << "<B>You are now a traitor.</B>"
|
||||
newtraitor.mind.special_role = "traitor"
|
||||
var/datum/atom_hud/antag/tatorhud = huds[SPECIALROLE_HUD]
|
||||
tatorhud.join_solo_hud(newtraitor)
|
||||
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR]
|
||||
tatorhud.join_hud(newtraitor)
|
||||
set_antag_hud(src, "hudsyndicate")
|
||||
|
||||
var/obj_count = 1
|
||||
|
||||
@@ -164,12 +164,12 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
|
||||
update_change_icons_removed(changeling_mind)
|
||||
|
||||
/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)
|
||||
var/datum/atom_hud/antag/linghud = huds[ANTAG_HUD_CHANGELING]
|
||||
linghud.join_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]
|
||||
var/datum/atom_hud/antag/linghud = huds[ANTAG_HUD_CHANGELING]
|
||||
linghud.leave_hud(changeling.current)
|
||||
set_antag_hud(changeling.current, null)
|
||||
|
||||
|
||||
@@ -340,13 +340,13 @@
|
||||
traitor_mob.mind.store_memory("<b>Potential Collaborator</b>: [M.real_name]")
|
||||
|
||||
/datum/game_mode/proc/update_traitor_icons_added(datum/mind/traitor_mind)
|
||||
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_SOLO]
|
||||
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR]
|
||||
//var/ref = "\ref[traitor_mind]"
|
||||
tatorhud.join_solo_hud(traitor_mind.current)
|
||||
tatorhud.join_hud(traitor_mind.current)
|
||||
set_antag_hud(traitor_mind.current, "hudsyndicate")
|
||||
|
||||
/datum/game_mode/proc/update_traitor_icons_removed(datum/mind/traitor_mind)
|
||||
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_SOLO]
|
||||
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR]
|
||||
tatorhud.leave_hud(traitor_mind.current)
|
||||
set_antag_hud(traitor_mind.current, null)
|
||||
|
||||
|
||||
@@ -328,12 +328,12 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha
|
||||
|
||||
//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_SOLO]
|
||||
vamp_hud.join_solo_hud(vampire_mind.current)
|
||||
var/datum/atom_hud/antag/vamp_hud = huds[ANTAG_HUD_VAMPIRE]
|
||||
vamp_hud.join_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_SOLO]
|
||||
var/datum/atom_hud/antag/vampire_hud = huds[ANTAG_HUD_VAMPIRE]
|
||||
vampire_hud.leave_hud(vampire_mind.current)
|
||||
set_antag_hud(vampire_mind.current, null)
|
||||
|
||||
|
||||
@@ -110,18 +110,6 @@ Works together with spawning an observer, noted above.
|
||||
if(!loc) return
|
||||
if(!client) return 0
|
||||
|
||||
//regular_hud_updates()
|
||||
//if(client.images.len)
|
||||
// for(var/image/hud in client.images)
|
||||
// if(copytext(hud.icon_state,1,4) == "hud")
|
||||
// client.images.Remove(hud)
|
||||
//if(antagHUD)
|
||||
// var/list/target_list = list()
|
||||
// for(var/mob/living/target in oview(src, 14))
|
||||
// if(target.mind && (target.mind.special_role || issilicon(target) || target.mind.nation))
|
||||
// target_list += target
|
||||
// if(target_list.len)
|
||||
// assess_targets(target_list, src)
|
||||
|
||||
|
||||
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
|
||||
@@ -320,9 +308,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
//var/adding_hud = (usr in A.hudusers) ? 0 : 1
|
||||
|
||||
for(var/datum/atom_hud/antag/H in (huds))
|
||||
//if(istype(H, /datum/atom_hud/antag))// || istype(H, /datum/atom_hud/data/human/security/advanced))
|
||||
if(!M.antagHUD)
|
||||
//(adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr)
|
||||
H.add_hud_to(usr)
|
||||
else
|
||||
H.remove_hud_from(usr)
|
||||
|
||||
Reference in New Issue
Block a user