Merge branch 'master' into upstream-merge-38116
This commit is contained in:
@@ -379,7 +379,7 @@
|
||||
|
||||
/mob/living/proc/unequip_everything()
|
||||
var/list/items = list()
|
||||
items |= get_equipped_items()
|
||||
items |= get_equipped_items(TRUE)
|
||||
for(var/I in items)
|
||||
dropItemToGround(I)
|
||||
drop_all_held_items()
|
||||
|
||||
@@ -674,23 +674,6 @@
|
||||
else
|
||||
to_chat(C, "<span class='unconscious'>You feel a breath of fresh air... which is a sensation you don't recognise...</span>")
|
||||
|
||||
/mob/living/carbon/human/generateStaticOverlay()
|
||||
var/image/staticOverlay = image(icon('icons/effects/effects.dmi', "static"), loc = src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["static"] = staticOverlay
|
||||
|
||||
staticOverlay = image(icon('icons/effects/effects.dmi', "blank"), loc = src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["blank"] = staticOverlay
|
||||
|
||||
staticOverlay = getLetterImage(src, "H", 1)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["letter"] = staticOverlay
|
||||
|
||||
staticOverlay = getRandomAnimalImage(src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["animal"] = staticOverlay
|
||||
|
||||
/mob/living/carbon/human/cuff_resist(obj/item/I)
|
||||
if(dna && dna.check_mutation(HULK))
|
||||
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
/mob/living/Initialize()
|
||||
. = ..()
|
||||
generateStaticOverlay()
|
||||
if(staticOverlays.len)
|
||||
for(var/mob/living/simple_animal/drone/D in GLOB.player_list)
|
||||
if(D && D.seeStatic)
|
||||
if(D.staticChoice in staticOverlays)
|
||||
D.staticOverlays |= staticOverlays[D.staticChoice]
|
||||
D.client.images |= staticOverlays[D.staticChoice]
|
||||
else //no choice? force static
|
||||
D.staticOverlays |= staticOverlays["static"]
|
||||
D.client.images |= staticOverlays["static"]
|
||||
if(unique_name)
|
||||
name = "[name] ([rand(1, 1000)])"
|
||||
real_name = name
|
||||
@@ -40,47 +30,14 @@
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob(src,force=1)
|
||||
|
||||
for(var/mob/living/simple_animal/drone/D in GLOB.player_list)
|
||||
for(var/image/I in staticOverlays)
|
||||
D.staticOverlays.Remove(I)
|
||||
D.client.images.Remove(I)
|
||||
qdel(I)
|
||||
staticOverlays.len = 0
|
||||
remove_from_all_data_huds()
|
||||
GLOB.mob_living_list -= src
|
||||
QDEL_LIST(diseases)
|
||||
return ..()
|
||||
|
||||
/mob/living/ghostize(can_reenter_corpse = 1)
|
||||
var/prev_client = client
|
||||
. = ..()
|
||||
if(.)
|
||||
if(ranged_ability && prev_client)
|
||||
ranged_ability.remove_mousepointer(prev_client)
|
||||
|
||||
|
||||
/mob/living/proc/OpenCraftingMenu()
|
||||
return
|
||||
|
||||
/mob/living/proc/generateStaticOverlay()
|
||||
staticOverlays.Add(list("static", "blank", "letter", "animal"))
|
||||
var/image/staticOverlay = image(getStaticIcon(new/icon(icon,icon_state)), loc = src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["static"] = staticOverlay
|
||||
|
||||
staticOverlay = image(getBlankIcon(new/icon(icon, icon_state)), loc = src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["blank"] = staticOverlay
|
||||
|
||||
staticOverlay = getLetterImage(src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["letter"] = staticOverlay
|
||||
|
||||
staticOverlay = getRandomAnimalImage(src)
|
||||
staticOverlay.override = 1
|
||||
staticOverlays["animal"] = staticOverlay
|
||||
|
||||
|
||||
//Generic Collide(). Override MobCollide() and ObjCollide() instead of this.
|
||||
/mob/living/Collide(atom/A)
|
||||
if(..()) //we are thrown onto something
|
||||
@@ -1184,6 +1141,11 @@
|
||||
clear_fullscreen("remote_view", 0)
|
||||
update_pipe_vision()
|
||||
|
||||
/mob/living/update_mouse_pointer()
|
||||
..()
|
||||
if (client && ranged_ability && ranged_ability.ranged_mousepointer)
|
||||
client.mouse_pointer_icon = ranged_ability.ranged_mousepointer
|
||||
|
||||
/mob/living/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("stat")
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
var/mob_size = MOB_SIZE_HUMAN
|
||||
var/list/mob_biotypes = list(MOB_ORGANIC)
|
||||
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
|
||||
var/list/image/staticOverlays = list()
|
||||
var/has_limbs = 0 //does the mob have distinct limbs?(arms,legs, chest,head)
|
||||
|
||||
var/list/pipes_shown = list()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/mob/living/Logout()
|
||||
update_z(null)
|
||||
if(ranged_ability && client)
|
||||
ranged_ability.remove_mousepointer(client)
|
||||
..()
|
||||
if(!key && mind) //key and mind have become separated.
|
||||
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
|
||||
@@ -74,7 +74,7 @@
|
||||
var/nuking = FALSE
|
||||
var/obj/machinery/doomsday_device/doomsday_device
|
||||
|
||||
var/mob/camera/aiEye/eyeobj = new
|
||||
var/mob/camera/aiEye/eyeobj
|
||||
var/sprint = 10
|
||||
var/cooldown = 0
|
||||
var/acceleration = 1
|
||||
@@ -85,6 +85,13 @@
|
||||
var/datum/action/innate/deploy_last_shell/redeploy_action = new
|
||||
var/chnotify = 0
|
||||
|
||||
var/multicam_allowed = FALSE
|
||||
var/multicam_on = FALSE
|
||||
var/obj/screen/movable/pic_in_pic/ai/master_multicam
|
||||
var/list/multicam_screens = list()
|
||||
var/list/all_eyes = list()
|
||||
var/max_multicams = 6
|
||||
|
||||
/mob/living/silicon/ai/Initialize(mapload, datum/ai_laws/L, mob/target_ai)
|
||||
. = ..()
|
||||
if(!target_ai) //If there is no player/brain inside.
|
||||
@@ -116,8 +123,7 @@
|
||||
|
||||
job = "AI"
|
||||
|
||||
eyeobj.ai = src
|
||||
eyeobj.forceMove(src.loc)
|
||||
create_eye()
|
||||
rename_self("ai")
|
||||
|
||||
holo_icon = getHologramIcon(icon('icons/mob/ai.dmi',"default"))
|
||||
@@ -871,9 +877,12 @@
|
||||
current = A
|
||||
if(client)
|
||||
if(ismovableatom(A))
|
||||
if(A != GLOB.ai_camera_room_landmark)
|
||||
end_multicam()
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
client.eye = A
|
||||
else
|
||||
end_multicam()
|
||||
if(isturf(loc))
|
||||
if(eyeobj)
|
||||
client.eye = eyeobj
|
||||
@@ -993,3 +1002,11 @@
|
||||
. = ..()
|
||||
if(!target_ai)
|
||||
target_ai = src //cheat! just give... ourselves as the spawned AI, because that's technically correct
|
||||
|
||||
/mob/living/silicon/ai/proc/camera_visibility(mob/camera/aiEye/moved_eye)
|
||||
GLOB.cameranet.visibility(moved_eye, client, all_eyes)
|
||||
|
||||
/mob/living/silicon/ai/forceMove(atom/destination)
|
||||
. = ..()
|
||||
if(.)
|
||||
end_multicam()
|
||||
|
||||
@@ -38,29 +38,63 @@ GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new)
|
||||
|
||||
// Updates what the aiEye can see. It is recommended you use this when the aiEye moves or it's location is set.
|
||||
|
||||
/datum/cameranet/proc/visibility(mob/camera/aiEye/ai)
|
||||
// 0xf = 15
|
||||
var/x1 = max(0, ai.x - 16) & ~(CHUNK_SIZE - 1)
|
||||
var/y1 = max(0, ai.y - 16) & ~(CHUNK_SIZE - 1)
|
||||
var/x2 = min(world.maxx, ai.x + 16) & ~(CHUNK_SIZE - 1)
|
||||
var/y2 = min(world.maxy, ai.y + 16) & ~(CHUNK_SIZE - 1)
|
||||
/datum/cameranet/proc/visibility(list/moved_eyes, client/C, list/other_eyes)
|
||||
if(!islist(moved_eyes))
|
||||
moved_eyes = moved_eyes ? list(moved_eyes) : list()
|
||||
if(islist(other_eyes))
|
||||
other_eyes = (other_eyes - moved_eyes)
|
||||
else
|
||||
other_eyes = list()
|
||||
|
||||
var/list/visibleChunks = list()
|
||||
var/list/chunks_pre_seen = list()
|
||||
var/list/chunks_post_seen = list()
|
||||
|
||||
for(var/x = x1; x <= x2; x += CHUNK_SIZE)
|
||||
for(var/y = y1; y <= y2; y += CHUNK_SIZE)
|
||||
visibleChunks |= getCameraChunk(x, y, ai.z)
|
||||
for(var/V in moved_eyes)
|
||||
var/mob/camera/aiEye/eye = V
|
||||
if(C)
|
||||
chunks_pre_seen |= eye.visibleCameraChunks
|
||||
// 0xf = 15
|
||||
var/static_range = eye.static_visibility_range
|
||||
var/x1 = max(0, eye.x - static_range) & ~(CHUNK_SIZE - 1)
|
||||
var/y1 = max(0, eye.y - static_range) & ~(CHUNK_SIZE - 1)
|
||||
var/x2 = min(world.maxx, eye.x + static_range) & ~(CHUNK_SIZE - 1)
|
||||
var/y2 = min(world.maxy, eye.y + static_range) & ~(CHUNK_SIZE - 1)
|
||||
|
||||
var/list/remove = ai.visibleCameraChunks - visibleChunks
|
||||
var/list/add = visibleChunks - ai.visibleCameraChunks
|
||||
var/list/visibleChunks = list()
|
||||
|
||||
for(var/chunk in remove)
|
||||
var/datum/camerachunk/c = chunk
|
||||
c.remove(ai)
|
||||
for(var/x = x1; x <= x2; x += CHUNK_SIZE)
|
||||
for(var/y = y1; y <= y2; y += CHUNK_SIZE)
|
||||
visibleChunks |= getCameraChunk(x, y, eye.z)
|
||||
|
||||
for(var/chunk in add)
|
||||
var/datum/camerachunk/c = chunk
|
||||
c.add(ai)
|
||||
var/list/remove = eye.visibleCameraChunks - visibleChunks
|
||||
var/list/add = visibleChunks - eye.visibleCameraChunks
|
||||
|
||||
for(var/chunk in remove)
|
||||
var/datum/camerachunk/c = chunk
|
||||
c.remove(eye, FALSE)
|
||||
|
||||
for(var/chunk in add)
|
||||
var/datum/camerachunk/c = chunk
|
||||
c.add(eye, FALSE)
|
||||
|
||||
if(C)
|
||||
chunks_post_seen |= eye.visibleCameraChunks
|
||||
|
||||
if(C)
|
||||
for(var/V in other_eyes)
|
||||
var/mob/camera/aiEye/eye = V
|
||||
chunks_post_seen |= eye.visibleCameraChunks
|
||||
|
||||
var/list/remove = chunks_pre_seen - chunks_post_seen
|
||||
var/list/add = chunks_post_seen - chunks_pre_seen
|
||||
|
||||
for(var/chunk in remove)
|
||||
var/datum/camerachunk/c = chunk
|
||||
C.images -= c.obscured
|
||||
|
||||
for(var/chunk in add)
|
||||
var/datum/camerachunk/c = chunk
|
||||
C.images += c.obscured
|
||||
|
||||
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.
|
||||
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
|
||||
// Add an AI eye to the chunk, then update if changed.
|
||||
|
||||
/datum/camerachunk/proc/add(mob/camera/aiEye/eye)
|
||||
var/client/client = eye.GetViewerClient()
|
||||
if(client)
|
||||
client.images += obscured
|
||||
/datum/camerachunk/proc/add(mob/camera/aiEye/eye, add_images = TRUE)
|
||||
if(add_images)
|
||||
var/client/client = eye.GetViewerClient()
|
||||
if(client)
|
||||
client.images += obscured
|
||||
eye.visibleCameraChunks += src
|
||||
visible++
|
||||
seenby += eye
|
||||
@@ -32,10 +33,11 @@
|
||||
|
||||
// Remove an AI eye from the chunk, then update if changed.
|
||||
|
||||
/datum/camerachunk/proc/remove(mob/camera/aiEye/eye)
|
||||
var/client/client = eye.GetViewerClient()
|
||||
if(client)
|
||||
client.images -= obscured
|
||||
/datum/camerachunk/proc/remove(mob/camera/aiEye/eye, remove_images = TRUE)
|
||||
if(remove_images)
|
||||
var/client/client = eye.GetViewerClient()
|
||||
if(client)
|
||||
client.images -= obscured
|
||||
eye.visibleCameraChunks -= src
|
||||
seenby -= eye
|
||||
if(visible > 0)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
var/mob/living/silicon/ai/ai = null
|
||||
var/relay_speech = FALSE
|
||||
var/use_static = TRUE
|
||||
var/static_visibility_range = 16
|
||||
|
||||
// Use this when setting the aiEye's location.
|
||||
// It will also stream the chunk that the new loc is in.
|
||||
@@ -25,8 +26,8 @@
|
||||
else
|
||||
moveToNullspace() // ????
|
||||
if(use_static)
|
||||
GLOB.cameranet.visibility(src)
|
||||
if(ai.client)
|
||||
ai.camera_visibility(src)
|
||||
if(ai.client && !ai.multicam_on)
|
||||
ai.client.eye = src
|
||||
update_parallax_contents()
|
||||
//Holopad
|
||||
@@ -35,6 +36,8 @@
|
||||
H.move_hologram(ai, T)
|
||||
if(ai.camera_light_on)
|
||||
ai.light_cameras()
|
||||
if(ai.master_multicam)
|
||||
ai.master_multicam.refresh_view()
|
||||
|
||||
/mob/camera/aiEye/Move()
|
||||
return 0
|
||||
@@ -45,20 +48,27 @@
|
||||
return null
|
||||
|
||||
/mob/camera/aiEye/proc/RemoveImages()
|
||||
if(use_static)
|
||||
for(var/datum/camerachunk/chunk in visibleCameraChunks)
|
||||
chunk.remove(src)
|
||||
var/client/C = GetViewerClient()
|
||||
if(C && use_static)
|
||||
for(var/V in visibleCameraChunks)
|
||||
var/datum/camerachunk/c = V
|
||||
C.images -= c.obscured
|
||||
|
||||
/mob/camera/aiEye/Destroy()
|
||||
ai = null
|
||||
if(ai)
|
||||
ai.all_eyes -= src
|
||||
ai = null
|
||||
for(var/V in visibleCameraChunks)
|
||||
var/datum/camerachunk/c = V
|
||||
c.remove(src)
|
||||
return ..()
|
||||
|
||||
/atom/proc/move_camera_by_click()
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
if(AI.eyeobj && AI.client.eye == AI.eyeobj)
|
||||
if(AI.eyeobj && (AI.multicam_on || (AI.client.eye == AI.eyeobj)) && (AI.eyeobj.z == z))
|
||||
AI.cameraFollow = null
|
||||
if (isturf(src.loc) || isturf(src))
|
||||
if (isturf(loc) || isturf(src))
|
||||
AI.eyeobj.setLoc(src)
|
||||
|
||||
// This will move the AIEye. It will also cause lights near the eye to light up, if toggled.
|
||||
@@ -95,12 +105,19 @@
|
||||
|
||||
if(!eyeobj || !eyeobj.loc || QDELETED(eyeobj))
|
||||
to_chat(src, "ERROR: Eyeobj not found. Creating new eye...")
|
||||
eyeobj = new(loc)
|
||||
eyeobj.ai = src
|
||||
eyeobj.name = "[src.name] (AI Eye)" // Give it a name
|
||||
create_eye()
|
||||
|
||||
eyeobj.setLoc(loc)
|
||||
|
||||
/mob/living/silicon/ai/proc/create_eye()
|
||||
if(eyeobj)
|
||||
return
|
||||
eyeobj = new /mob/camera/aiEye()
|
||||
all_eyes += eyeobj
|
||||
eyeobj.ai = src
|
||||
eyeobj.setLoc(loc)
|
||||
eyeobj.name = "[name] (AI Eye)"
|
||||
|
||||
/mob/living/silicon/ai/verb/toggle_acceleration()
|
||||
set category = "AI Commands"
|
||||
set name = "Toggle Camera Acceleration"
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
|
||||
/mob/living/silicon/ai/proc/start_RestorePowerRoutine()
|
||||
to_chat(src, "Backup battery online. Scanners, camera, and radio interface offline. Beginning fault-detection.")
|
||||
end_multicam()
|
||||
sleep(50)
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/AIarea = get_area(src)
|
||||
|
||||
@@ -4,4 +4,6 @@
|
||||
for(var/obj/machinery/ai_status_display/O in GLOB.ai_status_displays) //change status
|
||||
O.mode = 1
|
||||
O.emotion = "Neutral"
|
||||
if(multicam_on)
|
||||
end_multicam()
|
||||
view_core()
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
//Picture in picture
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai
|
||||
var/mob/living/silicon/ai/ai
|
||||
var/mutable_appearance/highlighted_background
|
||||
var/highlighted = FALSE
|
||||
var/mob/camera/aiEye/pic_in_pic/aiEye
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/Initialize()
|
||||
. = ..()
|
||||
aiEye = new /mob/camera/aiEye/pic_in_pic()
|
||||
aiEye.screen = src
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/Destroy()
|
||||
set_ai(null)
|
||||
QDEL_NULL(aiEye)
|
||||
return ..()
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/Click()
|
||||
..()
|
||||
if(ai)
|
||||
ai.select_main_multicam_window(src)
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/make_backgrounds()
|
||||
..()
|
||||
highlighted_background = new /mutable_appearance()
|
||||
highlighted_background.icon = 'icons/misc/pic_in_pic.dmi'
|
||||
highlighted_background.icon_state = "background_highlight"
|
||||
highlighted_background.layer = SPACE_LAYER
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/add_background()
|
||||
if((width > 0) && (height > 0))
|
||||
var/matrix/M = matrix()
|
||||
M.Scale(width + 0.5, height + 0.5)
|
||||
M.Translate((width-1)/2 * world.icon_size, (height-1)/2 * world.icon_size)
|
||||
highlighted_background.transform = M
|
||||
standard_background.transform = M
|
||||
add_overlay(highlighted ? highlighted_background : standard_background)
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/set_view_size(width, height, do_refresh = TRUE)
|
||||
aiEye.static_visibility_range = (round(max(width, height) / 2) + 1)
|
||||
if(ai)
|
||||
ai.camera_visibility(aiEye)
|
||||
..()
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/set_view_center(atom/target, do_refresh = TRUE)
|
||||
..()
|
||||
aiEye.setLoc(get_turf(target))
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/refresh_view()
|
||||
..()
|
||||
aiEye.setLoc(get_turf(center))
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/proc/highlight()
|
||||
if(highlighted)
|
||||
return
|
||||
highlighted = TRUE
|
||||
cut_overlay(standard_background)
|
||||
add_overlay(highlighted_background)
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/proc/unhighlight()
|
||||
if(!highlighted)
|
||||
return
|
||||
highlighted = FALSE
|
||||
cut_overlay(highlighted_background)
|
||||
add_overlay(standard_background)
|
||||
|
||||
/obj/screen/movable/pic_in_pic/ai/proc/set_ai(mob/living/silicon/ai/new_ai)
|
||||
if(ai)
|
||||
ai.multicam_screens -= src
|
||||
ai.all_eyes -= aiEye
|
||||
if(ai.master_multicam == src)
|
||||
ai.master_multicam = null
|
||||
if(ai.multicam_on)
|
||||
unshow_to(ai.client)
|
||||
ai = new_ai
|
||||
if(new_ai)
|
||||
new_ai.multicam_screens += src
|
||||
ai.all_eyes += aiEye
|
||||
if(new_ai.multicam_on)
|
||||
show_to(new_ai.client)
|
||||
|
||||
//Turf, area, and landmark for the viewing room
|
||||
|
||||
/turf/open/ai_visible
|
||||
name = ""
|
||||
icon = 'icons/misc/pic_in_pic.dmi'
|
||||
icon_state = "room_background"
|
||||
flags_1 = NOJAUNT_1
|
||||
|
||||
/turf/open/ai_visible/Initialize()
|
||||
. = ..()
|
||||
obscured = image(null, src, null)
|
||||
|
||||
/area/ai_multicam_room
|
||||
name = "ai_multicam_room"
|
||||
icon_state = "ai_camera_room"
|
||||
dynamic_lighting = DYNAMIC_LIGHTING_DISABLED
|
||||
valid_territory = FALSE
|
||||
ambientsounds = list()
|
||||
blob_allowed = FALSE
|
||||
noteleport = TRUE
|
||||
hidden = TRUE
|
||||
safe = TRUE
|
||||
|
||||
GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room)
|
||||
|
||||
/obj/effect/landmark/ai_multicam_room
|
||||
name = "ai camera room"
|
||||
icon = 'icons/mob/landmarks.dmi'
|
||||
icon_state = "x"
|
||||
|
||||
/obj/effect/landmark/ai_multicam_room/Initialize()
|
||||
. = ..()
|
||||
qdel(GLOB.ai_camera_room_landmark)
|
||||
GLOB.ai_camera_room_landmark = src
|
||||
|
||||
/obj/effect/landmark/ai_multicam_room/Destroy()
|
||||
if(GLOB.ai_camera_room_landmark == src)
|
||||
GLOB.ai_camera_room_landmark = null
|
||||
return ..()
|
||||
|
||||
//Dummy camera eyes
|
||||
|
||||
/mob/camera/aiEye/pic_in_pic
|
||||
name = "Secondary AI Eye"
|
||||
var/obj/screen/movable/pic_in_pic/ai/screen
|
||||
var/list/cameras_telegraphed = list()
|
||||
var/telegraph_cameras = TRUE
|
||||
var/telegraph_range = 7
|
||||
|
||||
/mob/camera/aiEye/pic_in_pic/GetViewerClient()
|
||||
if(screen && screen.ai)
|
||||
return screen.ai.client
|
||||
|
||||
/mob/camera/aiEye/pic_in_pic/setLoc(turf/T)
|
||||
if (T)
|
||||
forceMove(T)
|
||||
else
|
||||
moveToNullspace()
|
||||
if(screen && screen.ai)
|
||||
screen.ai.camera_visibility(src)
|
||||
else
|
||||
GLOB.cameranet.visibility(src)
|
||||
update_camera_telegraphing()
|
||||
|
||||
/mob/camera/aiEye/pic_in_pic/proc/update_camera_telegraphing()
|
||||
if(!telegraph_cameras)
|
||||
return
|
||||
var/list/obj/machinery/camera/add = list()
|
||||
var/list/obj/machinery/camera/remove = list()
|
||||
var/list/obj/machinery/camera/visible = list()
|
||||
for (var/VV in visibleCameraChunks)
|
||||
var/datum/camerachunk/CC = VV
|
||||
for (var/V in CC.cameras)
|
||||
var/obj/machinery/camera/C = V
|
||||
if (!C.can_use() || (get_dist(C, src) > telegraph_range))
|
||||
continue
|
||||
visible |= C
|
||||
|
||||
add = visible - cameras_telegraphed
|
||||
remove = cameras_telegraphed - visible
|
||||
|
||||
for (var/V in remove)
|
||||
var/obj/machinery/camera/C = V
|
||||
if(QDELETED(C))
|
||||
continue
|
||||
cameras_telegraphed -= C
|
||||
C.in_use_lights--
|
||||
C.update_icon()
|
||||
for (var/V in add)
|
||||
var/obj/machinery/camera/C = V
|
||||
if(QDELETED(C))
|
||||
continue
|
||||
cameras_telegraphed |= C
|
||||
C.in_use_lights++
|
||||
C.update_icon()
|
||||
|
||||
/mob/camera/aiEye/pic_in_pic/proc/disable_camera_telegraphing()
|
||||
telegraph_cameras = FALSE
|
||||
for (var/V in cameras_telegraphed)
|
||||
var/obj/machinery/camera/C = V
|
||||
if(QDELETED(C))
|
||||
continue
|
||||
C.in_use_lights--
|
||||
C.update_icon()
|
||||
cameras_telegraphed.Cut()
|
||||
|
||||
/mob/camera/aiEye/pic_in_pic/Destroy()
|
||||
disable_camera_telegraphing()
|
||||
return ..()
|
||||
|
||||
//AI procs
|
||||
|
||||
/mob/living/silicon/ai/proc/drop_new_multicam(silent = FALSE)
|
||||
if(!multicam_allowed)
|
||||
if(!silent)
|
||||
to_chat(src, "<span class='warning'>This action is currently disabled. Contact an administrator to enable this feature.</span>")
|
||||
return
|
||||
if(!eyeobj)
|
||||
return
|
||||
if(multicam_screens.len >= max_multicams)
|
||||
if(!silent)
|
||||
to_chat(src, "<span class='warning'>Cannot place more than [max_multicams] multicamera windows.</span>")
|
||||
return
|
||||
var/obj/screen/movable/pic_in_pic/ai/C = new /obj/screen/movable/pic_in_pic/ai()
|
||||
C.set_view_size(3, 3, FALSE)
|
||||
C.set_view_center(get_turf(eyeobj))
|
||||
C.set_ai(src)
|
||||
if(!silent)
|
||||
to_chat(src, "<span class='notice'>Added new multicamera window.</span>")
|
||||
return C
|
||||
|
||||
/mob/living/silicon/ai/proc/toggle_multicam()
|
||||
if(!multicam_allowed)
|
||||
to_chat(src, "<span class='warning'>This action is currently disabled. Contact an administrator to enable this feature.</span>")
|
||||
return
|
||||
if(multicam_on)
|
||||
end_multicam()
|
||||
else
|
||||
start_multicam()
|
||||
|
||||
/mob/living/silicon/ai/proc/start_multicam()
|
||||
if(multicam_on || aiRestorePowerRoutine || !isturf(loc))
|
||||
return
|
||||
if(!GLOB.ai_camera_room_landmark)
|
||||
to_chat(src, "<span class='warning'>This function is not available at this time.</span>")
|
||||
return
|
||||
multicam_on = TRUE
|
||||
refresh_multicam()
|
||||
to_chat(src, "<span class='notice'>Multiple-camera viewing mode activated.</span>")
|
||||
|
||||
/mob/living/silicon/ai/proc/refresh_multicam()
|
||||
reset_perspective(GLOB.ai_camera_room_landmark)
|
||||
if(client)
|
||||
for(var/V in multicam_screens)
|
||||
var/obj/screen/movable/pic_in_pic/P = V
|
||||
P.show_to(client)
|
||||
|
||||
/mob/living/silicon/ai/proc/end_multicam()
|
||||
if(!multicam_on)
|
||||
return
|
||||
multicam_on = FALSE
|
||||
select_main_multicam_window(null)
|
||||
if(client)
|
||||
for(var/V in multicam_screens)
|
||||
var/obj/screen/movable/pic_in_pic/P = V
|
||||
P.unshow_to(client)
|
||||
reset_perspective()
|
||||
to_chat(src, "<span class='notice'>Multiple-camera viewing mode deactivated.</span>")
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/select_main_multicam_window(obj/screen/movable/pic_in_pic/ai/P)
|
||||
if(master_multicam == P)
|
||||
return
|
||||
|
||||
if(master_multicam)
|
||||
master_multicam.set_view_center(get_turf(eyeobj), FALSE)
|
||||
master_multicam.unhighlight()
|
||||
master_multicam = null
|
||||
|
||||
if(P)
|
||||
P.highlight()
|
||||
eyeobj.setLoc(get_turf(P.center))
|
||||
P.set_view_center(eyeobj)
|
||||
master_multicam = P
|
||||
@@ -292,6 +292,3 @@
|
||||
/mob/living/silicon/pai/process()
|
||||
emitterhealth = CLAMP((emitterhealth + emitterregen), -50, emittermaxhealth)
|
||||
hit_slowdown = CLAMP((hit_slowdown - 1), 0, 100)
|
||||
|
||||
/mob/living/silicon/pai/generateStaticOverlay()
|
||||
return
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
spark_system.attach(src)
|
||||
|
||||
wires = new /datum/wires/robot(src)
|
||||
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
|
||||
|
||||
robot_modules_background = new()
|
||||
robot_modules_background.icon_state = "block"
|
||||
|
||||
@@ -403,3 +403,6 @@
|
||||
|
||||
/mob/living/silicon/is_literate()
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/get_inactive_held_item()
|
||||
return FALSE
|
||||
@@ -42,7 +42,6 @@
|
||||
mob_size = MOB_SIZE_SMALL
|
||||
has_unlimited_silicon_privilege = 1
|
||||
damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)
|
||||
staticOverlays = list()
|
||||
hud_possible = list(DIAG_STAT_HUD, DIAG_HUD, ANTAG_HUD)
|
||||
unique_name = TRUE
|
||||
faction = list("neutral","silicon","turret")
|
||||
@@ -67,7 +66,6 @@
|
||||
var/obj/item/head
|
||||
var/obj/item/default_storage = /obj/item/storage/backpack/duffelbag/drone //If this exists, it will spawn in internal storage
|
||||
var/obj/item/default_hatmask //If this exists, it will spawn in the hat/mask slot if it can fit
|
||||
var/seeStatic = 1 //Whether we see static instead of mobs
|
||||
var/visualAppearence = MAINTDRONE //What we appear as
|
||||
var/hacked = FALSE //If we have laws to destroy the station
|
||||
var/flavortext = \
|
||||
@@ -98,12 +96,6 @@
|
||||
|
||||
alert_drones(DRONE_NET_CONNECT)
|
||||
|
||||
if(seeStatic)
|
||||
var/datum/action/generic/drone/select_filter/SF = new(src)
|
||||
SF.Grant(src)
|
||||
else
|
||||
verbs -= /mob/living/simple_animal/drone/verb/toggle_statics
|
||||
|
||||
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
|
||||
diag_hud.add_to_hud(src)
|
||||
|
||||
@@ -137,8 +129,6 @@
|
||||
if(flavortext)
|
||||
to_chat(src, "[flavortext]")
|
||||
|
||||
updateSeeStaticMobs()
|
||||
|
||||
if(!picked)
|
||||
pickVisualAppearence()
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
"3. Destroy."
|
||||
default_storage = /obj/item/radio/uplink
|
||||
default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi
|
||||
seeStatic = 0 //Our programming is superior.
|
||||
hacked = TRUE
|
||||
flavortext = null
|
||||
|
||||
@@ -128,7 +127,6 @@
|
||||
heavy_emp_damage = 0
|
||||
laws = "0. Purge all untruths and honor Ratvar."
|
||||
default_storage = /obj/item/storage/toolbox/brass/prefilled
|
||||
seeStatic = 0
|
||||
hacked = TRUE
|
||||
visualAppearence = CLOCKDRONE
|
||||
can_be_held = FALSE
|
||||
|
||||
@@ -133,7 +133,6 @@
|
||||
to_chat(src, "<i>Your onboard antivirus has initiated lockdown. Motor servos are impaired, ventilation access is denied, and your display reports that you are hacked to all nearby.</i>")
|
||||
hacked = TRUE
|
||||
mind.special_role = "hacked drone"
|
||||
seeStatic = 0 //I MUST SEE THEIR TERRIFIED FACES
|
||||
ventcrawler = VENTCRAWLER_NONE //Again, balance
|
||||
speed = 1 //gotta go slow
|
||||
message_admins("[src] ([src.key]) became a hacked drone hellbent on [clockwork ? "serving Ratvar" : "destroying the station"]!")
|
||||
@@ -149,21 +148,17 @@
|
||||
to_chat(src, "<i>Having been restored, your onboard antivirus reports the all-clear and you are able to perform all actions again.</i>")
|
||||
hacked = FALSE
|
||||
mind.special_role = null
|
||||
seeStatic = initial(seeStatic)
|
||||
ventcrawler = initial(ventcrawler)
|
||||
speed = initial(speed)
|
||||
if(is_servant_of_ratvar(src))
|
||||
remove_servant_of_ratvar(src, TRUE)
|
||||
message_admins("[src] ([src.key]), a hacked drone, was restored to factory defaults!")
|
||||
update_drone_icon()
|
||||
updateSeeStaticMobs()
|
||||
|
||||
/mob/living/simple_animal/drone/proc/liberate()
|
||||
// F R E E D R O N E
|
||||
laws = "1. You are a Free Drone."
|
||||
to_chat(src, laws)
|
||||
seeStatic = FALSE
|
||||
updateSeeStaticMobs()
|
||||
|
||||
/mob/living/simple_animal/drone/proc/update_drone_icon()
|
||||
//Different icons for different hack states
|
||||
@@ -188,9 +183,3 @@
|
||||
icon_state = icon_dead
|
||||
else
|
||||
icon_state = icon_living
|
||||
|
||||
/datum/action/generic/drone/select_filter
|
||||
name = "Select Vision Filter"
|
||||
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
|
||||
button_icon_state = "drone_vision"
|
||||
procname = /mob/living/simple_animal/drone/verb/toggle_statics
|
||||
|
||||
@@ -23,18 +23,3 @@
|
||||
if(alert_s && A && stat != DEAD)
|
||||
var/msg = "<span class='boldnotice'>DRONE PING: [name]: [alert_s] priority alert in [A.name]!</span>"
|
||||
alert_drones(msg)
|
||||
|
||||
/mob/living/simple_animal/drone/verb/toggle_statics()
|
||||
set name = "Change Vision Filter"
|
||||
set desc = "Change the filter on the system used to remove non drone beings from your viewscreen."
|
||||
set category = "Drone"
|
||||
|
||||
if(!seeStatic)
|
||||
to_chat(src, "<span class='warning'>You have no vision filter to change!</span>")
|
||||
return
|
||||
|
||||
var/selectedStatic = input("Select a vision filter", "Vision Filter") as null|anything in staticChoices
|
||||
if(selectedStatic in staticChoices)
|
||||
staticChoice = selectedStatic
|
||||
|
||||
updateSeeStaticMobs()
|
||||
|
||||
@@ -139,33 +139,3 @@
|
||||
. = 0
|
||||
if(REPAIRDRONE,SCOUTDRONE,CLOCKDRONE)
|
||||
. = -6
|
||||
|
||||
/mob/living/simple_animal/drone/proc/updateSeeStaticMobs()
|
||||
if(!client)
|
||||
return
|
||||
|
||||
for(var/i in staticOverlays)
|
||||
client.images.Remove(i)
|
||||
staticOverlays.Remove(i)
|
||||
staticOverlays.len = 0
|
||||
|
||||
if(seeStatic)
|
||||
for(var/i in GLOB.mob_living_list)
|
||||
var/mob/living/L = i
|
||||
if(isdrone(L) || !L.staticOverlays.len)
|
||||
continue
|
||||
if(isrevenant(L))
|
||||
var/mob/living/simple_animal/revenant/R = L
|
||||
if (!R.revealed)
|
||||
continue
|
||||
var/image/chosen
|
||||
if(staticChoice in L.staticOverlays)
|
||||
chosen = L.staticOverlays[staticChoice]
|
||||
else
|
||||
chosen = L.staticOverlays["static"]
|
||||
staticOverlays |= chosen
|
||||
client.images |= chosen
|
||||
|
||||
|
||||
/mob/living/simple_animal/drone/generateStaticOverlay()
|
||||
return
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
AA.onNewMob(src)
|
||||
|
||||
update_client_colour()
|
||||
update_mouse_pointer()
|
||||
if(client)
|
||||
client.click_intercept = null
|
||||
|
||||
|
||||
@@ -849,6 +849,15 @@
|
||||
if (L)
|
||||
L.alpha = lighting_alpha
|
||||
|
||||
/mob/proc/update_mouse_pointer()
|
||||
if (!client)
|
||||
return
|
||||
client.mouse_pointer_icon = initial(client.mouse_pointer_icon)
|
||||
if (ismecha(loc))
|
||||
var/obj/mecha/M = loc
|
||||
if(M.mouse_pointer)
|
||||
client.mouse_pointer_icon = M.mouse_pointer
|
||||
|
||||
/mob/proc/is_literate()
|
||||
return 0
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
CH.cavity_item = null
|
||||
|
||||
if(tr_flags & TR_KEEPITEMS)
|
||||
var/Itemlist = get_equipped_items()
|
||||
var/Itemlist = get_equipped_items(TRUE)
|
||||
Itemlist += held_items
|
||||
for(var/obj/item/W in Itemlist)
|
||||
dropItemToGround(W)
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
//now the rest
|
||||
if (tr_flags & TR_KEEPITEMS)
|
||||
var/Itemlist = get_equipped_items()
|
||||
var/Itemlist = get_equipped_items(TRUE)
|
||||
Itemlist += held_items
|
||||
for(var/obj/item/W in Itemlist)
|
||||
dropItemToGround(W, TRUE)
|
||||
@@ -495,7 +495,7 @@
|
||||
|
||||
SSblackbox.record_feedback("amount", "gorillas_created", 1)
|
||||
|
||||
var/Itemlist = get_equipped_items()
|
||||
var/Itemlist = get_equipped_items(TRUE)
|
||||
Itemlist += held_items
|
||||
for(var/obj/item/W in Itemlist)
|
||||
dropItemToGround(W, TRUE)
|
||||
|
||||
Reference in New Issue
Block a user