diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 8ec06dbcbd4..58e2be31b01 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -7,6 +7,7 @@ #define PLANE_SPACE_PARALLAX -90 #define GAME_PLANE 0 +#define SPACE_LAYER 1.8 //#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define #define MID_TURF_LAYER 2.02 #define HIGH_TURF_LAYER 2.03 diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 3e631b64f18..a8a6307e70c 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -479,3 +479,16 @@ This is always put in the attack log. /proc/update_all_mob_security_hud() for(var/mob/living/carbon/human/H in mob_list) H.sec_hud_set_security_status() + +/proc/getviewsize(view) + var/viewX + var/viewY + if(isnum(view)) + var/totalviewrange = 1 + 2 * view + viewX = totalviewrange + viewY = totalviewrange + else + var/list/viewrangelist = splittext(view, "x") + viewX = text2num(viewrangelist[1]) + viewY = text2num(viewrangelist[2]) + return list(viewX, viewY) \ No newline at end of file diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 8fe3c3ba7fa..35d271461df 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1055,6 +1055,8 @@ proc/get_mob_with_client_list() //Find coordinates var/turf/T = get_turf(AM) //use AM's turfs, as it's coords are the same as AM's AND AM's coords are lost if it is inside another atom + if(!T) + return null var/final_x = T.x + rough_x var/final_y = T.y + rough_y diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index d88ff6201f8..b2521527a98 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -35,6 +35,17 @@ return var/turf/pixel_turf = get_turf_pixel(A) + if(isnull(pixel_turf)) + return + if(!can_see(A)) + if(isturf(A)) //On unmodified clients clicking the static overlay clicks the turf underneath + return // So there's no point messaging admins + message_admins("[key_name_admin(src)] might be running a modified client! (failed can_see on AI click of [A]([ADMIN_COORDJMP(pixel_turf)]))") + var/message = "[key_name(src)] might be running a modified client! (failed can_see on AI click of [A]([COORD(pixel_turf)]))" + log_admin(message) + send2irc_adminless_only("NOCHEAT", "[key_name(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(pixel_turf)]))") + + var/turf_visible if(pixel_turf) turf_visible = cameranet.checkTurfVis(pixel_turf) @@ -157,9 +168,6 @@ return /atom/proc/AICtrlClick(var/mob/living/silicon/ai/user) - if(user.holo) - var/obj/machinery/hologram/holopad/H = user.holo - H.face_atom(src) return /obj/machinery/door/airlock/AICtrlClick() // Bolts doors diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index 315fce5bf65..668e0e67fc7 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -11,6 +11,8 @@ /obj/screen/movable var/snap2grid = FALSE var/moved = FALSE + var/x_off = -16 + var/y_off = -16 //Snap Screen Object //Tied to the grid, snaps to the nearest turf @@ -39,8 +41,8 @@ screen_loc = "[screen_loc_X[1]],[screen_loc_Y[1]]" else //Normalise Pixel Values (So the object drops at the center of the mouse, not 16 pixels off) - var/pix_X = text2num(screen_loc_X[2]) - 16 - var/pix_Y = text2num(screen_loc_Y[2]) - 16 + var/pix_X = text2num(screen_loc_X[2]) + x_off + var/pix_Y = text2num(screen_loc_Y[2]) + y_off screen_loc = "[screen_loc_X[1]]:[pix_X],[screen_loc_Y[1]]:[pix_Y]" moved = screen_loc diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm new file mode 100644 index 00000000000..a98a65cb1a2 --- /dev/null +++ b/code/datums/holocall.dm @@ -0,0 +1,190 @@ +#define HOLOPAD_MAX_DIAL_TIME 200 + +/mob/camera/aiEye/remote/holo/setLoc() + . = ..() + var/obj/machinery/hologram/holopad/H = origin + H.move_hologram(eye_user, loc) + +//this datum manages it's own references + +/datum/holocall + var/mob/living/user //the one that called + var/obj/machinery/hologram/holopad/calling_holopad //the one that sent the call + var/obj/machinery/hologram/holopad/connected_holopad //the one that answered the call (may be null) + var/list/dialed_holopads //all things called, will be cleared out to just connected_holopad once answered + + var/mob/camera/aiEye/remote/holo/eye //user's eye, once connected + var/obj/effect/overlay/holo_pad_hologram/hologram //user's hologram, once connected + var/datum/action/innate/end_holocall/hangup //hangup action + + var/call_start_time + +//creates a holocall made by `caller` from `calling_pad` to `callees` +/datum/holocall/New(mob/living/caller, obj/machinery/hologram/holopad/calling_pad, list/callees) + call_start_time = world.time + user = caller + calling_pad.outgoing_call = src + calling_holopad = calling_pad + dialed_holopads = list() + + for(var/I in callees) + var/obj/machinery/hologram/holopad/H = I + if(!QDELETED(H) && !(H.stat & NOPOWER)) + dialed_holopads += H + var/area/area = get_area(H) + LAZYADD(H.holo_calls, src) + H.atom_say("[area] pad beeps: Incoming call from [caller]!") + + if(!dialed_holopads.len) + calling_holopad.atom_say("Connection failure.") + qdel(src) + return + +//cleans up ALL references :) +/datum/holocall/Destroy() + QDEL_NULL(hangup) + + var/user_good = !QDELETED(user) + if(user_good) + user.reset_perspective() + user.remote_control = null + + if(!QDELETED(eye)) + eye.RemoveImages() + QDEL_NULL(eye) + + if(connected_holopad && !QDELETED(hologram)) + hologram = null + connected_holopad.clear_holo(user) + + user = null + + //Hologram survived holopad destro + if(!QDELETED(hologram)) + hologram.HC = null + QDEL_NULL(hologram) + + + for(var/I in dialed_holopads) + var/obj/machinery/hologram/holopad/H = I + LAZYREMOVE(H.holo_calls, src) + dialed_holopads.Cut() + + if(calling_holopad) + calling_holopad.outgoing_call = null + calling_holopad.SetLightsAndPower() + calling_holopad = null + if(connected_holopad) + connected_holopad.SetLightsAndPower() + connected_holopad = null + + + return ..() + + +//Gracefully disconnects a holopad `H` from a call. Pads not in the call are ignored. Notifies participants of the disconnection +/datum/holocall/proc/Disconnect(obj/machinery/hologram/holopad/H) + if(H == connected_holopad) + var/area/A = get_area(connected_holopad) + calling_holopad.atom_say("[A] holopad disconnected.") + else if(H == calling_holopad && connected_holopad) + connected_holopad.atom_say("[user] disconnected.") + + user.unset_machine(H) + if(istype(hangup)) + hangup.Remove(user) + + ConnectionFailure(H, TRUE) + +//Forcefully disconnects a holopad `H` from a call. Pads not in the call are ignored. +/datum/holocall/proc/ConnectionFailure(obj/machinery/hologram/holopad/H, graceful = FALSE) + if(H == connected_holopad || H == calling_holopad) + if(!graceful && H != calling_holopad) + calling_holopad.atom_say("Connection failure.") + qdel(src) + return + + LAZYREMOVE(H.holo_calls, src) + dialed_holopads -= H + if(!dialed_holopads.len) + if(graceful) + calling_holopad.atom_say("Call rejected.") + qdel(src) + +//Answers a call made to a holopad `H` which cannot be the calling holopad. Pads not in the call are ignored +/datum/holocall/proc/Answer(obj/machinery/hologram/holopad/H) + if(H == calling_holopad) + return + + if(!(H in dialed_holopads)) + return + + if(connected_holopad) + return + + for(var/I in dialed_holopads) + if(I == H) + continue + Disconnect(I) + + for(var/I in H.holo_calls) + var/datum/holocall/HC = I + if(HC != src) + HC.Disconnect(H) + + connected_holopad = H + + if(!Check()) + return + + hologram = H.activate_holo(user) + hologram.HC = src + + user.unset_machine(H) + //eyeobj code is horrid, this is the best copypasta I could make + eye = new() + eye.origin = H + eye.eye_initialized = TRUE + eye.eye_user = user + eye.name = "Camera Eye ([user.name])" + user.remote_control = eye + user.remote_view = 1 + user.reset_perspective(eye) + eye.setLoc(get_turf(H)) + + hangup = new(eye,src) + hangup.Grant(user) + +//Checks the validity of a holocall and qdels itself if it's not. Returns TRUE if valid, FALSE otherwise +/datum/holocall/proc/Check() + for(var/I in dialed_holopads) + var/obj/machinery/hologram/holopad/H = I + if((H.stat & NOPOWER)) + ConnectionFailure(H) + + if(QDELETED(src)) + return FALSE + + . = !QDELETED(user) && !user.incapacitated() && !QDELETED(calling_holopad) && !(calling_holopad.stat & NOPOWER) && user.loc == calling_holopad.loc + + if(.) + if(!connected_holopad) + . = world.time < (call_start_time + HOLOPAD_MAX_DIAL_TIME) + if(!.) + calling_holopad.atom_say("No answer received.") + calling_holopad.temp = "" + + else if(!.) + qdel(src) + +/datum/action/innate/end_holocall + name = "End Holocall" + button_icon_state = "camera_off" + var/datum/holocall/hcall + +/datum/action/innate/end_holocall/New(Target, datum/holocall/HC) + ..() + hcall = HC + +/datum/action/innate/end_holocall/Activate() + hcall.Disconnect(hcall.calling_holopad) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 2195ee25522..00f6a98f2bc 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -8,16 +8,39 @@ var/list/networks = list("SS13") var/datum/action/innate/camera_off/off_action = new var/datum/action/innate/camera_jump/jump_action = new + var/list/actions = list() /obj/machinery/computer/camera_advanced/proc/CreateEye() eyeobj = new() eyeobj.origin = src -/obj/machinery/computer/camera_advanced/proc/GrantActions(mob/living/carbon/user) - off_action.target = user - off_action.Grant(user) - jump_action.target = user - jump_action.Grant(user) +/obj/machinery/computer/camera_advanced/proc/GrantActions(mob/living/user) + if(off_action) + off_action.target = user + off_action.Grant(user) + actions += off_action + + if(jump_action) + jump_action.target = user + jump_action.Grant(user) + actions += jump_action + +/obj/machinery/computer/camera_advanced/proc/remove_eye_control(mob/living/user) + if(!user) + return + for(var/V in actions) + var/datum/action/A = V + A.Remove(user) + if(user.client) + user.reset_perspective(null) + eyeobj.RemoveImages() + eyeobj.eye_user = null + user.remote_control = null + user.remote_view = FALSE + + current_user = null + user.unset_machine() + playsound(src, 'sound/machines/terminal_off.ogg', 25, 0) /obj/machinery/computer/camera_advanced/check_eye(mob/user) if((stat & (NOPOWER|BROKEN)) || !Adjacent(user) || !user.has_vision() || user.incapacitated()) @@ -33,7 +56,7 @@ /obj/machinery/computer/camera_advanced/on_unset_machine(mob/M) if(M == current_user) - off_action.Activate() + remove_eye_control(M) /obj/machinery/computer/camera_advanced/attack_hand(mob/user) if(current_user) @@ -95,6 +118,13 @@ origin = null return ..() +/mob/camera/aiEye/remote/RemoveImages() + ..() + if(visible_icon) + var/client/C = GetViewerClient() + if(C) + C.images -= user_image + /mob/camera/aiEye/remote/GetViewerClient() if(eye_user) return eye_user.client @@ -140,20 +170,8 @@ return var/mob/living/carbon/C = target var/mob/camera/aiEye/remote/remote_eye = C.remote_control - C.remote_view = 0 - remote_eye.origin.current_user = null - remote_eye.origin.jump_action.Remove(C) - remote_eye.eye_user = null - if(C.client) - C.reset_perspective(null) - if(remote_eye.visible_icon) - 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) - playsound(remote_eye.origin, 'sound/machines/terminal_off.ogg', 25, 0) + var/obj/machinery/computer/camera_advanced/console = remote_eye.origin + console.remove_eye_control(target) /datum/action/innate/camera_jump name = "Jump To Camera" diff --git a/code/game/machinery/computer/hologram.dm b/code/game/machinery/computer/hologram.dm deleted file mode 100644 index 2d2e5d37ae0..00000000000 --- a/code/game/machinery/computer/hologram.dm +++ /dev/null @@ -1,118 +0,0 @@ -/obj/machinery/computer/hologram_comp - name = "hologram computer" - desc = "Rumoured to control holograms." - icon = 'icons/obj/stationobjs.dmi' - icon_keyboard = "tech_key" - icon_screen = "holocontrol" - var/obj/machinery/hologram/projector/projector = null - var/temp = null - var/lumens = 0.0 - var/h_r = 245.0 - var/h_g = 245.0 - var/h_b = 245.0 - - -/obj/machinery/computer/hologram_comp/New() - ..() - spawn( 10 ) - src.projector = locate(/obj/machinery/hologram/projector, get_step(src.loc, NORTH)) - return - return - -/obj/machinery/computer/hologram_comp/attack_hand() - if(!in_range(src, usr)) - return 0 - src.show_console(usr) - return - -/obj/machinery/computer/hologram_comp/proc/render() - var/icon/I = new /icon('icons/mob/human.dmi', "body_m_s") - - if(src.lumens >= 0) - I.Blend(rgb(src.lumens, src.lumens, src.lumens), ICON_ADD) - else - I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), ICON_SUBTRACT) - - I.Blend(new /icon('icons/mob/human.dmi', "mouth_m_s"), ICON_OVERLAY) - I.Blend(new /icon('icons/mob/underwear.dmi', "Mens White"), ICON_OVERLAY) - - var/icon/U = new /icon('icons/mob/human_face.dmi', "hair_a_s") - U.Blend(rgb(src.h_r, src.h_g, src.h_b), ICON_ADD) - - I.Blend(U, ICON_OVERLAY) - - src.projector.hologram.icon = I - -/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob) - var/dat - user.set_machine(src) - if(src.temp) - dat = text("[]

