mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Merge pull request #5908 from tkdrg/hud
Makes data and antag huds passive and creates /datum/atom_hud
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// for secHUDs and medHUDs and variants. The number is the location of the image on the list hud_list
|
||||
// note: if you add more HUDs, even for non-human atoms, make sure to use unique numbers for the defines!
|
||||
// /datum/atom_hud expects these to be unique
|
||||
// these need to be strings in order to make them associative lists
|
||||
#define HEALTH_HUD "1" // dead, alive, sick, health status
|
||||
#define STATUS_HUD "2" // a simple line rounding the mob's number health
|
||||
#define ID_HUD "3" // the job asigned to your ID
|
||||
#define WANTED_HUD "4" // wanted, released, parroled, security status
|
||||
#define IMPLOYAL_HUD "5" // loyality implant
|
||||
#define IMPCHEM_HUD "6" // chemical implant
|
||||
#define IMPTRACK_HUD "7" // tracking implant
|
||||
//for antag huds. these are used at the /mob level
|
||||
#define ANTAG_HUD "8"
|
||||
|
||||
//data HUD (medhud, sechud) defines
|
||||
//Don't forget to update human/New() if you change these!
|
||||
#define DATA_HUD_SECURITY_BASIC 1
|
||||
#define DATA_HUD_SECURITY_ADVANCED 2
|
||||
#define DATA_HUD_MEDICAL_BASIC 3
|
||||
#define DATA_HUD_MEDICAL_ADVANCED 4
|
||||
//antag HUD defines
|
||||
#define ANTAG_HUD_CULT 5
|
||||
#define ANTAG_HUD_REV 6
|
||||
#define ANTAG_HUD_OPS 7
|
||||
#define ANTAG_HUD_GANG_A 8
|
||||
#define ANTAG_HUD_GANG_B 9
|
||||
@@ -50,4 +50,4 @@
|
||||
#define STAGE_TWO 3
|
||||
#define STAGE_THREE 5
|
||||
#define STAGE_FOUR 7
|
||||
#define STAGE_FIVE 9
|
||||
#define STAGE_FIVE 9
|
||||
|
||||
@@ -21,12 +21,3 @@
|
||||
#define BORGMESON 1
|
||||
#define BORGTHERM 2
|
||||
#define BORGXRAY 4
|
||||
|
||||
// for secHUDs and medHUDs and variants. The number is the location of the image on the list hud_list of humans.
|
||||
#define HEALTH_HUD 1 // dead, alive, sick, health status
|
||||
#define STATUS_HUD 2 // a simple line rounding the mob's number health
|
||||
#define ID_HUD 3 // the job asigned to your ID
|
||||
#define WANTED_HUD 4 // wanted, released, parroled, security status
|
||||
#define IMPLOYAL_HUD 5 // loyality implant
|
||||
#define IMPCHEM_HUD 6 // chemical implant
|
||||
#define IMPTRACK_HUD 7 // tracking implant
|
||||
|
||||
@@ -14,5 +14,3 @@ var/global/list/chemical_reactions_list //list of all /datum/chemical_reactio
|
||||
var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
|
||||
var/global/list/surgeries_list = list() //list of all surgeries by name, associated with their path.
|
||||
var/global/list/table_recipes = list() //list of all table craft recipes
|
||||
var/global/list/med_hud_users = list() //list of all entities using a medical HUD.
|
||||
var/global/list/sec_hud_users = list() //list of all entities using a security HUD.
|
||||
@@ -37,8 +37,11 @@
|
||||
DD.affected_mob = src
|
||||
DD.holder = src
|
||||
if(DD.disease_flags & CAN_CARRY && prob(5))
|
||||
DD.carrier++
|
||||
DD.carrier = 1
|
||||
|
||||
/mob/living/carbon/human/AddDisease(var/datum/disease/D)
|
||||
..()
|
||||
med_hud_set_status()
|
||||
|
||||
/mob/living/carbon/ContractDisease(var/datum/disease/D)
|
||||
if(!CanContractDisease(D))
|
||||
@@ -122,4 +125,4 @@
|
||||
/mob/proc/ForceContractDisease(var/datum/disease/D)
|
||||
if(!CanContractDisease(D))
|
||||
return 0
|
||||
AddDisease(D)
|
||||
AddDisease(D)
|
||||
|
||||
@@ -152,7 +152,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
if(disease_flags & CAN_RESIST)
|
||||
if(!(type in affected_mob.resistances))
|
||||
affected_mob.resistances += type
|
||||
affected_mob.viruses -= src
|
||||
remove_virus()
|
||||
del(src)
|
||||
|
||||
|
||||
@@ -192,3 +192,10 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
if(spread_flags & CONTACT_FEET || spread_flags & CONTACT_HANDS || spread_flags & CONTACT_GENERAL)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//don't use this proc directly. this should only ever be called by cure()
|
||||
/datum/disease/proc/remove_virus()
|
||||
affected_mob.viruses -= src //remove the datum from the list
|
||||
if(istype(affected_mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
|
||||
@@ -106,7 +106,7 @@ var/list/advance_cures = list(
|
||||
var/id = "[GetDiseaseID()]"
|
||||
if(resistance && !(id in affected_mob.resistances))
|
||||
affected_mob.resistances[id] = id
|
||||
affected_mob.viruses -= src //remove the datum from the list
|
||||
remove_virus()
|
||||
del(src) //delete the datum to stop it processing
|
||||
|
||||
// Returns the advance disease with a different reference memory.
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/* HUD DATUMS */
|
||||
|
||||
//GLOBAL HUD LIST
|
||||
var/datum/atom_hud/huds = list( \
|
||||
DATA_HUD_SECURITY_BASIC = new/datum/atom_hud/data/security/basic(), \
|
||||
DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/security/advanced(), \
|
||||
DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/medical/basic(), \
|
||||
DATA_HUD_MEDICAL_ADVANCED = new/datum/atom_hud/data/medical/advanced(), \
|
||||
ANTAG_HUD_CULT = new/datum/atom_hud/antag(), \
|
||||
ANTAG_HUD_REV = new/datum/atom_hud/antag(), \
|
||||
ANTAG_HUD_OPS = new/datum/atom_hud/antag(), \
|
||||
ANTAG_HUD_GANG_A = new/datum/atom_hud/antag(), \
|
||||
ANTAG_HUD_GANG_B = new/datum/atom_hud/antag(), \
|
||||
)
|
||||
|
||||
/mob/proc/refresh_huds(var/mob/inherited_from = null)
|
||||
var/mob/seek_for = (inherited_from) ? inherited_from : src
|
||||
var/image/oldantagicon = seek_for.hud_list[ANTAG_HUD]
|
||||
var/image/newantagicon = hud_list[ANTAG_HUD]
|
||||
if(oldantagicon && oldantagicon.icon_state)
|
||||
newantagicon.icon_state = oldantagicon.icon_state
|
||||
if(istype(inherited_from, /mob/dead/observer))
|
||||
var/mob/dead/observer/G = inherited_from
|
||||
for(var/datum/atom_hud/hud in G.oldhuds)
|
||||
readd_hud(hud)
|
||||
else
|
||||
for(var/datum/atom_hud/hud in huds)
|
||||
if(seek_for in hud.hudusers)
|
||||
readd_hud(hud)
|
||||
|
||||
/mob/proc/readd_hud(var/datum/atom_hud/hud)
|
||||
hud.add_hud_to(src)
|
||||
|
||||
/mob/dead/observer/readd_hud(var/datum/atom_hud/hud)
|
||||
oldhuds |= hud
|
||||
|
||||
/datum/atom_hud
|
||||
var/list/atom/hudatoms = list() //list of all atoms which display this hud
|
||||
var/list/mob/hudusers = list() //list with all mobs who can see the hud
|
||||
var/list/hud_icons = list() //these will be the indexes for the atom's hud_list
|
||||
|
||||
/datum/atom_hud/proc/remove_hud_from(var/mob/M)
|
||||
for(var/atom/A in hudatoms)
|
||||
remove_from_single_hud(M, A)
|
||||
hudusers -= M
|
||||
|
||||
/datum/atom_hud/proc/remove_from_hud(var/atom/A)
|
||||
for(var/mob/M in hudusers)
|
||||
remove_from_single_hud(M, A)
|
||||
hudatoms -= A
|
||||
|
||||
/datum/atom_hud/proc/remove_from_single_hud(var/mob/M, var/atom/A) //unsafe, no sanity apart from client
|
||||
if(!M.client)
|
||||
return
|
||||
for(var/i in hud_icons)
|
||||
M.client.images -= A.hud_list[i]
|
||||
|
||||
/datum/atom_hud/proc/add_hud_to(var/mob/M)
|
||||
hudusers |= M
|
||||
for(var/atom/A in hudatoms)
|
||||
add_to_single_hud(M, A)
|
||||
|
||||
/datum/atom_hud/proc/add_to_hud(var/atom/A)
|
||||
hudatoms |= A
|
||||
for(var/mob/M in hudusers)
|
||||
add_to_single_hud(M, A)
|
||||
|
||||
/datum/atom_hud/proc/add_to_single_hud(var/mob/M, var/atom/A) //unsafe, no sanity apart from client
|
||||
if(!M.client)
|
||||
return
|
||||
for(var/i in hud_icons)
|
||||
M.client.images |= A.hud_list[i]
|
||||
@@ -75,6 +75,7 @@
|
||||
if(new_character.mind) //disassociate any mind currently in our new body's mind variable
|
||||
new_character.mind.current = null
|
||||
|
||||
new_character.refresh_huds(current) //inherit the HUDs from the old body
|
||||
current = new_character //associate ourself with our new body
|
||||
new_character.mind = src //and associate our new body with ourself
|
||||
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
///Chemistry.
|
||||
var/datum/reagents/reagents = null
|
||||
|
||||
//This atom's HUD (med/sec, etc) images. Associative list.
|
||||
var/list/image/hud_list = list()
|
||||
//HUD images that this atom can provide.
|
||||
var/list/hud_possible
|
||||
|
||||
//var/chem_is_open_container = 0
|
||||
// replaced by OPENCONTAINER flags and atom/proc/is_open_container()
|
||||
///Chemistry.
|
||||
|
||||
+98
-121
@@ -1,21 +1,70 @@
|
||||
/* Using the HUD procs is simple. Call these procs in the life.dm of the intended mob.
|
||||
Use the regular_hud_updates() proc before process_med_hud(mob) or process_sec_hud(mob) so
|
||||
the HUD updates properly! */
|
||||
/*
|
||||
* Data HUDs have been rewritten in a more generic way.
|
||||
* In short, they now use an observer-listener pattern.
|
||||
* See code/datum/hud.dm for the generic hud datum.
|
||||
* Update the HUD icons when needed with the appropriate hook. (see below)
|
||||
*/
|
||||
|
||||
//Deletes the current HUD images so they can be refreshed with new ones.
|
||||
mob/proc/regular_hud_updates() //Used in the life.dm of mobs that can use HUDs.
|
||||
if(client)
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,1,4) == "hud")
|
||||
client.images -= hud
|
||||
med_hud_users -= src
|
||||
sec_hud_users -= src
|
||||
/* DATA HUD DATUMS */
|
||||
|
||||
/atom/proc/add_to_all_data_huds()
|
||||
for(var/datum/atom_hud/data/hud in huds) hud.add_to_hud(src)
|
||||
|
||||
//Medical HUD procs
|
||||
/atom/proc/remove_from_all_data_huds()
|
||||
for(var/datum/atom_hud/data/hud in huds) hud.remove_from_hud(src)
|
||||
|
||||
proc/RoundHealth(health)
|
||||
/datum/atom_hud/data
|
||||
|
||||
/datum/atom_hud/data/medical
|
||||
hud_icons = list(HEALTH_HUD, STATUS_HUD)
|
||||
|
||||
/datum/atom_hud/data/medical/basic
|
||||
|
||||
/datum/atom_hud/data/medical/basic/proc/check_sensors(var/mob/living/carbon/human/H)
|
||||
if(!istype(H)) return 0
|
||||
var/obj/item/clothing/under/U = H.w_uniform
|
||||
if(!istype(U)) return 0
|
||||
if(U.sensor_mode <= 2) return 0
|
||||
return 1
|
||||
|
||||
/datum/atom_hud/data/medical/basic/add_to_single_hud(var/mob/M, var/mob/living/carbon/human/H)
|
||||
if(check_sensors(H))
|
||||
..()
|
||||
|
||||
/datum/atom_hud/data/medical/basic/proc/update_suit_sensors(var/mob/living/carbon/human/H)
|
||||
check_sensors(H) ? add_to_hud(H) : remove_from_hud(H)
|
||||
|
||||
/datum/atom_hud/data/medical/advanced
|
||||
|
||||
/datum/atom_hud/data/security
|
||||
|
||||
/datum/atom_hud/data/security/basic
|
||||
hud_icons = list(ID_HUD)
|
||||
|
||||
/datum/atom_hud/data/security/advanced
|
||||
hud_icons = list(ID_HUD, IMPTRACK_HUD, IMPLOYAL_HUD, IMPCHEM_HUD, WANTED_HUD)
|
||||
|
||||
/* MED/SEC HUD HOOKS */
|
||||
|
||||
/*
|
||||
* THESE HOOKS SHOULD BE CALLED BY THE MOB SHOWING THE HUD
|
||||
*/
|
||||
|
||||
/***********************************************
|
||||
Medical HUD! Basic mode needs suit sensors on.
|
||||
************************************************/
|
||||
|
||||
//HELPERS
|
||||
|
||||
//called when a human changes virus
|
||||
/mob/living/carbon/human/proc/check_virus()
|
||||
for(var/datum/disease/D in viruses)
|
||||
if((!(D.visibility_flags & HIDDEN_SCANNER)) && (D.severity != NONTHREAT))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//helper for getting the appropriate health status
|
||||
/proc/RoundHealth(health)
|
||||
switch(health)
|
||||
if(100 to INFINITY)
|
||||
return "health100"
|
||||
@@ -37,146 +86,74 @@ proc/RoundHealth(health)
|
||||
return "health-100"
|
||||
return "0"
|
||||
|
||||
/*Called by the Life() proc of the mob using it, usually. Items can call it as well.
|
||||
Called with this syntax: (The user mob, the type of hud in use, the advanced or basic version of the hud,eye object in the case of an AI) */
|
||||
//HOOKS
|
||||
|
||||
proc/process_data_hud(var/mob/M, var/hud_type, var/hud_mode, var/mob/eye)
|
||||
#define DATA_HUD_MEDICAL 1
|
||||
#define DATA_HUD_SECURITY 2
|
||||
//called when a human changes suit sensors
|
||||
/mob/living/carbon/human/proc/update_suit_sensors()
|
||||
var/datum/atom_hud/data/medical/basic/B = huds[DATA_HUD_MEDICAL_BASIC]
|
||||
B.update_suit_sensors(src)
|
||||
|
||||
#define DATA_HUD_BASIC 1
|
||||
#define DATA_HUD_ADVANCED 2
|
||||
|
||||
if(!M)
|
||||
return
|
||||
if(!M.client)
|
||||
return
|
||||
|
||||
var/turf/T
|
||||
if(eye)
|
||||
T = get_turf(eye)
|
||||
else
|
||||
T = get_turf(M)
|
||||
|
||||
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
if(get_dist(H, T) > M.client.view) //Ignores any humans outside of the user's view distance.
|
||||
continue
|
||||
|
||||
switch(hud_type)
|
||||
if(DATA_HUD_MEDICAL)
|
||||
med_hud_users |= M
|
||||
process_med_hud(M,hud_mode,T,H)
|
||||
|
||||
if(DATA_HUD_SECURITY)
|
||||
sec_hud_users |= M //Used for Security HUD alerts.
|
||||
process_sec_hud(M,hud_mode,T,H)
|
||||
|
||||
/***********************************************
|
||||
Medical HUD outputs! Advanced mode ignores suit sensors.
|
||||
************************************************/
|
||||
proc/process_med_hud(var/mob/M, var/mode, var/turf/T, var/mob/living/carbon/human/patient)
|
||||
|
||||
var/client/C = M.client
|
||||
|
||||
if(mode == DATA_HUD_BASIC && !med_hud_suit_sensors(patient)) //Used for the AI's MedHUD, only works if the patient has activated suit sensors.
|
||||
return
|
||||
|
||||
|
||||
var/foundVirus = med_hud_find_virus(patient) //Detects non-hidden diseases in a patient, returns as a binary value.
|
||||
|
||||
C.images += med_hud_get_health(patient) //Generates a patient's health bar.
|
||||
C.images += med_hud_get_status(patient, foundVirus) //Determines the type of status icon to show.
|
||||
|
||||
|
||||
proc/med_hud_suit_sensors(var/mob/living/carbon/human/patient)
|
||||
if(istype(patient.w_uniform, /obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/U = patient.w_uniform
|
||||
if(U.sensor_mode > 2)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/med_hud_find_virus(var/mob/living/carbon/human/patient)
|
||||
for(var/datum/disease/D in patient.viruses)
|
||||
if(!(D.visibility_flags & HIDDEN_SCANNER))
|
||||
if(D.severity != NONTHREAT)
|
||||
return 1
|
||||
|
||||
proc/med_hud_get_health(var/mob/living/carbon/human/patient)
|
||||
var/image/holder = patient.hud_list[HEALTH_HUD]
|
||||
if(patient.stat == 2)
|
||||
//called when a human changes health
|
||||
/mob/living/carbon/human/proc/med_hud_set_health()
|
||||
var/image/holder = hud_list[HEALTH_HUD]
|
||||
if(stat == 2)
|
||||
holder.icon_state = "hudhealth-100"
|
||||
else
|
||||
holder.icon_state = "hud[RoundHealth(patient.health)]"
|
||||
return holder
|
||||
holder.icon_state = "hud[RoundHealth(health)]"
|
||||
|
||||
proc/med_hud_get_status(var/mob/living/carbon/human/patient, var/foundVirus)
|
||||
var/image/holder = patient.hud_list[STATUS_HUD]
|
||||
if(patient.stat == 2)
|
||||
//called when a human changes stat, virus or XENO_HOST
|
||||
/mob/living/carbon/human/proc/med_hud_set_status()
|
||||
var/image/holder = hud_list[STATUS_HUD]
|
||||
if(stat == 2)
|
||||
holder.icon_state = "huddead"
|
||||
else if(patient.status_flags & XENO_HOST)
|
||||
else if(status_flags & XENO_HOST)
|
||||
holder.icon_state = "hudxeno"
|
||||
else if(foundVirus)
|
||||
else if(check_virus())
|
||||
holder.icon_state = "hudill"
|
||||
else
|
||||
holder.icon_state = "hudhealthy"
|
||||
return holder
|
||||
|
||||
|
||||
/***********************************************
|
||||
Security HUDs.
|
||||
Pass a value for the second argument to enable implant viewing or other special features.
|
||||
Security HUDs! Basic mode shows only the job.
|
||||
************************************************/
|
||||
proc/process_sec_hud(var/mob/M, var/mode, var/turf/T, var/mob/living/carbon/human/perp)
|
||||
|
||||
var/client/C = M.client
|
||||
//HOOKS
|
||||
|
||||
sec_hud_get_ID(C, perp) //Provides the perp's job icon.
|
||||
|
||||
if(mode == DATA_HUD_ADVANCED) //If not set to "DATA_HUD_ADVANCED, the Sec HUD will only display the job.
|
||||
sec_hud_get_implants(C, perp) //Returns the perp's implants, if any.
|
||||
sec_hud_get_security_status(C, perp) //Gives the perp's arrest record, if there is one.
|
||||
|
||||
|
||||
proc/sec_hud_get_ID(var/client/C, var/mob/living/carbon/human/perp)
|
||||
var/image/holder
|
||||
holder = perp.hud_list[ID_HUD]
|
||||
/mob/living/carbon/human/proc/sec_hud_set_ID()
|
||||
var/image/holder = hud_list[ID_HUD]
|
||||
holder.icon_state = "hudno_id"
|
||||
if(perp.wear_id)
|
||||
holder.icon_state = "hud[ckey(perp.wear_id.GetJobName())]"
|
||||
C.images += holder
|
||||
if(wear_id)
|
||||
holder.icon_state = "hud[ckey(wear_id.GetJobName())]"
|
||||
|
||||
proc/sec_hud_get_implants(var/client/C, var/mob/living/carbon/human/perp)
|
||||
/mob/living/carbon/human/proc/sec_hud_set_implants()
|
||||
var/image/holder
|
||||
for(var/obj/item/weapon/implant/I in perp)
|
||||
for(var/i in list(IMPTRACK_HUD, IMPLOYAL_HUD, IMPCHEM_HUD))
|
||||
holder = hud_list[i]
|
||||
holder.icon_state = null
|
||||
for(var/obj/item/weapon/implant/I in src)
|
||||
if(I.implanted)
|
||||
if(istype(I,/obj/item/weapon/implant/tracking))
|
||||
holder = perp.hud_list[IMPTRACK_HUD]
|
||||
holder = hud_list[IMPTRACK_HUD]
|
||||
holder.icon_state = "hud_imp_tracking"
|
||||
else if(istype(I,/obj/item/weapon/implant/loyalty))
|
||||
holder = perp.hud_list[IMPLOYAL_HUD]
|
||||
holder = hud_list[IMPLOYAL_HUD]
|
||||
holder.icon_state = "hud_imp_loyal"
|
||||
else if(istype(I,/obj/item/weapon/implant/chem))
|
||||
holder = perp.hud_list[IMPCHEM_HUD]
|
||||
holder = hud_list[IMPCHEM_HUD]
|
||||
holder.icon_state = "hud_imp_chem"
|
||||
else
|
||||
continue
|
||||
C.images += holder
|
||||
break
|
||||
|
||||
proc/sec_hud_get_security_status(var/client/C, var/mob/living/carbon/human/perp)
|
||||
/mob/living/carbon/human/proc/sec_hud_set_security_status()
|
||||
var/image/holder
|
||||
var/perpname = perp.get_face_name(perp.get_id_name(""))
|
||||
var/perpname = get_face_name(get_id_name(""))
|
||||
if(perpname)
|
||||
var/datum/data/record/R = find_record("name", perpname, data_core.security)
|
||||
if(R)
|
||||
holder = perp.hud_list[WANTED_HUD]
|
||||
holder = hud_list[WANTED_HUD]
|
||||
switch(R.fields["criminal"])
|
||||
if("*Arrest*") holder.icon_state = "hudwanted"
|
||||
if("Incarcerated") holder.icon_state = "hudincarcerated"
|
||||
if("Parolled") holder.icon_state = "hudparolled"
|
||||
if("Discharged") holder.icon_state = "huddischarged"
|
||||
else
|
||||
return
|
||||
C.images += holder
|
||||
if("Discharged") holder.icon_state = "huddischarged"
|
||||
else holder.icon_state = null
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/datum/atom_hud/antag
|
||||
hud_icons = list(ANTAG_HUD)
|
||||
|
||||
/datum/atom_hud/antag/proc/join_hud(var/mob/M)
|
||||
add_to_hud(M)
|
||||
add_hud_to(M)
|
||||
|
||||
/datum/atom_hud/antag/proc/leave_hud(var/mob/M)
|
||||
remove_from_hud(M)
|
||||
remove_hud_from(M)
|
||||
|
||||
/datum/game_mode/proc/set_antag_hud(var/mob/M, var/new_icon_state)
|
||||
var/image/holder = M.hud_list[ANTAG_HUD]
|
||||
holder.icon_state = new_icon_state
|
||||
@@ -25,5 +25,9 @@
|
||||
user.status_flags &= ~(FAKEDEATH)
|
||||
user.update_canmove()
|
||||
user.mind.changeling.purchasedpowers -= src
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.med_hud_set_status()
|
||||
H.med_hud_set_health()
|
||||
feedback_add_details("changeling_powers","CR")
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -241,52 +241,15 @@
|
||||
for(var/mob/M in viewers(cult_mind.current))
|
||||
M << "<FONT size = 3>[cult_mind.current] looks like they just reverted to their old faith!</FONT>"
|
||||
|
||||
/datum/game_mode/proc/update_all_cult_icons()
|
||||
spawn(0)
|
||||
for(var/datum/mind/cultist in cult)
|
||||
if(cultist.current)
|
||||
if(cultist.current.client)
|
||||
for(var/image/I in cultist.current.client.images)
|
||||
if(I.icon_state == "cult")
|
||||
del(I)
|
||||
|
||||
for(var/datum/mind/cultist in cult)
|
||||
if(cultist.current)
|
||||
if(cultist.current.client)
|
||||
for(var/datum/mind/cultist_1 in cult)
|
||||
if(cultist_1.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = cultist_1.current, icon_state = "cult")
|
||||
cultist.current.client.images += I
|
||||
|
||||
|
||||
/datum/game_mode/proc/update_cult_icons_added(datum/mind/cult_mind)
|
||||
spawn(0)
|
||||
for(var/datum/mind/cultist in cult)
|
||||
if(cultist.current)
|
||||
if(cultist.current.client)
|
||||
var/I = image('icons/mob/mob.dmi', loc = cult_mind.current, icon_state = "cult")
|
||||
cultist.current.client.images += I
|
||||
if(cult_mind.current)
|
||||
if(cult_mind.current.client)
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = cultist.current, icon_state = "cult")
|
||||
cult_mind.current.client.images += J
|
||||
|
||||
var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT]
|
||||
culthud.join_hud(cult_mind.current)
|
||||
set_antag_hud(cult_mind.current, "cult")
|
||||
|
||||
/datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind)
|
||||
spawn(0)
|
||||
for(var/datum/mind/cultist in cult)
|
||||
if(cultist.current)
|
||||
if(cultist.current.client)
|
||||
for(var/image/I in cultist.current.client.images)
|
||||
if(I.icon_state == "cult" && I.loc == cult_mind.current)
|
||||
del(I)
|
||||
|
||||
if(cult_mind.current)
|
||||
if(cult_mind.current.client)
|
||||
for(var/image/I in cult_mind.current.client.images)
|
||||
if(I.icon_state == "cult")
|
||||
del(I)
|
||||
|
||||
var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT]
|
||||
culthud.leave_hud(cult_mind.current)
|
||||
set_antag_hud(cult_mind.current, null)
|
||||
|
||||
/datum/game_mode/cult/proc/get_unconvertables()
|
||||
var/list/ucs = list()
|
||||
|
||||
@@ -233,127 +233,41 @@
|
||||
gangster_mind.current.visible_message("[gangster_mind.current] looks like they've given up the life of crime!")
|
||||
gangster_mind.current << "<FONT size=3 color=red><B>You have been reformed! You are no longer a gangster!</B></FONT>"
|
||||
|
||||
update_gang_icons_removed(gangster_mind)
|
||||
update_gang_icons_removed(gangster_mind, gang)
|
||||
|
||||
///////////////////////
|
||||
//Add/remove gang HUD//
|
||||
///////////////////////
|
||||
/datum/game_mode/proc/get_gang_hud(var/gang)
|
||||
var/datum/atom_hud/antag/ganghud = null
|
||||
switch(gang)
|
||||
if("A") ganghud = huds[ANTAG_HUD_GANG_A]
|
||||
if("B") ganghud = huds[ANTAG_HUD_GANG_B]
|
||||
return ganghud
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Keeps track of players having the correct icons////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/proc/update_all_gang_icons()
|
||||
spawn(0)
|
||||
var/list/all_gangsters = A_bosses + B_bosses + A_gangsters + B_gangsters
|
||||
/datum/game_mode/proc/get_gang_bosses(var/gang)
|
||||
var/bosses = null
|
||||
switch(gang)
|
||||
if("A") bosses = A_bosses
|
||||
if("B") bosses = B_bosses
|
||||
return bosses
|
||||
|
||||
//Delete all gang icons
|
||||
for(var/datum/mind/gang_mind in all_gangsters)
|
||||
if(gang_mind.current)
|
||||
if(gang_mind.current.client)
|
||||
for(var/image/I in gang_mind.current.client.images)
|
||||
if(I.icon_state == "gangster" || I.icon_state == "gang_boss")
|
||||
del(I)
|
||||
|
||||
update_gang_icons("A")
|
||||
update_gang_icons("B")
|
||||
|
||||
/datum/game_mode/proc/update_gang_icons(var/gang)
|
||||
var/list/bosses
|
||||
var/list/gangsters
|
||||
if(gang == "A")
|
||||
bosses = A_bosses
|
||||
gangsters = A_gangsters
|
||||
else if(gang == "B")
|
||||
bosses = B_bosses
|
||||
gangsters = B_gangsters
|
||||
else
|
||||
world << "ERROR: Invalid gang in update_gang_icons()"
|
||||
|
||||
//Update gang icons for boss' visions
|
||||
for(var/datum/mind/boss_mind in bosses)
|
||||
if(boss_mind.current)
|
||||
if(boss_mind.current.client)
|
||||
for(var/datum/mind/gangster_mind in gangsters)
|
||||
if(gangster_mind.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = gangster_mind.current, icon_state = "gangster")
|
||||
boss_mind.current.client.images += I
|
||||
for(var/datum/mind/boss2_mind in bosses)
|
||||
if(boss2_mind.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = boss2_mind.current, icon_state = "gang_boss")
|
||||
boss_mind.current.client.images += I
|
||||
|
||||
//Update boss and self icons for gangsters' visions
|
||||
for(var/datum/mind/gangster_mind in gangsters)
|
||||
if(gangster_mind.current)
|
||||
if(gangster_mind.current.client)
|
||||
for(var/datum/mind/boss_mind in bosses)
|
||||
if(boss_mind.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = boss_mind.current, icon_state = "gang_boss")
|
||||
gangster_mind.current.client.images += I
|
||||
//Tag themselves to see
|
||||
var/K
|
||||
if(gangster_mind in bosses) //If the new gangster is a boss himself
|
||||
K = image('icons/mob/mob.dmi', loc = gangster_mind.current, icon_state = "gang_boss")
|
||||
else
|
||||
K = image('icons/mob/mob.dmi', loc = gangster_mind.current, icon_state = "gangster")
|
||||
gangster_mind.current.client.images += K
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//Assigns icons when a new gangster is recruited//
|
||||
/////////////////////////////////////////////////
|
||||
/datum/game_mode/proc/update_gang_icons_added(datum/mind/recruit_mind, var/gang)
|
||||
var/list/bosses
|
||||
if(gang == "A")
|
||||
bosses = A_bosses
|
||||
else if(gang == "B")
|
||||
bosses = B_bosses
|
||||
if(!gang)
|
||||
world << "ERROR: Invalid gang in update_gang_icons_added()"
|
||||
var/datum/atom_hud/antag/ganghud = get_gang_hud(gang)
|
||||
var/bosses = get_gang_bosses(gang)
|
||||
if(!ganghud)
|
||||
ERROR("Invalid gang in update_gang_icons_added(): [gang]")
|
||||
|
||||
spawn(0)
|
||||
for(var/datum/mind/boss_mind in bosses)
|
||||
//Tagging the new gangster for the bosses to see
|
||||
if(boss_mind.current)
|
||||
if(boss_mind.current.client)
|
||||
var/I
|
||||
if(recruit_mind in bosses) //If the new gangster is a boss himself
|
||||
I = image('icons/mob/mob.dmi', loc = recruit_mind.current, icon_state = "gang_boss")
|
||||
else
|
||||
I = image('icons/mob/mob.dmi', loc = recruit_mind.current, icon_state = "gangster")
|
||||
boss_mind.current.client.images += I
|
||||
//Tagging every boss for the new gangster to see
|
||||
if(recruit_mind.current)
|
||||
if(recruit_mind.current.client)
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = boss_mind.current, icon_state = "gang_boss")
|
||||
recruit_mind.current.client.images += J
|
||||
//Tag themselves to see
|
||||
if(recruit_mind.current)
|
||||
if(recruit_mind.current.client)
|
||||
var/K
|
||||
if(recruit_mind in bosses) //If the new gangster is a boss himself
|
||||
K = image('icons/mob/mob.dmi', loc = recruit_mind.current, icon_state = "gang_boss")
|
||||
else
|
||||
K = image('icons/mob/mob.dmi', loc = recruit_mind.current, icon_state = "gangster")
|
||||
recruit_mind.current.client.images += K
|
||||
ganghud.join_hud(recruit_mind.current)
|
||||
set_antag_hud(recruit_mind.current, ((recruit_mind in bosses) ? "gang_boss" : "gangster"))
|
||||
|
||||
////////////////////////////////////////
|
||||
//Keeps track of deconverted gangsters//
|
||||
////////////////////////////////////////
|
||||
/datum/game_mode/proc/update_gang_icons_removed(datum/mind/defector_mind)
|
||||
var/list/all_gangsters = A_bosses + B_bosses + A_gangsters + B_gangsters
|
||||
/datum/game_mode/proc/update_gang_icons_removed(datum/mind/defector_mind, var/gang)
|
||||
var/datum/atom_hud/antag/ganghud = get_gang_hud(gang)
|
||||
if(!ganghud)
|
||||
ERROR("Invalid gang in update_gang_icons_removed(): [gang]")
|
||||
|
||||
spawn(0)
|
||||
//Remove defector's icon from gangsters' visions
|
||||
for(var/datum/mind/boss_mind in all_gangsters)
|
||||
if(boss_mind.current)
|
||||
if(boss_mind.current.client)
|
||||
for(var/image/I in boss_mind.current.client.images)
|
||||
if((I.icon_state == "gangster" || I.icon_state == "gang_boss") && I.loc == defector_mind.current)
|
||||
del(I)
|
||||
|
||||
//Remove gang icons from defector's vision
|
||||
if(defector_mind.current)
|
||||
if(defector_mind.current.client)
|
||||
for(var/image/I in defector_mind.current.client.images)
|
||||
if(I.icon_state == "gangster" || I.icon_state == "gang_boss")
|
||||
del(I)
|
||||
ganghud.leave_hud(defector_mind.current)
|
||||
set_antag_hud(defector_mind.current, null)
|
||||
|
||||
///////////////////////////
|
||||
//Checks for gang victory//
|
||||
|
||||
@@ -48,44 +48,15 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/proc/update_all_synd_icons()
|
||||
spawn(0)
|
||||
for(var/datum/mind/synd_mind in syndicates)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/image/I in synd_mind.current.client.images)
|
||||
if(I.icon_state == "synd")
|
||||
del(I)
|
||||
|
||||
for(var/datum/mind/synd_mind in syndicates)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/datum/mind/synd_mind_1 in syndicates)
|
||||
if(synd_mind_1.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
|
||||
synd_mind.current.client.images += I
|
||||
|
||||
/datum/game_mode/proc/update_synd_icons_added(datum/mind/synd_mind)
|
||||
spawn(0)
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
var/I = image('icons/mob/mob.dmi', loc = synd_mind.current, icon_state = "synd")
|
||||
synd_mind.current.client.images += I
|
||||
var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS]
|
||||
opshud.join_hud(synd_mind.current)
|
||||
set_antag_hud(synd_mind.current, "synd")
|
||||
|
||||
/datum/game_mode/proc/update_synd_icons_removed(datum/mind/synd_mind)
|
||||
spawn(0)
|
||||
for(var/datum/mind/synd in syndicates)
|
||||
if(synd.current)
|
||||
if(synd.current.client)
|
||||
for(var/image/I in synd.current.client.images)
|
||||
if(I.icon_state == "synd" && I.loc == synd_mind.current)
|
||||
del(I)
|
||||
|
||||
if(synd_mind.current)
|
||||
if(synd_mind.current.client)
|
||||
for(var/image/I in synd_mind.current.client.images)
|
||||
if(I.icon_state == "synd")
|
||||
del(I)
|
||||
var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS]
|
||||
opshud.leave_hud(synd_mind.current)
|
||||
set_antag_hud(synd_mind.current, null)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -129,8 +100,6 @@
|
||||
spawnpos++
|
||||
update_synd_icons_added(synd_mind)
|
||||
|
||||
update_all_synd_icons()
|
||||
|
||||
if(uplinklocker)
|
||||
new /obj/structure/closet/syndicate/nuclear(uplinklocker.loc)
|
||||
if(nuke_spawn && synd_spawn.len > 0)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// Just make sure the converter is a head before you call it!
|
||||
// To remove a rev (from brainwashing or w/e), call ticker.mode:remove_revolutionary(_THE_PLAYERS_MIND_),
|
||||
// this will also check they're not a head, so it can just be called freely
|
||||
// If the rev icons start going wrong for some reason, ticker.mode:update_all_rev_icons() can be called to correct them.
|
||||
// If the game somtimes isn't registering a win properly, then ticker.mode.check_win() isn't being called somewhere.
|
||||
|
||||
/datum/game_mode
|
||||
@@ -258,120 +257,21 @@
|
||||
else
|
||||
M << "[rev_mind.current] looks like they just remembered their real allegiance!"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Keeps track of players having the correct icons////////////////////////////////////////////////
|
||||
//CURRENTLY CONTAINS BUGS:///////////////////////////////////////////////////////////////////////
|
||||
//-PLAYERS THAT HAVE BEEN REVS FOR AWHILE OBTAIN THE BLUE ICON WHILE STILL NOT BEING A REV HEAD//
|
||||
// -Possibly caused by cloning of a standard rev/////////////////////////////////////////////////
|
||||
//-UNCONFIRMED: DECONVERTED REVS NOT LOSING THEIR ICON PROPERLY//////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/datum/game_mode/proc/update_all_rev_icons()
|
||||
spawn(0)
|
||||
for(var/datum/mind/head_rev_mind in head_revolutionaries)
|
||||
if(head_rev_mind.current)
|
||||
if(head_rev_mind.current.client)
|
||||
for(var/image/I in head_rev_mind.current.client.images)
|
||||
if(I.icon_state == "rev" || I.icon_state == "rev_head")
|
||||
del(I)
|
||||
|
||||
for(var/datum/mind/rev_mind in revolutionaries)
|
||||
if(rev_mind.current)
|
||||
if(rev_mind.current.client)
|
||||
for(var/image/I in rev_mind.current.client.images)
|
||||
if(I.icon_state == "rev" || I.icon_state == "rev_head")
|
||||
del(I)
|
||||
|
||||
for(var/datum/mind/head_rev in head_revolutionaries)
|
||||
if(head_rev.current)
|
||||
if(head_rev.current.client)
|
||||
for(var/datum/mind/rev in revolutionaries)
|
||||
if(rev.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = rev.current, icon_state = "rev")
|
||||
head_rev.current.client.images += I
|
||||
for(var/datum/mind/head_rev_1 in head_revolutionaries)
|
||||
if(head_rev_1.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = head_rev_1.current, icon_state = "rev_head")
|
||||
head_rev.current.client.images += I
|
||||
|
||||
for(var/datum/mind/rev in revolutionaries)
|
||||
if(rev.current)
|
||||
if(rev.current.client)
|
||||
for(var/datum/mind/head_rev in head_revolutionaries)
|
||||
if(head_rev.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = head_rev.current, icon_state = "rev_head")
|
||||
rev.current.client.images += I
|
||||
for(var/datum/mind/rev_1 in revolutionaries)
|
||||
if(rev_1.current)
|
||||
var/I = image('icons/mob/mob.dmi', loc = rev_1.current, icon_state = "rev")
|
||||
rev.current.client.images += I
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//Keeps track of converted revs icons///////////////
|
||||
//Refer to above bugs. They may apply here as well//
|
||||
////////////////////////////////////////////////////
|
||||
/////////////////////////////////////
|
||||
//Adds the rev hud to a new convert//
|
||||
/////////////////////////////////////
|
||||
/datum/game_mode/proc/update_rev_icons_added(datum/mind/rev_mind)
|
||||
spawn(0)
|
||||
for(var/datum/mind/head_rev_mind in head_revolutionaries)
|
||||
var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV]
|
||||
revhud.join_hud(rev_mind.current)
|
||||
set_antag_hud(rev_mind.current, ((rev_mind in head_revolutionaries) ? "rev_head" : "rev"))
|
||||
|
||||
//Tagging the new rev for revheads to see
|
||||
if(head_rev_mind.current)
|
||||
if(head_rev_mind.current.client)
|
||||
var/I
|
||||
if(rev_mind in head_revolutionaries) //If the new rev is a head rev
|
||||
I = image('icons/mob/mob.dmi', loc = rev_mind.current, icon_state = "rev_head")
|
||||
else
|
||||
I = image('icons/mob/mob.dmi', loc = rev_mind.current, icon_state = "rev")
|
||||
head_rev_mind.current.client.images += I
|
||||
|
||||
//Tagging the revheads for new rev to see
|
||||
if(rev_mind.current)
|
||||
if(rev_mind.current.client)
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = head_rev_mind.current, icon_state = "rev_head")
|
||||
rev_mind.current.client.images += J
|
||||
|
||||
for(var/datum/mind/rev_mind_1 in revolutionaries)
|
||||
|
||||
//Tagging the new rev for fellow revs to see
|
||||
if(rev_mind_1.current)
|
||||
if(rev_mind_1.current.client)
|
||||
var/I
|
||||
if(rev_mind in head_revolutionaries) //If the new rev is a head rev
|
||||
I = image('icons/mob/mob.dmi', loc = rev_mind.current, icon_state = "rev_head")
|
||||
else
|
||||
I = image('icons/mob/mob.dmi', loc = rev_mind.current, icon_state = "rev")
|
||||
rev_mind_1.current.client.images += I
|
||||
|
||||
//Tagging fellow revs for the new rev to see
|
||||
if(rev_mind.current)
|
||||
if(rev_mind.current.client)
|
||||
var/image/J = image('icons/mob/mob.dmi', loc = rev_mind_1.current, icon_state = "rev")
|
||||
rev_mind.current.client.images += J
|
||||
|
||||
///////////////////////////////////
|
||||
//Keeps track of deconverted revs//
|
||||
///////////////////////////////////
|
||||
/////////////////////////////////////////
|
||||
//Removes the hud from deconverted revs//
|
||||
/////////////////////////////////////////
|
||||
/datum/game_mode/proc/update_rev_icons_removed(datum/mind/rev_mind)
|
||||
spawn(0)
|
||||
for(var/datum/mind/head_rev_mind in head_revolutionaries)
|
||||
if(head_rev_mind.current)
|
||||
if(head_rev_mind.current.client)
|
||||
for(var/image/I in head_rev_mind.current.client.images)
|
||||
if((I.icon_state == "rev" || I.icon_state == "rev_head") && I.loc == rev_mind.current)
|
||||
del(I)
|
||||
|
||||
for(var/datum/mind/rev_mind_1 in revolutionaries)
|
||||
if(rev_mind_1.current)
|
||||
if(rev_mind_1.current.client)
|
||||
for(var/image/I in rev_mind_1.current.client.images)
|
||||
if((I.icon_state == "rev" || I.icon_state == "rev_head") && I.loc == rev_mind.current)
|
||||
del(I)
|
||||
|
||||
if(rev_mind.current)
|
||||
if(rev_mind.current.client)
|
||||
for(var/image/I in rev_mind.current.client.images)
|
||||
if(I.icon_state == "rev" || I.icon_state == "rev_head")
|
||||
del(I)
|
||||
var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV]
|
||||
revhud.leave_hud(rev_mind.current)
|
||||
set_antag_hud(rev_mind.current, null)
|
||||
|
||||
//////////////////////////
|
||||
//Checks for rev victory//
|
||||
|
||||
@@ -43,6 +43,7 @@ Captain
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
minor_announce("Captain [H.real_name] on deck!")
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ Head of Security
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
/*
|
||||
Warden
|
||||
@@ -94,6 +95,7 @@ Warden
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
/datum/job/warden/get_access()
|
||||
var/list/L = list()
|
||||
@@ -143,6 +145,7 @@ Detective
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
/*
|
||||
Security Officer
|
||||
@@ -187,6 +190,7 @@ Security Officer
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
/datum/job/officer/get_access()
|
||||
var/list/L = list()
|
||||
|
||||
@@ -168,24 +168,11 @@
|
||||
//Here let's calculate their health so the pod doesn't immediately eject them!!!
|
||||
H.updatehealth()
|
||||
|
||||
H.refresh_huds(clonemind.current)
|
||||
clonemind.transfer_to(H)
|
||||
H.ckey = ckey
|
||||
H << "<span class='notice'><b>Consciousness slowly creeps over you as your body regenerates.</b><br><i>So this is what cloning feels like?</i></span>"
|
||||
|
||||
// -- Mode/mind specific stuff goes here
|
||||
|
||||
if((H.mind in ticker.mode.revolutionaries) || (H.mind in ticker.mode.head_revolutionaries))
|
||||
ticker.mode.update_all_rev_icons() //So the icon actually appears
|
||||
if((H.mind in ticker.mode.A_bosses) || ((H.mind in ticker.mode.A_gangsters) || (H.mind in ticker.mode.B_bosses)) || (H.mind in ticker.mode.B_gangsters))
|
||||
ticker.mode.update_all_gang_icons()
|
||||
if(H.mind in ticker.mode.syndicates)
|
||||
ticker.mode.update_all_synd_icons()
|
||||
if (H.mind in ticker.mode.cult)
|
||||
ticker.mode.add_cultist(src.occupant.mind)
|
||||
ticker.mode.update_all_cult_icons() //So the icon actually appears
|
||||
|
||||
// -- End mode specific stuff
|
||||
|
||||
hardset_dna(H, ui, se, null, null, mrace, mcolor)
|
||||
|
||||
if(efficiency > 2)
|
||||
|
||||
@@ -628,7 +628,8 @@ What a mess.*/
|
||||
if("released")
|
||||
active2.fields["criminal"] = "Discharged"
|
||||
investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [usr.name] ([usr.key]).", "records")
|
||||
|
||||
for(var/mob/living/carbon/human/H in mob_list) //thanks for forcing me to do this, whoever wrote this shitty records system
|
||||
H.sec_hud_set_security_status()
|
||||
if ("Delete Record (Security) Execute")
|
||||
investigate_log("[usr.name] ([usr.key]) has deleted the security records for [active1.fields["name"]].", "records")
|
||||
if (active2)
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
var/id = null // id of door it controls.
|
||||
var/releasetime = 0 // when world.time reaches it - release the prisoneer
|
||||
var/timelength = 0 // the length of time this door will be set for
|
||||
var/timing = 1 // boolean, true/1 timer is on, false/0 means it's not timing
|
||||
var/timing = 0 // boolean, true/1 timer is on, false/0 means it's not timing
|
||||
var/picture_state // icon_state of alert picture, if not displaying text/numbers
|
||||
var/list/obj/machinery/targets = list()
|
||||
var/obj/item/device/radio/Radio //needed to send messages to sec radio
|
||||
|
||||
maptext_height = 26
|
||||
maptext_width = 32
|
||||
@@ -34,6 +35,9 @@
|
||||
/obj/machinery/door_timer/New()
|
||||
..()
|
||||
|
||||
Radio = new/obj/item/device/radio(src)
|
||||
Radio.listening = 0
|
||||
|
||||
pixel_x = ((src.dir & 3)? (0) : (src.dir == 4 ? 32 : -32))
|
||||
pixel_y = ((src.dir & 3)? (src.dir ==1 ? 24 : -32) : (0))
|
||||
|
||||
@@ -64,7 +68,8 @@
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
if(timing)
|
||||
if(world.time > src.releasetime)
|
||||
broadcast_hud_message("[src]'s timer has expired. Releasing prisoner.", src)
|
||||
Radio.set_frequency(SEC_FREQ)
|
||||
Radio.talk_into(src, "Timer has expired. Releasing prisoner.", SEC_FREQ)
|
||||
src.timer_end() // open doors, reset timer, clear status screen
|
||||
timing = 0
|
||||
timeset(0)
|
||||
|
||||
@@ -9,102 +9,25 @@
|
||||
internal_damage_threshold = 35
|
||||
deflect_chance = 15
|
||||
step_energy_drain = 6
|
||||
var/obj/item/clothing/glasses/hud/health/mech/hud
|
||||
|
||||
/obj/mecha/medical/odysseus/New()
|
||||
..()
|
||||
hud = new /obj/item/clothing/glasses/hud/health/mech(src)
|
||||
return
|
||||
var/builtin_hud_user = 0
|
||||
|
||||
/obj/mecha/medical/odysseus/moved_inside(var/mob/living/carbon/human/H as mob)
|
||||
if(..())
|
||||
if(H.glasses)
|
||||
occupant_message("<font color='red'>[H.glasses] prevent you from using [src] [hud]</font>")
|
||||
if(H.glasses && istype(H.glasses, /obj/item/clothing/glasses/hud))
|
||||
occupant_message("<span class='warning'>Your [H.glasses] prevent you from using the built-in medical hud.</span>")
|
||||
else
|
||||
H.glasses = hud
|
||||
var/datum/atom_hud/data/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.add_hud_to(H)
|
||||
builtin_hud_user = 1
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/mecha/medical/odysseus/go_out()
|
||||
if(ishuman(occupant))
|
||||
if(ishuman(occupant) && builtin_hud_user)
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
if(H.glasses == hud)
|
||||
H.glasses = null
|
||||
var/datum/atom_hud/data/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.remove_hud_from(H)
|
||||
..()
|
||||
return
|
||||
/*
|
||||
/obj/mecha/medical/odysseus/verb/set_perspective()
|
||||
set name = "Set client perspective."
|
||||
set category = "Exosuit Interface"
|
||||
set src = usr.loc
|
||||
var/perspective = input("Select a perspective type.",
|
||||
"Client perspective",
|
||||
occupant.client.perspective) in list(MOB_PERSPECTIVE,EYE_PERSPECTIVE)
|
||||
world << "[perspective]"
|
||||
occupant.client.perspective = perspective
|
||||
return
|
||||
|
||||
/obj/mecha/medical/odysseus/verb/toggle_eye()
|
||||
set name = "Toggle eye."
|
||||
set category = "Exosuit Interface"
|
||||
set src = usr.loc
|
||||
if(occupant.client.eye == occupant)
|
||||
occupant.client.eye = src
|
||||
else
|
||||
occupant.client.eye = occupant
|
||||
world << "[occupant.client.eye]"
|
||||
return
|
||||
*/
|
||||
|
||||
//TODO - Check documentation for client.eye and client.perspective...
|
||||
/obj/item/clothing/glasses/hud/health/mech
|
||||
name = "integrated medical Hud"
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/hud/health/mech/process_hud(var/mob/M)
|
||||
/*
|
||||
world<< "view(M)"
|
||||
for(var/mob/mob in view(M))
|
||||
world << "[mob]"
|
||||
world<< "view(M.client)"
|
||||
for(var/mob/mob in view(M.client))
|
||||
world << "[mob]"
|
||||
world<< "view(M.loc)"
|
||||
for(var/mob/mob in view(M.loc))
|
||||
world << "[mob]"
|
||||
*/
|
||||
|
||||
if(!M || M.stat || !(M in view(M))) return
|
||||
if(!M.client) return
|
||||
var/client/C = M.client
|
||||
var/image/holder
|
||||
for(var/mob/living/carbon/human/patient in view(M.loc))
|
||||
if(M.see_invisible < patient.invisibility)
|
||||
continue
|
||||
var/foundVirus = 0
|
||||
for(var/datum/disease/D in patient.viruses)
|
||||
if(!(D.visibility_flags & HIDDEN_SCANNER))
|
||||
if(D.severity != NONTHREAT)
|
||||
foundVirus++
|
||||
//if(patient.virus2)
|
||||
// foundVirus++
|
||||
|
||||
holder = patient.hud_list[HEALTH_HUD]
|
||||
if(patient.stat == 2)
|
||||
holder.icon_state = "hudhealth-100"
|
||||
C.images += holder
|
||||
else
|
||||
holder.icon_state = "hud[RoundHealth(patient.health)]"
|
||||
C.images += holder
|
||||
|
||||
holder = patient.hud_list[STATUS_HUD]
|
||||
if(patient.stat == 2)
|
||||
holder.icon_state = "huddead"
|
||||
else if(patient.status_flags & XENO_HOST)
|
||||
holder.icon_state = "hudxeno"
|
||||
else if(foundVirus)
|
||||
holder.icon_state = "hudill"
|
||||
else
|
||||
holder.icon_state = "hudhealthy"
|
||||
C.images += holder
|
||||
|
||||
@@ -221,9 +221,6 @@
|
||||
/obj/item/proc/talk_into(mob/M as mob, text)
|
||||
return
|
||||
|
||||
/obj/item/proc/moved(mob/user as mob, old_loc as turf)
|
||||
return
|
||||
|
||||
/obj/item/proc/dropped(mob/user as mob)
|
||||
..()
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
/obj/item/weapon/implant/proc/implanted(var/mob/source)
|
||||
if(activated)
|
||||
action_button_name = "Activate [src.name]"
|
||||
if(istype(source, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = source
|
||||
H.sec_hud_set_implants()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -205,4 +208,4 @@
|
||||
/obj/item/weapon/implant/emp/activate()
|
||||
if (src.uses < 1) return 0
|
||||
src.uses--
|
||||
empulse(imp_in, 3, 5)
|
||||
empulse(imp_in, 3, 5)
|
||||
|
||||
@@ -302,8 +302,6 @@ client/proc/one_click_antag()
|
||||
new_character.mind.make_Nuke(synd_spawn[spawnpos],nuke_code)
|
||||
spawnpos++
|
||||
|
||||
ticker.mode.update_all_synd_icons()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -33,14 +33,10 @@
|
||||
var/darkness_view = 2//Base human is 2
|
||||
var/invis_view = SEE_INVISIBLE_LIVING
|
||||
var/emagged = 0
|
||||
var/hud = null
|
||||
var/list/icon/current = list() //the current hud icons
|
||||
strip_delay = 20
|
||||
put_on_delay = 25
|
||||
|
||||
/obj/item/clothing/glasses/proc/process_hud(var/mob/M)
|
||||
return
|
||||
|
||||
/*
|
||||
SEE_SELF // can see self, no matter what
|
||||
SEE_MOBS // can see all mobs, no matter what
|
||||
@@ -268,7 +264,7 @@ atom/proc/generate_female_clothing(index,t_color,icon)
|
||||
var/mob/M = usr
|
||||
if (istype(M, /mob/dead/))
|
||||
return
|
||||
if (!can_use(usr))
|
||||
if (!can_use(M))
|
||||
return
|
||||
if(src.has_sensor >= 2)
|
||||
usr << "The controls are locked."
|
||||
@@ -281,13 +277,17 @@ atom/proc/generate_female_clothing(index,t_color,icon)
|
||||
src.sensor_mode = 0
|
||||
switch(src.sensor_mode)
|
||||
if(0)
|
||||
usr << "You disable your suit's remote sensing equipment."
|
||||
M << "You disable your suit's remote sensing equipment."
|
||||
if(1)
|
||||
usr << "Your suit will now report whether you are live or dead."
|
||||
M << "Your suit will now report whether you are live or dead."
|
||||
if(2)
|
||||
usr << "Your suit will now report your vital lifesigns."
|
||||
M << "Your suit will now report your vital lifesigns."
|
||||
if(3)
|
||||
usr << "Your suit will now report your vital lifesigns as well as your coordinate position."
|
||||
M << "Your suit will now report your vital lifesigns as well as your coordinate position."
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.w_uniform == src)
|
||||
H.update_suit_sensors()
|
||||
..()
|
||||
|
||||
/obj/item/clothing/under/verb/rolldown()
|
||||
|
||||
@@ -3,33 +3,27 @@
|
||||
desc = "A heads-up display that provides important info in (almost) real time."
|
||||
flags = null //doesn't protect eyes because it's a monocle, duh
|
||||
origin_tech = "magnets=3;biotech=2"
|
||||
hud = 1
|
||||
var/hud_type = null
|
||||
|
||||
/* /obj/item/clothing/glasses/hud/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/card/emag))
|
||||
if(emagged == 0)
|
||||
emagged = 1
|
||||
user << "<span class='warning'>PZZTTPFFFT</span>"
|
||||
desc = desc+ " The display flickers slightly."
|
||||
else
|
||||
user << "<span class='warning'>It is already emagged!</span>" */ //No emags allowed
|
||||
/obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot)
|
||||
if(slot == slot_glasses)
|
||||
var/datum/atom_hud/H = huds[hud_type]
|
||||
H.add_hud_to(user)
|
||||
|
||||
/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user)
|
||||
var/datum/atom_hud/H = huds[hud_type]
|
||||
H.remove_hud_from(user)
|
||||
|
||||
/obj/item/clothing/glasses/hud/emp_act(severity)
|
||||
if(emagged == 0)
|
||||
emagged = 1
|
||||
desc = desc + " The display flickers slightly."
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/hud/health
|
||||
name = "Health Scanner HUD"
|
||||
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
|
||||
icon_state = "healthhud"
|
||||
|
||||
|
||||
/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M)
|
||||
process_data_hud(M,DATA_HUD_MEDICAL,DATA_HUD_ADVANCED)
|
||||
|
||||
hud_type = DATA_HUD_MEDICAL_ADVANCED
|
||||
|
||||
/obj/item/clothing/glasses/hud/health/night
|
||||
name = "Night Vision Health Scanner HUD"
|
||||
@@ -43,6 +37,7 @@
|
||||
name = "Security HUD"
|
||||
desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status and security records."
|
||||
icon_state = "securityhud"
|
||||
hud_type = DATA_HUD_SECURITY_ADVANCED
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/eyepatch
|
||||
name = "Eyepatch HUD"
|
||||
@@ -56,6 +51,7 @@
|
||||
darkness_view = 1
|
||||
flash_protect = 1
|
||||
tint = 1
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/night
|
||||
name = "Night Vision Security HUD"
|
||||
desc = "An advanced heads-up display which provides id data and vision in complete darkness."
|
||||
@@ -68,5 +64,3 @@
|
||||
emagged = 1
|
||||
desc = desc + " The display flickers slightly."
|
||||
|
||||
/obj/item/clothing/glasses/hud/security/process_hud(var/mob/M)
|
||||
process_data_hud(M,DATA_HUD_SECURITY,DATA_HUD_ADVANCED)
|
||||
|
||||
@@ -45,7 +45,5 @@
|
||||
else
|
||||
D = new virus_type()
|
||||
D.carrier = 1
|
||||
D.holder = H
|
||||
D.affected_mob = H
|
||||
H.viruses += D
|
||||
H.AddDisease(D)
|
||||
break
|
||||
@@ -14,7 +14,5 @@
|
||||
continue
|
||||
|
||||
var/datum/disease/D = new /datum/disease/appendicitis
|
||||
D.holder = H
|
||||
D.affected_mob = H
|
||||
H.viruses += D
|
||||
H.AddDisease(D)
|
||||
break
|
||||
@@ -811,29 +811,12 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
podman.real_name = realName
|
||||
else
|
||||
podman.real_name = "Pod Person [rand(0,999)]"
|
||||
podman.refresh_huds(mind.current)
|
||||
var/oldactive = mind.active
|
||||
mind.active = 1
|
||||
mind.transfer_to(podman)
|
||||
mind.active = oldactive
|
||||
// -- Mode/mind specific stuff goes here. TODO! Broken :( Should be merged into mob/living/Login
|
||||
if((podman.mind in ticker.mode.A_bosses) || (podman.mind in ticker.mode.A_gangsters) || (podman.mind in ticker.mode.B_bosses) || (podman.mind in ticker.mode.B_gangsters))
|
||||
ticker.mode.update_all_gang_icons()
|
||||
if(podman.mind in ticker.mode:revolutionaries)
|
||||
ticker.mode.add_revolutionary(podman.mind)
|
||||
ticker.mode.update_all_rev_icons() //So the icon actually appears
|
||||
if(podman.mind in ticker.mode:head_revolutionaries)
|
||||
ticker.mode.add_revolutionary(podman.mind)
|
||||
ticker.mode.update_all_rev_icons()
|
||||
if(podman.mind in ticker.mode:syndicates)
|
||||
ticker.mode:update_all_synd_icons()
|
||||
if(podman.mind in ticker.mode:cult)
|
||||
ticker.mode:add_cultist(podman.mind)
|
||||
ticker.mode:update_all_cult_icons() //So the icon actually appears
|
||||
|
||||
// -- End mode specific stuff
|
||||
|
||||
podman.gender = ghost.gender
|
||||
|
||||
//dna stuff
|
||||
hardset_dna(podman, ui, se, null, null, null, !prob(potency) ? /datum/species/plant/pod : null, "#59CE00") //makes sure podman has dna and sets the dna's ui/se/mutantrace/real_name etc variables
|
||||
|
||||
|
||||
@@ -12,9 +12,13 @@
|
||||
var/obj/item/weapon/card/id/prisoner/inserted_id
|
||||
var/obj/machinery/door/airlock/release_door
|
||||
var/door_tag = "prisonshuttle"
|
||||
var/obj/item/device/radio/Radio //needed to send messages to sec radio
|
||||
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/New()
|
||||
..()
|
||||
Radio = new/obj/item/device/radio(src)
|
||||
Radio.listening = 0
|
||||
spawn(7)
|
||||
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
||||
var/t
|
||||
@@ -93,7 +97,8 @@
|
||||
if(s.location == /area/shuttle/laborcamp/outpost)
|
||||
if(alone_in_area(get_area(loc), usr))
|
||||
if (s.move_shuttle(0)) // No delay, to stop people from getting on while it is departing.
|
||||
broadcast_hud_message("<B>[inserted_id.registered_name]</B> has met their quota and has returned to the station. Minerals and Prisoner ID card ready for retrieval.", src)
|
||||
Radio.set_frequency(SEC_FREQ)
|
||||
Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", SEC_FREQ)
|
||||
usr << "<span class='notice'>Shuttle recieved message and will be sent shortly.</span>"
|
||||
else
|
||||
usr << "<span class='notice'>Shuttle is already moving.</span>"
|
||||
@@ -162,4 +167,4 @@
|
||||
else
|
||||
user << "<span class='warning'>Error: Invalid ID</span>"
|
||||
return
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
|
||||
var/atom/movable/following = null
|
||||
var/fun_verbs = 0
|
||||
var/list/datum/atom_hud/oldhuds = null //old antag hud, gets readded in cloning/plantpodding
|
||||
|
||||
/mob/dead/observer/New(mob/body)
|
||||
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
|
||||
@@ -69,6 +70,7 @@ Works together with spawning an observer, noted above.
|
||||
var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc.
|
||||
ghost.can_reenter_corpse = can_reenter_corpse
|
||||
ghost.key = key
|
||||
ghost.refresh_huds(src) //inherit the HUDs
|
||||
return ghost
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,6 +14,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
if(istype(loc, /mob/living))
|
||||
affected_mob = loc
|
||||
affected_mob.status_flags |= XENO_HOST
|
||||
if(istype(affected_mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
processing_objects.Add(src)
|
||||
spawn(0)
|
||||
AddInfectionImages(affected_mob)
|
||||
@@ -23,6 +26,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
/obj/item/alien_embryo/Destroy()
|
||||
if(affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
if(istype(affected_mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
spawn(0)
|
||||
RemoveInfectionImages(affected_mob)
|
||||
..()
|
||||
@@ -31,6 +37,9 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
|
||||
if(!affected_mob) return
|
||||
if(loc != affected_mob)
|
||||
affected_mob.status_flags &= ~(XENO_HOST)
|
||||
if(istype(affected_mob,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = affected_mob
|
||||
H.med_hud_set_status()
|
||||
processing_objects.Remove(src)
|
||||
spawn(0)
|
||||
RemoveInfectionImages(affected_mob)
|
||||
@@ -132,4 +141,4 @@ Des: Removes all images from the mob infected by this embryo
|
||||
if(alien.client)
|
||||
for(var/image/I in alien.client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected") && I.loc == affected_mob)
|
||||
qdel(I)
|
||||
qdel(I)
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
if(dna)
|
||||
dna.species.spec_death(gibbed,src)
|
||||
med_hud_set_health()
|
||||
med_hud_set_status()
|
||||
|
||||
tod = worldtime2text() //weasellos time of death patch
|
||||
if(mind) mind.store_memory("Time of death: [tod]", 0)
|
||||
@@ -66,4 +68,4 @@
|
||||
/mob/living/carbon/proc/Drain()
|
||||
ChangeToHusk()
|
||||
mutations |= NOCLONE
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
voice_name = "Unknown"
|
||||
icon = 'icons/mob/human.dmi'
|
||||
icon_state = "caucasian1_m_s"
|
||||
var/list/hud_list = list()
|
||||
|
||||
|
||||
|
||||
@@ -27,9 +26,6 @@
|
||||
internal_organs += new /obj/item/organ/heart
|
||||
internal_organs += new /obj/item/organ/brain
|
||||
|
||||
for(var/i=0;i<7;i++) // 2 for medHUDs and 5 for secHUDs
|
||||
hud_list += image('icons/mob/hud.dmi', src, "hudunknown")
|
||||
|
||||
// for spawned humans; overwritten by other code
|
||||
create_dna(src)
|
||||
ready_dna(src)
|
||||
@@ -37,9 +33,24 @@
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/prepare_huds()
|
||||
..()
|
||||
prepare_data_huds()
|
||||
|
||||
/mob/living/carbon/human/proc/prepare_data_huds()
|
||||
//Update all our data hud images...
|
||||
med_hud_set_health()
|
||||
med_hud_set_status()
|
||||
sec_hud_set_ID()
|
||||
sec_hud_set_implants()
|
||||
sec_hud_set_security_status()
|
||||
//...and display them
|
||||
add_to_all_data_huds()
|
||||
|
||||
/mob/living/carbon/human/Destroy()
|
||||
for(var/atom/movable/organelle in organs)
|
||||
qdel(organelle)
|
||||
remove_from_all_data_huds()
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
|
||||
@@ -400,9 +411,7 @@
|
||||
if(setcriminal != "Cancel")
|
||||
investigate_log("[src.key] has been set from [R.fields["criminal"]] to [setcriminal] by [usr.name] ([usr.key]).", "records")
|
||||
R.fields["criminal"] = setcriminal
|
||||
|
||||
spawn()
|
||||
H.handle_regular_hud_updates()
|
||||
sec_hud_set_security_status()
|
||||
return
|
||||
|
||||
if(href_list["view"])
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
//TODO: fix husking
|
||||
if( ((maxHealth - total_burn) < config.health_threshold_dead) && stat == DEAD )
|
||||
ChangeToHusk()
|
||||
med_hud_set_health()
|
||||
med_hud_set_status()
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/mob/living/carbon/human
|
||||
languages = HUMAN
|
||||
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD, ANTAG_HUD)
|
||||
//Hair colour and style
|
||||
var/hair_color = "000"
|
||||
var/hair_style = "Bald"
|
||||
@@ -46,4 +47,4 @@
|
||||
|
||||
var/xylophone = 0 //For the spoooooooky xylophone cooldown
|
||||
|
||||
var/gender_ambiguous = 0 //if something goes wrong during gender reassignment this generates a line in examine
|
||||
var/gender_ambiguous = 0 //if something goes wrong during gender reassignment this generates a line in examine
|
||||
|
||||
@@ -260,6 +260,7 @@
|
||||
if(belt)
|
||||
unEquip(belt)
|
||||
w_uniform = null
|
||||
update_suit_sensors()
|
||||
update_inv_w_uniform(0)
|
||||
else if(I == gloves)
|
||||
gloves = null
|
||||
@@ -289,9 +290,11 @@
|
||||
if(internals)
|
||||
internals.icon_state = "internal0"
|
||||
internal = null
|
||||
sec_hud_set_ID()
|
||||
update_inv_wear_mask(0)
|
||||
else if(I == wear_id)
|
||||
wear_id = null
|
||||
sec_hud_set_ID()
|
||||
update_inv_wear_id(0)
|
||||
else if(I == r_store)
|
||||
r_store = null
|
||||
@@ -330,6 +333,7 @@
|
||||
wear_mask = I
|
||||
if(wear_mask.flags & BLOCKHAIR)
|
||||
update_hair(redraw_mob) //rebuild hair
|
||||
sec_hud_set_ID()
|
||||
update_inv_wear_mask(redraw_mob)
|
||||
if(slot_handcuffed)
|
||||
handcuffed = I
|
||||
@@ -348,6 +352,7 @@
|
||||
update_inv_belt(redraw_mob)
|
||||
if(slot_wear_id)
|
||||
wear_id = I
|
||||
sec_hud_set_ID()
|
||||
update_inv_wear_id(redraw_mob)
|
||||
if(slot_ears)
|
||||
ears = I
|
||||
@@ -373,6 +378,7 @@
|
||||
update_inv_wear_suit(redraw_mob)
|
||||
if(slot_w_uniform)
|
||||
w_uniform = I
|
||||
update_suit_sensors()
|
||||
update_inv_w_uniform(redraw_mob)
|
||||
if(slot_l_store)
|
||||
l_store = I
|
||||
@@ -387,7 +393,7 @@
|
||||
if(get_active_hand() == I)
|
||||
unEquip(I)
|
||||
I.loc = back
|
||||
return
|
||||
else
|
||||
src << "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>"
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
@@ -583,8 +583,6 @@
|
||||
/mob/living/carbon/human/proc/handle_regular_hud_updates()
|
||||
if(!client) return 0
|
||||
|
||||
regular_hud_updates() //For MED/SEC HUD icon deletion
|
||||
|
||||
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
|
||||
|
||||
update_action_buttons()
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/mob/living/carbon/human/Login()
|
||||
..()
|
||||
update_hud()
|
||||
if(ticker.mode)
|
||||
ticker.mode.update_all_synd_icons() //This proc only sounds CPU-expensive on paper. It is O(n^2), but the outer for-loop only iterates through syndicates, which are only prsenet in nuke rounds and even when they exist, there's usually 6 of them.
|
||||
return
|
||||
|
||||
@@ -457,9 +457,6 @@
|
||||
H.sight |= G.vision_flags
|
||||
H.see_in_dark = G.darkness_view
|
||||
H.see_invisible = G.invis_view
|
||||
if(G.hud)
|
||||
G.process_hud(H)
|
||||
|
||||
if(H.druggy) //Override for druggy
|
||||
H.see_invisible = see_temp
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/mob/living/carbon/slime/regular_hud_updates()
|
||||
return
|
||||
@@ -35,8 +35,6 @@
|
||||
//to find it.
|
||||
src.blinded = null
|
||||
|
||||
regular_hud_updates() // Basically just deletes any screen objects :<
|
||||
|
||||
if(environment)
|
||||
handle_environment(environment) // Handle temperature/pressure differences between body and environment
|
||||
|
||||
|
||||
@@ -4,64 +4,16 @@
|
||||
sync_mind()
|
||||
mind.show_memory(src, 0)
|
||||
|
||||
//Round specific stuff like hud updates
|
||||
//Round specific stuff
|
||||
if(ticker && ticker.mode)
|
||||
switch(ticker.mode.name)
|
||||
if("sandbox")
|
||||
CanBuild()
|
||||
if("revolution")
|
||||
if((mind in ticker.mode.revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
|
||||
ticker.mode.update_rev_icons_added(src.mind)
|
||||
if("gang")
|
||||
if((mind in ticker.mode.A_bosses) || (mind in ticker.mode.A_gangsters))
|
||||
ticker.mode.update_gang_icons_added(src.mind,"A")
|
||||
if((mind in ticker.mode.B_bosses) || (mind in ticker.mode.B_gangsters))
|
||||
ticker.mode.update_gang_icons_added(src.mind,"B")
|
||||
if("cult")
|
||||
if(mind in ticker.mode:cult)
|
||||
ticker.mode.update_cult_icons_added(src.mind)
|
||||
if("nuclear emergency")
|
||||
if(mind in ticker.mode:syndicates)
|
||||
ticker.mode.update_all_synd_icons()
|
||||
|
||||
//HUD updates (antag hud, etc)
|
||||
refresh_huds()
|
||||
|
||||
if(ventcrawler)
|
||||
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
|
||||
update_interface()
|
||||
return .
|
||||
|
||||
//This stuff needs to be merged from cloning.dm but I'm not in the mood to be shouted at for breaking all the things :< ~Carn
|
||||
/* clones
|
||||
switch(ticker.mode.name)
|
||||
if("revolution")
|
||||
if(src.occupant.mind in ticker.mode:revolutionaries)
|
||||
ticker.mode:update_all_rev_icons() //So the icon actually appears
|
||||
if(src.occupant.mind in ticker.mode:head_revolutionaries)
|
||||
ticker.mode:update_all_rev_icons()
|
||||
if("nuclear emergency")
|
||||
if (src.occupant.mind in ticker.mode:syndicates)
|
||||
ticker.mode:update_all_synd_icons()
|
||||
if("cult")
|
||||
if (src.occupant.mind in ticker.mode:cult)
|
||||
ticker.mode:add_cultist(src.occupant.mind)
|
||||
ticker.mode:update_all_cult_icons() //So the icon actually appears
|
||||
*/
|
||||
|
||||
/* Plantpeople
|
||||
switch(ticker.mode.name)
|
||||
if ("revolution")
|
||||
if (podman.mind in ticker.mode:revolutionaries)
|
||||
ticker.mode:add_revolutionary(podman.mind)
|
||||
ticker.mode:update_all_rev_icons() //So the icon actually appears
|
||||
if (podman.mind in ticker.mode:head_revolutionaries)
|
||||
ticker.mode:update_all_rev_icons()
|
||||
if ("nuclear emergency")
|
||||
if (podman.mind in ticker.mode:syndicates)
|
||||
ticker.mode:update_all_synd_icons()
|
||||
if ("cult")
|
||||
if (podman.mind in ticker.mode:cult)
|
||||
ticker.mode:add_cultist(podman.mind)
|
||||
ticker.mode:update_all_cult_icons() //So the icon actually appears
|
||||
if ("changeling")
|
||||
if (podman.mind in ticker.mode:changelings)
|
||||
podman.make_changeling()
|
||||
*/
|
||||
@@ -20,6 +20,8 @@ var/list/ai_list = list()
|
||||
density = 1
|
||||
status_flags = CANSTUN|CANPARALYSE|CANPUSH
|
||||
force_compose = 1 //This ensures that the AI always composes it's own hear message. Needed for hrefs and job display.
|
||||
med_hud = DATA_HUD_MEDICAL_BASIC
|
||||
sec_hud = DATA_HUD_SECURITY_BASIC
|
||||
var/list/network = list("SS13")
|
||||
var/obj/machinery/camera/current = null
|
||||
var/list/connected_robots = list()
|
||||
|
||||
@@ -163,11 +163,6 @@
|
||||
sleep(50)
|
||||
theAPC = null
|
||||
|
||||
regular_hud_updates()
|
||||
|
||||
if(sensor_mode) //Data HUDs, such as Security or Medical HUDS. Passes the AI's eye since it seems from that instead of itself.
|
||||
process_data_hud(src,sensor_mode,DATA_HUD_BASIC,src.eyeobj)
|
||||
|
||||
/mob/living/silicon/ai/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
health = maxHealth
|
||||
@@ -175,4 +170,4 @@
|
||||
return
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getBruteLoss()
|
||||
if(!fire_res_on_core)
|
||||
health -= getFireLoss()
|
||||
health -= getFireLoss()
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
M.show_message("<span class='danger'>[src.cable] rapidly retracts back into its spool.</span>", 3, "<span class='danger'>You hear a click and the sound of wire spooling rapidly.</span>", 2)
|
||||
qdel(src.cable)
|
||||
cable = null
|
||||
|
||||
regular_hud_updates()
|
||||
if(secHUD == 1)
|
||||
process_data_hud(src, DATA_HUD_SECURITY,DATA_HUD_ADVANCED)
|
||||
if(medHUD == 1)
|
||||
process_data_hud(src, DATA_HUD_MEDICAL,DATA_HUD_ADVANCED)
|
||||
if(silence_time)
|
||||
if(world.timeofday >= silence_time)
|
||||
silence_time = null
|
||||
|
||||
@@ -238,10 +238,16 @@
|
||||
temp = "Unable to locate requested security record. Record may have been deleted, or never have existed."
|
||||
if("securityhud")
|
||||
if(href_list["toggle"])
|
||||
src.secHUD = !src.secHUD
|
||||
secHUD = !secHUD
|
||||
remove_med_sec_hud()
|
||||
if(secHUD)
|
||||
add_sec_hud()
|
||||
if("medicalhud")
|
||||
if(href_list["toggle"])
|
||||
src.medHUD = !src.medHUD
|
||||
medHUD = !medHUD
|
||||
remove_med_sec_hud()
|
||||
if(medHUD)
|
||||
add_med_hud()
|
||||
if("translator")
|
||||
if(href_list["toggle"])
|
||||
languages = languages == ALL ? HUMAN & ROBOT : ALL
|
||||
|
||||
@@ -166,11 +166,6 @@
|
||||
if(see_override)
|
||||
see_invisible = see_override
|
||||
|
||||
regular_hud_updates() //Handles MED/SEC HUDs for borgs.
|
||||
|
||||
if(sensor_mode)
|
||||
process_data_hud(src,sensor_mode,DATA_HUD_ADVANCED)
|
||||
|
||||
if (src.healths)
|
||||
if (src.stat != 2)
|
||||
switch(health)
|
||||
@@ -310,4 +305,4 @@
|
||||
/mob/living/silicon/robot/update_canmove()
|
||||
if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0
|
||||
else canmove = 1
|
||||
return canmove
|
||||
return canmove
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
var/lawcheck[1]
|
||||
var/ioncheck[1]
|
||||
|
||||
var/sensor_mode = 0 //Determines the current HUD.
|
||||
var/med_hud = DATA_HUD_MEDICAL_ADVANCED //Determines the med hud to use
|
||||
var/sec_hud = DATA_HUD_SECURITY_ADVANCED //Determines the sec hud to use
|
||||
|
||||
/mob/living/silicon/proc/cancelAlarm()
|
||||
return
|
||||
@@ -317,18 +318,32 @@
|
||||
/mob/living/silicon/assess_threat() //Secbots won't hunt silicon units
|
||||
return -10
|
||||
|
||||
/mob/living/silicon/proc/remove_med_sec_hud()
|
||||
var/datum/atom_hud/secsensor = huds[sec_hud]
|
||||
var/datum/atom_hud/medsensor = huds[med_hud]
|
||||
secsensor.remove_hud_from(src)
|
||||
medsensor.remove_hud_from(src)
|
||||
|
||||
/mob/living/silicon/proc/add_sec_hud()
|
||||
var/datum/atom_hud/secsensor = huds[sec_hud]
|
||||
secsensor.add_hud_to(src)
|
||||
|
||||
/mob/living/silicon/proc/add_med_hud()
|
||||
var/datum/atom_hud/medsensor = huds[med_hud]
|
||||
medsensor.add_hud_to(src)
|
||||
|
||||
/mob/living/silicon/verb/sensor_mode()
|
||||
set name = "Set Sensor Augmentation"
|
||||
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Disable")
|
||||
remove_med_sec_hud()
|
||||
switch(sensor_type)
|
||||
if ("Security")
|
||||
sensor_mode = DATA_HUD_SECURITY
|
||||
add_sec_hud()
|
||||
src << "<span class='notice'>Security records overlay enabled.</span>"
|
||||
if ("Medical")
|
||||
sensor_mode = DATA_HUD_MEDICAL
|
||||
add_med_hud()
|
||||
src << "<span class='notice'>Life signs monitor overlay enabled.</span>"
|
||||
if ("Disable")
|
||||
sensor_mode = 0
|
||||
src << "Sensor augmentations disabled."
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
/mob/proc/sac_act(var/obj/effect/rune/R, var/mob/victim as mob)
|
||||
return
|
||||
|
||||
|
||||
var/next_mob_id = 0
|
||||
/mob/New()
|
||||
tag = "mob_[next_mob_id++]"
|
||||
@@ -22,8 +21,13 @@ var/next_mob_id = 0
|
||||
dead_mob_list += src
|
||||
else
|
||||
living_mob_list += src
|
||||
prepare_huds()
|
||||
..()
|
||||
|
||||
/mob/proc/prepare_huds()
|
||||
for(var/hud in hud_possible)
|
||||
hud_list[hud] = image('icons/mob/hud.dmi', src, "")
|
||||
|
||||
/mob/proc/Cell()
|
||||
set category = "Admin"
|
||||
set hidden = 1
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
layer = 4
|
||||
animate_movement = 2
|
||||
flags = NOREACT | HEAR
|
||||
hud_possible = list(ANTAG_HUD)
|
||||
var/datum/mind/mind
|
||||
|
||||
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
|
||||
|
||||
@@ -463,11 +463,3 @@ proc/is_special_character(mob/M) // returns 1 for special characters and 2 for h
|
||||
else
|
||||
return
|
||||
|
||||
/proc/broadcast_hud_message(var/message, var/broadcast_source)
|
||||
var/turf/sourceturf = get_turf(broadcast_source)
|
||||
var/user_list = sec_hud_users //A local var is used for easy addition of other HUD types.
|
||||
var/hud_icon = /obj/item/weapon/restraints/handcuffs //Icon displayed when the HUD triggered. Handcuffs for Sec HUDs.
|
||||
for(var/mob/hud_user in user_list)
|
||||
var/turf/userturf = get_turf(hud_user)
|
||||
if(userturf.z == sourceturf.z) //Must have same z-level.
|
||||
hud_user.show_message("<span class='info'>\icon[hud_icon] [message]</span>", 1)
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
viruses = list()
|
||||
for(var/datum/disease/D in O.viruses)
|
||||
D.affected_mob = O
|
||||
O.med_hud_set_status()
|
||||
|
||||
//keep damage?
|
||||
if (tr_flags & TR_KEEPDAMAGE)
|
||||
@@ -175,6 +176,7 @@
|
||||
for(var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
O.sec_hud_set_implants()
|
||||
|
||||
if(mind)
|
||||
mind.transfer_to(O)
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
if(istype(I, /obj/item/weapon/implant/loyalty))
|
||||
target << "<span class='notice'>You feel a sense of liberation as Nanotrasen's grip on your mind fades away.</span>"
|
||||
qdel(I)
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.sec_hud_set_implants()
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] can't find anything in [target]'s [target_zone].</span>")
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
author: Tkdrg
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- tweak: Security/Medical HUDs are now more responsive and less laggy.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 180 KiB |
+3
-1
@@ -23,6 +23,7 @@
|
||||
#include "code\__DEFINES\combat.dm"
|
||||
#include "code\__DEFINES\flags.dm"
|
||||
#include "code\__DEFINES\genetics.dm"
|
||||
#include "code\__DEFINES\hud.dm"
|
||||
#include "code\__DEFINES\machines.dm"
|
||||
#include "code\__DEFINES\math.dm"
|
||||
#include "code\__DEFINES\misc.dm"
|
||||
@@ -131,6 +132,7 @@
|
||||
#include "code\datums\datacore.dm"
|
||||
#include "code\datums\datumvars.dm"
|
||||
#include "code\datums\gas_mixture.dm"
|
||||
#include "code\datums\hud.dm"
|
||||
#include "code\datums\mind.dm"
|
||||
#include "code\datums\mixed.dm"
|
||||
#include "code\datums\modules.dm"
|
||||
@@ -244,6 +246,7 @@
|
||||
#include "code\game\area\ai_monitored.dm"
|
||||
#include "code\game\area\areas.dm"
|
||||
#include "code\game\area\Space Station 13 areas.dm"
|
||||
#include "code\game\gamemodes\antag_hud.dm"
|
||||
#include "code\game\gamemodes\antag_spawner.dm"
|
||||
#include "code\game\gamemodes\events.dm"
|
||||
#include "code\game\gamemodes\factions.dm"
|
||||
@@ -1073,7 +1076,6 @@
|
||||
#include "code\modules\mob\living\carbon\slime\death.dm"
|
||||
#include "code\modules\mob\living\carbon\slime\emote.dm"
|
||||
#include "code\modules\mob\living\carbon\slime\examine.dm"
|
||||
#include "code\modules\mob\living\carbon\slime\hud.dm"
|
||||
#include "code\modules\mob\living\carbon\slime\life.dm"
|
||||
#include "code\modules\mob\living\carbon\slime\login.dm"
|
||||
#include "code\modules\mob\living\carbon\slime\powers.dm"
|
||||
|
||||
Reference in New Issue
Block a user