mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-08 07:52:54 +00:00
* pAIs control a PDA they're inserted into (#78103) ## About The Pull Request This PR lets pAIs inserted into a PDA to control the PDA of their owner. They can see their own pAI configurations but cannot edit any of it. They also can't eject themselves from it. This means they can receive and send PDA messages as their owner, acting like a personal secretary This also adds support for multiple people using a PDA and its UI updating for all of them and PDA messages being received and responded to from multiple people under the same PDA It also removes pAI camera in favor of using siliconcamera, which is the same thing; this just cuts down on some copy paste. I also reverted PDA's ringer being off preventing messages from being sent to your chat, silent mode was meant to prevent only the ringing sound. ## Why It's Good For The Game pAIs can now do a little bit more to help their owners on a personal level, and adds support for more stuff like this in the future (an idea I had was being able to hack into PDAs in the same way the CE can hack into APCs remotely) This is a re-PR of https://github.com/tgstation/tgstation/pull/76445 but it's a little better this time and does not remove the PDA Messenger app from pAIs. ## Changelog 🆑 fix: PDAs being on silent no longer prevents PDAs from being sent to your chat, again. add: pAIs inserted into a PDA can now control the PDA, and will receive PDA messages sent to it (and can respond under the PDA's name). /🆑 * pAIs control a PDA they're inserted into --------- Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
58 lines
1.8 KiB
Plaintext
58 lines
1.8 KiB
Plaintext
/mob/living/silicon/pai/ClickOn(atom/target, params)
|
|
. = ..()
|
|
if(aicamera && aicamera.in_camera_mode)
|
|
aicamera.toggle_camera_mode(sound = FALSE)
|
|
aicamera.captureimage(target, usr)
|
|
return TRUE
|
|
|
|
/obj/item/camera/siliconcam/pai_camera
|
|
name = "pAI photo camera"
|
|
light_color = COLOR_PAI_GREEN
|
|
|
|
/obj/item/camera/siliconcam/pai_camera/after_picture(mob/user, datum/picture/picture)
|
|
var/number = length(stored)
|
|
picture.picture_name = "Image [number] (taken by [loc.name])"
|
|
stored[picture] = TRUE
|
|
playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 75, TRUE, -3)
|
|
balloon_alert(user, "image recorded")
|
|
|
|
/**
|
|
* Handles selecting and printing stored images.
|
|
*
|
|
* @param {mob} user - The pAI.
|
|
*
|
|
* @returns {boolean} - TRUE if the pAI prints an image,
|
|
* FALSE otherwise.
|
|
*/
|
|
/obj/item/camera/siliconcam/pai_camera/proc/pai_print(mob/user)
|
|
var/mob/living/silicon/pai/pai = loc
|
|
var/datum/picture/selection = selectpicture(user)
|
|
if(!istype(selection))
|
|
balloon_alert(user, "invalid image")
|
|
return FALSE
|
|
printpicture(user, selection)
|
|
user.visible_message(span_notice("A picture appears on top of the chassis of [pai.name]!"), span_notice("You print a photograph."))
|
|
return TRUE
|
|
|
|
/**
|
|
* All inclusive camera proc. Zooms, snaps, prints.
|
|
*
|
|
* @param {mob} user - The pAI requesting the camera.
|
|
*
|
|
* @param {string} mode - The camera option to toggle.
|
|
*
|
|
* @returns {boolean} - TRUE if the camera worked.
|
|
*/
|
|
/mob/living/silicon/pai/proc/use_camera(mob/user, mode)
|
|
if(!aicamera || isnull(mode))
|
|
return FALSE
|
|
switch(mode)
|
|
if(PAI_PHOTO_MODE_CAMERA)
|
|
aicamera.toggle_camera_mode(user)
|
|
if(PAI_PHOTO_MODE_PRINTER)
|
|
var/obj/item/camera/siliconcam/pai_camera/paicam = aicamera
|
|
paicam.pai_print(user)
|
|
if(PAI_PHOTO_MODE_ZOOM)
|
|
aicamera.adjust_zoom(user)
|
|
return TRUE
|