Merge pull request #7285 from Aurorablade/RingRingHello

Ring! Ring! Hello?
This commit is contained in:
tigercat2000
2018-06-06 00:19:07 -07:00
committed by GitHub
20 changed files with 727 additions and 375 deletions
+2 -1
View File
@@ -832,7 +832,8 @@
/mob/living/carbon/human/handle_vision()
if(machine)
if(!machine.check_eye(src)) reset_perspective(null)
if(!machine.check_eye(src))
reset_perspective(null)
else
var/isRemoteObserve = 0
if((REMOTE_VIEW in mutations) && remoteview_target)
+14 -4
View File
@@ -87,11 +87,12 @@ var/list/ai_verbs_default = list(
var/mob/living/simple_animal/bot/Bot
var/turf/waypoint //Holds the turf of the currently selected waypoint.
var/waypoint_mode = 0 //Waypoint mode is for selecting a turf via clicking.
var/apc_override = FALSE //hack for letting the AI use its APC even when visionless
var/nuking = 0
var/obj/machinery/doomsday_device/doomsday_device
var/obj/machinery/hologram/holopad/holo = null
var/mob/camera/aiEye/eyeobj = new()
var/mob/camera/aiEye/eyeobj
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
@@ -191,9 +192,7 @@ var/list/ai_verbs_default = list(
spawn(5)
new /obj/machinery/ai_powersupply(src)
eyeobj.ai = src
eyeobj.name = "[src.name] (AI Eye)" // Give it a name
eyeobj.loc = src.loc
create_eye()
builtInCamera = new /obj/machinery/camera/portable(src)
builtInCamera.c_tag = name
@@ -1163,6 +1162,17 @@ var/list/ai_verbs_default = list(
client.eye = eyeobj
return TRUE
/mob/living/silicon/ai/proc/can_see(atom/A)
if(isturf(loc)) //AI in core, check if on cameras
//get_turf_pixel() is because APCs in maint aren't actually in view of the inner camera
//apc_override is needed here because AIs use their own APC when depowered
return (cameranet && cameranet.checkTurfVis(get_turf_pixel(A))) || apc_override
//AI is carded/shunted
//view(src) returns nothing for carded/shunted AIs and they have x-ray vision so just use get_dist
var/list/viewscale = getviewsize(client.view)
return get_dist(src, A) <= max(viewscale[1]*0.5,viewscale[2]*0.5)
/mob/living/silicon/ai/proc/relay_speech(mob/living/M, text, verb, datum/language/speaking)
if(!say_understands(M, speaking))//The AI will be able to understand most mobs talking through the holopad.
if(speaking)
@@ -28,7 +28,7 @@
eye.visibleCameraChunks += src
visible++
seenby += eye
if(changed && !updating)
if(changed)
update()
// Remove an AI eye from the chunk, then update if changed.
@@ -20,7 +20,6 @@
// It will also stream the chunk that the new loc is in.
/mob/camera/aiEye/setLoc(T)
if(ai)
if(!isturf(ai.loc))
return
@@ -30,8 +29,9 @@
if(ai.client)
ai.client.eye = src
//Holopad
if(ai.holo)
ai.holo.move_hologram()
if(istype(ai.current, /obj/machinery/hologram/holopad))
var/obj/machinery/hologram/holopad/H = ai.current
H.move_hologram(ai, T)
/mob/camera/aiEye/Move()
return 0
@@ -41,8 +41,22 @@
return ai.client
return null
/mob/camera/aiEye/proc/RemoveImages()
var/client/C = GetViewerClient()
if(C)
for(var/V in visibleCameraChunks)
var/datum/camerachunk/chunk = V
C.images -= chunk.obscured
/mob/camera/aiEye/Destroy()
ai = null
if(ai)
//ai.all_eyes -= src
ai = null
for(var/V in visibleCameraChunks)
var/datum/camerachunk/chunk = V
chunk.remove(src)
return ..()
/atom/proc/move_camera_by_click()
@@ -102,12 +116,18 @@
src.eyeobj.loc = src.loc
else
to_chat(src, "ERROR: Eyeobj not found. Creating new eye...")
src.eyeobj = new(src.loc)
src.eyeobj.ai = src
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()
eyeobj.ai = src
eyeobj.setLoc(loc)
eyeobj.name = "[name] (AI Eye)"
/mob/living/silicon/ai/proc/toggle_acceleration()
set category = "AI Commands"
set name = "Toggle Camera Acceleration"
+3 -1
View File
@@ -129,8 +129,10 @@
to_chat(src, "Receiving control information from APC.")
sleep(2)
//bring up APC dialog
aiRestorePowerRoutine = 3
apc_override = 1
theAPC.attack_ai(src)
apc_override = 0
aiRestorePowerRoutine = 3
to_chat(src, "Here are your current laws:")
src.show_laws() //WHY THE FUCK IS THIS HERE
sleep(50)
+6 -6
View File
@@ -74,8 +74,8 @@
if(!message)
return
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.hologram && T.master == src)//If there is a hologram and its master is the user.
var/obj/machinery/hologram/holopad/T = current
if(istype(T) && T.masters[src])
//Human-like, sorta, heard by those who understand humans.
var/rendered_a
@@ -112,8 +112,8 @@
if(!message)
return
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.hologram && T.master == src)
var/obj/machinery/hologram/holopad/T = current
if(istype(T) && T.masters[src])
var/rendered = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message]</span></span>"
to_chat(src, "<i><span class='game say'>Holopad action relayed, <span class='name'>[real_name]</span> <span class='message'>[message]</span></span></i>")
@@ -127,8 +127,8 @@
return 1
/mob/living/silicon/ai/emote(var/act, var/type, var/message)
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.hologram && T.master == src) //Is the AI using a holopad?
var/obj/machinery/hologram/holopad/T = current
if(istype(T) && T.masters[src])//Is the AI using a holopad?
src.holopad_emote(message)
else //Emote normally, then.
..()
@@ -22,7 +22,6 @@
desc = "A computer used for remotely handling slimes."
networks = list("SS13")
circuit = /obj/item/circuitboard/xenobiology
off_action = new /datum/action/innate/camera_off/xenobio
var/datum/action/innate/slime_place/slime_place_action = new
var/datum/action/innate/slime_pick_up/slime_up_action = new
var/datum/action/innate/feed_slime/feed_slime_action = new
@@ -43,23 +42,27 @@
eyeobj.icon_state = "camera_target"
/obj/machinery/computer/camera_advanced/xenobio/GrantActions(mob/living/carbon/user)
off_action.target = user
off_action.Grant(user)
..()
if(slime_up_action)
slime_up_action.target = src
slime_up_action.Grant(user)
actions += slime_up_action
if(slime_place_action)
slime_place_action.target = src
slime_place_action.Grant(user)
actions += slime_place_action
if(feed_slime_action)
feed_slime_action.target = src
feed_slime_action.Grant(user)
actions += feed_slime_action
if(monkey_recycle_action)
monkey_recycle_action.target = src
monkey_recycle_action.Grant(user)
actions += monkey_recycle_action
jump_action.target = user
jump_action.Grant(user)
slime_up_action.target = src
slime_up_action.Grant(user)
slime_place_action.target = src
slime_place_action.Grant(user)
feed_slime_action.target = src
feed_slime_action.Grant(user)
monkey_recycle_action.target = src
monkey_recycle_action.Grant(user)
/obj/machinery/computer/camera_advanced/xenobio/attack_hand(mob/user)
@@ -87,31 +90,6 @@
return
..()
/datum/action/innate/camera_off/xenobio/Activate()
if(!target || !ishuman(target))
return
var/mob/living/carbon/C = target
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/origin = remote_eye.origin
C.remote_view = 0
origin.current_user = null
origin.jump_action.Remove(C)
origin.slime_place_action.Remove(C)
origin.slime_up_action.Remove(C)
origin.feed_slime_action.Remove(C)
origin.monkey_recycle_action.Remove(C)
//All of this stuff below could probably be a proc for all advanced cameras, only the action removal needs to be camera specific
remote_eye.eye_user = null
C.reset_perspective(null)
if(C.client)
C.client.images -= remote_eye.user_image
for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks)
C.client.images -= chunk.obscured
C.remote_control = null
C.unset_machine()
src.Remove(C)
/datum/action/innate/slime_place
name = "Place Slimes"
button_icon_state = "slime_down"