From bd999f28293e8cd98d2d97f00f0feae309216ce3 Mon Sep 17 00:00:00 2001 From: KeptheKobold <62698555+KeptheKobold@users.noreply.github.com> Date: Fri, 1 Aug 2025 20:11:24 +0300 Subject: [PATCH] Re-Adds leashing to pAIs as a pAI side optional toggle (#4297) ## About The Pull Request pAIs can now toggle if they wish to project out of their cards or take their cards with them. This can be toggled whenever they are in their card form with a new action button spirited by ExusA ## Why It's Good For The Game Lets pAI players choose between projecting out as a hologram, and running around with their card inside of their hologram thingy ## Proof Of Testing Compiled the game and spawned as pAI. Tested turning on and off the leash, and made sure couldnt change it while folded out ## Changelog :cl: code: Added toggle to turn leashing on or off for pAIs, from pAI side image: Added new sprite for Leash toggle for pAIs, made by ExusA /:cl: --------- Co-authored-by: Kobo <> --- code/modules/pai/pai.dm | 11 +++-- code/modules/pai/shell.dm | 49 ++++++++++++++--------- modular_zubbers/code/modules/pai/hud.dm | 26 ++++++++++++ modular_zubbers/code/modules/pai/pai.dm | 10 +++++ modular_zubbers/icons/hud/screen_pai.dmi | Bin 0 -> 788 bytes tgstation.dme | 2 + 6 files changed, 77 insertions(+), 21 deletions(-) create mode 100644 modular_zubbers/code/modules/pai/hud.dm create mode 100644 modular_zubbers/code/modules/pai/pai.dm create mode 100644 modular_zubbers/icons/hud/screen_pai.dmi diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index f77d327d114..c3914a88064 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -220,7 +220,7 @@ pai_card.set_personality(src) card = pai_card forceMove(pai_card) - // BUBBER EDIT REMOVAL: PAI Freedom: ORIGINAL: leash = AddComponent(/datum/component/leash, pai_card, HOLOFORM_DEFAULT_RANGE, force_teleport_out_effect = /obj/effect/temp_visual/guardian/phase/out) + leash = AddComponent(/datum/component/leash, pai_card, HOLOFORM_DEFAULT_RANGE, force_teleport_out_effect = /obj/effect/temp_visual/guardian/phase/out) addtimer(VARSET_WEAK_CALLBACK(src, holochassis_ready, TRUE), HOLOCHASSIS_INIT_TIME) if(!holoform) add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), PAI_FOLDED) @@ -261,7 +261,12 @@ SEND_SIGNAL(src, COMSIG_LIVING_HEALTH_UPDATE) /mob/living/silicon/pai/update_desc(updates) - desc = "A pAI mobile hard-light holographics emitter. This one appears in the form of a [chassis]." // BUBBER EDIT: PAI Freedom: ORIGINAL: desc = "A hard-light holographic avatar representing a pAI. This one appears in the form of a [chassis]." +// BUBBER EDIT START: PAI ReLeashed: ORIGINAL: desc = "A hard-light holographic avatar representing a pAI. This one appears in the form of a [chassis]." + if(!holo_leash) + desc = "A pAI mobile hard-light holographics emitter. This one appears in the form of a [chassis]." + else + desc = "A hard-light holographic avatar representing a pAI. This one appears in the form of a [chassis]." +// BUBBER EDIT END return ..() /mob/living/silicon/pai/update_icon_state() @@ -472,7 +477,7 @@ /// Updates the distance we can be from our pai card /mob/living/silicon/pai/proc/increment_range(increment_amount) - if(!leash) // BUBBER EDIT: PAI Freedom: ORIGINAL: if(emagged) + if(!holo_leash) // BUBBER EDIT: PAI ReLeashed: ORIGINAL: if(emagged) return var/new_distance = leash.distance + increment_amount diff --git a/code/modules/pai/shell.dm b/code/modules/pai/shell.dm index 43938258496..9b9882f0766 100644 --- a/code/modules/pai/shell.dm +++ b/code/modules/pai/shell.dm @@ -78,7 +78,12 @@ if(!holoform) . = fold_out(force) return FALSE - visible_message(span_notice("[src] deactivates its holochassis emitter and folds back into a compact card!")) // BUBBER EDIT: PAI Freedom: ORIGINAL: visible_message(span_notice("[src] dematerialises!")) + // BUBBER EDIT START: PAI ReLeashed + if(!holo_leash) + visible_message(span_notice("[src] deactivates its holochassis emitter and folds back into a compact card!")) // BUBBER EDIT: PAI Freedom: ORIGINAL: visible_message(span_notice("[src] dematerialises!")) + else + visible_message(span_notice("[src] dematerialises!")) + // BUBBER EDIT END stop_pulling() if(ispickedupmob(loc)) var/obj/item/mob_holder/mob_head = loc @@ -88,9 +93,10 @@ client.set_eye(card) if (isturf(loc)) new /obj/effect/temp_visual/guardian/phase/out(loc) - // BUBBER EDIT ADDITION START: PAI Freedom - var/turf/target = drop_location() - card.forceMove(target) + // BUBBER EDIT ADDITION START: PAI ReLeashed + if(!holo_leash) + var/turf/target = drop_location() + card.forceMove(target) // BUBBER EDIT END forceMove(card) add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), PAI_FOLDED) @@ -126,26 +132,33 @@ REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, PAI_FOLDED) REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, PAI_FOLDED) REMOVE_TRAIT(src, TRAIT_UNDENSE, PAI_FOLDED) - // BUBBER EDIT START: PAI Freedom: ORIGINAL: forceMove(get_turf(card)) - if(istype(card.loc, /obj/item/modular_computer)) - 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 - forceMove(get_turf(card)) - card.forceMove(src) - + // BUBBER EDIT START: PAI ReLeashed: ORIGINAL: forceMove(get_turf(card)) + if(!holo_leash) + if(istype(card.loc, /obj/item/modular_computer)) + 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 + forceMove(get_turf(card)) + card.forceMove(src) + else + forceMove(get_turf(card)) // BUBBER EDIT END if(client) client.perspective = EYE_PERSPECTIVE client.set_eye(src) set_light_on(FALSE) update_appearance(UPDATE_ICON_STATE) - visible_message(span_boldnotice("[src] folds out its holochassis emitter and forms a holoshell around itself!")) // BUBBER EDIT: PAI Freedom: ORIGINAL: visible_message(span_boldnotice("[src] appears in a flash of light!")) + // BUBBER EDIT START: PAI ReLeashed + if(!holo_leash) + visible_message(span_boldnotice("[src] folds out its holochassis emitter and forms a holoshell around itself!")) // BUBBER EDIT: PAI Freedom: ORIGINAL: visible_message(span_boldnotice("[src] appears in a flash of light!")) + else + visible_message(span_boldnotice("[src] appears in a flash of light!")) + // BUBBER EDIT END: PAI ReLeashed holoform = TRUE return TRUE diff --git a/modular_zubbers/code/modules/pai/hud.dm b/modular_zubbers/code/modules/pai/hud.dm new file mode 100644 index 00000000000..22ff5c4fb0d --- /dev/null +++ b/modular_zubbers/code/modules/pai/hud.dm @@ -0,0 +1,26 @@ +/atom/movable/screen/pai/leash + name = "Toggle Leash" + icon = 'modular_zubbers/icons/hud/screen_pai.dmi' + icon_state = "pai_leash" + +/atom/movable/screen/pai/leash/Click() + if(!..()) + return + var/mob/living/silicon/pai/pAI = usr + if(!pAI.holoform) + if(pAI.holo_leash) + pAI.balloon_alert(usr, "emitters set to Move") + pAI.holo_leash = FALSE + else + pAI.balloon_alert(usr, "emitters set to Project") + pAI.holo_leash = TRUE + else + pAI.balloon_alert(usr, "your emitters are active!") + +/datum/hud/pai/New(mob/living/silicon/pai/owner) + ..() + var/atom/movable/screen/using +// Hololeash + using = new /atom/movable/screen/pai/leash(null, src) + using.screen_loc = "SOUTH:6,WEST+14" + static_inventory += using diff --git a/modular_zubbers/code/modules/pai/pai.dm b/modular_zubbers/code/modules/pai/pai.dm new file mode 100644 index 00000000000..00dea295c99 --- /dev/null +++ b/modular_zubbers/code/modules/pai/pai.dm @@ -0,0 +1,10 @@ +// pAI +/mob/living/silicon/pai + /// Whetever this pAI has leashing enabled + var/holo_leash = FALSE +/mob/living/silicon/pai/get_status_tab_items() + . = ..() + if(!holo_leash) + . += "Emitter set to: Move" + else + . += "Emitter set to: Project" diff --git a/modular_zubbers/icons/hud/screen_pai.dmi b/modular_zubbers/icons/hud/screen_pai.dmi new file mode 100644 index 0000000000000000000000000000000000000000..80aa735ec39abeadf0fa5167fe63fb1a7b07227b GIT binary patch literal 788 zcmV+v1MB>WP)V=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+ z(=$pSoZ^zil2jm5sUR^kJ|{J?I75kxGbOXA7$|1Q#hF%=n41b=D=WDAxqyuZ0J)1B zvC+uEVE_OEVo5|nRCt`lS3OI^P!vtIKOmqW1($-8piAZsb#U+pI4HOXE{^TkvEb6W zbrDELVtjwJqai8=H=T)dmy}<_jT?)_kAR#e!p+b5_2_p#JQ{_MHeh z04y$4rY5gg1LORv>e{%Jp@bq-0pNO|8k2;iI}qFjjvpxqqH>A4c1JlO=NQ^*uEm8Ace(-`&L~au zH8g=~8Ub>Bjx;2$0fO>3TZUgsTlUfCh+0z;xfEceB-8DvInt1*0QWE<2?1St^u?IM z6aXrQT4=HayuBZ+%X^ok-UX)V2wQDIK-y@F8lT$%J%aJrD-j`W9kQ)(1+bTKzca!( zzyUA+x%ji)hNHC%wtHpKICQ*()W7it&4MjhIcR{m7GKmvq^ zJ8Ij(M%{Y(_g_(&zld(%-$G7MjmOU~V`FK#7zg4MkcW^=1KURB`C=T1Q((VdF;4FW zfs>Hr`}O#*-dqmgd;R$6GI7Ae{X?kk_&#}z&LL5fKc}uS8KB S5IukZ0000