Hud refactor

This commit is contained in:
Aurorablade
2015-12-10 01:01:54 -05:00
parent a02d49d177
commit c590958f2d
58 changed files with 1002 additions and 692 deletions
+11 -1
View File
@@ -135,6 +135,7 @@
flags = GLASSESCOVERSEYES
slot_flags = SLOT_EYES
materials = list(MAT_GLASS = 250)
var/emagged = 0
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/invisa_view = 0
@@ -223,6 +224,11 @@ BLIND // can't see anything
user << "Your suit will now report your vital lifesigns."
if(3)
user << "Your suit will now report your vital lifesigns as well as your coordinate position."
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(H.w_uniform == src)
H.update_suit_sensors()
else if (istype(src.loc, /mob))
switch(sensor_mode)
if(0)
@@ -237,6 +243,10 @@ BLIND // can't see anything
if(3)
for(var/mob/V in viewers(user, 1))
V.show_message("[user] sets [src.loc]'s sensors to maximum.", 1)
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src
if(H.w_uniform == src)
H.update_suit_sensors()
/obj/item/clothing/under/verb/toggle()
set name = "Toggle Suit Sensors"
@@ -253,7 +263,7 @@ BLIND // can't see anything
var/blockTracking // Do we block AI tracking?
var/flash_protect = 0
var/tint = 0
var/HUDType = 0
var/HUDType = null
var/vision_flags = 0
var/see_darkness = 1
+2 -2
View File
@@ -10,7 +10,7 @@
var/prescription = 0
var/prescription_upgradable = 0
var/see_darkness = 1
var/HUDType = 0
var/HUDType = null
/obj/item/clothing/glasses/New()
. = ..()
@@ -321,7 +321,7 @@
darkness_view = 1
flash_protect = 1
tint = 1
HUDType = SECHUD
HUDType = DATA_HUD_SECURITY_BASIC
prescription_upgradable = 1
species_fit = list("Vox")
sprite_sheets = list(
+24 -3
View File
@@ -3,23 +3,38 @@
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"
HUDType = SECHUD
HUDType = DATA_HUD_SECURITY_BASIC
prescription_upgradable = 1
var/list/icon/current = list() //the current hud icons
/obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot)
if(slot == slot_glasses)
var/datum/atom_hud/H = huds[HUDType]
H.add_hud_to(user)
/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user)
if(user.glasses == src)
var/datum/atom_hud/H = huds[HUDType]
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 = "/improper 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"
HUDType = MEDHUD
HUDType = DATA_HUD_MEDICAL_ADVANCED
/obj/item/clothing/glasses/hud/health_advanced
name = "/improper Advanced Health Scanner HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status. Includes anti-flash filter."
icon_state = "advmedhud"
flash_protect = 1
HUDType = MEDHUD
HUDType = DATA_HUD_MEDICAL_ADVANCED
/obj/item/clothing/glasses/hud/health/night
name = "/improper Night Vision Health Scanner HUD"
@@ -30,6 +45,11 @@
see_darkness = 0
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/diagnostic
name = "Diagnostic HUD"
desc = "A heads-up display that scans silicons"
icon_state = "healthhud"
HUDType = DATA_HUD_DIAGNOSTIC
/obj/item/clothing/glasses/hud/security
name = "/improper Security HUD"
@@ -37,6 +57,7 @@
icon_state = "securityhud"
var/global/list/jobs[0]
flash_protect = 1
HUDType = DATA_HUD_SECURITY_ADVANCED
/obj/item/clothing/glasses/hud/security/jensenshades
name = "augmented shades"
+18 -14
View File
@@ -23,12 +23,11 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
universal_speak = 1
var/atom/movable/following = null
var/medHUD = 0
var/secHUD = 0
var/anonsay = 0
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/seedarkness = 1
var/data_hud_seen = 0 //this should one of the defines in __DEFINES/hud.dm
/mob/dead/observer/New(var/mob/body=null, var/flags=1)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
@@ -111,7 +110,7 @@ Works together with spawning an observer, noted above.
if(!loc) return
if(!client) return 0
regular_hud_updates()
//regular_hud_updates()
if(client.images.len)
for(var/image/hud in client.images)
if(copytext(hud.icon_state,1,4) == "hud")
@@ -123,12 +122,12 @@ Works together with spawning an observer, noted above.
target_list += target
if(target_list.len)
assess_targets(target_list, src)
if(medHUD)
process_medHUD(src)
if(secHUD)
process_secHUD(src)
//if(medHUD)
/// process_medHUD(src)
//if(secHUD)
// process_secHUD(src)
/*
/mob/dead/proc/process_medHUD(var/mob/M)
var/client/C = M.client
for(var/mob/living/carbon/human/patient in oview(M, 14))
@@ -141,6 +140,7 @@ Works together with spawning an observer, noted above.
C.images += target.hud_list[IMPTRACK_HUD]
C.images += target.hud_list[IMPLOYAL_HUD]
C.images += target.hud_list[IMPCHEM_HUD]
*/
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
var/client/C = U.client
@@ -270,18 +270,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 1
/mob/dead/observer/proc/show_me_the_hud(hud_index)
var/datum/atom_hud/H = huds[hud_index]
H.add_hud_to(src)
data_hud_seen = hud_index
/mob/dead/observer/verb/toggle_medHUD()
set category = "Ghost"
set name = "Toggle MedicHUD"
set desc = "Toggles the medical HUD."
if(!client)
return
if(medHUD)
medHUD = 0
src << "\blue <B>Medical HUD Disabled</B>"
else
medHUD = 1
src << "\blue <B>Medical HUD Enabled</B>"
if(data_hud_seen) //remove old huds
var/datum/atom_hud/H = huds[data_hud_seen]
H.remove_hud_from(src)
show_me_the_hud(DATA_HUD_SECURITY_BASIC)
/mob/dead/observer/verb/toggle_antagHUD()
set category = "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))
var/mob/living/carbon/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))
var/mob/living/carbon/H = affected_mob
H.med_hud_set_status()
spawn(0)
RemoveInfectionImages(affected_mob)
return ..()
@@ -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))
var/mob/living/carbon/H = affected_mob
H.med_hud_set_status()
processing_objects.Remove(src)
spawn(0)
RemoveInfectionImages(affected_mob)
+14
View File
@@ -7,6 +7,20 @@ mob/living
update_hud()
return
/mob/living/carbon/prepare_huds()
..()
prepare_data_huds()
/mob/living/carbon/proc/prepare_data_huds()
..()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/updatehealth()
..()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/Destroy()
for(var/atom/movable/guts in internal_organs)
qdel(guts)
@@ -91,10 +91,10 @@
dizziness = 0
jitteriness = 0
hud_updateflag |= 1 << HEALTH_HUD
hud_updateflag |= 1 << STATUS_HUD
//hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << STATUS_HUD
handle_hud_list()
//handle_hud_list()
//Handle species-specific deaths.
if(species) species.handle_death(src)
@@ -135,6 +135,8 @@
if(client) blind.layer = 0
timeofdeath = worldtime2text()
med_hud_set_health()
med_hud_set_status()
if(mind) mind.store_memory("Time of death: [timeofdeath]", 0)
if(ticker && ticker.mode)
// log_to_dd("k")
@@ -492,14 +492,11 @@
else
return 0
else if(istype(M, /mob/living/silicon))
var/mob/living/silicon/R = M
switch(hudtype)
if("security")
if(R.sensor_mode == 1)
return 1
return 1
if("medical")
if(R.sensor_mode == 2)
return 1
return 1
else
return 0
else
+31 -20
View File
@@ -6,7 +6,7 @@
icon_state = "body_m_s"
//why are these here and not in human_defines.dm
var/list/hud_list[10]
//var/list/hud_list[10]
var/datum/species/species //Contains icon generation and language information, set during New().
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/obj/item/weapon/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call.
@@ -29,16 +29,16 @@
reagents = R
R.my_atom = src
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudunknown")
hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD_OOC] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
//hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
//hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudunknown")
////hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[STATUS_HUD_OOC] = image('icons/mob/hud.dmi', src, "hudhealthy")
//hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
..()
@@ -48,6 +48,7 @@
var/mob/M = src
faction |= "\ref[M]" //what
prepare_data_huds()
// Set up DNA.
if(!delay_ready_dna && dna)
dna.ready_dna(src)
@@ -55,6 +56,16 @@
sync_organ_dna() //this shouldn't be necessaaaarrrryyyyyyyy
UpdateAppearance()
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...
..()
//...sec hud images...
sec_hud_set_ID()
sec_hud_set_implants()
sec_hud_set_security_status()
//...and display them.
add_to_all_human_data_huds()
/mob/living/carbon/human/Destroy()
for(var/atom/movable/organelle in organs)
qdel(organelle)
@@ -858,13 +869,13 @@
modified = 1
spawn()
hud_updateflag |= 1 << WANTED_HUD
//hud_updateflag |= 1 << WANTED_HUD
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
U.handle_regular_hud_updates()
//var/mob/living/carbon/human/U = usr
sec_hud_set_security_status()
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
U.handle_regular_hud_updates()
//var/mob/living/silicon/robot/U = usr
sec_hud_set_security_status()
if(!modified)
usr << "\red Unable to locate a data core entry for this person."
@@ -990,11 +1001,11 @@
spawn()
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
U.handle_regular_hud_updates()
//var/mob/living/carbon/human/U = usr
sec_hud_set_security_status()
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
U.handle_regular_hud_updates()
//var/mob/living/silicon/robot/U = usr
sec_hud_set_security_status()
if(!modified)
usr << "\red Unable to locate a data core entry for this person."
@@ -22,8 +22,12 @@
if(B)
if((health >= (config.health_threshold_dead / 100 * 75)) && stat == DEAD)
update_revive()
med_hud_set_health()
med_hud_set_status()
if(stat == CONSCIOUS && (src in dead_mob_list)) //Defib fix
update_revive()
med_hud_set_health()
med_hud_set_status()
/mob/living/carbon/human/adjustBrainLoss(var/amount)
if(status_flags & GODMODE)
@@ -88,7 +92,7 @@
take_overall_damage(amount, 0)
else
heal_overall_damage(-amount, 0)
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/adjustFireLoss(var/amount)
if(species && species.burn_mod)
@@ -97,7 +101,7 @@
take_overall_damage(0, amount)
else
heal_overall_damage(0, -amount)
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/proc/adjustBruteLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
if(species && species.brute_mod)
@@ -112,7 +116,7 @@
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(-amount, 0, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/proc/adjustFireLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
if(species && species.burn_mod)
@@ -127,7 +131,7 @@
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(0, -amount, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
/mob/living/carbon/human/Stun(amount)
..()
@@ -181,7 +185,7 @@
O.unmutate()
src << "<span class='notice'>Your [O.name] is shaped normally again.</span>"
hud_updateflag |= 1 << HEALTH_HUD //what even is this shit
//hud_updateflag |= 1 << HEALTH_HUD //what even is this shit
// Defined here solely to take species flags into account without having to recast at mob/living level.
/mob/living/carbon/human/getOxyLoss()
@@ -246,7 +250,7 @@
var/obj/item/organ/external/picked = pick(parts)
if(picked.heal_damage(brute,burn))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
updatehealth()
//Damages ONE external organ, organ gets randomly selected from damagable ones.
@@ -259,7 +263,7 @@
var/obj/item/organ/external/picked = pick(parts)
if(picked.take_damage(brute,burn,sharp,edge))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
updatehealth()
speech_problem_flag = 1
@@ -283,7 +287,7 @@
parts -= picked
updatehealth()
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
speech_problem_flag = 1
if(update)
UpdateDamageIcon()
@@ -308,7 +312,7 @@
parts -= picked
updatehealth()
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
if(update)
UpdateDamageIcon()
@@ -335,7 +339,7 @@ This function restores all organs.
if(istype(E, /obj/item/organ/external))
if(E.heal_damage(brute, burn))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
//hud_updateflag |= 1 << HEALTH_HUD
else
return 0
@@ -1,4 +1,6 @@
/mob/living/carbon/human
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,SPECIALROLE_HUD)
//Hair colour and style
var/r_hair = 0
var/g_hair = 0
@@ -164,9 +164,11 @@
if(internals)
internals.icon_state = "internal0"
internal = null
sec_hud_set_ID()
update_inv_wear_mask()
else if(I == wear_id)
wear_id = null
sec_hud_set_ID()
update_inv_wear_id()
else if(I == wear_pda)
wear_pda = null
@@ -220,6 +222,7 @@
wear_mask = W
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
sec_hud_set_ID()
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
handcuffed = W
@@ -238,6 +241,7 @@
update_inv_belt(redraw_mob)
if(slot_wear_id)
wear_id = W
sec_hud_set_ID()
update_inv_wear_id(redraw_mob)
if(slot_wear_pda)
wear_pda = W
+93 -91
View File
@@ -51,8 +51,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
loc_as_cryobag.used++
in_stasis = 1
if(mob_master.current_cycle % 30 == 15)
hud_updateflag = 1022
//if(mob_master.current_cycle % 30 == 15)
//hud_updateflag = 1022
//HudRefactor:WTF do i put here....
voice = GetVoice()
@@ -990,13 +991,13 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
/mob/living/carbon/human/handle_hud_icons()
species.handle_hud_icons(src)
/mob/living/carbon/human/handle_regular_hud_updates()
if(hud_updateflag)
handle_hud_list()
///mob/living/carbon/human/handle_regular_hud_updates()
// if(hud_updateflag)
// handle_hud_list()
if(..())
if(hud_updateflag)
handle_hud_list()
// if(..())
// if(hud_updateflag)
// handle_hud_list()
/mob/living/carbon/human/handle_random_events()
@@ -1260,92 +1261,92 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
*/
/mob/living/carbon/human/proc/handle_hud_list()
///mob/living/carbon/human/proc/handle_hud_list()
//
// if(hud_updateflag & 1 << HEALTH_HUD)
// var/image/holder = hud_list[HEALTH_HUD]
// if(stat == 2)
// holder.icon_state = "hudhealth-100" // X_X
// else
// holder.icon_state = "hud[RoundHealth(health)]"
//
// hud_list[HEALTH_HUD] = holder
//
//
// if(hud_updateflag & 1 << STATUS_HUD)
// var/foundVirus = 0
// for (var/ID in virus2)
// if (ID in virusDB)
// foundVirus = 1
// break
if(hud_updateflag & 1 << HEALTH_HUD)
var/image/holder = hud_list[HEALTH_HUD]
if(stat == 2)
holder.icon_state = "hudhealth-100" // X_X
else
holder.icon_state = "hud[RoundHealth(health)]"
// var/image/holder = hud_list[STATUS_HUD]
// var/image/holder2 = hud_list[STATUS_HUD_OOC]
// if(stat == 2)
// holder.icon_state = "huddead"
// holder2.icon_state = "huddead"
// else if(status_flags & XENO_HOST)
// holder.icon_state = "hudxeno"
// holder2.icon_state = "hudxeno"
// else if(foundVirus)
// holder.icon_state = "hudill"
// else if(has_brain_worms())
// var/mob/living/simple_animal/borer/B = has_brain_worms()
// if(B.controlling)
// holder.icon_state = "hudbrainworm"
// else
// holder.icon_state = "hudhealthy"
// holder2.icon_state = "hudbrainworm"
// else
// holder.icon_state = "hudhealthy"
// if(virus2.len)
// holder2.icon_state = "hudill"
// else
// holder2.icon_state = "hudhealthy"
hud_list[HEALTH_HUD] = holder
// hud_list[STATUS_HUD] = holder
// hud_list[STATUS_HUD_OOC] = holder2
//
if(hud_updateflag & 1 << STATUS_HUD)
var/foundVirus = 0
for (var/ID in virus2)
if (ID in virusDB)
foundVirus = 1
break
var/image/holder = hud_list[STATUS_HUD]
var/image/holder2 = hud_list[STATUS_HUD_OOC]
if(stat == 2)
holder.icon_state = "huddead"
holder2.icon_state = "huddead"
else if(status_flags & XENO_HOST)
holder.icon_state = "hudxeno"
holder2.icon_state = "hudxeno"
else if(foundVirus)
holder.icon_state = "hudill"
else if(has_brain_worms())
var/mob/living/simple_animal/borer/B = has_brain_worms()
if(B.controlling)
holder.icon_state = "hudbrainworm"
else
holder.icon_state = "hudhealthy"
holder2.icon_state = "hudbrainworm"
else
holder.icon_state = "hudhealthy"
if(virus2.len)
holder2.icon_state = "hudill"
else
holder2.icon_state = "hudhealthy"
hud_list[STATUS_HUD] = holder
hud_list[STATUS_HUD_OOC] = holder2
if(hud_updateflag & 1 << ID_HUD)
var/image/holder = hud_list[ID_HUD]
if(wear_id)
var/obj/item/weapon/card/id/I = wear_id.GetID()
if(I)
holder.icon_state = "hud[ckey(I.GetJobName())]"
else
holder.icon_state = "hudunknown"
else
holder.icon_state = "hudunknown"
hud_list[ID_HUD] = holder
if(hud_updateflag & 1 << WANTED_HUD)
var/image/holder = hud_list[WANTED_HUD]
holder.icon_state = "hudblank"
var/perpname = name
if(wear_id)
var/obj/item/weapon/card/id/I = wear_id.GetID()
if(I)
perpname = I.registered_name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.security)
if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "*Arrest*"))
holder.icon_state = "hudwanted"
break
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated"))
holder.icon_state = "hudprisoner"
break
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Parolled"))
holder.icon_state = "hudparolled"
break
else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Released"))
holder.icon_state = "hudreleased"
break
hud_list[WANTED_HUD] = holder
// if(hud_updateflag & 1 << ID_HUD)
// var/image/holder = hud_list[ID_HUD]
// if(wear_id)
// var/obj/item/weapon/card/id/I = wear_id.GetID()
// if(I)
// holder.icon_state = "hud[ckey(I.GetJobName())]"
// else
// holder.icon_state = "hudunknown"
// else
// holder.icon_state = "hudunknown"
//
//
// hud_list[ID_HUD] = holder
//
//
// if(hud_updateflag & 1 << WANTED_HUD)
// var/image/holder = hud_list[WANTED_HUD]
// holder.icon_state = "hudblank"
// var/perpname = name
// if(wear_id)
// var/obj/item/weapon/card/id/I = wear_id.GetID()
// if(I)
// perpname = I.registered_name
// for(var/datum/data/record/E in data_core.general)
// if(E.fields["name"] == perpname)
// for (var/datum/data/record/R in data_core.security)
// if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "*Arrest*"))
// holder.icon_state = "hudwanted"
// break
// else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Incarcerated"))
// holder.icon_state = "hudprisoner"
// break
// else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Parolled"))
// holder.icon_state = "hudparolled"
// break
// else if((R.fields["id"] == E.fields["id"]) && (R.fields["criminal"] == "Released"))
// holder.icon_state = "hudreleased"
// break
/* hud_list[WANTED_HUD] = holder
if(hud_updateflag & 1 << IMPLOYAL_HUD || hud_updateflag & 1 << IMPCHEM_HUD || hud_updateflag & 1 << IMPTRACK_HUD)
@@ -1436,6 +1437,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
hud_list[NATIONS_HUD] = holder
hud_updateflag = 0
*/
/mob/living/carbon/human/handle_silent()
if(..())
@@ -5,6 +5,4 @@
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
update_pipe_vision()
update_hud()
if(ticker && 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
@@ -422,13 +422,13 @@
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
switch(G.HUDType)
if(SECHUD)
process_sec_hud(H,1)
if(MEDHUD)
process_med_hud(H,1)
if(ANTAGHUD)
process_antag_hud(H)
//switch(G.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.head)
if(istype(H.head, /obj/item/clothing/head))
@@ -438,13 +438,13 @@
if(!hat.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
switch(hat.HUDType)
if(SECHUD)
process_sec_hud(H,1)
if(MEDHUD)
process_med_hud(H,1)
if(ANTAGHUD)
process_antag_hud(H)
//switch(hat.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey
var/obj/item/weapon/rig/rig = H.back
@@ -460,13 +460,13 @@
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
switch(G.HUDType)
if(SECHUD)
process_sec_hud(H,1)
if(MEDHUD)
process_med_hud(H,1)
if(ANTAGHUD)
process_antag_hud(H)
//switch(G.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.vision_type)
H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight)
+1 -1
View File
@@ -54,7 +54,7 @@
update_canmove()
if(client)
regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
//regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
handle_regular_hud_updates() //IT JUST REMOVES FUCKING HUD IMAGES
if(get_nations_mode())
process_nations()
+1 -24
View File
@@ -11,30 +11,7 @@
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
update_pipe_vision()
update_interface()
//Round specific stuff like hud updates
if(ticker && ticker.mode)
var/ref = "\ref[mind]"
switch(ticker.mode.name)
if("revolution")
if((mind in ticker.mode.revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
ticker.mode.update_rev_icons_added(src.mind)
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()
if("mutiny")
var/datum/game_mode/mutiny/mode = get_mutiny_mode()
if(mode)
mode.update_all_icons()
if("vampire")
if((ref in ticker.mode.vampire_thralls) || (mind in ticker.mode.vampire_enthralled))
ticker.mode.update_vampire_icons_added(mind)
if("shadowling")
if((mind in ticker.mode.shadowling_thralls) || (mind in ticker.mode.shadows))
ticker.mode.update_shadow_icons_added(src.mind)
return .
+13 -11
View File
@@ -82,10 +82,12 @@ var/list/ai_verbs_default = list(
var/turf/waypoint //Holds the turf of the currently selected waypoint.
var/waypoint_mode = 0 //Waypoint mode is for selecting a turf via clicking.
var/obj/item/borg/sight/hud/sec/sechud = null
var/obj/item/borg/sight/hud/med/healthhud = null
//var/obj/item/borg/sight/hud/sec/sechud = null
//var/obj/item/borg/sight/hud/med/healthhud = null
var/arrivalmsg = "$name, $rank, has arrived on the station."
med_hud = DATA_HUD_MEDICAL_BASIC
sec_hud = DATA_HUD_SECURITY_BASIC
/mob/living/silicon/ai/proc/add_ai_verbs()
src.verbs |= ai_verbs_default
@@ -175,15 +177,15 @@ var/list/ai_verbs_default = list(
new /obj/machinery/ai_powersupply(src)
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
ai_list += src
..()
+9 -6
View File
@@ -145,13 +145,13 @@
theAPC = null
process_queued_alarms()
regular_hud_updates()
//regular_hud_updates()
switch(sensor_mode)
if (SEC_HUD)
process_sec_hud(src, 1, eyeobj)
if (MED_HUD)
process_med_hud(src, 1, eyeobj)
//switch(sensor_mode)
/// if (SEC_HUD)
// process_sec_hud(src, 1, eyeobj)
// if (MED_HUD)
// process_med_hud(src, 1, eyeobj)
if(get_nations_mode())
process_nations_ai()
@@ -165,6 +165,9 @@
health = 100 - getOxyLoss() - getToxLoss() - getBruteLoss()
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/ai/proc/lacks_power()
var/turf/T = get_turf(src)
+4 -4
View File
@@ -1,10 +1,10 @@
/mob/living/silicon/pai/Life()
. = ..()
if(.)
if(secHUD == 1)
process_sec_hud(src, 1)
if(medHUD == 1)
process_med_hud(src, 1)
//if(secHUD == 1)
// process_sec_hud(src, 1)
////if(medHUD == 1)
// process_med_hud(src, 1)
if(silence_time)
if(world.timeofday >= silence_time)
silence_time = null
@@ -460,7 +460,9 @@
toggle(mob/living/silicon/pai/user)
user.secHUD = !user.secHUD
user.remove_med_sec_hud()
if(user.secHUD)
user.add_sec_hud()
is_active(mob/living/silicon/pai/user)
return user.secHUD
@@ -471,6 +473,9 @@
toggle(mob/living/silicon/pai/user)
user.medHUD = !user.medHUD
user.remove_med_sec_hud()
if(user.medHUD)
user.add_med_hud()
is_active(mob/living/silicon/pai/user)
return user.medHUD
+14 -9
View File
@@ -71,6 +71,7 @@
stat = UNCONSCIOUS
update_headlamp(1)
Paralyse(3)
diag_hud_set_borgcell()
/mob/living/silicon/robot/handle_regular_status_updates()
@@ -95,6 +96,7 @@
if(.) //alive
if(health <= config.health_threshold_dead)
death()
diag_hud_set_status()
return
if(!istype(src, /mob/living/silicon/robot/drone))
@@ -119,6 +121,8 @@
else
stat = CONSCIOUS
diag_hud_set_health()
diag_hud_set_status()
else //dead
eye_blind = 1
@@ -224,15 +228,15 @@
cells.icon_state = "charge-empty"
/mob/living/silicon/robot/handle_regular_hud_updates()
if(!client)
return
switch(sensor_mode)
if(SEC_HUD)
process_sec_hud(src,1)
if(MED_HUD)
process_med_hud(src,1)
/*/mob/living/silicon/robot/handle_regular_hud_updates()
// if(!client)
// return
//
// switch(sensor_mode)
// if(SEC_HUD)
// process_sec_hud(src,1)
// if(MED_HUD)
// process_med_hud(src,1)
if(syndicate)
if(ticker.mode.name == "traitor")
@@ -251,6 +255,7 @@
..()
return 1
*/
+14 -9
View File
@@ -80,6 +80,8 @@ var/list/robot_verbs_default = list(
var/updating = 0 //portable camera camerachunk update
hud_possible = list(SPECIALROLE_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_BATT_HUD)
var/jetpackoverlay = 0
var/magpulse = 0
@@ -141,15 +143,16 @@ var/list/robot_verbs_default = list(
cell_component.wrapped = cell
cell_component.installed = 1
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
//hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
//hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
diag_hud_set_borgcell()
scanner.Grant(src)
/mob/living/silicon/robot/proc/init(var/alien=0)
@@ -719,6 +722,7 @@ var/list/robot_verbs_default = list(
//This will mean that removing and replacing a power cell will repair the mount, but I don't care at this point. ~Z
C.brute_damage = 0
C.electronics_damage = 0
diag_hud_set_borgcell()
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
if (wiresexposed)
@@ -959,6 +963,7 @@ var/list/robot_verbs_default = list(
user << "You remove \the [cell]."
cell = null
update_icons()
diag_hud_set_borgcell()
if(!opened && (!istype(user, /mob/living/silicon)))
if (user.a_intent == I_HELP)
+41 -8
View File
@@ -8,7 +8,7 @@
var/list/stating_laws = list()// Channels laws are currently being stated on
var/list/alarms_to_show = list()
var/list/alarms_to_clear = list()
var/list/hud_list[10]
//var/list/hud_list[10]
var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer
var/list/alarm_handlers = list() // List of alarm handlers this silicon is registered to
var/designation = ""
@@ -19,19 +19,28 @@
var/speak_query = "queries"
var/pose //Yes, now AIs can pose too.
var/sensor_mode = 0 //Determines the current HUD.
//var/sensor_mode = 0 //Determines the current HUD.
var/next_alarm_notice
var/list/datum/alarm/queued_alarms = new()
#define SEC_HUD 1 //Security HUD mode
#define MED_HUD 2 //Medical HUD mode
hud_possible = list(SPECIALROLE_HUD, DIAG_STAT_HUD, DIAG_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
var/d_hud = DATA_HUD_DIAGNOSTIC //There is only one kind of diag hud
var/local_transmit //If set, can only speak to others of the same type within a short range.
var/obj/item/device/radio/common_radio
/mob/living/silicon/New()
silicon_mob_list |= src
..()
var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
add_language("Galactic Common")
init_subsystems()
@@ -252,17 +261,41 @@
/mob/living/silicon/binarycheck()
return 1
/mob/living/silicon/proc/remove_med_sec_hud()
var/datum/atom_hud/secsensor = huds[sec_hud]
var/datum/atom_hud/medsensor = huds[med_hud]
var/datum/atom_hud/diagsensor = huds[d_hud]
secsensor.remove_hud_from(src)
medsensor.remove_hud_from(src)
diagsensor.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/proc/add_diag_hud()
var/datum/atom_hud/diagsensor = huds[d_hud]
diagsensor.add_hud_to(src)
/mob/living/silicon/proc/toggle_sensor_mode()
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Disable")
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Diagnostic","Disable")
remove_med_sec_hud()
switch(sensor_type)
if ("Security")
sensor_mode = SEC_HUD
add_sec_hud()
src << "<span class='notice'>Security records overlay enabled.</span>"
if ("Medical")
sensor_mode = MED_HUD
add_med_hud()
src << "<span class='notice'>Life signs monitor overlay enabled.</span>"
if ("Diagnostic")
add_diag_hud()
src << "<span class='notice'>Robotics diagnostic overlay enabled.</span>"
if ("Disable")
sensor_mode = 0
src << "Sensor augmentations disabled."
/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised)
@@ -340,8 +340,8 @@
/mob/living/simple_animal/hostile/guardian/healer/Life()
..()
regular_hud_updates()
process_med_hud(src, 1)
var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED]
medsensor.add_hud_to(src)
/mob/living/simple_animal/hostile/guardian/healer/AttackingTarget()
..()
+3
View File
@@ -64,6 +64,9 @@
client.screen += client.void
//HUD updates (antag hud, etc)
//readd this mob's HUDs (antag, med, etc)
reload_huds()
CallHook("Login", list("client" = src.client, "mob" = src))
+5
View File
@@ -18,8 +18,13 @@
dead_mob_list += src
else
living_mob_list += src
prepare_huds()
..()
/atom/proc/prepare_huds()
for(var/hud in hud_possible)
hud_list[hud] = image('icons/mob/hud.dmi', src, "")
/mob/proc/generate_name()
return name
+2
View File
@@ -131,6 +131,8 @@
var/datum/hud/hud_used = null
hud_possible = list(SPECIALROLE_HUD)
var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining.
var/datum/action/scan_mode/scanner = new
+2 -2
View File
@@ -31,7 +31,7 @@
if ("groin")
return "abdominal"
return ""
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping around inside [target]'s [affected.name] with \the [tool]!", \
@@ -177,7 +177,7 @@
"\blue You take [obj] out of [target]'s [affected.name]s with \the [tool]." )
affected.implants -= obj
target.hud_updateflag |= 1 << IMPLOYAL_HUD
target.sec_hud_set_implants()
//Handle possessive brain borers.
if(istype(obj,/mob/living/simple_animal/borer))