From cb8ca472a1f2ff60d69a8cf46ad103f04dacd972 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Wed, 16 Nov 2022 02:39:16 -0500 Subject: [PATCH] Re-adds the clown's PDA virus honking (#71035) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About The Pull Request Re-adds the Clown's virus disk's ability to make machines, airlocks, and computers honk, which was removed in the transition from PDA to modular computer. Fun fact: This was broken for a long time, I had fixed it in https://github.com/tgstation/tgstation/pull/64443 before it got accidentally wiped off the face of the earth. To anyone who isn't aware: - Clown's virus disk has 5 charges - You can use these charges to install viruses in computers, airlocks, and machines if they're screwed open (computers dont need to) - This will make them honk when used. - You can get charges back by slipping people with the PDA while the virus disk is installed in it (which it is by default) - The max charges you can get at once is 5. ## Why It's Good For The Game A feature that was lost in the PDA to modular computer transition, now re-added. It's a cool feature and I personally would use it if I played bad jobs. Things actually working is a 🛩️ ## Changelog :cl: fix: Clown PDA virus disk can once again be installed in machines, computers, and airlocks. /:cl: --- .../computers/item/tablet.dm | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/code/modules/modular_computers/computers/item/tablet.dm b/code/modules/modular_computers/computers/item/tablet.dm index b419d03b253..25cae33a914 100644 --- a/code/modules/modular_computers/computers/item/tablet.dm +++ b/code/modules/modular_computers/computers/item/tablet.dm @@ -67,6 +67,34 @@ return ..() +/obj/item/modular_computer/tablet/pre_attack(atom/target, mob/living/user, params) + if(!inserted_disk || !ismachinery(target)) + return ..() + + var/obj/machinery/target_machine = target + if(!target_machine.panel_open && !istype(target, /obj/machinery/computer)) + return ..() + + if(!istype(inserted_disk, /obj/item/computer_disk/virus/clown)) + return ..() + var/obj/item/computer_disk/virus/clown/installed_cartridge = inserted_disk + if(!installed_cartridge.charges) + to_chat(user, span_notice("Out of virus charges.")) + return ..() + + to_chat(user, span_notice("You upload the virus to [target]!")) + var/sig_list = list(COMSIG_ATOM_ATTACK_HAND) + if(istype(target,/obj/machinery/door/airlock)) + sig_list = list(COMSIG_AIRLOCK_OPEN, COMSIG_AIRLOCK_CLOSE) + + installed_cartridge.charges-- + target.AddComponent( + /datum/component/sound_player, \ + uses = rand(15,20), \ + signal_list = sig_list, \ + ) + return TRUE + /obj/item/modular_computer/tablet/interact(mob/user) . = ..() if(HAS_TRAIT(src, TRAIT_PDA_MESSAGE_MENU_RIGGED))