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 00000000000..bf3bf7dbe82 Binary files /dev/null and b/icons/obj/memorywiper.dmi differ