POLARIS: Planes shenanigans. Begins 'plane' work.

This commit is contained in:
Arokha Sieyes
2018-01-14 00:39:59 -05:00
parent 05864e06ea
commit ad74dec1c0
52 changed files with 601 additions and 464 deletions
+21
View File
@@ -60,6 +60,7 @@ var/list/admin_verbs_admin = list(
/client/proc/check_antagonists,
/client/proc/admin_memo, //admin memo system. show/delete/write. +SERVER needed to delete admin memos of others,
/client/proc/dsay, //talk in deadchat using our ckey/fakekey,
/client/proc/ghost_view, //let us see ghosts WHENEVERRRR
// /client/proc/toggle_hear_deadcast, //toggles whether we hear deadchat,
/client/proc/investigate_show, //various admintools for investigation. Such as a singulo grief-log,
/client/proc/secrets,
@@ -215,6 +216,7 @@ var/list/admin_verbs_debug = list(
/client/proc/jumptomob,
/client/proc/jumptocoord,
/client/proc/dsay,
/client/proc/ghost_view,
/client/proc/toggle_debug_logs,
/client/proc/admin_ghost, //allows us to ghost/reenter body at will,
/datum/admins/proc/view_runtimes,
@@ -329,6 +331,7 @@ var/list/admin_verbs_mod = list(
/datum/admins/proc/show_player_info,
/client/proc/player_panel_new,
/client/proc/dsay,
/client/proc/ghost_view,
/datum/admins/proc/show_skills,
/datum/admins/proc/show_player_panel,
/client/proc/check_antagonists,
@@ -353,6 +356,7 @@ var/list/admin_verbs_event_manager = list(
/client/proc/admin_ghost,
/datum/admins/proc/show_player_info,
/client/proc/dsay,
/client/proc/ghost_view,
/client/proc/cmd_admin_subtle_message,
/client/proc/debug_variables,
/client/proc/check_antagonists,
@@ -492,6 +496,23 @@ var/list/admin_verbs_event_manager = list(
body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus
feedback_add_details("admin_verb","O") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/ghost_view()
set category = "Admin"
set name = "Ghost View"
set desc = "Toggles ability to see ghosts, even while in a mob."
if(!holder) return
if(!mob.plane_holder) return
var/choice = alert(src,"Do you want to see ghosts, or not?","Ghost viewing","Show 'em!","Cancel","Hide 'em!")
if(choice == "Cancel")
return
if(choice == "Show 'em!" && mob.plane_holder)
mob.plane_holder.set_vis(VIS_GHOSTS,TRUE)
to_chat(src,"<span class='notice'>Ghosts are now visible (while in this mob).</span>")
else if(mob.plane_holder)
mob.plane_holder.set_vis(VIS_GHOSTS,FALSE)
to_chat(src,"<span class='notice'>Ghosts are now hidden (while in this mob).</span>")
/client/proc/invisimin()
set name = "Invisimin"
+2 -1
View File
@@ -37,7 +37,8 @@
/obj/effect/bmode//Cleaning up the tree a bit
density = 1
anchored = 1
layer = 20
layer = LAYER_HUD_BASE
plane = PLANE_PLAYER_HUD
dir = NORTH
icon = 'icons/misc/buildmode.dmi'
var/obj/effect/bmode/buildholder/master = null
+12
View File
@@ -11,6 +11,8 @@
var/flash_protection = FLASH_PROTECTION_NONE
var/tint = TINT_NONE
var/list/enables_planes //Enables these planes in the wearing mob's plane_holder
var/list/plane_slots //But only if it's equipped into this specific slot
/*
Sprites used when the clothing item is refit. This is done by setting icon_override.
@@ -37,6 +39,16 @@
var/obj/item/clothing/accessory/tie = new T(src)
src.attach_accessory(null, tie)
/obj/item/clothing/equipped(var/mob/user,var/slot)
..()
if(enables_planes)
user.recalculate_vis()
/obj/item/clothing/dropped(var/mob/user)
..()
if(enables_planes)
user.recalculate_vis()
//BS12: Species-restricted clothing check.
/obj/item/clothing/mob_can_equip(M as mob, slot)
+18 -29
View File
@@ -16,6 +16,7 @@ BLIND // can't see anything
icon = 'icons/obj/clothing/glasses.dmi'
w_class = ITEMSIZE_SMALL
slot_flags = SLOT_EYES
plane_slots = list(slot_glasses)
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/see_invisible = -1
@@ -25,6 +26,7 @@ BLIND // can't see anything
var/active = 1
var/activation_sound = 'sound/items/goggles_charge.ogg'
var/obj/screen/overlay = null
var/list/away_planes //Holder for disabled planes
sprite_sheets = list(
"Teshari" = 'icons/mob/species/seromi/eyes.dmi',
@@ -44,6 +46,8 @@ BLIND // can't see anything
user.update_inv_glasses()
flash_protection = FLASH_PROTECTION_NONE
tint = TINT_NONE
away_planes = enables_planes
enables_planes = null
to_chat(usr, "You deactivate the optical matrix on the [src].")
else
active = 1
@@ -51,8 +55,11 @@ BLIND // can't see anything
user.update_inv_glasses()
flash_protection = initial(flash_protection)
tint = initial(tint)
enables_planes = away_planes
away_planes = null
to_chat(usr, "You activate the optical matrix on the [src].")
user.update_action_buttons()
user.recalculate_vis()
/obj/item/clothing/glasses/meson
name = "optical meson scanner"
@@ -63,6 +70,7 @@ BLIND // can't see anything
origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2)
toggleable = 1
vision_flags = SEE_TURFS
enables_planes = (VIS_FULLBRIGHT)
/obj/item/clothing/glasses/meson/New()
..()
@@ -130,9 +138,9 @@ BLIND // can't see anything
darkness_view = 7
toggleable = 1
action_button_name = "Toggle Goggles"
see_invisible = SEE_INVISIBLE_NOLIGHTING
off_state = "denight"
flash_protection = FLASH_PROTECTION_REDUCED
enables_planes = list(VIS_FULLBRIGHT)
/obj/item/clothing/glasses/night/vox
name = "Alien Optics"
@@ -316,12 +324,7 @@ BLIND // can't see anything
name = "\improper HUD sunglasses"
desc = "Sunglasses with a HUD."
icon_state = "sunSecHud"
var/obj/item/clothing/glasses/hud/security/hud = null
New()
..()
src.hud = new/obj/item/clothing/glasses/hud/security(src)
return
enables_planes = list(VIS_CH_ID,VIS_CH_WANTED,VIS_CH_IMPTRACK,VIS_CH_IMPLOYAL,VIS_CH_IMPCHEM)
/obj/item/clothing/glasses/sunglasses/sechud/tactical
name = "tactical HUD"
@@ -338,31 +341,22 @@ BLIND // can't see anything
toggleable = 1
activation_sound = 'sound/effects/pop.ogg'
var/hud_holder
/obj/item/clothing/glasses/sunglasses/sechud/aviator/New()
..()
hud_holder = hud
/obj/item/clothing/glasses/sunglasses/sechud/aviator/Destroy()
qdel(hud_holder)
hud_holder = null
hud = null
. = ..()
/obj/item/clothing/glasses/sunglasses/sechud/aviator/attack_self(mob/user)
if(toggleable && !user.incapacitated())
on = !on
if(on)
flash_protection = FLASH_PROTECTION_NONE
src.hud = hud_holder
enables_planes = away_planes
away_planes = null
to_chat(usr, "You switch the [src] to HUD mode.")
else
flash_protection = initial(flash_protection)
src.hud = null
away_planes = enables_planes
enables_planes = null
to_chat(usr, "You switch \the [src] to flash protection mode.")
update_icon()
user << activation_sound
user.recalculate_vis()
user.update_inv_glasses()
user.update_action_buttons()
@@ -381,12 +375,7 @@ BLIND // can't see anything
name = "\improper HUD sunglasses"
desc = "Sunglasses with a HUD."
icon_state = "sunMedHud"
var/obj/item/clothing/glasses/hud/health/hud = null
/obj/item/clothing/glasses/sunglasses/medhud/New()
..()
src.hud = new/obj/item/clothing/glasses/hud/health(src)
return
enables_planes = list(VIS_CH_STATUS,VIS_CH_HEALTH)
/obj/item/clothing/glasses/thermal
name = "optical thermal scanner"
@@ -397,7 +386,7 @@ BLIND // can't see anything
toggleable = 1
action_button_name = "Toggle Goggles"
vision_flags = SEE_MOBS
see_invisible = SEE_INVISIBLE_NOLIGHTING
enables_planes = list(VIS_FULLBRIGHT)
flash_protection = FLASH_PROTECTION_REDUCED
emp_act(severity)
@@ -454,4 +443,4 @@ BLIND // can't see anything
name = "optical thermal implants"
desc = "A set of implantable lenses designed to augment your vision"
icon_state = "thermalimplants"
item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses")
item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses")
+2 -11
View File
@@ -3,10 +3,6 @@
desc = "A heads-up display that provides important info in (almost) real time."
flags = 0 //doesn't protect eyes because it's a monocle, duh
origin_tech = list(TECH_MAGNET = 3, TECH_BIO = 2)
var/list/icon/current = list() //the current hud icons
proc
process_hud(var/mob/M) return
/obj/item/clothing/glasses/hud/health
name = "Health Scanner HUD"
@@ -14,6 +10,7 @@
icon_state = "healthhud"
item_state_slots = list(slot_r_hand_str = "headset", slot_l_hand_str = "headset")
body_parts_covered = 0
enables_planes = list(VIS_CH_STATUS,VIS_CH_HEALTH)
/obj/item/clothing/glasses/hud/health/prescription
name = "Prescription Health Scanner HUD"
@@ -22,16 +19,13 @@
icon_state = "healthhudpresc"
item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses")
/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M)
process_med_hud(M, 1)
/obj/item/clothing/glasses/hud/security
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"
item_state_slots = list(slot_r_hand_str = "headset", slot_l_hand_str = "headset")
body_parts_covered = 0
var/global/list/jobs[0]
enables_planes = list(VIS_CH_ID,VIS_CH_WANTED,VIS_CH_IMPTRACK,VIS_CH_IMPLOYAL,VIS_CH_IMPCHEM)
/obj/item/clothing/glasses/hud/security/prescription
name = "Prescription Security HUD"
@@ -47,6 +41,3 @@
item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses")
vision_flags = SEE_MOBS
see_invisible = SEE_INVISIBLE_NOLIGHTING
/obj/item/clothing/glasses/hud/security/process_hud(var/mob/M)
process_sec_hud(M, 1)
+2 -1
View File
@@ -6,7 +6,8 @@
anchored = 1
icon = LIGHTING_ICON
layer = LIGHTING_LAYER
invisibility = INVISIBILITY_LIGHTING
plane = PLANE_LIGHTING
//invisibility = INVISIBILITY_LIGHTING
color = LIGHTING_BASE_MATRIX
icon_state = "light1"
auto_init = 0 // doesn't need special init
+6 -4
View File
@@ -1,5 +1,7 @@
//Nobody here anymore.
/mob/observer/dead/Login()
..()
if (ghostimage)
ghostimage.icon_state = src.icon_state
updateghostimages()
..() //Creates the plane_holder lazily
plane_holder.set_vis(VIS_GHOSTS, ghostvision)
plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness)
plane_holder.set_vis(VIS_AI_EYE, TRUE)
plane = PLANE_GHOSTS
+36 -109
View File
@@ -1,6 +1,3 @@
var/global/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness
var/global/list/image/ghost_sightless_images = list() //this is a list of images for things ghosts should still be able to see even without ghost sight
/mob/observer
name = "observer"
desc = "This shouldn't appear"
@@ -12,11 +9,12 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
icon = 'icons/mob/ghost.dmi'
icon_state = "ghost"
layer = 3.9 //Just below normal mobs
plane = PLANE_GHOSTS
alpha = 127
stat = DEAD
canmove = 0
blinded = 0
anchored = 1 // don't get pushed around
invisibility = INVISIBILITY_OBSERVER
var/can_reenter_corpse
var/datum/hud/living/carbon/hud = null // hud
var/bootime = 0
@@ -30,9 +28,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
var/atom/movable/following = null
var/admin_ghosted = 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
incorporeal_move = 1
var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil.
@@ -92,15 +88,12 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
/mob/observer/dead/New(mob/body)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
see_in_dark = world.view //I mean. I don't even know if byond has occlusion culling... but...
plane = PLANE_GHOSTS //Why doesn't the var above work...???
verbs += /mob/observer/dead/proc/dead_tele
stat = DEAD
ghostimage = image(src.icon,src,src.icon_state)
ghost_darkness_images |= ghostimage
updateallghostimages()
var/turf/T
if(ismob(body))
T = get_turf(body) //Where is the body located?
@@ -115,8 +108,6 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
icon_state = body.icon_state
overlays = body.overlays
alpha = 127
gender = body.gender
if(body.mind && body.mind.name)
name = body.mind.name
@@ -139,22 +130,12 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
real_name = name
..()
/mob/observer/dead/Destroy()
if (ghostimage)
ghost_darkness_images -= ghostimage
qdel(ghostimage)
ghostimage = null
updateallghostimages()
return ..()
/mob/observer/dead/Topic(href, href_list)
if (href_list["track"])
var/mob/target = locate(href_list["track"]) in mob_list
if(target)
ManualFollow(target)
/mob/observer/dead/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/weapon/book/tome))
var/mob/observer/dead/M = src
@@ -174,31 +155,6 @@ Works together with spawning an observer, noted above.
handle_regular_hud_updates()
if(antagHUD)
var/list/target_list = list()
for(var/mob/living/target in oview(src, 14))
if(target.mind && target.mind.special_role)
target_list += target
if(target_list.len)
assess_targets(target_list, src)
if(medHUD)
process_medHUD(src)
/mob/observer/dead/proc/process_medHUD(var/mob/M)
var/client/C = M.client
for(var/mob/living/carbon/human/patient in oview(M, 14))
C.images += patient.hud_list[HEALTH_HUD]
C.images += patient.hud_list[STATUS_HUD_OOC]
/mob/observer/dead/proc/assess_targets(list/target_list, mob/observer/dead/U)
var/client/C = U.client
for(var/mob/living/carbon/human/target in target_list)
C.images += target.hud_list[SPECIALROLE_HUD]
for(var/mob/living/silicon/target in target_list)
C.images += target.hud_list[SPECIALROLE_HUD]
return 1
/mob/proc/ghostize(var/can_reenter_corpse = 1)
if(key)
if(ishuman(src))
@@ -305,41 +261,33 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost"
set name = "Toggle MedicHUD"
set desc = "Toggles Medical HUD allowing you to see how everyone is doing"
if(!client)
return
if(medHUD)
medHUD = 0
src << "<font color='blue'><B>Medical HUD Disabled</B></font>"
else
medHUD = 1
src << "<font color='blue'><B>Medical HUD Enabled</B></font>"
medHUD = !medHUD
plane_holder.set_vis(VIS_CH_HEALTH, medHUD)
plane_holder.set_vis(VIS_CH_STATUS_OOC, medHUD)
to_chat(src,"<font color='blue'><B>Medical HUD [medHUD ? "Enabled" : "Disabled"]</B></font>")
/mob/observer/dead/verb/toggle_antagHUD()
set category = "Ghost"
set name = "Toggle AntagHUD"
set desc = "Toggles AntagHUD allowing you to see who is the antagonist"
if(!client)
return
if(!config.antag_hud_allowed && !client.holder)
src << "<font color='red'>Admins have disabled this for this round.</font>"
return
var/mob/observer/dead/M = src
if(jobban_isbanned(M, "AntagHUD"))
if(jobban_isbanned(src, "AntagHUD"))
src << "<font color='red'><B>You have been banned from using this feature</B></font>"
return
if(config.antag_hud_restricted && !M.has_enabled_antagHUD && !client.holder)
if(config.antag_hud_restricted && !has_enabled_antagHUD && !client.holder)
var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No")
if(response == "No") return
M.can_reenter_corpse = 0
if(!M.has_enabled_antagHUD && !client.holder)
M.has_enabled_antagHUD = 1
if(M.antagHUD)
M.antagHUD = 0
src << "<font color='blue'><B>AntagHUD Disabled</B></font>"
else
M.antagHUD = 1
src << "<font color='blue'><B>AntagHUD Enabled</B></font>"
can_reenter_corpse = FALSE
if(!has_enabled_antagHUD && !client.holder)
has_enabled_antagHUD = TRUE
antagHUD = !antagHUD
plane_holder.set_vis(VIS_CH_SPECIAL, antagHUD)
to_chat(src,"<font color='blue'><B>AntagHUD [antagHUD ? "Enabled" : "Disabled"]</B></font>")
/mob/observer/dead/proc/dead_tele(var/area/A in return_sorted_areas())
set category = "Ghost"
@@ -433,7 +381,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(check_rights(R_ADMIN|R_FUN, 0, src))
return 0
return (T && T.holy) && (invisibility <= SEE_INVISIBLE_LIVING || (mind in cult.current_antagonists))
return (T && T.holy) && (is_manifest || (mind in cult.current_antagonists))
/mob/observer/dead/verb/jumptomob(target in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"
@@ -665,18 +613,16 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 1
/mob/observer/dead/proc/manifest(mob/user)
is_manifest = 0
if(!is_manifest)
is_manifest = 1
verbs += /mob/observer/dead/proc/toggle_visibility
verbs += /mob/observer/dead/proc/ghost_whisper
src << "<font color='purple'>As you are now in the realm of the living, you can whisper to the living with the <b>Spectral Whisper</b> verb, inside the IC tab.</font>"
if(src.invisibility != 0)
is_manifest = TRUE
verbs |= /mob/observer/dead/proc/toggle_visibility
verbs |= /mob/observer/dead/proc/ghost_whisper
to_chat(src,"<font color='purple'>As you are now in the realm of the living, you can whisper to the living with the <b>Spectral Whisper</b> verb, inside the IC tab.</font>")
if(plane != PLANE_WORLD)
user.visible_message( \
"<span class='warning'>\The [user] drags ghost, [src], to our plane of reality!</span>", \
"<span class='warning'>You drag [src] to our plane of reality!</span>" \
)
toggle_visibility(1)
toggle_visibility(TRUE)
else
user.visible_message ( \
"<span class='warning'>\The [user] just tried to smash \his book into that ghost! It's not very effective.</span>", \
@@ -703,17 +649,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set desc = "Allows you to turn (in)visible (almost) at will."
var/toggled_invisible
if(!forced && invisibility && world.time < toggled_invisible + 600)
if(!forced && plane == PLANE_GHOSTS && world.time < toggled_invisible + 600)
src << "You must gather strength before you can turn visible again..."
return
if(invisibility == 0)
if(plane == PLANE_WORLD)
toggled_invisible = world.time
visible_message("<span class='emote'>It fades from sight...</span>", "<span class='info'>You are now invisible.</span>")
else
src << "<span class='info'>You are now visible!</span>"
invisibility = invisibility == INVISIBILITY_OBSERVER ? 0 : INVISIBILITY_OBSERVER
plane = PLANE_GHOSTS ? PLANE_WORLD : PLANE_GHOSTS
// Give the ghost a cult icon which should be visible only to itself
toggle_icon("cult")
@@ -738,41 +685,21 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Toggle Ghost Vision"
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
set category = "Ghost"
ghostvision = !(ghostvision)
ghostvision = !ghostvision
updateghostsight()
usr << "You [(ghostvision?"now":"no longer")] have ghost vision."
to_chat(src,"You [ghostvision ? "now" : "no longer"] have ghost vision.")
/mob/observer/dead/verb/toggle_darkness()
set name = "Toggle Darkness"
set desc = "Toggles your ability to see lighting overlays, and the darkness they create."
set category = "Ghost"
seedarkness = !(seedarkness)
seedarkness = !seedarkness
updateghostsight()
to_chat(src,"You [seedarkness ? "now" : "no longer"] see darkness.")
/mob/observer/dead/proc/updateghostsight()
if (!seedarkness)
see_invisible = SEE_INVISIBLE_NOLIGHTING
else
see_invisible = SEE_INVISIBLE_OBSERVER
if (!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING;
updateghostimages()
/proc/updateallghostimages()
for (var/mob/observer/dead/O in player_list)
O.updateghostimages()
/mob/observer/dead/proc/updateghostimages()
if (!client)
return
if (seedarkness || !ghostvision)
client.images -= ghost_darkness_images
client.images |= ghost_sightless_images
else
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
client.images -= ghost_sightless_images
client.images |= ghost_darkness_images
if (ghostimage)
client.images -= ghostimage //remove ourself
plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness) //Inversion, because "not seeing" the darkness is "seeing" the lighting plane master.
plane_holder.set_vis(VIS_GHOSTS, ghostvision)
mob/observer/dead/MayRespawn(var/feedback = 0)
if(!client)
+2 -15
View File
@@ -16,7 +16,7 @@
see_in_dark = 7
status_flags = GODMODE
invisibility = INVISIBILITY_EYE
plane = PLANE_AI_EYE
var/mob/owner = null
var/list/visibleChunks = list()
@@ -24,20 +24,7 @@
var/ghostimage = null
var/datum/visualnet/visualnet
/mob/observer/eye/New()
ghostimage = image(src.icon,src,src.icon_state)
ghost_darkness_images |= ghostimage //so ghosts can see the eye when they disable darkness
ghost_sightless_images |= ghostimage //so ghosts can see the eye when they disable ghost sight
updateallghostimages()
..()
mob/observer/eye/Destroy()
if (ghostimage)
ghost_darkness_images -= ghostimage
ghost_sightless_images -= ghostimage
qdel(ghostimage)
ghostimage = null
updateallghostimages()
/mob/observer/eye/Destroy()
if(owner)
if(owner.eyeobj == src)
owner.eyeobj = null
+2 -2
View File
@@ -122,7 +122,7 @@ var/list/slot_equipment_priority = list( \
if(!W)
return 0
W.forceMove(get_turf(src))
W.layer = initial(W.layer)
W.reset_plane_and_layer()
W.dropped()
return 0
@@ -198,7 +198,7 @@ var/list/slot_equipment_priority = list( \
src.u_equip(O)
if (src.client)
src.client.screen -= O
O.layer = initial(O.layer)
O.reset_plane_and_layer()
O.screen_loc = null
if(istype(O, /obj/item))
var/obj/item/I = O
+1 -1
View File
@@ -87,7 +87,7 @@
visible_message("<span class='warning'>[src] is trying to inject [H]!</span>")
if(declare_treatment)
var/area/location = get_area(src)
broadcast_medical_hud_message("[src] is treating <b>[H]</b> in <b>[location]</b>", src)
global_announcer.autosay("[src] is treating <b>[H]</b> in <b>[location]</b>", "[src]", "Medical")
busy = 1
update_icons()
if(do_mob(src, H, 30))
+3 -3
View File
@@ -153,7 +153,7 @@
/mob/living/bot/secbot/proc/react_to_attack(mob/attacker)
if(!target)
playsound(src.loc, pick(threat_found_sounds), 50)
broadcast_security_hud_message("[src] was attacked by a hostile <b>[target_name(attacker)]</b> in <b>[get_area(src)]</b>.", src)
global_announcer.autosay("[src] was attacked by a hostile <b>[target_name(attacker)]</b> in <b>[get_area(src)]</b>.", "[src]", "Security")
target = attacker
awaiting_surrender = INFINITY // Don't try and wait for surrender
@@ -161,7 +161,7 @@
/mob/living/bot/secbot/proc/demand_surrender(mob/target, var/threat)
var/suspect_name = target_name(target)
if(declare_arrests)
broadcast_security_hud_message("[src] is [arrest_type ? "detaining" : "arresting"] a level [threat] suspect <b>[suspect_name]</b> in <b>[get_area(src)]</b>.", src)
global_announcer.autosay("[src] is [arrest_type ? "detaining" : "arresting"] a level [threat] suspect <b>[suspect_name]</b> in <b>[get_area(src)]</b>.", "[src]", "Security")
say("Down on the floor, [suspect_name]! You have [SECBOT_WAIT_TIME] seconds to comply.")
playsound(src.loc, pick(preparing_arrest_sounds), 50)
// Register to be told when the target moves
@@ -214,7 +214,7 @@
var/action = arrest_type ? "detaining" : "arresting"
if(istype(target, /mob/living/simple_animal))
action = "fighting"
broadcast_security_hud_message("[src] is [action] a level [threat] [action != "fighting" ? "suspect" : "threat"] <b>[target_name(target)]</b> in <b>[get_area(src)]</b>.", src)
global_announcer.autosay("[src] is [action] a level [threat] [action != "fighting" ? "suspect" : "threat"] <b>[target_name(target)]</b> in <b>[get_area(src)]</b>.", "[src]", "Security")
UnarmedAttack(target)
// So Beepsky talks while beating up simple mobs.
+1 -20
View File
@@ -37,26 +37,7 @@
nutrition = rand(200,400)
hud_list[HEALTH_HUD] = new /image/hud_overlay('icons/mob/hud_med.dmi', src, "100")
if(isSynthetic())
hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudrobo")
hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudrobo")
else
hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy")
//VOREStation Add - Custom HUDs
hud_list[HEALTH_VR_HUD] = new /image/hud_overlay('icons/mob/hud_med_vr.dmi', src, "100")
hud_list[STATUS_R_HUD] = new /image/hud_overlay('icons/mob/hud_vr.dmi', src, "hudhealthy")
hud_list[BACKUP_HUD] = new /image/hud_overlay('icons/mob/hud_vr.dmi', src, "hudblank")
hud_list[VANTAG_HUD] = new /image/hud_overlay('icons/mob/hud_vr.dmi', src, "hudblank")
//VOREStation Add End
hud_list[ID_HUD] = new /image/hud_overlay(using_map.id_hud_icons, src, "hudunknown")
hud_list[WANTED_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD_OOC] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy")
make_hud_overlays()
human_mob_list |= src
..()
@@ -76,6 +76,7 @@
var/icon/stand_icon = null
var/icon/lying_icon = null
var/icon/hud_icon = null
var/voice = "" //Instead of new say code calling GetVoice() over and over and over, we're just going to ask this variable, which gets updated in Life()
@@ -106,6 +107,8 @@
can_be_antagged = TRUE
var/has_huds = TRUE //Do they have all the fancy life huds? Not for mannequins.
// Used by mobs in virtual reality to point back to the "real" mob the client belongs to.
var/mob/living/carbon/human/vr_holder = null
// Used by "real" mobs after they leave a VR session
@@ -108,6 +108,58 @@
return FBP_NONE
/mob/living/carbon/human/proc/make_hud_overlays()
hud_list[HEALTH_HUD] = gen_hud_image(ingame_hud_med, src, "100", plane = PLANE_CH_HEALTH)
if(isSynthetic())
hud_list[STATUS_HUD] = gen_hud_image(ingame_hud, src, "hudrobo", plane = PLANE_CH_STATUS)
hud_list[LIFE_HUD] = gen_hud_image(ingame_hud, src, "hudrobo", plane = PLANE_CH_LIFE)
else
hud_list[STATUS_HUD] = gen_hud_image(ingame_hud, src, "hudhealthy", plane = PLANE_CH_STATUS)
hud_list[LIFE_HUD] = gen_hud_image(ingame_hud, src, "hudhealthy", plane = PLANE_CH_LIFE)
hud_list[ID_HUD] = gen_hud_image(using_map.id_hud_icons, src, "hudunknown", plane = PLANE_CH_ID)
hud_list[WANTED_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_WANTED)
hud_list[IMPLOYAL_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_IMPLOYAL)
hud_list[IMPCHEM_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_IMPCHEM)
hud_list[IMPTRACK_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_IMPTRACK)
hud_list[SPECIALROLE_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_SPECIAL)
hud_list[STATUS_HUD_OOC] = gen_hud_image(ingame_hud, src, "hudhealthy", plane = PLANE_CH_STATUS_OOC)
/mob/living/carbon/human/recalculate_vis()
if(!vis_enabled || !plane_holder)
return
//These things are allowed to add vision flags.
//If you code some crazy item that goes on your feet that lets you see ghosts, you need to add a slot here.
var/tmp/list/slots = list(slot_glasses,slot_head)
var/tmp/list/compiled_vis = list()
for(var/slot in slots)
var/obj/item/clothing/O = get_equipped_item(slot) //Change this type if you move the vision stuff to item or something.
if(O && O.enables_planes && (slot in O.plane_slots))
compiled_vis |= O.enables_planes
//VOREStation Add - NIF Support
if(nif)
compiled_vis |= nif.planes_visible
//VOREStation Add End
if(!compiled_vis.len && !vis_enabled.len)
return //Nothin' doin'.
var/tmp/list/oddities = vis_enabled ^ compiled_vis
if(!oddities.len)
return //Same thing in both lists!
var/tmp/list/to_enable = oddities - vis_enabled
var/tmp/list/to_disable = oddities - compiled_vis
for(var/vis in to_enable)
plane_holder.set_vis(vis,TRUE)
vis_enabled += vis
for(var/vis in to_disable)
plane_holder.set_vis(vis,FALSE)
vis_enabled -= vis
#undef HUMAN_EATING_NO_ISSUE
#undef HUMAN_EATING_NO_MOUTH
#undef HUMAN_EATING_BLOCKED_MOUTH
@@ -1,6 +1,7 @@
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
status_flags = GODMODE|CANPUSH
has_huds = FALSE
/mob/living/carbon/human/dummy/mannequin/New()
..()
@@ -231,7 +231,7 @@ This saves us from having to call add_fingerprint() any time something is put in
var/obj/item/clothing/ears/offear/O = new(W)
O.loc = src
src.r_ear = O
O.layer = 20
O.hud_layerise()
W.equipped(src, slot)
update_inv_ears(redraw_mob)
if(slot_r_ear)
@@ -240,7 +240,7 @@ This saves us from having to call add_fingerprint() any time something is put in
var/obj/item/clothing/ears/offear/O = new(W)
O.loc = src
src.l_ear = O
O.layer = 20
O.hud_layerise()
W.equipped(src, slot)
update_inv_ears(redraw_mob)
if(slot_glasses)
@@ -303,7 +303,7 @@ This saves us from having to call add_fingerprint() any time something is put in
src.r_hand = null
update_inv_r_hand()
W.layer = 20
W.hud_layerise()
if(W.action_button_name)
update_action_buttons()
+7 -21
View File
@@ -1217,6 +1217,7 @@
var/mutable_appearance/healths_ma = new(healths)
healths_ma.icon_state = "blank"
healths_ma.overlays = null
healths_ma.plane = PLANE_PLAYER_HUD
var/no_damage = 1
var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
@@ -1382,29 +1383,13 @@
client.screen |= G.overlay
if(G.vision_flags)
sight |= G.vision_flags
if(!druggy && !seer)
see_invisible = SEE_INVISIBLE_MINIMUM
if(G.see_invisible >= 0)
see_invisible = G.see_invisible
if(istype(G,/obj/item/clothing/glasses/night) && !seer)
see_invisible = SEE_INVISIBLE_MINIMUM
/* HUD shit goes here, as long as it doesn't modify sight flags */
// The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl
var/obj/item/clothing/glasses/hud/O = G
//VOREStation Add - Support for omnihud glasses
if(istype(G, /obj/item/clothing/glasses/omnihud))
var/obj/item/clothing/glasses/omnihud/S = G
O = S.hud
//VOREStation Add End
else if(istype(G, /obj/item/clothing/glasses/sunglasses/sechud)) //VOREStation Edit - Added else
var/obj/item/clothing/glasses/sunglasses/sechud/S = G
O = S.hud
else if(istype(G, /obj/item/clothing/glasses/sunglasses/medhud)) //VOREStation Edit - Added else
var/obj/item/clothing/glasses/sunglasses/medhud/M = G
O = M.hud
if(istype(O))
O.process_hud(src)
if(!druggy && !seer) see_invisible = SEE_INVISIBLE_LIVING
if(G.see_invisible >= 0)
see_invisible = G.see_invisible
else if(!druggy && !seer)
see_invisible = SEE_INVISIBLE_LIVING
/mob/living/carbon/human/handle_random_events()
if(inStasisNow())
@@ -1733,6 +1718,7 @@
hud_list[SPECIALROLE_HUD] = holder
attempt_vr(src,"handle_hud_list_vr",list()) //VOREStation Add - Custom HUDs.
hud_updateflag = 0
update_icons()
/mob/living/carbon/human/handle_stunned()
if(!can_feel_pain())
@@ -152,14 +152,20 @@ Please contact me on #coderbus IRC. ~Carn x
update_hud() //TODO: remove the need for this
overlays.Cut()
if (icon_update)
icon = stand_icon
for(var/entry in overlays_standing)
if(istype(entry, /image))
overlays += entry
else if(istype(entry, /list))
for(var/inner_entry in entry)
overlays += inner_entry
icon = icon('icons/effects/effects.dmi', "icon_state"="nothing")
if(has_huds)
for(var/I in hud_list)
overlays += I
overlays += backplane
overlays += stand_icon
for(var/entry in overlays_standing)
if(istype(entry, /image))
overlays += entry
else if(istype(entry, /list))
for(var/inner_entry in entry)
overlays += inner_entry
if(species && species.has_floating_eyes)
overlays |= species.get_eyes(src)
-10
View File
@@ -172,16 +172,6 @@ var/list/ai_verbs_default = list(
spawn(5)
new /obj/machinery/ai_powersupply(src)
hud_list[HEALTH_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[ID_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[WANTED_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
ai_list += src
..()
return
@@ -150,11 +150,6 @@
process_queued_alarms()
handle_regular_hud_updates()
switch(src.sensor_mode)
if (SEC_HUD)
process_sec_hud(src,0,src.eyeobj)
if (MED_HUD)
process_med_hud(src,0,src.eyeobj)
/mob/living/silicon/ai/proc/lacks_power()
if(APU_power)
+1 -7
View File
@@ -15,12 +15,6 @@
handle_regular_hud_updates()
if(src.secHUD == 1)
process_sec_hud(src, 1)
if(src.medHUD == 1)
process_med_hud(src, 1)
if(silence_time)
if(world.timeofday >= silence_time)
silence_time = null
@@ -31,7 +25,7 @@
if(health <= 0)
death(null,"gives one shrill beep before falling lifeless.")
/mob/living/silicon/pai/updatehealth()
if(status_flags & GODMODE)
@@ -231,21 +231,21 @@
return
if(!module_state_1)
module_state_1 = O
O.layer = 20
O.hud_layerise()
O.screen_loc = inv1.screen_loc
contents += O
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode |= module_state_1:sight_mode
else if(!module_state_2)
module_state_2 = O
O.layer = 20
O.hud_layerise()
O.screen_loc = inv2.screen_loc
contents += O
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode |= module_state_2:sight_mode
else if(!module_state_3)
module_state_3 = O
O.layer = 20
O.hud_layerise()
O.screen_loc = inv3.screen_loc
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
@@ -191,16 +191,6 @@
..()
var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src)
if(hud && hud.hud)
hud.hud.process_hud(src)
else
switch(src.sensor_mode)
if (SEC_HUD)
process_sec_hud(src,0)
if (MED_HUD)
process_med_hud(src,0)
if (src.healths)
if (src.stat != 2)
if(istype(src,/mob/living/silicon/robot/drone))
+12 -13
View File
@@ -109,7 +109,6 @@
robot_modules_background = new()
robot_modules_background.icon_state = "block"
robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it.
ident = rand(1, 999)
module_sprites["Basic"] = "robot"
icontype = "Basic"
@@ -151,15 +150,15 @@
add_robot_verbs()
hud_list[HEALTH_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[ID_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[WANTED_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPLOYAL_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPCHEM_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank")
hud_list[HEALTH_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_HEALTH)
hud_list[STATUS_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudhealth100", plane = PLANE_CH_STATUS)
hud_list[LIFE_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudhealth100", plane = PLANE_CH_LIFE)
hud_list[ID_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_ID)
hud_list[WANTED_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_WANTED)
hud_list[IMPLOYAL_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_IMPLOYAL)
hud_list[IMPCHEM_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_IMPCHEM)
hud_list[IMPTRACK_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_IMPTRACK)
hud_list[SPECIALROLE_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_SPECIAL)
/mob/living/silicon/robot/proc/init()
aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src)
@@ -812,19 +811,19 @@
return 1
if(!module_state_1)
module_state_1 = O
O.layer = 20
O.hud_layerise()
contents += O
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode |= module_state_1:sight_mode
else if(!module_state_2)
module_state_2 = O
O.layer = 20
O.hud_layerise()
contents += O
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode |= module_state_2:sight_mode
else if(!module_state_3)
module_state_3 = O
O.layer = 20
O.hud_layerise()
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode |= module_state_3:sight_mode
+39 -9
View File
@@ -18,8 +18,6 @@
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
var/local_transmit //If set, can only speak to others of the same type within a short range.
var/sensor_mode = 0 //Determines the current HUD.
var/next_alarm_notice
var/list/datum/alarm/queued_alarms = new()
@@ -238,17 +236,49 @@
return
/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","Disable")
switch(sensor_type)
if ("Security")
sensor_mode = SEC_HUD
src << "<span class='notice'>Security records overlay enabled.</span>"
if(plane_holder)
//Enable Security planes
plane_holder.set_vis(VIS_CH_ID,TRUE)
plane_holder.set_vis(VIS_CH_WANTED,TRUE)
plane_holder.set_vis(VIS_CH_IMPLOYAL,TRUE)
plane_holder.set_vis(VIS_CH_IMPTRACK,TRUE)
plane_holder.set_vis(VIS_CH_IMPCHEM,TRUE)
//Disable Medical planes
plane_holder.set_vis(VIS_CH_STATUS,FALSE)
plane_holder.set_vis(VIS_CH_HEALTH,FALSE)
to_chat(src,"<span class='notice'>Security records overlay enabled.</span>")
if ("Medical")
sensor_mode = MED_HUD
src << "<span class='notice'>Life signs monitor overlay enabled.</span>"
if(plane_holder)
//Disable Security planes
plane_holder.set_vis(VIS_CH_ID,FALSE)
plane_holder.set_vis(VIS_CH_WANTED,FALSE)
plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE)
plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE)
plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE)
//Enable Medical planes
plane_holder.set_vis(VIS_CH_STATUS,TRUE)
plane_holder.set_vis(VIS_CH_HEALTH,TRUE)
to_chat(src,"<span class='notice'>Life signs monitor overlay enabled.</span>")
if ("Disable")
sensor_mode = 0
src << "Sensor augmentations disabled."
if(plane_holder)
//Disable Security planes
plane_holder.set_vis(VIS_CH_ID,FALSE)
plane_holder.set_vis(VIS_CH_WANTED,FALSE)
plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE)
plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE)
plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE)
//Disable Medical planes
plane_holder.set_vis(VIS_CH_STATUS,FALSE)
plane_holder.set_vis(VIS_CH_HEALTH,FALSE)
to_chat(src,"Sensor augmentations disabled.")
/mob/living/silicon/verb/pose()
set name = "Set Pose"
+7
View File
@@ -47,5 +47,12 @@
client.perspective = MOB_PERSPECTIVE
reload_fullscreen() // Reload any fullscreen overlays this mob has.
add_click_catcher()
if(!plane_holder) //Lazy
plane_holder = new(src) //Not a location, it takes it and saves it.
vis_enabled = list()
client.screen += plane_holder.plane_masters
recalculate_vis()
//set macro to normal incase it was overriden (like cyborg currently does)
winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")
+1
View File
@@ -13,6 +13,7 @@
if(mind && mind.current == src)
spellremove(src)
ghostize()
qdel_null(plane_holder)
..()
return QDEL_HINT_HARDDEL_NOW
+3
View File
@@ -34,6 +34,9 @@
var/obj/screen/wizard/energy/wiz_energy_display = null
var/obj/screen/wizard/instability/wiz_instability_display = null
var/datum/plane_holder/plane_holder = null
var/list/vis_enabled = null
//spells hud icons - this interacts with add_spell and remove_spell
var/list/obj/screen/movable/spell_master/spell_masters = null
var/obj/screen/movable/ability_master/ability_master = null
+19 -13
View File
@@ -355,19 +355,6 @@ proc/is_blind(A)
return 1
return 0
/proc/broadcast_security_hud_message(var/message, var/broadcast_source)
broadcast_hud_message(message, broadcast_source, sec_hud_users, /obj/item/clothing/glasses/hud/security)
/proc/broadcast_medical_hud_message(var/message, var/broadcast_source)
broadcast_hud_message(message, broadcast_source, med_hud_users, /obj/item/clothing/glasses/hud/health)
/proc/broadcast_hud_message(var/message, var/broadcast_source, var/list/targets, var/icon)
var/atom/sourceturf = isarea(broadcast_source) ? broadcast_source : get_turf(broadcast_source) // VOREStation Edit - Allow broadcasts from an area
for(var/mob/M in targets)
var/turf/targetturf = get_turf(M)
if((targetturf.z == sourceturf.z))
M.show_message("<span class='info'>\icon[icon] [message]</span>", 1)
/proc/mobs_in_area(var/area/A)
var/list/mobs = new
for(var/mob/living/M in mob_list)
@@ -616,3 +603,22 @@ var/list/global/organ_rel_size = list(
/mob/proc/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
return
//Recalculates what planes this mob can see using their plane_holder, for humans this is checking slots, for others, could be whatever.
/mob/proc/recalculate_vis()
return
//General HUD updates done regularly (health puppet things, etc)
/mob/proc/handle_regular_hud_updates()
return
//Icon is used to occlude things like huds from the faulty byond context menu.
// http://www.byond.com/forum/?post=2336679
var/global/image/backplane
/hook/startup/proc/generate_backplane()
backplane = image('icons/misc/win32.dmi')
backplane.alpha = 0
backplane.plane = -100
backplane.mouse_opacity = 0
return TRUE
+178
View File
@@ -0,0 +1,178 @@
//////////////////////////////////////////////
// These planemaster objects are created on mobs when a client logs into them (lazy). We'll use them to adjust the visibility of objects, among other things.
//
/datum/plane_holder
var/mob/my_mob
var/list/plane_masters[VIS_COUNT]
/datum/plane_holder/New(mob/this_guy)
my_mob = this_guy
//It'd be nice to lazy init these but some of them are important to just EXIST. Like without ghost planemaster, you can see ghosts. Go figure.
plane_masters[VIS_FULLBRIGHT] = new /obj/screen/plane_master/fullbright //Lighting system (lighting_overlay objects)
plane_masters[VIS_GHOSTS] = new /obj/screen/plane_master/ghosts //Ghosts!
plane_masters[VIS_AI_EYE] = new /obj/screen/plane_master{plane = PLANE_AI_EYE} //AI Eye!
plane_masters[VIS_CH_STATUS] = new /obj/screen/plane_master{plane = PLANE_CH_STATUS} //Status is the synth/human icon left side of medhuds
plane_masters[VIS_CH_HEALTH] = new /obj/screen/plane_master{plane = PLANE_CH_HEALTH} //Health bar
plane_masters[VIS_CH_LIFE] = new /obj/screen/plane_master{plane = PLANE_CH_LIFE} //Alive-or-not icon
plane_masters[VIS_CH_ID] = new /obj/screen/plane_master{plane = PLANE_CH_ID} //Job ID icon
plane_masters[VIS_CH_WANTED] = new /obj/screen/plane_master{plane = PLANE_CH_WANTED} //Wanted status
plane_masters[VIS_CH_IMPLOYAL] = new /obj/screen/plane_master{plane = PLANE_CH_IMPLOYAL} //Loyalty implants
plane_masters[VIS_CH_IMPTRACK] = new /obj/screen/plane_master{plane = PLANE_CH_IMPTRACK} //Tracking implants
plane_masters[VIS_CH_IMPCHEM] = new /obj/screen/plane_master{plane = PLANE_CH_IMPCHEM} //Chemical implants
plane_masters[VIS_CH_SPECIAL] = new /obj/screen/plane_master{plane = PLANE_CH_SPECIAL} //"Special" role stuff
plane_masters[VIS_CH_STATUS_OOC]= new /obj/screen/plane_master{plane = PLANE_CH_STATUS_OOC} //OOC status HUD
plane_masters[VIS_ADMIN1] = new /obj/screen/plane_master{plane = PLANE_ADMIN1} //For admin use
plane_masters[VIS_ADMIN2] = new /obj/screen/plane_master{plane = PLANE_ADMIN2} //For admin use
plane_masters[VIS_ADMIN3] = new /obj/screen/plane_master{plane = PLANE_ADMIN3} //For admin use
plane_masters[VIS_D_COLORBLIND] = new /obj/screen/plane_master/colorblindness //Colorblindness (affects world)
plane_masters[VIS_D_COLORBLINDI]= new /obj/screen/plane_master/colorblindness/items //Colorblindness (items in HUD, subplane of above, don't toggle)
..()
/datum/plane_holder/Destroy()
if(my_mob)
my_mob.plane_holder = null
my_mob = null
plane_masters.Cut() //Goodbye my children, be free
..() //We will get qdel'd, as there will not be references to us, then our planelets will disappear on their own.
/datum/plane_holder/proc/set_vis(var/which = null, var/state = FALSE)
ASSERT(which)
var/obj/screen/plane_master/PM = plane_masters[which]
if(!PM)
crash_with("Tried to alter [which] in plane_holder on [my_mob]!")
PM.set_visibility(state)
if(PM.sub_planes)
var/list/subplanes = PM.sub_planes
for(var/SP in subplanes)
set_vis(which = SP, state = state)
/datum/plane_holder/proc/set_desired_alpha(var/which = null, var/new_alpha)
ASSERT(which)
var/obj/screen/plane_master/PM = plane_masters[which]
if(!PM)
crash_with("Tried to alter [which] in plane_holder on [my_mob]!")
PM.set_desired_alpha(new_alpha)
if(PM.sub_planes)
var/list/subplanes = PM.sub_planes
for(var/SP in subplanes)
set_vis(which = SP, new_alpha = new_alpha)
////////////////////
// The Plane Master
////////////////////
/obj/screen/plane_master
screen_loc = "1,1"
plane = -100 //Dodge just in case someone instantiates one of these accidentally, don't end up on 0 with plane_master
appearance_flags = PLANE_MASTER
mouse_opacity = 0 //Normally unclickable
alpha = 0 //Hidden from view
var/desired_alpha = 255 //What we go to when we're enabled
var/invis_toggle = FALSE
var/list/sub_planes
/obj/screen/plane_master/proc/set_desired_alpha(var/new_alpha)
if(new_alpha != alpha && new_alpha > 0 && new_alpha <= 255)
desired_alpha = new_alpha
if(alpha) //If we're already visible, update it now.
alpha = new_alpha
/obj/screen/plane_master/proc/set_visibility(var/want = FALSE)
//Invisibility-managed
if(invis_toggle)
if(want && invisibility)
invisibility = 0 //Does not need a mouse_opacity toggle because these are for effects
else if(!want && !invisibility)
invisibility = 101
//Alpha-managed
else
if(want && !alpha)
alpha = desired_alpha
mouse_opacity = 1 //Not bool, don't replace with true/false
else if(!want && alpha)
alpha = 0
mouse_opacity = 0
/obj/screen/plane_master/proc/set_alpha(var/new_alpha = 255)
if(new_alpha != alpha)
new_alpha = sanitize_integer(new_alpha, 0, 255, 255)
alpha = new_alpha
////////////////////
// Special masters
////////////////////
/////////////////
//Lighting is weird and has matrix shenanigans. Think of this as turning on/off darkness.
/obj/screen/plane_master/fullbright
plane = PLANE_LIGHTING
layer = LIGHTING_LAYER
color = null //To break lighting when visible (this is sorta backwards)
alpha = 255 //Starts full opaque
invisibility = 101 //But invisible
invis_toggle = TRUE
/////////////////
//Ghosts has a special alpha level
/obj/screen/plane_master/ghosts
plane = PLANE_GHOSTS
desired_alpha = 127 //When enabled, they're like half-transparent
//'Normal'ness v v v
//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B
#define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11)
#define MATRIX_Protanopia list(0.57, 0.43, 0, 0.56, 0.44, 0, 0, 0.24, 0.76)
#define MATRIX_Protanomaly list(0.82, 0.18, 0, 0.33, 0.67, 0, 0, 0.13, 0.88)
#define MATRIX_Deuteranopia list(0.63, 0.38, 0, 0.70, 0.30, 0, 0, 0.30, 0.70)
#define MATRIX_Deuteranomaly list(0.80, 0.20, 0, 0.26, 0.74, 0, 0, 0.14, 0.86)
#define MATRIX_Tritanopia list(0.95, 0.05, 0, 0, 0.43, 0.57, 0, 0.48, 0.53)
#define MATRIX_Tritanomaly list(0.97, 0.03, 0, 0, 0.73, 0.27, 0, 0.18, 0.82)
#define MATRIX_Achromatopsia list(0.30, 0.59, 0.11, 0.30, 0.59, 0.11, 0.30, 0.59, 0.11)
#define MATRIX_Achromatomaly list(0.62, 0.32, 0.06, 0.16, 0.78, 0.06, 0.16, 0.32, 0.52)
#define MATRIX_Vulp_Colorblind list(0.50, 0.40, 0.10, 0.50, 0.40, 0.10, 0, 0.20, 0.80)
#define MATRIX_Taj_Colorblind list(0.40, 0.20, 0.40, 0.40, 0.60, 0, 0.20, 0.20, 0.60)
/////////////////
//Colorblindness uses special color shenanigans
/obj/screen/plane_master/colorblindness
plane = PLANE_WORLD //Affects the main game world
color = MATRIX_Monochromia
alpha = 255 //Starts out nice and opaque
invisibility = 101 //Can't see it usually
mouse_opacity = 1 //Don't make entire world not visible pls
invis_toggle = TRUE
sub_planes = list(VIS_D_COLORBLINDI)
var/list/varieties = list(
"Monochromia" = MATRIX_Monochromia,
"Protanopia" = MATRIX_Protanopia,
"Protanomaly" = MATRIX_Protanomaly,
"Deuteranopia" = MATRIX_Deuteranopia,
"Deuteranomaly" = MATRIX_Deuteranomaly,
"Tritanopia" = MATRIX_Tritanopia,
"Tritanomaly" = MATRIX_Tritanomaly,
"Achromatopsia" = MATRIX_Achromatopsia,
"Achromatomaly" = MATRIX_Achromatomaly,
"Paradise Vulp" = MATRIX_Vulp_Colorblind,
"Paradise Taj" = MATRIX_Taj_Colorblind
)
/obj/screen/plane_master/colorblindness/proc/set_variety(var/which = null)
var/new_type = varieties[which]
if(!new_type) return
color = new_type
/obj/screen/plane_master/colorblindness/proc/debug_variety()
var/choice = input(usr,"Pick a type of colorblindness","Which?") as null|anything in varieties
if(choice)
color = varieties[choice]
/obj/screen/plane_master/colorblindness/items
plane = PLANE_PLAYER_HUD_ITEMS
sub_planes = null
+2 -2
View File
@@ -448,13 +448,13 @@
else if (h_user.l_store == src)
h_user.drop_from_inventory(src)
B.loc = h_user
B.layer = 20
B.hud_layerise()
h_user.l_store = B
h_user.update_inv_pockets()
else if (h_user.r_store == src)
h_user.drop_from_inventory(src)
B.loc = h_user
B.layer = 20
B.hud_layerise()
h_user.r_store = B
h_user.update_inv_pockets()
else if (h_user.head == src)
+2
View File
@@ -131,6 +131,7 @@ var/global/photo_count = 0
var/icon_on = "camera"
var/icon_off = "camera_off"
var/size = 3
var/picture_planes = list(PLANE_WORLD)
/obj/item/device/camera/verb/change_size()
set name = "Set Photo Focus"
@@ -181,6 +182,7 @@ var/global/photo_count = 0
// As well as anything that isn't invisible.
for(var/atom/A in the_turf)
if(A.invisibility) continue
if(!(A.plane in picture_planes)) continue
atoms.Add(A)
// Sort the atoms into their layers