diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index e969751e1dd..4e907975426 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -159,7 +159,7 @@ /atom/proc/AICtrlClick(var/mob/living/silicon/ai/user) if(user.holo) var/obj/machinery/hologram/holopad/H = user.holo - H.face_atom(src) + H.face_atom(src)//runtime return /obj/machinery/door/airlock/AICtrlClick() // Bolts doors diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm new file mode 100644 index 00000000000..1ef623179a5 --- /dev/null +++ b/code/datums/holocall.dm @@ -0,0 +1,159 @@ +#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/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 + LAZYADD(H.holo_calls, src) + + if(!dialed_holopads.len) + calling_holopad.visible_message("Connection failure.") + qdel(src) + return + + log_debug("Holocall started") + +//cleans up ALL references :) +/datum/holocall/Destroy() + QDEL_NULL(eye) + + user.reset_perspective() + + user = null + hologram.HC = null + hologram = null + calling_holopad.outgoing_call = null + + 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.SetLightsAndPower() + calling_holopad = null + if(connected_holopad) + connected_holopad.SetLightsAndPower() + connected_holopad = null + + log_debug("Holocall destroyed") + + 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) + testing("Holocall disconnect") + if(H == connected_holopad) + calling_holopad.visible_message("[usr] disconnected.") + else if(H == calling_holopad && connected_holopad) + connected_holopad.visible_message("[usr] disconnected.") + + 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) + testing("Holocall connection failure: graceful [graceful]") + if(H == connected_holopad || H == calling_holopad) + if(!graceful) + calling_holopad.visible_message("Connection failure.") + qdel(src) + return + + LAZYREMOVE(H.holo_calls, src) + dialed_holopads -= H + if(!dialed_holopads.len) + if(graceful) + calling_holopad.visible_message("Call rejected.") + log_debug("No recipients, terminating") + 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) + testing("Holocall answer") + if(H == calling_holopad) + CRASH("How cute, a holopad tried to answer itself.") + + if(!(H in dialed_holopads)) + return + + if(connected_holopad) + CRASH("Multi-connection holocall") + + 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 + + //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.reset_perspective(eye) + eye.setLoc(H.loc) + +//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) + . = !qdeleted(connected_holopad) && !(calling_holopad.stat & NOPOWER) + else + . = world.time < (call_start_time + HOLOPAD_MAX_DIAL_TIME) + if(!.) + calling_holopad.visible_message("No answer recieved.") + calling_holopad.temp = "" + + if(!.) + log_debug("Holocall Check fail") + qdel(src) \ No newline at end of file diff --git a/code/game/machinery/computer/hologram.dm b/code/game/machinery/computer/hologram.dm deleted file mode 100644 index 26b7fa17fa2..00000000000 --- a/code/game/machinery/computer/hologram.dm +++ /dev/null @@ -1,120 +0,0 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - -/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 aa345e29643..966ba88ed23 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,7 +9,7 @@ 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. @@ -27,19 +27,31 @@ Possible to do for anyone motivated enough: // HOLOPAD MODE // 0 = RANGE BASED // 1 = AREA BASED +#define HOLOPAD_PASSIVE_POWER_USAGE 1 +#define HOLOGRAM_POWER_USAGE 2 + var/const/HOLOPAD_MODE = 0 + 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. - 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/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 = TRUE //Calls will be automatically answered after a couple rings, here for debugging + var/static/list/holopads = list() /obj/machinery/hologram/holopad/New() ..() @@ -49,6 +61,21 @@ var/list/holopads = list() component_parts += new /obj/item/weapon/stock_parts/capacitor(null) RefreshParts() +/obj/machinery/hologram/holopad/Destroy() + if(outgoing_call) + LAZYADD(holo_calls, outgoing_call) + outgoing_call = null + + for(var/I in holo_calls) + var/datum/holocall/HC = I + HC.ConnectionFailure(src) + LAZYCLEARLIST(holo_calls) + + for (var/I in masters) + clear_holo(I) + holopads -= src + return ..() + /obj/machinery/hologram/holopad/RefreshParts() var/holograph_range = 4 for(var/obj/item/weapon/stock_parts/capacitor/B in component_parts) @@ -68,7 +95,7 @@ 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(var/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") @@ -82,184 +109,308 @@ var/list/holopads = list() else to_chat(user, "A request for AI presence was already sent recently.") -/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) +/obj/machinery/hologram/holopad/proc/CheckCallClose() + for(var/I in holo_calls) + var/datum/holocall/HC = I + if(usr == HC.eye) + HC.Disconnect(HC.calling_holopad) //disconnect via clicking the called holopad + return TRUE + return FALSE + +/obj/machinery/hologram/holopad/Click(location,control,params) + if(!CheckCallClose()) + return ..() + +/obj/machinery/hologram/holopad/AltClick(mob/living/carbon/human/user) + if(!CheckCallClose()) + interact(user) + +/obj/machinery/hologram/holopad/interact(mob/living/carbon/human/user) //Carn: hologram requests. if(!istype(user)) return + + if(outgoing_call || user.incapacitated() || !(stat & NOPOWER)) + return + + user.set_machine(src) + 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/datum/browser/popup = new(user, "holopad", name, 300, 130) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.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 = locate(href_list["connectcall"]) + if(!qdeleted(call_to_connect)) + call_to_connect.Answer(src) + temp = "" + + else if(href_list["disconnectcall"]) + var/datum/holocall/call_to_disconnect = locate(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 sattelite +/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) + if (!istype(user)) + 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. user.eyeobj.setLoc(get_turf(src)) - else if(!hologram)//If there is no hologram, possibly make one. + else if(!masters[user])//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 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 + var/mob/living/silicon/ai/AI = master + if(!istype(AI)) + AI = null + + if(!qdeleted(master) && !master.incapacitated() && master.client && (!AI || AI.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(AI) //ais are range based + if((HOLOPAD_MODE == 0 && (get_dist(AI.eyeobj, src) <= holo_range))) + return 1 + + else if(HOLOPAD_MODE == 1) + + var/area/holo_area = get_area(src) + var/area/eye_area = get_area(AI.eyeobj) + + if(eye_area != holo_area) + return 1 + + else + var/turf/target_turf = get_turf(AI.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, AI.eyeobj) + if(get_dist(pad_close, AI.eyeobj) <= pad_close.holo_range) + if(!(pad_close.stat & NOPOWER) && !pad_close.masters[src]) + pad_close.activate_holo(AI, 1) + if(pad_close.masters[src]) + pad_close.AI.forceMove(target_turf) + //pad_close.hologram.dir = newdir + else + continue + clear_holo(master)//If not, we want to get rid of the hologram. + + if(outgoing_call) + outgoing_call.Check() + + for(var/I in holo_calls) + var/datum/holocall/HC = I + 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! + +/obj/machinery/hologram/holopad/proc/move_hologram(mob/living/user, turf/new_turf) + if(masters[user]) + var/obj/effect/overlay/holo_pad_hologram/H = masters[user] + step_to(H, new_turf) + H.loc = new_turf + + return 1 + +/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(istype(AI) && !force && AI.eyeobj.loc != src.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. + + if(!(stat & NOPOWER) && (!AI || AI.eyeobj.loc == loc))//If the projector has power and client eye is on it + if (AI && istype(AI.current, /obj/machinery/hologram/holopad)) + to_chat(user, "ERROR: \black Image feed in progress.") + return + + if(!masters[user])//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.") + visible_message("A holographic image of [user] flicks to life right before your eyes!") + else - to_chat(user, "ERROR: Unable to project hologram.") - return + to_chat(user, "ERROR: \black Unable to project hologram.") /*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_message(speaker, message, verb, message_language)//< 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 - else - if(dx > 0) hologram.dir = EAST - else hologram.dir = WEST - -/* - * Hologram - */ - -/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/blob_act() - qdel(src) - return - -/obj/machinery/hologram/holopad/Destroy() - holopads -= src - if(hologram) - clear_holo() +/obj/effect/overlay/holo_pad_hologram/Destroy() + Impersonation = null + if(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 -*/ /* * Other Stuff: Is this even used? @@ -269,3 +420,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/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 71a2e6cba36..3f105fa8d4c 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -30,8 +30,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 diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 7f25a743fc7..c91fbca3b76 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -75,8 +75,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/holopad/T = current + if(istype(T) && T.masters[src]) //Human-like, sorta, heard by those who understand humans. var/rendered_a @@ -116,8 +116,8 @@ if(!message) return - var/obj/machinery/hologram/holopad/T = src.holo - if(T && T.hologram && T.master == src) + var/obj/machinery/holopad/T = current + if(istype(T) && T.masters[src]) var/rendered = "[name] [message]" to_chat(src, "Holopad action relayed, [real_name] [message]") @@ -129,8 +129,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/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/paradise.dme b/paradise.dme index 2b1a4cf4eda..421e7b9daec 100644 --- a/paradise.dme +++ b/paradise.dme @@ -204,6 +204,7 @@ #include "code\datums\datacore.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\material_container.dm" #include "code\datums\mind.dm" @@ -585,7 +586,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"