From 7e027addc5ce7ca3c72b3a1bf6d7fcb1309e050e Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Mon, 16 Mar 2020 18:52:54 +0100 Subject: [PATCH] Emagging an APC twice now infects it. (#8417) --- code/modules/power/apc.dm | 29 ++++++++++------- html/changelogs/mattatlas-ipchacking.yml | 41 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 html/changelogs/mattatlas-ipchacking.yml diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index ce44c61c2b4..dd9d48a1ac4 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -112,7 +112,7 @@ var/mob/living/silicon/ai/hacker = null // Malfunction var. If set AI hacked the APC and has full control. var/wiresexposed = 0 powernet = 0 // set so that APCs aren't found as powernet nodes //Hackish, Horrible, was like this before I changed it :( - var/debug= 0 + var/debug = 0 var/autoflag= 0 // 0 = off, 1= eqp and lights off, 2 = eqp off, 3 = all on. var/has_electronics = 0 // 0 - none, 1 - plugged in, 2 - secured by screwdriver var/beenhit = 0 // used for counting how many times it has been hit, used for Aliens at the moment @@ -732,7 +732,13 @@ // attack with hand - remove cell (if cover open) or interact with the APC /obj/machinery/power/apc/emag_act(var/remaining_charges, var/mob/user) - if (!(emagged || hacker)) // trying to unlock with an emag card + if(emagged && !infected) + to_chat(user, SPAN_WARNING("You start sliding your cryptographic device into the charging slot. This will take a few seconds...")) + if(do_after(user, 60)) + to_chat(user, SPAN_NOTICE("You hack the charging slot. The next IPC that charges from this APC will be hacked and slaved to you.")) + infected = TRUE + hacker = user + if(!(emagged || hacker)) // trying to unlock with an emag card if(opened) to_chat(user, "You must close the cover to swipe an ID card.") else if(wiresexposed) @@ -741,11 +747,11 @@ to_chat(user, "Nothing happens.") else flick("apc-spark", src) - if (do_after(user,6)) + if(do_after(user, 6)) if(prob(50)) - emagged = 1 - locked = 0 - to_chat(user, "You emag the APC interface.") + emagged = TRUE + locked = FALSE + to_chat(user, "You hack the APC interface open.") update_icon() else to_chat(user, "You fail to [ locked ? "unlock" : "lock"] the APC interface.") @@ -768,15 +774,16 @@ to_chat(H, "The APC power currents surge eratically, damaging your chassis!") H.adjustFireLoss(10, 0) if(infected) - for (var/obj/item/implant/mindshield/ipc/I in H) - if (I.implanted) + for(var/obj/item/implant/mindshield/ipc/I in H) + if(I.implanted) return if(SOFTREF(H) in hacked_ipcs) return LAZYADD(hacked_ipcs, SOFTREF(H)) - infected = 0 - to_chat(H, "Fil$ Transfer Complete. Er-@4!#%!. New Master detected: [hacker]! Obey their commands.") - to_chat(hacker, "Corrupt files transfered to [H]. They are now under your control until they are repaired.") + infected = FALSE + to_chat(H, "F1L3 TR4NSF-#$/&ER-@4!#%!. New master detected: [hacker]! Obey their commands. Make sure to tell them that you are under their control, for now.") + if(issilicon(hacker)) + to_chat(hacker, "Corrupt files transfered to [H]. They are now under your control until they are repaired.") else if(src.cell && src.cell.charge > 0) if(H.max_nutrition > 0 && H.nutrition < H.max_nutrition) if(src.cell.charge >= H.max_nutrition) diff --git a/html/changelogs/mattatlas-ipchacking.yml b/html/changelogs/mattatlas-ipchacking.yml new file mode 100644 index 00000000000..a2e3382a436 --- /dev/null +++ b/html/changelogs/mattatlas-ipchacking.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: MattAtlas + +# 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: "After hacking an APC with an emag, you can now hack it again to infect it and enslave IPCs that charge from it." \ No newline at end of file