VS: Planes shenanigans. Begins 'plane' work, for VS specific things.

This commit is contained in:
Arokha Sieyes
2018-01-14 00:40:00 -05:00
parent ad74dec1c0
commit 8f71a052a4
16 changed files with 74 additions and 128 deletions
+5
View File
@@ -0,0 +1,5 @@
// "Character HUDs", aka HUDs, but not the game's UI. Things like medhuds.
#define PLANE_CH_HEALTH_VR 27 //Hidden healthbar when at full health
#define PLANE_CH_STATUS_R 28 //Right-side status icon
#define PLANE_CH_BACKUP 29 //Backup implant
#define PLANE_CH_VANTAG 30 //Vore Antag hud
+8
View File
@@ -0,0 +1,8 @@
#undef VIS_COUNT
#define VIS_CH_STATUS_R 18
#define VIS_CH_HEALTH_VR 19
#define VIS_CH_BACKUP 20
#define VIS_CH_VANTAG 21
#define VIS_COUNT 21
-60
View File
@@ -1,60 +0,0 @@
var/global/list/gen_hud_users = list() // List of all entities using a generic AR shades.
var/global/list/eng_hud_users = list() // List of all entities using a engineer HUD.
var/global/list/sci_hud_users = list() // List of all entities using a science HUD.
var/global/list/vantag_hud_users = list() // List of all mobs with the VANTAG hud on.
/proc/broadcast_engineering_hud_message(var/message, var/broadcast_source)
broadcast_hud_message(message, broadcast_source, eng_hud_users, /obj/item/clothing/glasses/omnihud/eng)
/proc/broadcast_science_hud_message(var/message, var/broadcast_source)
broadcast_hud_message(message, broadcast_source, sci_hud_users, /obj/item/clothing/glasses/omnihud/rnd)
proc/process_omni_hud(var/mob/M, var/mode, var/mob/Alt)
if(!can_process_hud(M))
return
var/datum/arranged_hud_process/P
switch(mode)
if("med")
P = arrange_hud_process(M, Alt, med_hud_users)
if("sec")
P = arrange_hud_process(M, Alt, sec_hud_users)
if("eng")
P = arrange_hud_process(M, Alt, eng_hud_users)
if("sci")
P = arrange_hud_process(M, Alt, sci_hud_users)
if("best")
P = arrange_hud_process(M, Alt, sec_hud_users)
else
P = arrange_hud_process(M, Alt, gen_hud_users)
for(var/mob/living/carbon/human/guy in P.Mob.in_view(P.Turf))
if(P.Mob.see_invisible < guy.invisibility)
continue
P.Client.images += guy.hud_list[ID_HUD]
P.Client.images += guy.hud_list[HEALTH_VR_HUD]
if(mode == "med") //Medical advanced version
P.Client.images += guy.hud_list[STATUS_R_HUD]
P.Client.images += guy.hud_list[BACKUP_HUD]
if(mode == "sec") //Security advanced version
P.Client.images += guy.hud_list[WANTED_HUD]
if(mode == "best") //Command/omni advanced version
P.Client.images += guy.hud_list[WANTED_HUD]
P.Client.images += guy.hud_list[STATUS_R_HUD]
P.Client.images += guy.hud_list[BACKUP_HUD]
proc/process_vantag_hud(var/mob/M)
if(!M.vantag_hud || !can_process_hud(M))
return
var/datum/arranged_hud_process/P = arrange_hud_process(M, null, vantag_hud_users)
for(var/mob/living/carbon/human/guy in P.Mob.in_view(P.Turf))
if(P.Mob.see_invisible < guy.invisibility)
continue
P.Client.images += guy.hud_list[VANTAG_HUD]
+2 -2
View File
@@ -19,8 +19,8 @@
return minor_alarms
//VOREStation Add - Alarm for AR glasses
/datum/alarm_handler/atmosphere/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
/*/datum/alarm_handler/atmosphere/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
..()
var/atom/source = length(alarm.sources_assoc) ? alarm.sources_assoc[1] : alarm.alarm_area()
broadcast_engineering_hud_message("Alarm in [alarm.origin] [was_raised ? "raised!" : "cleared."]", source)
broadcast_engineering_hud_message("Alarm in [alarm.origin] [was_raised ? "raised!" : "cleared."]", source)*/
//VOREStation Add End
+2 -2
View File
@@ -9,7 +9,7 @@
else
A.fire_reset()
//VOREStation Add - Alarm for AR glasses uses
var/atom/source = length(alarm.sources_assoc) ? alarm.sources_assoc[1] : alarm.alarm_area()
broadcast_engineering_hud_message("Alarm in [alarm.origin] [was_raised ? "raised!" : "cleared."]", source)
/*var/atom/source = length(alarm.sources_assoc) ? alarm.sources_assoc[1] : alarm.alarm_area()
broadcast_engineering_hud_message("Alarm in [alarm.origin] [was_raised ? "raised!" : "cleared."]", source)*/
//VOREStation Add End
..()
+2 -1
View File
@@ -58,4 +58,5 @@
..()
/obj/item/clothing/glasses/sunglasses/sechud/tactical
item_flags = AIRTIGHT
item_flags = AIRTIGHT
body_parts_covered = EYES
+5 -23
View File
@@ -9,15 +9,15 @@
var/datum/nano_module/arscreen
var/arscreen_path
var/flash_prot = 0 //0 for none, 1 for flash weapon protection, 2 for welder protection
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR)
plane_slots = list(slot_glasses)
/obj/item/clothing/glasses/omnihud/New()
..()
src.hud = new/obj/item/clothing/glasses/hud/omni(src)
if(arscreen_path)
arscreen = new arscreen_path(src)
/obj/item/clothing/glasses/omnihud/Destroy()
qdel_null(hud)
qdel_null(arscreen)
. = ..()
@@ -27,12 +27,9 @@
..()
/obj/item/clothing/glasses/omnihud/emp_act(var/severity)
var/disconnect_hud = hud
var/disconnect_ar = arscreen
hud = null
arscreen = null
spawn(20 SECONDS)
hud = disconnect_hud
arscreen = disconnect_ar
..()
@@ -75,6 +72,7 @@
mode = "med"
action_button_name = "AR Console (Crew Monitor)"
arscreen_path = /datum/nano_module/crew_monitor
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP)
ar_interact(var/mob/living/carbon/human/user)
if(arscreen)
@@ -89,6 +87,7 @@
flash_protection = FLASH_PROTECTION_MAJOR
action_button_name = "AR Console (Security Alerts)"
arscreen_path = /datum/nano_module/alarm_monitor/security
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_WANTED)
ar_interact(var/mob/living/carbon/human/user)
if(arscreen)
@@ -161,21 +160,4 @@
These have been upgraded with every feature the lesser models have. Now we're talkin'."
mode = "best"
flash_protection = FLASH_PROTECTION_MAJOR
/obj/item/clothing/glasses/hud/omni
name = "internal omni hud"
desc = "You shouldn't see this. This is an internal item for glasses."
var/obj/item/clothing/glasses/omnihud/shades = null
vision_flags = SEE_MOBS
see_invisible = SEE_INVISIBLE_NOLIGHTING
New()
..()
if(istype(loc,/obj/item/clothing/glasses/omnihud))
shades = loc
else
qdel(src)
/obj/item/clothing/glasses/hud/omni/process_hud(var/mob/M)
process_omni_hud(M,shades.mode)
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED)
+1 -1
View File
@@ -39,7 +39,7 @@
var/mob/living/L = pulledby
UnarmedAttack(L)
say("Do not interfere with active law enforcement routines!")
broadcast_security_hud_message("[src] was interfered with in <b>[get_area(src)]</b>, activating defense routines.", src)
global_announcer.autosay("[src] was interfered with in <b>[get_area(src)]</b>, activating defense routines.", "[src]", "Security")
//VOREStation Add End
/mob/living/bot/secbot/beepsky
name = "Officer Beepsky"
@@ -0,0 +1,9 @@
var/static/icon/ingame_hud_vr = icon('icons/mob/hud_vr.dmi')
var/static/icon/ingame_hud_med_vr = icon('icons/mob/hud_med_vr.dmi')
/mob/living/carbon/human/make_hud_overlays()
. = ..()
hud_list[HEALTH_VR_HUD] = gen_hud_image(ingame_hud_med_vr, src, "100", plane = PLANE_CH_HEALTH_VR)
hud_list[STATUS_R_HUD] = gen_hud_image(ingame_hud_vr, src, plane = PLANE_CH_STATUS_R)
hud_list[BACKUP_HUD] = gen_hud_image(ingame_hud_vr, src, plane = PLANE_CH_BACKUP)
hud_list[VANTAG_HUD] = gen_hud_image(ingame_hud_vr, src, plane = PLANE_CH_VANTAG)
@@ -213,7 +213,7 @@
last_target_time = world.time
return M
if(check_threat(M) >= 4)
broadcast_security_hud_message("[src] is attempting to 'detain' suspect <b>[target_name(M)]</b> in <b>[get_area(src)]</b>.", src)
global_announcer.autosay("[src] is attempting to 'detain' suspect <b>[target_name(M)]</b> in <b>[get_area(src)]</b>.", "[src]", "Security")
else if(investigates)
spawn(1)
WanderTowards(seen)
+6
View File
@@ -0,0 +1,6 @@
/datum/plane_holder/New(mob/this_guy)
..()
plane_masters[VIS_CH_STATUS_R] = new /obj/screen/plane_master{plane = PLANE_CH_STATUS_R} //Right-side status icon
plane_masters[VIS_CH_HEALTH_VR] = new /obj/screen/plane_master{plane = PLANE_CH_HEALTH_VR} //Health bar but transparent at 100
plane_masters[VIS_CH_BACKUP] = new /obj/screen/plane_master{plane = PLANE_CH_BACKUP} //Backup implant status
plane_masters[VIS_CH_VANTAG] = new /obj/screen/plane_master{plane = PLANE_CH_VANTAG} //Vore Antags
+26 -33
View File
@@ -42,7 +42,6 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
var/tmp/install_done // Time when install will finish
var/tmp/open = FALSE // If it's open for maintenance (1-3)
var/obj/item/clothing/glasses/hud/nif_hud/nif_hud // The AR ones require this
var/obj/item/device/communicator/commlink/comm // The commlink requires this
var/global/icon/big_icon
@@ -58,6 +57,8 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
var/list/save_data
var/list/planes_visible = list()
//Constructor comes with a free AR HUD
/obj/item/device/nif/New(var/newloc,var/wear,var/list/load_data)
..(newloc)
@@ -66,9 +67,6 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
if(!big_icon)
big_icon = new(icon,icon_state = "nif_full")
//Required for AR stuff.
nif_hud = new(src)
//Put loaded data here if we loaded any
save_data = islist(load_data) ? load_data.Copy() : list()
@@ -101,7 +99,6 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
human.nif = null
human = null
qdel_null_list(nifsofts)
qdel_null(nif_hud)
qdel_null(comm)
nifsofts_life.Cut()
return ..()
@@ -294,11 +291,12 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
//Perform our passive drain
if(!use_charge(power_usage))
stat = NIF_POWFAIL
update_vision()
notify("Insufficient energy!",TRUE)
return FALSE
//HUD update!
nif_hud.process_hud(human,1)
//nif_hud.process_hud(human,1) //TODO VIS
//Process all the ones that want that
for(var/S in nifsofts_life)
@@ -310,6 +308,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
return FALSE
else
stat = NIF_WORKING
update_vision()
notify("System Reboot Complete.")
if(NIF_TEMPFAIL)
@@ -466,6 +465,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
switch(hint)
if(NIF_FLAGS_VISION)
vision_flags |= flag
update_vision()
if(NIF_FLAGS_HEALTH)
health_flags |= flag
if(NIF_FLAGS_COMBAT)
@@ -482,6 +482,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
switch(hint)
if(NIF_FLAGS_VISION)
vision_flags &= ~flag
update_vision()
if(NIF_FLAGS_HEALTH)
health_flags &= ~flag
if(NIF_FLAGS_COMBAT)
@@ -524,35 +525,27 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
return result
///////////////////////////////////////////////////////////////////////////////////////
//NIF HUD object becasue HUD handling is trash and should be rewritten
/obj/item/clothing/glasses/hud/nif_hud/var/obj/item/device/nif/nif
/obj/item/device/nif/proc/update_vision()
if(stat != NIF_WORKING)
planes_visible.Cut()
/obj/item/clothing/glasses/hud/nif_hud/New(var/newloc)
..(newloc)
nif = newloc
else if(NIF_V_AR_OMNI & vision_flags)
planes_visible = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED)
else if(NIF_V_AR_SECURITY & vision_flags)
planes_visible = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_WANTED)
else if(NIF_V_AR_MEDICAL & vision_flags)
planes_visible = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP)
else if(NIF_V_AR_ENGINE & vision_flags)
planes_visible = list(VIS_CH_ID,VIS_CH_HEALTH_VR)
else if(NIF_V_AR_SCIENCE & vision_flags)
planes_visible = list(VIS_CH_ID,VIS_CH_HEALTH_VR)
else if(NIF_V_AR_CIVILIAN & vision_flags)
planes_visible = list(VIS_CH_ID,VIS_CH_HEALTH_VR)
else
planes_visible = list()
/obj/item/clothing/glasses/hud/nif_hud/Destroy()
if(nif)
nif.nif_hud = null
nif = null
return ..()
/obj/item/clothing/glasses/hud/nif_hud/process_hud(M,var/thing)
//Faster checking with local var, and this is called often so I want fast.
var/visflags = nif.vision_flags
if(NIF_V_AR_OMNI & visflags)
process_omni_hud(nif.human, "best")
else if(NIF_V_AR_SECURITY & visflags)
process_omni_hud(nif.human, "sec")
else if(NIF_V_AR_MEDICAL & visflags)
process_omni_hud(nif.human, "med")
else if(NIF_V_AR_ENGINE & visflags)
process_omni_hud(nif.human, "eng")
else if(NIF_V_AR_SCIENCE & visflags)
process_omni_hud(nif.human, "sci")
else if(NIF_V_AR_CIVILIAN & visflags)
process_omni_hud(nif.human, "civ")
if(human)
human.recalculate_vis()
// Alternate NIFs
/obj/item/device/nif/bad
-3
View File
@@ -590,9 +590,6 @@ var/global/list/default_infomorph_software = list()
//Wipe all the huds, then readd them (of course...)
handle_regular_hud_updates()
if(src.arHUD == 1)
process_omni_hud(src, "civ")
//In response to EMPs, we can be silenced
if(silence_time)
if(world.timeofday >= silence_time)
@@ -284,6 +284,9 @@
toggle(mob/living/silicon/infomorph/user)
user.arHUD = !user.arHUD
if(user.plane_holder)
user.plane_holder.set_vis(VIS_CH_ID,user.arHUD)
user.plane_holder.set_vis(VIS_CH_HEALTH_VR,user.arHUD)
is_active(mob/living/silicon/infomorph/user)
return user.arHUD
+1 -1
View File
@@ -76,7 +76,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
if(..()) return 1
var/new_y_offset = 32 * (size_multiplier - 1)
for(var/I in hud_list)
var/image/hud_overlay/HI = I
var/image/HI = I
HI.pixel_y = new_y_offset
// Optimize mannequins - never a point to animating or doing HUDs on these.
+3 -1
View File
@@ -45,6 +45,7 @@
#include "code\__defines\misc.dm"
#include "code\__defines\misc_vr.dm"
#include "code\__defines\mobs.dm"
#include "code\__defines\mobs_vr.dm"
#include "code\__defines\nifsoft.dm"
#include "code\__defines\planets.dm"
#include "code\__defines\process_scheduler.dm"
@@ -354,7 +355,6 @@
#include "code\defines\procs\announce.dm"
#include "code\defines\procs\AStar.dm"
#include "code\defines\procs\dbcore.dm"
#include "code\defines\procs\hud_vr.dm"
#include "code\defines\procs\radio.dm"
#include "code\defines\procs\sd_Alert.dm"
#include "code\defines\procs\statistics.dm"
@@ -1797,6 +1797,7 @@
#include "code\modules\mob\mob_helpers.dm"
#include "code\modules\mob\mob_movement.dm"
#include "code\modules\mob\mob_planes.dm"
#include "code\modules\mob\mob_planes_vr.dm"
#include "code\modules\mob\mob_transformation_simple.dm"
#include "code\modules\mob\say.dm"
#include "code\modules\mob\say_vr.dm"
@@ -1907,6 +1908,7 @@
#include "code\modules\mob\living\carbon\human\human_defines.dm"
#include "code\modules\mob\living\carbon\human\human_defines_vr.dm"
#include "code\modules\mob\living\carbon\human\human_helpers.dm"
#include "code\modules\mob\living\carbon\human\human_helpers_vr.dm"
#include "code\modules\mob\living\carbon\human\human_movement.dm"
#include "code\modules\mob\living\carbon\human\human_organs.dm"
#include "code\modules\mob\living\carbon\human\human_powers.dm"