From d4d89e45137e90a23de7e180b72456c1ed3489cb Mon Sep 17 00:00:00 2001 From: "Wowzewow (Wezzy)" <42310821+alsoandanswer@users.noreply.github.com> Date: Tue, 30 Aug 2022 04:02:54 +0800 Subject: [PATCH] Portable Memory Wiper. (#14696) --- aurorastation.dme | 1 + .../datums/outfits/event/outfit_nanotrasen.dm | 4 + code/datums/uplink/devices and tools.dm | 2 +- .../game/objects/items/devices/memorywiper.dm | 122 ++++++++++++++++++ .../closets/secure/scientist.dm | 1 + html/changelogs/wezzy_memorywiper.yml | 41 ++++++ icons/obj/memorywiper.dmi | Bin 0 -> 1280 bytes 7 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 code/game/objects/items/devices/memorywiper.dm create mode 100644 html/changelogs/wezzy_memorywiper.yml create mode 100644 icons/obj/memorywiper.dmi diff --git a/aurorastation.dme b/aurorastation.dme index ce07676ff1e..124d5e3b983 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -902,6 +902,7 @@ #include "code\game\objects\items\devices\magnetic_lock.dm" #include "code\game\objects\items\devices\medicaltools.dm" #include "code\game\objects\items\devices\megaphone.dm" +#include "code\game\objects\items\devices\memorywiper.dm" #include "code\game\objects\items\devices\modkit.dm" #include "code\game\objects\items\devices\multitool.dm" #include "code\game\objects\items\devices\oxycandle.dm" diff --git a/code/datums/outfits/event/outfit_nanotrasen.dm b/code/datums/outfits/event/outfit_nanotrasen.dm index 9e72ee78dd4..cd4072f8083 100644 --- a/code/datums/outfits/event/outfit_nanotrasen.dm +++ b/code/datums/outfits/event/outfit_nanotrasen.dm @@ -121,6 +121,10 @@ pda = /obj/item/modular_computer/handheld/pda/command/cciaa id = /obj/item/card/id/ccia + backpack_contents = list( + /obj/item/device/memorywiper = 1 + ) + id_icon = "ccia" id_access = "CCIA Agent" diff --git a/code/datums/uplink/devices and tools.dm b/code/datums/uplink/devices and tools.dm index 6376ad1b7eb..f39ee0de373 100644 --- a/code/datums/uplink/devices and tools.dm +++ b/code/datums/uplink/devices and tools.dm @@ -214,4 +214,4 @@ name = "25 Liquid-Bags" desc = "Use these bags to set up some barricades. Does not come with barbed wire included." item_cost = 2 - path = /obj/item/stack/liquidbags \ No newline at end of file + path = /obj/item/stack/liquidbags diff --git a/code/game/objects/items/devices/memorywiper.dm b/code/game/objects/items/devices/memorywiper.dm new file mode 100644 index 00000000000..e24e7274c1c --- /dev/null +++ b/code/game/objects/items/devices/memorywiper.dm @@ -0,0 +1,122 @@ + +/obj/item/device/memorywiper + name = "portable memory wiper" + desc = "Inset into a sturdy pelican case, this computer holds the software and wiring necessary to wipe and factory reset any IPC." + desc_info = "You can alt-click the laptop while it's set down on surface to open it up and work with it. Left clicking while it is open will allow you to operate it." + icon = 'icons/obj/memorywiper.dmi' + icon_state = "portable_memorywiper" + item_state = "portable_memorywiper" + contained_sprite = TRUE + anchored = FALSE + drop_sound = 'sound/items/drop/backpack.ogg' + pickup_sound = 'sound/items/pickup/backpack.ogg' + var/mob/living/carbon/human/attached = null + var/wiping = FALSE + var/datum/progressbar/wipe_bar + var/wipe_start_time = 0 + +/obj/item/device/memorywiper/Destroy() + if(attached) + attached = null + wiping = FALSE + return ..() + + +/obj/item/device/memorywiper/AltClick() + if(use_check(usr)) + return + if(!isturf(loc)) + to_chat(usr, SPAN_NOTICE("\The [src] has to be on a stable surface first!")) + return + anchored = !anchored + if(attached) + unplug() + playsound(src.loc, 'sound/items/storage/briefcase.ogg', 50, 1, -5) + update_icon() + +/obj/item/device/memorywiper/update_icon() + cut_overlays() + if(anchored) + icon_state = "[initial(icon_state)]_opened" + if(attached) + add_overlay("wireout") + if(wiping) + add_overlay("screen") + else + icon_state = initial(icon_state) + +/obj/item/device/memorywiper/MouseDrop(over_object, src_location, over_location) + ..() + if(use_check_and_message(usr)) + return + if(in_range(src, usr) && isipc(over_object) && in_range(over_object, src)) + if(attached) + if(attached == usr) + to_chat(usr, "You unplug \the [src] from your maintenace port.") + else + visible_message("[usr] unplugs \the [src] from [attached]'s maintenance port.") + unplug() + return + else + if(over_object == usr) + plug(over_object) + to_chat(usr, "You plug \the [src] into your maintenace port.") + else + visible_message("[usr] begins hunting for the maintenance port on \the [over_object]'s chassis.") // The age old question of "where do I put it in!?" + if(do_after(usr, 50)) + plug(over_object) + visible_message("[usr] plugs \the [src] into \the [attached]'s maintenance port.") + +/obj/item/device/memorywiper/attack_hand(user as mob) + if(attached) + to_chat(user, SPAN_NOTICE("You initialize the memory wipe protocols. This procedure will take approximately 30 seconds.")) + to_chat(attached, SPAN_WARNING("The computer hums to life and you feel your memories bleed away into nothingness.")) + playsound(src.loc, /decl/sound_category/keyboard_sound, 30, TRUE) + wiping = TRUE + update_icon() + if(wipe_bar) + to_chat(src, SPAN_WARNING("The memory wipe protocol is already in progress!")) + return + + var/wipe_time = rand(20 SECONDS, 40 SECONDS) + addtimer(CALLBACK(src, .proc/memorywipe), wipe_time) + wipe_bar = new /datum/progressbar/autocomplete(src, wipe_time, attached) + wipe_start_time = world.time + wipe_bar.update(0) + if(anchored) + return + if(..()) + return + +/obj/item/device/memorywiper/proc/memorywipe() + if(attached && wiping) + visible_message(SPAN_NOTICE("\The [src] pings, \"Memory wipe protocols complete.\"")) + playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) + to_chat(attached, "The process finishes, leaving you with nothing beyond your base programming and databases.") + wiping = FALSE + switch(alert(attached, "You've lost your memories! You can choose to ghost, or stay and be manipulated for someone else's ulterior motives...", "Memory Loss", "Ghost", "Stay")) + if("Ghost") + attached.ghostize(0) + +/obj/item/device/memorywiper/process() + if(attached) + if(!attached.Adjacent(src)) + attached.visible_message(SPAN_WARNING("The cable rips out of [attached]'s maintenace port."), SPAN_DANGER("\The [src]'s cable rips out of your maintenace port.")) + unplug() + return + +/obj/item/device/memorywiper/proc/unplug() + if(wiping) + visible_message(SPAN_WARNING("\The [src]'s screen flashes, \"ERROR : IPC NOT FOUND, TERMINATING PROTOCOL.\"")) + playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, TRUE) + wiping = FALSE + playsound(src.loc, 'sound/machines/id_swipe.ogg', 25, 1) + attached = null + STOP_PROCESSING(SSprocessing, src) + update_icon() + +/obj/item/device/memorywiper/proc/plug(over_object) + playsound(src.loc, 'sound/weapons/click.ogg', 25, 1) + attached = over_object + START_PROCESSING(SSprocessing, src) + update_icon() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm index cfff8ecbd8d..841f565d45c 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm @@ -37,6 +37,7 @@ new /obj/item/storage/box/tethers(src) new /obj/item/taperoll/science(src) new /obj/item/gun/energy/disruptorpistol/miniature(src) + new /obj/item/device/memorywiper(src) /obj/structure/closet/secure_closet/RD2 name = "research director's attire" diff --git a/html/changelogs/wezzy_memorywiper.yml b/html/changelogs/wezzy_memorywiper.yml new file mode 100644 index 00000000000..1ff5c7781ce --- /dev/null +++ b/html/changelogs/wezzy_memorywiper.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Wowzewow(Wezzy), niennab + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds the IPC portable memory wiper." diff --git a/icons/obj/memorywiper.dmi b/icons/obj/memorywiper.dmi new file mode 100644 index 0000000000000000000000000000000000000000..bf3bf7dbe82ad5cae13e6493d79a4a4e86286ce3 GIT binary patch literal 1280 zcmV+b1^@bqP)C0001TP)t-sz`($7 zS~7fQJK4saxSnN*azn+cZsF9m7#J8RC@57`Rouaa|MAWfFDZ*Bkpc$`yKaB_9` z^iy#0_2eo`Eh^5;&r`5fFwryM;w;ZhDainGjE%TBGg33tGfE(w;*!LYR3KBSAit<2 zF)1fCJ~uTtzo@c2vmmudiHkEOv#1y-ZOFx$R+N~V3Sr~b6rW#^nwOeFP;YT^QEF-) zc4ekO(bSy8N|3ODju8|Z!Z8{|7+RiLl$u{!LY~8mG7$PqNYIyqQ=hVetDg%vIslzD zc@y^JEs_8L1AR$EK~#90?V5{Lqc9La$r~18eRN$Pp{uR?|G&7I1htgF1RILym|N|M zjEA`mX-Ot6icBUJLTN#Of>Ltv1okkshZ*ObxfV(6U{5FnB^)4Bh?4|VNX8}Ma9nUA zIg^5>%#S4?f-xIoR4GLn@qeZiz!E_JK-W-rDQrhUA0-t)5|Fa2ejQVlW#S&FYt=BO z0LB_s*Zm%-Dt&c~uBuakUObRvGEQy!x~>}!v{c<212*B+=94QcG!VGH*=(*i_W5QL z6u751Ty0lN1 z6DZ5_Uyrg(I|wm>rKe=5fPmXI>prSoJME+t!_Ar@tpi$#r{yTn^^$hCA>X=ae&;~n zU-LpsvrHzF$(*&ciiqO^*!up=I4-dLWcKPdB904S>w73~+}^q0+3Wu}f%9G=)`Pgf z+Ji8YSr}hmSTTQBUsz3G?^2s~Jpq@xHLD4j*0}n@Y63;OH@m}%`HS_ge#eUMz;7b3 z=H>qu0&C~bWHOmdCX>lT5x)_%%$CuNohY)zmK~q55l09QA4fW8D#$6N;j_m6FYmS$ z$44Bd2lk zMFo@>P-6mWT7b%QX_a5n2Z