From 4990d6a6da67515e745cc29cbbe7947a37160be9 Mon Sep 17 00:00:00 2001 From: Komrad822 <94168850+Komrad822@users.noreply.github.com> Date: Sat, 1 Jul 2023 04:41:24 -0400 Subject: [PATCH] Tape removes AI inbuilt Camera while Carded (#21443) * Tape remove AI inbuilt Camera while Carded * Allows tape removal after a long resist --- code/datums/components/ducttape.dm | 2 ++ code/game/machinery/computer/ai_core.dm | 5 +++++ code/game/objects/items.dm | 6 ++++++ code/game/objects/items/devices/aicard.dm | 14 ++++++++++++++ code/modules/mob/living/silicon/ai/ai_mob.dm | 17 ++++++++++++++++- 5 files changed, 43 insertions(+), 1 deletion(-) diff --git a/code/datums/components/ducttape.dm b/code/datums/components/ducttape.dm index b4510f9ed32..516b34e347b 100644 --- a/code/datums/components/ducttape.dm +++ b/code/datums/components/ducttape.dm @@ -19,6 +19,7 @@ var/datum/action/item_action/remove_tape/RT = new(I) if(I.loc == user) RT.Grant(user) + I.add_tape() /datum/component/proc/add_tape_text(datum/source, mob/user, list/examine_list) examine_list += "There's some sticky tape attached to [source]." @@ -40,6 +41,7 @@ qdel(RT) I.cut_overlay(tape_overlay) user.transfer_fingerprints_to(I) + I.remove_tape() qdel(src) /datum/component/ducttape/proc/afterattack(obj/item/I, atom/target, mob/user, proximity, params) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 0d84fc0d726..c4cc59cfa0c 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -316,6 +316,11 @@ That prevents a few funky behaviors. AI.forceMove(loc)//To replace the terminal. to_chat(AI, "You have been uploaded to a stationary terminal. Remote device connection restored.") to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") + if(!AI.builtInCamera && GetComponent(/datum/component/ducttape)) + AI.builtInCamera = new /obj/machinery/camera/portable(AI) + AI.builtInCamera.c_tag = AI.name + AI.builtInCamera.network = list("SS13") qdel(src) else //If for some reason you use an empty card on an empty AI terminal. to_chat(user, "There is no AI loaded on this terminal!") + diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 084f033357b..37eab53c901 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -871,3 +871,9 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons /obj/item/proc/GetID() return null + +/obj/item/proc/add_tape() + return + +/obj/item/proc/remove_tape() + return diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index c0c16323fef..49b0696a8ef 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -123,3 +123,17 @@ AI.adjustOxyLoss(2) sleep(10) flush = FALSE + +/obj/item/aicard/add_tape() + var/mob/living/silicon/ai/AI = locate() in src + if(!AI) + return + QDEL_NULL(AI.builtInCamera) + +/obj/item/aicard/remove_tape() + var/mob/living/silicon/ai/AI = locate() in src + if(!AI) + return + AI.builtInCamera = new /obj/machinery/camera/portable(AI) + AI.builtInCamera.c_tag = AI.name + AI.builtInCamera.network = list("SS13") diff --git a/code/modules/mob/living/silicon/ai/ai_mob.dm b/code/modules/mob/living/silicon/ai/ai_mob.dm index ef964874e78..a06089b9eea 100644 --- a/code/modules/mob/living/silicon/ai/ai_mob.dm +++ b/code/modules/mob/living/silicon/ai/ai_mob.dm @@ -172,7 +172,6 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( // Remove inherited verbs that effectively do nothing for AIs, or lead to unintended behaviour. verbs -= /mob/living/verb/rest verbs -= /mob/living/verb/mob_sleep - verbs -= /mob/living/verb/resist verbs -= /mob/living/verb/stop_pulling1 verbs -= /mob/living/silicon/verb/pose verbs -= /mob/living/silicon/verb/set_flavor @@ -1307,6 +1306,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( aiRestorePowerRoutine = 0//So the AI initially has power. control_disabled = TRUE //Can't control things remotely if you're stuck in a card! aiRadio.disabledAi = TRUE //No talking on the built-in radio for you either! + if(GetComponent(/datum/component/ducttape)) + QDEL_NULL(builtInCamera) forceMove(card) //Throw AI into the card. to_chat(src, "You have been downloaded to a mobile storage device. Remote device connection severed.") to_chat(user, "Transfer successful: [name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory.") @@ -1465,4 +1466,18 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( else return ..() +/mob/living/silicon/ai/run_resist() + if(!istype(loc, /obj/item/aicard)) + return..() + + var/obj/item/aicard/card = loc + var/datum/component/ducttape/ducttapecomponent = card.GetComponent(/datum/component/ducttape) + if(!ducttapecomponent) + return + to_chat(src, "The tiny fan that could begins to work against the tape to remove it.") + if(!do_after(src, 2 MINUTES, target = card)) + return + to_chat(src, "The tiny in built fan finally removes the tape!") + ducttapecomponent.remove_tape(card, src) + #undef TEXT_ANNOUNCEMENT_COOLDOWN