Skip to content

Commit

Permalink
Holopad Caller History (#3005)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Holopads now show the location of the last holopad that called them on
examine.

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

While having to shamefully ask over wideband to have someone call again
after you missed their call is funny, knowing where to callback if you
miss someone should help streamline ship to ship communication and
improve quality of life.

## Changelog

:cl:
add: Holopads now display the location of the last holopad that called
them on examine.
code: Span macros for hologram.dm
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Gristlebee <[email protected]>
Co-authored-by: FalloutFalcon <[email protected]>
  • Loading branch information
Gristlebee and FalloutFalcon authored May 27, 2024
1 parent 5483d6a commit 79d4142
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Possible to do for anyone motivated enough:
var/secure = FALSE
/// If we are currently calling another holopad
var/calling = FALSE
/// The last holopad that called this one.
var/caller_history

/obj/machinery/holopad/Initialize()
. = ..()
Expand Down Expand Up @@ -178,7 +180,9 @@ Possible to do for anyone motivated enough:
/obj/machinery/holopad/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Current projection range: <b>[holo_range]</b> units.</span>"
. += span_notice("The status display reads: Current projection range: <b>[holo_range]</b> units.")
if(caller_history)
. += span_notice("The caller history displays the last recieved call to be from: [caller_history].")

/obj/machinery/holopad/attackby(obj/item/P, mob/user, params)
if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P))
Expand All @@ -195,11 +199,11 @@ Possible to do for anyone motivated enough:

if(istype(P,/obj/item/disk/holodisk))
if(disk)
to_chat(user,"<span class='warning'>There's already a disk inside [src]!</span>")
to_chat(user,span_warning("There's already a disk inside [src]!"))
return
if (!user.transferItemToLoc(P,src))
return
to_chat(user,"<span class='notice'>You insert [P] into [src].</span>")
to_chat(user,span_notice("You insert [P] into [src]."))
disk = P
return

Expand Down Expand Up @@ -249,15 +253,15 @@ Possible to do for anyone motivated enough:
if("AIrequest")
if(last_request + 200 < world.time)
last_request = world.time
to_chat(usr, "<span class='info'>You requested an AI's presence.</span>")
to_chat(usr, span_info("You requested an AI's presence."))
var/area/area = get_area(src)
for(var/mob/living/silicon/ai/AI in GLOB.silicon_mobs)
if(!AI.client)
continue
to_chat(AI, "<span class='info'>Your presence is requested at <a href='?src=[REF(AI)];jumptoholopad=[REF(src)]'>\the [area]</a>.</span>")
to_chat(AI, span_info("Your presence is requested at <a href='?src=[REF(AI)];jumptoholopad=[REF(src)]'>\the [area]</a>."))
return TRUE
else
to_chat(usr, "<span class='info'>A request for AI presence was already sent recently.</span>")
to_chat(usr, span_info("A request for AI presence was already sent recently."))
return
if("holocall")
if(outgoing_call)
Expand All @@ -280,7 +284,7 @@ Possible to do for anyone motivated enough:
calling = TRUE
return TRUE
else
to_chat(usr, "<span class='warning'>You must stand on the holopad to make a call!</span>")
to_chat(usr, span_warning("You must stand on the holopad to make a call!"))
if("connectcall")
var/datum/holocall/call_to_connect = locate(params["holopad"]) in holo_calls
if(!QDELETED(call_to_connect))
Expand Down Expand Up @@ -374,6 +378,7 @@ Possible to do for anyone motivated enough:
for(var/I in holo_calls)
var/datum/holocall/HC = I
if(HC.connected_holopad != src)
caller_history = get_area_name(HC.calling_holopad)
if(force_answer_call && world.time > (HC.call_start_time + (HOLOPAD_MAX_DIAL_TIME / 2)))
HC.Answer(src)
break
Expand All @@ -392,7 +397,7 @@ Possible to do for anyone motivated enough:

if(is_operational && (!AI || AI.eyeobj.loc == loc))//If the projector has power and client eye is on it
if (AI && istype(AI.current, /obj/machinery/holopad))
to_chat(user, "<span class='danger'>ERROR:</span> \black Image feed in progress.")
to_chat(user, span_danger("ERROR:</span> \black Image feed in progress."))
return

var/obj/effect/overlay/holo_pad_hologram/Hologram = new(loc)//Spawn a blank effect at the location.
Expand All @@ -415,11 +420,11 @@ Possible to do for anyone motivated enough:
move_hologram(user, loc)

set_holo(user, Hologram)
visible_message("<span class='notice'>A holographic image of [user] flickers to life before your eyes!</span>")
visible_message(span_notice("A holographic image of [user] flickers to life before your eyes!"))

return Hologram
else
to_chat(user, "<span class='danger'>ERROR:</span> Unable to project hologram.")
to_chat(user, span_danger("ERROR: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.*/
Expand Down Expand Up @@ -583,7 +588,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
Hologram.set_anchored(TRUE)//So space wind cannot drag it.
Hologram.name = "[record.caller_name] (Hologram)"//If someone decides to right click.
Hologram.set_light(2) //hologram lighting
visible_message("<span class='notice'>A holographic image of [record.caller_name] flickers to life before your eyes!</span>")
visible_message(span_notice("A holographic image of [record.caller_name] flickers to life before your eyes!"))
return Hologram

/obj/machinery/holopad/proc/replay_start()
Expand Down

0 comments on commit 79d4142

Please sign in to comment.