From 1d40ed488c436c0277d4945ff49c41db6dd3a656 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 5 Aug 2023 18:44:10 -0500 Subject: [PATCH] Add pAI movement freedom when emagged (#77325) ## About The Pull Request New emagged pAIs improvements: - Disables the range restriction - Renamed the `Malicious Software Detected` button to `Reset Software` since it resets the software to default state - Added a new law notification and flavor texts ## Why It's Good For The Game More unique emag effects are good. Plus this adds some polish to the current emag effects so the UI is smoother. ## Changelog :cl: add: Add pAI movement freedom when emagged. qol: The "Malicious Software Detected" button has been appropriately renamed to "Reset Software" for when pAIs are emagged qol: Add a new law notification popup and flavor texts when pAI is emagged /:cl: --- code/modules/pai/card.dm | 2 +- code/modules/pai/pai.dm | 10 +++++- tgui/packages/tgui/interfaces/PaiCard.tsx | 40 +++++++++++++---------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/code/modules/pai/card.dm b/code/modules/pai/card.dm index cc6f22e1ec5..a1b25312ecf 100644 --- a/code/modules/pai/card.dm +++ b/code/modules/pai/card.dm @@ -117,7 +117,7 @@ name = pai.name, transmit = pai.can_transmit, receive = pai.can_receive, - range = pai.leash.distance, + range = pai.leash?.distance, ) return data diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index 1da97757e8b..e350f85b98a 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -162,6 +162,7 @@ QDEL_NULL(internal_gps) QDEL_NULL(newscaster) QDEL_NULL(signaler) + QDEL_NULL(leash) card = null GLOB.pai_list.Remove(src) return ..() @@ -334,7 +335,10 @@ master_name = "The Syndicate" master_dna = "Untraceable Signature" // Sets supplemental directive to this - laws.supplied[1] = "Do not interfere with the operations of the Syndicate." + 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 /** @@ -350,6 +354,7 @@ master_name = null master_dna = null add_supplied_law(0, "None.") + leash = AddComponent(/datum/component/leash, card, HOLOFORM_DEFAULT_RANGE, force_teleport_out_effect = /obj/effect/temp_visual/guardian/phase/out) balloon_alert(src, "software rebooted") return TRUE @@ -449,6 +454,9 @@ /// 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 4a15a46e5d1..c8f5ba33f7c 100644 --- a/tgui/packages/tgui/interfaces/PaiCard.tsx +++ b/tgui/packages/tgui/interfaces/PaiCard.tsx @@ -186,23 +186,27 @@ const PaiOptions = (props, context) => { - - - )}