Files
Bubberstation/code/modules/pai/actions.dm
SkyratBot d865f6fa9a [MIRROR] pAIs control a PDA they're inserted into [MDB IGNORE] (#23519)
* 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>
2023-09-04 20:04:07 -04:00

79 lines
2.1 KiB
Plaintext

/datum/action/innate/pai
name = "PAI Action"
button_icon = 'icons/mob/actions/actions_silicon.dmi'
var/mob/living/silicon/pai/pai_owner
/datum/action/innate/pai/Trigger(trigger_flags)
if(!ispAI(owner))
return FALSE
pai_owner = owner
/datum/action/innate/pai/software
name = "Software Interface"
button_icon_state = "pai"
background_icon_state = "bg_tech"
overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/software/Trigger(trigger_flags)
..()
pai_owner.ui_act()
/datum/action/innate/pai/shell
name = "Toggle Holoform"
button_icon_state = "pai_holoform"
background_icon_state = "bg_tech"
overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/shell/Trigger(trigger_flags)
..()
if(pai_owner.holoform)
pai_owner.fold_in(0)
else
pai_owner.fold_out()
/datum/action/innate/pai/chassis
name = "Holochassis Appearance Composite"
button_icon_state = "pai_chassis"
background_icon_state = "bg_tech"
overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/chassis/Trigger(trigger_flags)
..()
pai_owner.choose_chassis()
/datum/action/innate/pai/rest
name = "Rest"
button_icon_state = "pai_rest"
background_icon_state = "bg_tech"
overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/rest/Trigger(trigger_flags)
..()
pai_owner.toggle_resting()
/datum/action/innate/pai/light
name = "Toggle Integrated Lights"
button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "emp"
background_icon_state = "bg_tech"
overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/light/Trigger(trigger_flags)
..()
pai_owner.toggle_integrated_light()
/datum/action/innate/pai/messenger
name = "Interact with PDA"
button_icon_state = "pda"
background_icon_state = "bg_tech"
overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/messenger/Trigger(trigger_flags)
. = ..()
var/obj/item/pai_card/pai_holder = owner.loc
if(!istype(pai_holder.loc, /obj/item/modular_computer))
owner.balloon_alert(owner, "not in a pda!")
return
var/obj/item/modular_computer/computer_host = pai_holder.loc
computer_host.interact(owner)