Clear", src.temp) - else - dat = text({"Hologram Status:
\n - Power: []
\n - Hologram Control:
\n - Color Luminosity: []/220 \[Reset\]
\n - Lighten: 1 10
\n - Darken: 1 10
\n -
\nHair Color: ([],[],[]) \[Reset\]
\n - Red (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\n - Green (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\n - Blue (0-255): \[0\] -10 -1 [] 1 10 \[255\]
- "}, (src.projector.hologram ? "On" : "Off"), -src.lumens + 35, src.h_r, src.h_g, src.h_b, src.h_r, src.h_g, src.h_b) - user << browse(dat, "window=hologram_console") - onclose(user, "hologram_console") - return - -/obj/machinery/computer/hologram_comp/Topic(href, href_list) - if(..()) - return 1 - if(in_range(src, usr)) - flick("holo_console1", src) - if(href_list["power"]) - if(src.projector.hologram) - src.projector.icon_state = "hologram0" - //src.projector.hologram = null - qdel(src.projector.hologram) - else - src.projector.hologram = new(src.projector.loc) - src.projector.hologram.icon = 'icons/mob/human.dmi' - src.projector.hologram.icon_state = "body_m_s" - src.projector.icon_state = "hologram1" - src.render() - else - if(href_list["h_r"]) - if(src.projector.hologram) - src.h_r += text2num(href_list["h_r"]) - src.h_r = min(max(src.h_r, 0), 255) - render() - else - if(href_list["h_g"]) - if(src.projector.hologram) - src.h_g += text2num(href_list["h_g"]) - src.h_g = min(max(src.h_g, 0), 255) - render() - else - if(href_list["h_b"]) - if(src.projector.hologram) - src.h_b += text2num(href_list["h_b"]) - src.h_b = min(max(src.h_b, 0), 255) - render() - else - if(href_list["light"]) - if(src.projector.hologram) - src.lumens += text2num(href_list["light"]) - src.lumens = min(max(src.lumens, -185.0), 35) - render() - else - if(href_list["reset"]) - if(src.projector.hologram) - src.lumens = 0 - render() - else - if(href_list["temp"]) - src.temp = null - for(var/mob/M in viewers(1, src)) - if((M.client && M.machine == src)) - src.show_console(M) - return diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 58404b133bd..0fc532ab0e4 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -1,7 +1,7 @@ -/* Holograms! +/* holograms! * Contains: * Holopad - * Hologram + * hologram * Other stuff */ @@ -9,11 +9,10 @@ Revised. Original based on space ninja hologram code. Which is also mine. /N How it works: AI clicks on holopad in camera view. View centers on holopad. -AI clicks again on the holopad to display a hologram. Hologram stays as long as AI is looking at the pad and it (the hologram) is in range of the pad. +AI clicks again on the holopad to display a hologram. hologram stays as long as AI is looking at the pad and it (the hologram) is in range of the pad. AI can use the directional keys to move the hologram around, provided the above conditions are met and the AI in question is the holopad's master. Only one AI may project from a holopad at any given time. AI may cancel the hologram at any time by clicking on the holopad once more. - Possible to do for anyone motivated enough: Give an AI variable for different hologram icons. Itegrate EMP effect to disable the unit. @@ -27,19 +26,35 @@ Possible to do for anyone motivated enough: // HOLOPAD MODE // 0 = RANGE BASED // 1 = AREA BASED -var/const/HOLOPAD_MODE = 0 +#define HOLOPAD_PASSIVE_POWER_USAGE 1 +#define HOLOGRAM_POWER_USAGE 2 +#define RANGE_BASED 0 +#define AREA_BASED 1 + +var/const/HOLOPAD_MODE = RANGE_BASED + var/list/holopads = list() /obj/machinery/hologram/holopad - name = "\improper AI holopad" - desc = "It's a floor-mounted device for projecting holographic images. It is activated remotely." + name = "holopad" + desc = "It's a floor-mounted device for projecting holographic images." icon_state = "holopad0" - + anchored = 1 + use_power = 1 + idle_power_usage = 5 + active_power_usage = 100 layer = TURF_LAYER+0.1 //Preventing mice and drones from sneaking under them. armor = list(melee = 50, bullet = 20, laser = 20, energy = 20, bomb = 0, bio = 0, rad = 0) - var/mob/living/silicon/ai/master//Which AI, if any, is controlling the object? Only one AI may control a hologram at any time. + var/list/masters = list()//List of living mobs that use the holopad + var/list/holorays = list()//Holoray-mob link. var/last_request = 0 //to prevent request spam. ~Carn var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. + var/temp = "" + var/list/holo_calls //array of /datum/holocalls + var/datum/holocall/outgoing_call //do not modify the datums only check and call the public procs + var/static/force_answer_call = FALSE //Calls will be automatically answered after a couple rings, here for debugging + var/obj/effect/overlay/holoray/ray + var/ringing = FALSE /obj/machinery/hologram/holopad/New() ..() @@ -49,6 +64,27 @@ var/list/holopads = list() component_parts += new /obj/item/stock_parts/capacitor(null) RefreshParts() +/obj/machinery/hologram/holopad/Destroy() + if(outgoing_call) + outgoing_call.ConnectionFailure(src) + + for(var/I in holo_calls) + var/datum/holocall/HC = I + HC.ConnectionFailure(src) + + for(var/I in masters) + clear_holo(I) + holopads -= src + return ..() + +/obj/machinery/hologram/holopad/power_change() + if(powered()) + stat &= ~NOPOWER + else + stat |= NOPOWER + if(outgoing_call) + outgoing_call.ConnectionFailure(src) + /obj/machinery/hologram/holopad/RefreshParts() var/holograph_range = 4 for(var/obj/item/stock_parts/capacitor/B in component_parts) @@ -68,197 +104,383 @@ var/list/holopads = list() default_deconstruction_crowbar(P) -/obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. +/obj/machinery/hologram/holopad/attack_hand(mob/living/carbon/human/user) + if(..()) + return + + if(outgoing_call) + return + + user.set_machine(src) + interact(user) + +/obj/machinery/hologram/holopad/AltClick(mob/living/carbon/human/user) + if(..()) + return + if(isAI(user)) + hangup_all_calls() + return + +//Stop ringing the AI!! +/obj/machinery/hologram/holopad/proc/hangup_all_calls() + for(var/I in holo_calls) + var/datum/holocall/HC = I + HC.Disconnect(src) + +/obj/machinery/hologram/holopad/interact(mob/living/carbon/human/user) //Carn: hologram requests. if(!istype(user)) return - if(alert(user,"Would you like to request an AI's presence?",,"Yes","No") == "Yes") - if(last_request + 200 < world.time) //don't spam the AI with requests you jerk! - last_request = world.time - to_chat(user, "You request an AI's presence.") - var/area/area = get_area(src) - for(var/mob/living/silicon/ai/AI in living_mob_list) - if(!AI.client) continue - to_chat(AI, "Your presence is requested at \the [area].") - else - to_chat(user, "A request for AI presence was already sent recently.") + var/dat + if(temp) + dat = temp + else + dat = "Request an AI's presence.
" + dat += "Call another holopad.
" + + if(LAZYLEN(holo_calls)) + dat += "=====================================================
" + + var/one_answered_call = FALSE + var/one_unanswered_call = FALSE + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad != src) + dat += "Answer call from [get_area(HC.calling_holopad)].
" + one_unanswered_call = TRUE + else + one_answered_call = TRUE + + if(one_answered_call && one_unanswered_call) + dat += "=====================================================
" + //we loop twice for formatting + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad == src) + dat += "Disconnect call from [HC.user].
" + + var/area/area = get_area(src) + var/datum/browser/popup = new(user, "holopad", "[area] holopad", 400, 300) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) + popup.open() + +/obj/machinery/hologram/holopad/Topic(href, href_list) + if(..() || isAI(usr)) + return + add_fingerprint(usr) + if(stat & NOPOWER) + return + if(href_list["AIrequest"]) + if(last_request + 200 < world.time) + last_request = world.time + temp = "You requested an AI's presence.
" + temp += "Main Menu" + var/area/area = get_area(src) + for(var/mob/living/silicon/ai/AI in ai_list) + if(!AI.client) + continue + to_chat(AI, "Your presence is requested at \the [area].") + else + temp = "A request for AI presence was already sent recently.
" + temp += "Main Menu" + + else if(href_list["Holocall"]) + if(outgoing_call) + return + + temp = "You must stand on the holopad to make a call!
" + temp += "Main Menu" + if(usr.loc == loc) + var/list/callnames = list() + for(var/I in holopads) + var/area/A = get_area(I) + if(A) + LAZYADD(callnames[A], I) + callnames -= get_area(src) + + var/result = input(usr, "Choose an area to call", "Holocall") as null|anything in callnames + + if(QDELETED(usr) || !result || outgoing_call) + return + + if(usr.loc == loc) + temp = "Dialing...
" + temp += "Main Menu" + new /datum/holocall(usr, src, callnames[result]) + + else if(href_list["connectcall"]) + var/datum/holocall/call_to_connect = locateUID(href_list["connectcall"]) + if(!QDELETED(call_to_connect) && (call_to_connect in holo_calls)) + call_to_connect.Answer(src) + temp = "" + + else if(href_list["disconnectcall"]) + var/datum/holocall/call_to_disconnect = locateUID(href_list["disconnectcall"]) + if(!QDELETED(call_to_disconnect)) + call_to_disconnect.Disconnect(src) + temp = "" + + else if(href_list["mainmenu"]) + temp = "" + if(outgoing_call) + outgoing_call.Disconnect() + + updateDialog() + +//do not allow AIs to answer calls or people will use it to meta the AI satellite /obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) if(!istype(user)) return + if(outgoing_call) + return /*There are pretty much only three ways to interact here. I don't need to check for client since they're clicking on an object. This may change in the future but for now will suffice.*/ - if(user.eyeobj.loc != src.loc)//Set client eye on the object if it's not already. + if(user.eyeobj.loc != loc)//Set client eye on the object if it's not already. user.eyeobj.setLoc(get_turf(src)) - else if(!hologram)//If there is no hologram, possibly make one. - activate_holo(user, 0) - else if(master == user)//If there is a hologram, remove it. But only if the user is the master. Otherwise do nothing. - clear_holo() - return + else if(!LAZYLEN(masters) || !masters[user])//If there is no hologram, possibly make one. + activate_holo(user, 1) + else//If there is a hologram, remove it. + clear_holo(user) -/obj/machinery/hologram/holopad/proc/activate_holo(mob/living/silicon/ai/user, var/force = 0) - if(!force && user.eyeobj.loc != src.loc) // allows holopads to pass off holograms to the next holopad in the chain +/obj/machinery/hologram/holopad/process() + for(var/I in masters) + var/mob/living/master = I + if((stat & NOPOWER) || !validate_user(master)) + clear_holo(master) + + if(outgoing_call) + outgoing_call.Check() + + ringing = FALSE + + for(var/I in holo_calls) + var/datum/holocall/HC = I + //Sanity check and skip if no longer valid call + if(!HC.Check()) + atom_say("Call was terminated at remote terminal.") + continue + + if(HC.connected_holopad != src) + if(force_answer_call && world.time > (HC.call_start_time + (HOLOPAD_MAX_DIAL_TIME / 2))) + HC.Answer(src) + break + if(outgoing_call) + HC.Disconnect(src)//can't answer calls while calling + else + playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring! + ringing = TRUE + + update_icon() + + +//Try to transfer hologram to another pad that can project on T +/obj/machinery/hologram/holopad/proc/transfer_to_nearby_pad(turf/T, mob/holo_owner) + if(!isAI(holo_owner)) + return + for(var/pad in holopads) + var/obj/machinery/hologram/holopad/another = pad + if(another == src) + continue + if(another.validate_location(T)) + var/obj/effect/overlay/holo_pad_hologram/h = masters[holo_owner] + unset_holo(holo_owner) + another.set_holo(holo_owner, h) + return TRUE + return FALSE + +/obj/machinery/hologram/holopad/proc/validate_user(mob/living/user) + if(QDELETED(user) || user.incapacitated() || !user.client) + return FALSE + + if(istype(user, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/AI = user + if(!AI.current) + return FALSE + return TRUE + +//Can we display holos there +//Area check instead of line of sight check because this is a called a lot if AI wants to move around. +/obj/machinery/hologram/holopad/proc/validate_location(turf/T,check_los = FALSE) + if(T.z == z && get_dist(T, src) <= holo_range && T.loc == get_area(src)) + return TRUE + return FALSE + + +/obj/machinery/hologram/holopad/proc/move_hologram(mob/living/user, turf/new_turf) + if(masters[user]) + var/obj/effect/overlay/holo_pad_hologram/holo = masters[user] + var/transfered = FALSE + if(!validate_location(new_turf)) + if(!transfer_to_nearby_pad(new_turf,user)) + clear_holo(user) + return FALSE + else + transfered = TRUE + //All is good. + holo.setDir(get_dir(holo.loc, new_turf)) + holo.forceMove(new_turf) + if(!transfered) + update_holoray(user,new_turf) + return TRUE + +/obj/machinery/hologram/holopad/proc/activate_holo(mob/living/user, var/force = 0) + var/mob/living/silicon/ai/AI = user + if(!istype(AI)) + AI = null + if(AI && !force && AI.eyeobj.loc != loc) // allows holopads to pass off holograms to the next holopad in the chain to_chat(user, "ERROR: Unable to project hologram.") - else if(!(stat & NOPOWER))//If the projector has power - if(user.holo) - var/obj/machinery/hologram/holopad/current = user.holo - current.clear_holo() - if(!hologram)//If there is not already a hologram. - create_holo(user)//Create one. - src.visible_message("A holographic image of [user] flicks to life right before your eyes!") - else - to_chat(user, "ERROR: Image feed in progress.") - else - to_chat(user, "ERROR: Unable to project hologram.") - return + if(!(stat & NOPOWER) && (!AI || force)) + if(AI && (istype(AI.current, /obj/machinery/hologram/holopad))) + to_chat(user, "ERROR: Image feed in progress.") + return + + var/obj/effect/overlay/holo_pad_hologram/hologram = new(loc)//Spawn a blank effect at the location. + if(isAI(user)) + hologram.icon = AI.holo_icon + else //make it like real life + hologram.icon = getHologramIcon(get_id_photo(user)) + hologram.icon_state = user.icon_state + hologram.alpha = 100 + hologram.Impersonation = user + + hologram.mouse_opacity = 0//So you can't click on it. + hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. + hologram.anchored = 1//So space wind cannot drag it. + hologram.name = "[user.name] (hologram)"//If someone decides to right click. + hologram.set_light(2) //hologram lighting + move_hologram() + + set_holo(user, hologram) + + if(!masters[user])//If there is not already a hologram. + visible_message("A holographic image of [user] flicks to life right before your eyes!") + + return hologram + + + to_chat(user, "ERROR: Hologram Projection Malfunction.") + clear_holo(user)//safety check /*This is the proc for special two-way communication between AI and holopad/people talking near holopad. For the other part of the code, check silicon say.dm. Particularly robot talk.*/ -/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text, verb, datum/language/speaking) - if(M && hologram && master)//Master is mostly a safety in case lag hits or something. - master.relay_speech(M, text, verb, speaking) +/obj/machinery/hologram/holopad/hear_talk(atom/movable/speaker, message, verb, datum/language/message_language) + if(speaker && masters.len)//Master is mostly a safety in case lag hits or something. Radio_freq so AIs dont hear holopad stuff through radios. + for(var/mob/living/silicon/ai/master in masters) + if(masters[master] && speaker != master) + master.relay_speech(speaker, message, verb, message_language) -/obj/machinery/hologram/holopad/hear_message(mob/living/M, text) - if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something. - var/name_used = M.GetVoice() - var/rendered = "Holopad received, [name_used] [text]" - master.show_message(rendered, 2) - return + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(HC.connected_holopad == src && speaker != HC.hologram) + HC.user.hear_say(message, verb, message_language, speaker = speaker) -/obj/machinery/hologram/holopad/proc/create_holo(mob/living/silicon/ai/A, turf/T = loc) - hologram = new(T)//Spawn a blank effect at the location. - hologram.icon = A.holo_icon - hologram.mouse_opacity = 0//So you can't click on it. - hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. - hologram.anchored = 1//So space wind cannot drag it. - hologram.name = "[A.name] (Hologram)"//If someone decides to right click. - hologram.set_light(2) //hologram lighting - set_light(2) //pad lighting - icon_state = "holopad1" - A.holo = src - master = A//AI is the master. - use_power = 2//Active power usage. - return 1 + if(outgoing_call && speaker == outgoing_call.user) + outgoing_call.hologram.atom_say(message) -/obj/machinery/hologram/holopad/proc/clear_holo() -// hologram.set_light(0)//Clear lighting. //handled by the lighting controller when its ower is deleted - QDEL_NULL(hologram)//Get rid of hologram. - if(master.holo == src) - master.holo = null - master = null//Null the master, since no-one is using it now. - set_light(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted) - icon_state = "holopad0" - use_power = 1//Passive power usage. - return 1 -/obj/machinery/hologram/holopad/process() - if(hologram)//If there is a hologram. - if(master && !master.stat && master.client && master.eyeobj)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. - if(!(stat & NOPOWER))//If the machine has power. - if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range))) - return 1 - else if(HOLOPAD_MODE == 1) - - var/area/holo_area = get_area(src) - var/area/eye_area = get_area(master.eyeobj) - - if(eye_area != holo_area) - return 1 - - var/mob/living/silicon/ai/theai = master - var/turf/target_turf = get_turf(master.eyeobj) - var/newdir = hologram.dir - clear_holo()//If not, we want to get rid of the hologram. - var/obj/machinery/hologram/holopad/pad_close = get_closest_atom(/obj/machinery/hologram/holopad, holopads, theai.eyeobj) - if(get_dist(pad_close, theai.eyeobj) <= pad_close.holo_range) - if(!(pad_close.stat & NOPOWER) && !pad_close.hologram && (theai && !theai.stat && theai.client)) - pad_close.activate_holo(theai, 1) - if(pad_close.hologram) - pad_close.hologram.forceMove(target_turf) - pad_close.hologram.dir = newdir - return 1 - -/obj/machinery/hologram/holopad/proc/move_hologram() - if(hologram) - step_to(hologram, master.eyeobj) // So it turns. - hologram.loc = get_turf(master.eyeobj) - - return 1 - -// Simple helper to face what you clicked on, in case it should be needed in more than one place -/obj/machinery/hologram/holopad/proc/face_atom(var/atom/A) - if( !hologram || !A || !hologram.x || !hologram.y || !A.x || !A.y ) return - var/dx = A.x - hologram.x - var/dy = A.y - hologram.y - if(!dx && !dy) // Wall items are graphically shifted but on the floor - if(A.pixel_y > 16) hologram.dir = NORTH - else if(A.pixel_y < -16)hologram.dir = SOUTH - else if(A.pixel_x > 16) hologram.dir = EAST - else if(A.pixel_x < -16)hologram.dir = WEST - return - - if(abs(dx) < abs(dy)) - if(dy > 0) hologram.dir = NORTH - else hologram.dir = SOUTH +/obj/machinery/hologram/holopad/proc/SetLightsAndPower() + var/total_users = masters.len + LAZYLEN(holo_calls) + use_power = HOLOPAD_PASSIVE_POWER_USAGE + HOLOGRAM_POWER_USAGE * total_users + if(total_users) + set_light(2) + icon_state = "holopad1" else - if(dx > 0) hologram.dir = EAST - else hologram.dir = WEST + set_light(0) + icon_state = "holopad0" + update_icon() -/* - * Hologram - */ +/obj/machinery/hologram/holopad/update_icon() + var/total_users = LAZYLEN(masters) + LAZYLEN(holo_calls) + if(ringing) + icon_state = "holopad_ringing" + else if(total_users) + icon_state = "holopad1" + else + icon_state = "holopad0" -/obj/machinery/hologram - anchored = 1 - use_power = 1 - idle_power_usage = 5 - active_power_usage = 100 - var/obj/effect/overlay/hologram//The projection itself. If there is one, the instrument is on, off otherwise. -//Destruction procs. -/obj/machinery/hologram/ex_act(severity) - switch(severity) - if(1.0) - qdel(src) - if(2.0) - if(prob(50)) - qdel(src) - if(3.0) - if(prob(5)) - qdel(src) - return +/obj/machinery/hologram/holopad/proc/set_holo(mob/living/user, var/obj/effect/overlay/holo_pad_hologram/h) + masters[user] = h + holorays[user] = new /obj/effect/overlay/holoray(loc) + var/mob/living/silicon/ai/AI = user + if(istype(AI)) + AI.current = src + SetLightsAndPower() + update_holoray(user, get_turf(loc)) + return TRUE -/obj/machinery/hologram/blob_act() - qdel(src) - return +/obj/machinery/hologram/holopad/proc/clear_holo(mob/living/user) + qdel(masters[user]) // Get rid of user's hologram + unset_holo(user) + return TRUE -/obj/machinery/hologram/holopad/Destroy() - holopads -= src - if(hologram) - clear_holo() +/obj/machinery/hologram/holopad/proc/unset_holo(mob/living/user) + var/mob/living/silicon/ai/AI = user + if(istype(AI) && AI.current == src) + AI.current = null + masters -= user // Discard AI from the list of those who use holopad + qdel(holorays[user]) + holorays -= user + SetLightsAndPower() + return TRUE + +/obj/machinery/hologram/holopad/proc/update_holoray(mob/living/user, turf/new_turf) + var/obj/effect/overlay/holo_pad_hologram/holo = masters[user] + var/obj/effect/overlay/holoray/ray = holorays[user] + var/disty = holo.y - ray.y + var/distx = holo.x - ray.x + var/newangle + if(!disty) + if(distx >= 0) + newangle = 90 + else + newangle = 270 + else + newangle = arctan(distx/disty) + if(disty < 0) + newangle += 180 + else if(distx < 0) + newangle += 360 + var/matrix/M = matrix() + if(get_dist(get_turf(holo), new_turf) <= 1) + animate(ray, transform = turn(M.Scale(1, sqrt(distx*distx+disty*disty)), newangle), time = 1) + else + ray.transform = turn(M.Scale(1, sqrt(distx*distx+disty*disty)), newangle) + + +/obj/effect/overlay/holo_pad_hologram + var/mob/living/Impersonation + var/datum/holocall/HC + +/obj/effect/overlay/holo_pad_hologram/Destroy() + Impersonation = null + if(!QDELETED(HC)) + HC.Disconnect(HC.calling_holopad) return ..() -/* -Holographic project of everything else. +/obj/effect/overlay/holo_pad_hologram/Process_Spacemove(movement_dir = 0) + return 1 -/mob/verb/hologram_test() - set name = "Hologram Debug New" - set category = "CURRENT DEBUG" +/obj/effect/overlay/holo_pad_hologram/examine(mob/user) + if(Impersonation) + return Impersonation.examine(user) + return ..() - var/obj/effect/overlay/hologram = new(loc)//Spawn a blank effect at the location. - var/icon/flat_icon = icon(getFlatIcon(src,0))//Need to make sure it's a new icon so the old one is not reused. - flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. - flat_icon.ChangeOpacity(0.5)//Make it half transparent. - var/input = input("Select what icon state to use in effect.",,"") - if(input) - var/icon/alpha_mask = new('icons/effects/effects.dmi', "[input]") - flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect. - hologram.icon = flat_icon - to_chat(world, "Your icon should appear now.") - return -*/ +/obj/effect/overlay/holoray + name = "holoray" + icon = 'icons/effects/96x96.dmi' + icon_state = "holoray" + layer = FLY_LAYER + density = FALSE + anchored = TRUE + mouse_opacity = 1 + pixel_x = -32 + pixel_y = -32 + alpha = 100 /* * Other Stuff: Is this even used? @@ -268,3 +490,6 @@ Holographic project of everything else. desc = "It makes a hologram appear...with magnets or something..." icon = 'icons/obj/stationobjs.dmi' icon_state = "hologram0" + +#undef HOLOPAD_PASSIVE_POWER_USAGE +#undef HOLOGRAM_POWER_USAGE diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a8deeff60a6..22e2e0ffe25 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 09b62f1c89c..bf11356b3a5 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -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) diff --git a/code/modules/mob/living/silicon/ai/freelook/chunk.dm b/code/modules/mob/living/silicon/ai/freelook/chunk.dm index eeeeed8e8bb..6737be463d6 100644 --- a/code/modules/mob/living/silicon/ai/freelook/chunk.dm +++ b/code/modules/mob/living/silicon/ai/freelook/chunk.dm @@ -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. diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 71a2e6cba36..2728a1af55e 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -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" diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 1755674b4f6..42f132e39d4 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -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) diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 0de811224dc..0a3ed47b933 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -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 = "[name] [message]" to_chat(src, "Holopad action relayed, [real_name] [message]") @@ -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. ..() diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index f7976645bc4..dcae187b028 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -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" diff --git a/icons/effects/96x96.dmi b/icons/effects/96x96.dmi index 2fdc968ebd6..a5195cc0167 100644 Binary files a/icons/effects/96x96.dmi and b/icons/effects/96x96.dmi differ diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index fa6f26fefe6..24515e61641 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ diff --git a/icons/obj/stationobjs.dmi b/icons/obj/stationobjs.dmi index 997642dcf29..d4b8e837db6 100755 Binary files a/icons/obj/stationobjs.dmi and b/icons/obj/stationobjs.dmi differ diff --git a/paradise.dme b/paradise.dme index aa34fb03b85..f9ee9ca47ea 100644 --- a/paradise.dme +++ b/paradise.dme @@ -224,6 +224,7 @@ #include "code\datums\datum.dm" #include "code\datums\datumvars.dm" #include "code\datums\gas_mixture.dm" +#include "code\datums\holocall.dm" #include "code\datums\hud.dm" #include "code\datums\mind.dm" #include "code\datums\mixed.dm" @@ -630,7 +631,6 @@ #include "code\game\machinery\computer\computer.dm" #include "code\game\machinery\computer\crew.dm" #include "code\game\machinery\computer\HolodeckControl.dm" -#include "code\game\machinery\computer\hologram.dm" #include "code\game\machinery\computer\honkputer.dm" #include "code\game\machinery\computer\law.dm" #include "code\game\machinery\computer\medical.dm"