From 593fe47c1c7f2a8cd396d7cfddafbf88d20bee93 Mon Sep 17 00:00:00 2001
From: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Date: Wed, 22 Oct 2025 00:50:14 +0300
Subject: [PATCH] PAI leashes can be toggled on or off by owners (#93239)
## About The Pull Request
PAI leashes can be toggled on or off by owners
## Why It's Good For The Game
i do agree with the idea of tying PAIs to their owners considering what
the P stands for and i wish it had worked out the way it was intended,
but it has sort of deterred a lot of people from playing the role. even
as the PAI owner in shifts where very little was going on, i did sort of
find it socially exhausting to have to be tied to my PAI for the entire
round and a massive responsibility since the fun the other player was
having was solely depending on me. i found myself wishing we could have
a little break from each other every now and then 3. i realize most of
these are my own shortcomings, but i speculate atleast a few other pai
owners may go through the same things which may tie into why very few
pai devices are being picked up
## Changelog
:cl:
feature: PAI leashes can now be turned on or off by pai owners. (they
are on by default)
/:cl:
---
code/modules/pai/card.dm | 4 ++++
code/modules/pai/pai.dm | 16 +++++++++-------
tgui/packages/tgui/interfaces/PaiCard.tsx | 15 +++++++++++----
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/code/modules/pai/card.dm b/code/modules/pai/card.dm
index eba717bdb1d..0c394227c6c 100644
--- a/code/modules/pai/card.dm
+++ b/code/modules/pai/card.dm
@@ -122,6 +122,7 @@
name = pai.name,
transmit = pai.can_transmit,
receive = pai.can_receive,
+ leashed = pai.leash,
range = pai.leash?.distance,
)
return data
@@ -156,6 +157,9 @@
if("toggle_holo")
pai.toggle_holo()
return TRUE
+ if("toggle_leash")
+ pai.toggle_leash()
+ return TRUE
if("toggle_radio")
pai.toggle_radio(params["option"])
return TRUE
diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm
index 7ccb16810b9..3875c5101e8 100644
--- a/code/modules/pai/pai.dm
+++ b/code/modules/pai/pai.dm
@@ -213,16 +213,23 @@
pai_card.set_personality(src)
card = pai_card
forceMove(pai_card)
- leash = AddComponent(/datum/component/leash, pai_card, HOLOFORM_DEFAULT_RANGE, force_teleport_out_effect = /obj/effect/temp_visual/guardian/phase/out)
+ toggle_leash()
addtimer(VARSET_WEAK_CALLBACK(src, holochassis_ready, TRUE), HOLOCHASSIS_INIT_TIME)
if(!holoform)
add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), PAI_FOLDED)
update_appearance(UPDATE_DESC)
-
RegisterSignal(src, COMSIG_LIVING_CULT_SACRIFICED, PROC_REF(on_cult_sacrificed))
RegisterSignals(src, list(COMSIG_LIVING_ADJUST_BRUTE_DAMAGE, COMSIG_LIVING_ADJUST_BURN_DAMAGE), PROC_REF(on_shell_damaged))
RegisterSignal(src, COMSIG_LIVING_ADJUST_STAMINA_DAMAGE, PROC_REF(on_shell_weakened))
+/mob/living/silicon/pai/proc/toggle_leash()
+ if(isnull(card))
+ return
+ if(leash)
+ QDEL_NULL(leash)
+ else
+ leash = AddComponent(/datum/component/leash, card, HOLOFORM_DEFAULT_RANGE, force_teleport_out_effect = /obj/effect/temp_visual/guardian/phase/out)
+
/mob/living/silicon/pai/create_modularInterface()
if(!modularInterface)
modularInterface = new /obj/item/modular_computer/pda/silicon/pai(src)
@@ -335,9 +342,7 @@
master_dna = "Untraceable Signature"
// Sets supplemental directive to this
add_supplied_law(0, "Do not interfere with the operations of the Syndicate.")
- QDEL_NULL(leash) // Freedom!!!
to_chat(src, span_danger("ALERT: Foreign software detected."))
- to_chat(src, span_danger("WARN: Holochasis range restrictions disabled."))
return TRUE
/mob/living/silicon/pai/on_saboteur(datum/source, disrupt_duration)
@@ -465,9 +470,6 @@
/// Updates the distance we can be from our pai card
/mob/living/silicon/pai/proc/increment_range(increment_amount)
- if(emagged)
- return
-
var/new_distance = leash.distance + increment_amount
if (new_distance < HOLOFORM_MIN_RANGE || new_distance > HOLOFORM_MAX_RANGE)
return
diff --git a/tgui/packages/tgui/interfaces/PaiCard.tsx b/tgui/packages/tgui/interfaces/PaiCard.tsx
index a20655f274d..7817e3b0a08 100644
--- a/tgui/packages/tgui/interfaces/PaiCard.tsx
+++ b/tgui/packages/tgui/interfaces/PaiCard.tsx
@@ -36,6 +36,7 @@ type Pai = {
name: string;
transmit: BooleanLike;
receive: BooleanLike;
+ leashed: BooleanLike;
range: number;
};
@@ -162,6 +163,7 @@ const PaiOptions = (props) => {
name,
transmit,
receive,
+ leashed,
range,
},
} = data;
@@ -194,10 +196,16 @@ const PaiOptions = (props) => {
Toggle
+
+
+
- {emagged ? (
- '∞'
- ) : (
- )}