PAI Holochassis are now leashed to an area around their card (#76763)

## About The Pull Request

This change restricts PAI holograms to an area around their assigned PAI
card. If you leave this area, you are teleported back to the card's
location (but not automatically put back into the card).

https://www.youtube.com/watch?v=L2ThEVa4nx8

This setting can be configured from the PAI menu, it's set pretty short
in the video because otherwise it wouldn't teleport when I threw the
card and I like doing that.

![image](https://github.com/tgstation/tgstation/assets/7483112/faf0fa0b-e9d6-4990-8d8c-f30def2892f1)

To accomodate this I set up a component to deal with a reasonably common
problem I have had, "what if I want to track the movement of something
in a box in a bag in someone's inventory". Please tell me if the
solution I came up with is stupid and we already have a better one that
I forgot about.

Also now you can put pAIs inside bots again, by popular request.

## Why It's Good For The Game

Personal AIs are intended to be personal assistants to their owner.
rather than fully independent entities which can pick up their own card
and leave as soon as they spawn.
As "aimless wanderer" players can now possess station bots, pAIs can be
limited to an area around the bearer of their card.

Because the holoform now doesn't contain the card, this also means that
a PAI cannot run off and then be impossible to retrieve. You are always
in control of where it can go.

Also it's funny to throw the card and watch the chicken get teleported
to it.

## Changelog

🆑
add: Personal AI holograms are now limited to an area around their PAI
card. The size of this are can be configured via the PAI card.
add: pAI cards can now be placed inside bots in order to grant them
control of the bot.
/🆑
This commit is contained in:
Jacquerel
2023-07-14 19:10:34 -06:00
committed by GitHub
parent f2fe624ca4
commit 52c8da7ea4
18 changed files with 332 additions and 65 deletions
+9 -20
View File
@@ -9,10 +9,7 @@
/mob/living/silicon/pai/update_resting()
. = ..()
if(resting)
icon_state = "[chassis]_rest"
else
icon_state = "[chassis]"
update_appearance(UPDATE_ICON_STATE)
if(loc != card)
visible_message(span_notice("[src] [resting? "lays down for a moment..." : "perks up from the ground."]"))
@@ -77,11 +74,11 @@
addtimer(VARSET_CALLBACK(src, holochassis_ready, TRUE), HOLOCHASSIS_COOLDOWN)
else
addtimer(VARSET_CALLBACK(src, holochassis_ready, TRUE), HOLOCHASSIS_OVERLOAD_COOLDOWN)
icon_state = "[chassis]"
set_resting(FALSE, silent = TRUE, instant = TRUE)
if(!holoform)
. = fold_out(force)
return FALSE
visible_message(span_notice("[src] deactivates its holochassis emitter and folds back into a compact card!"))
visible_message(span_notice("[src] dematerialises!"))
stop_pulling()
if(ispickedupmob(loc))
var/obj/item/clothing/head/mob_holder/mob_head = loc
@@ -89,8 +86,8 @@
if(client)
client.perspective = EYE_PERSPECTIVE
client.set_eye(card)
var/turf/target = drop_location()
card.forceMove(target)
if (isturf(loc))
new /obj/effect/temp_visual/guardian/phase/out(loc)
forceMove(card)
add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), PAI_FOLDED)
set_density(FALSE)
@@ -129,20 +126,14 @@
var/obj/item/modular_computer/pc = card.loc
pc.inserted_pai = null
pc.visible_message(span_notice("[src] ejects itself from [pc]!"))
if(isliving(card.loc))
var/mob/living/living_holder = card.loc
if(!living_holder.temporarilyRemoveItemFromInventory(card))
balloon_alert(src, "unable to expand")
return FALSE
card.forceMove(get_turf(pc))
forceMove(get_turf(card))
card.forceMove(src)
if(client)
client.perspective = EYE_PERSPECTIVE
client.set_eye(src)
set_light_on(FALSE)
icon_state = "[chassis]"
held_state = "[chassis]"
visible_message(span_boldnotice("[src] folds out its holochassis emitter and forms a holoshell around itself!"))
update_appearance(UPDATE_ICON_STATE)
visible_message(span_boldnotice("[src] appears in a flash of light!"))
holoform = TRUE
return TRUE
@@ -157,9 +148,7 @@
if(!choice)
return FALSE
chassis = choice
icon_state = "[chassis]"
held_state = "[chassis]"
desc = "A pAI mobile hard-light holographics emitter. This one appears in the form of a [chassis]."
update_appearance(UPDATE_DESC | UPDATE_ICON_STATE)
return TRUE
/**