Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] EFTPOS Hacking Key #27742

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions code/datums/uplink_items/uplink_general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,15 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
item = /obj/item/handheld_mirror
cost = 5

/datum/uplink_item/stealthy_tools/eftpos_hack_key
name = "EFTPOS Hacking Key"
desc = "The EFTPOS Hacking Key is a tiny gadget that can be inserted into EFTPOS terminals, \
allowing agents to steal account numbers and access data after transactions. \
Note: An Agent ID Card is required to retrieve the stolen data and access permissions; these are sold separately."
reference = "EFTHK"
item = /obj/item/storage/box/syndie_kit/eftpos_hacking_kit
cost = 15 // Ask Balance Team

////////////////////////////////////////
// MARK: DEVICES AND TOOLS
////////////////////////////////////////
Expand Down
194 changes: 194 additions & 0 deletions code/game/objects/items/devices/eftpos_hack_key.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/obj/item/eftpos_hack_key
name = "EFTPOS Hacking Key"
desc = "A small key inserted into EFTPOS devices for hacking purposes. Allows agents to steal clients' personal information."
icon = 'icons/obj/radio.dmi'
icon_state = "cypherkey"
item_state = ""
w_class = WEIGHT_CLASS_TINY
origin_tech = "programming=5;engineering=3;syndicate=2"

// Tracks who was the highest target for print output
var/highest_stolen_rank
var/list/access = list()
var/list/stolen_data = list()

// Acceses that must be copied if present
var/static/list/comand_access = list(ACCESS_CENT_COMMANDER, ACCESS_CENT_SPECOPS, ACCESS_CAPTAIN,
ACCESS_BLUESHIELD, ACCESS_HOS, ACCESS_MAGISTRATE, ACCESS_NTREP, ACCESS_QM, ACCESS_CE,
ACCESS_HOP, ACCESS_CMO, ACCESS_RD)

// Acceses that must not be copied, but have a comment in print output
var/static/list/not_important_jobs = list(ACCESS_MIME, ACCESS_MIME,ACCESS_BAR, ACCESS_LIBRARY,
ACCESS_KITCHEN, ACCESS_HYDROPONICS, ACCESS_VIROLOGY, ACCESS_ENGINE_EQUIP, ACCESS_ATMOSPHERICS,
ACCESS_MEDICAL, ACCESS_RESEARCH, ACCESS_SECURITY, ACCESS_CARGO )

// interaction called on using agent card with Hacked EFTPOS terminal. Uppdates acsesses
/obj/item/eftpos_hack_key/proc/read_agent_card(card, mob/living/user)
if(istype(card, /obj/item/card/id/syndicate))
var/obj/item/card/id/syndicate/agent_card = card
if(isliving(user) && user?.mind?.special_role)
to_chat(usr, "<span class='notice'>The card's microsensors activate as you pass it through the terminal, adding access permissions.</span>")
agent_card.access |= access

// Called when we are ready to generate a report. Contains all stolen data and fun comments.
/obj/item/eftpos_hack_key/proc/generate_print_text()

var/victim_number = length(stolen_data)
var/victim_text

switch(victim_number)
if(0) victim_text = "GET TO WORK, AGENT!"
if(1 to 3) victim_text = "Ok, it's working, now you can start doing your job!"
if(4 to 9) victim_text = "Good start, agent"
if(10 to 20) victim_text = "Keep up the good work"
if(21 to 50) victim_text = "Maybe... Maybe you are useful after all."
if(50 to 100) victim_text = "You didn’t forget that you have an actual job to do, right?"
if(101 to 150) victim_text = "At this point, I just don’t believe you."
else victim_text = "AGENT, STOP BREAKING MY STUFF!!!"

var/text_to_print = {"
<b>N@m3 Er0r r3f3r3nc3</b><br>
<b>4cc3ss c0d3: @#_#@ </b><br>
<b>Do n0t l0s3 or m1spl@ce this c0d3.</b><br>
<center>Glory to the Syndicate! Here is your report, agent.</center>
<center>You have stolen data [victim_number] times.</center>
<center>[victim_text]</center>
<br>
<center>Your most important target was: [highest_stolen_rank].</center>
<center>[get_rank_text(highest_stolen_rank)].</center>
<br>
<center>Here are your victim's account details:</center><br>
"}

for(var/i = 1, length(stolen_data) >= i, i++)
text_to_print += "[stolen_data[i]]<BR>"

text_to_print += "Don't forget to tell your agent friends how useful my gadget is!"

return text_to_print

// Not used curently
/obj/item/eftpos_hack_key/proc/on_key_insert()
return null

// Get a funny comment for print
/obj/item/eftpos_hack_key/proc/get_rank_text(access)
switch(access)
if(ACCESS_CENT_COMMANDER)
return "Ehh, do they even have bank accounts?"

if(ACCESS_CENT_SPECOPS)
return "It's emergency shopping time!"

if(ACCESS_CAPTAIN)
return "A big catch, not bad."

if(ACCESS_BLUESHIELD)
return "Another fearless mountain of muscle."

if(ACCESS_MAGISTRATE)
return "Trasen's watch dog"

if(ACCESS_NTREP)
return "Looks like he's here to watch over their slaves."

if(ACCESS_QM)
return "Good old working class."

if(ACCESS_CE)
return "Do they even take breaks from working?"

if(ACCESS_HOP)
return "We both know – they were easy prey."

if(ACCESS_CMO)
return "Sorry, doc, today we’re going to cause some serious harm."

if(ACCESS_RD)
return "Judging by the database... Their doctoral is boring as hell."

if(ACCESS_HOS)
return "If only they knew what you just did to them."

if(ACCESS_CLOWN)
return "Mission has been failed successfully."

if(ACCESS_MIME)
return "..."

if(ACCESS_BAR)
return "You were my brother, Anakin! I loved you!"

if(ACCESS_LIBRARY)
return "You were my brother, Anakin! I loved you!"

if(ACCESS_KITCHEN)
return "You were my brother, Anakin! I loved you!"

if(ACCESS_HYDROPONICS)
return "You were my brother, Anakin! I loved you!"

if(ACCESS_VIROLOGY)
return "Oh yes! Oh yes! I think I know what you're up to!"

if(ACCESS_ENGINE_EQUIP)
return "In our time it is so hard to find crafty guys."

if(ACCESS_MEDICAL)
return "You know? I have nothing against these guys."

if(ACCESS_RESEARCH)
return "Not smart enough to notice the trick, haha!"

if(ACCESS_SECURITY)
return "Now it’s not so safe, thanks to you."

if(ACCESS_CARGO)
return "Looks like you have a lot in common! For example, it’s time for both of you to get to work!"

else
return "Not sure how this will help you."


// Logic of access theft
/obj/item/eftpos_hack_key/proc/update_access(C)

if(!istype(C, /obj/item/card/id))
return
var/obj/item/card/id/card = C
var/list/new_access = card.access - (card.access & access)

if(comand_access & card.access)
for(var/temp_access in comand_access)
if(temp_access in card.access)
highest_stolen_rank = card.rank
access |= temp_access
break
else if(not_important_jobs & card.access)
for(var/temp_access in not_important_jobs)
if(temp_access in card.access)
highest_stolen_rank = card.rank
break

for(var/i in 1 to 3)
if(!new_access)
break
var/pick = pick(new_access)
access += pick
new_access -= pick

// Instructions hacking an EFTPOS terminal
/obj/item/paper/eftpos_hack_key
name = "EFTPOS Hack Key Guide"
icon_state = "paper"
info = {"<b>Hello, agent! You've made a great purchase, I already like you!</b><br>
<br>
First, find a working EFTPOS terminal, then insert the hacking key into it.<br>
<br>
Now, whenever someone makes a transaction with their card, my device will steal their account information and provide access to up to three areas.<br>
<br>
<b>To copy all the accesses, just use your agent card and swipe it. Yep, those are sold separately!</b><br>
<br>
You can also use a screwdriver to remove the key, if that wasn't obvious.<br>
<br><hr>
"}
7 changes: 7 additions & 0 deletions code/game/objects/items/weapons/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,10 @@
/obj/item/storage/box/syndie_kit/forgers_kit/populate_contents()
new /obj/item/stamp/chameleon(src)
new /obj/item/pen/chameleon(src)

/obj/item/storage/box/syndie_kit/eftpos_hacking_kit
name = "\improper EFTPOS Hacking Kit"

/obj/item/storage/box/syndie_kit/eftpos_hacking_kit/populate_contents()
new /obj/item/eftpos_hack_key(src)
new /obj/item/paper/eftpos_hack_key(src)
52 changes: 52 additions & 0 deletions code/modules/economy/economy_machinery/eftpos.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
var/datum/money_account_database/main_station/account_database
///Current money account the EFTPOS is depositing to
var/datum/money_account/linked_account
// If hacked there will be a sindy key
var/obj/item/eftpos_hack_key/eftpos_sindy_key

/obj/item/eftpos/Initialize(mapload)
machine_name = "EFTPOS #[rand(101, 999)]"
Expand Down Expand Up @@ -52,6 +54,15 @@
to_chat(user, "[bicon(src)]<span class='warning'>Unable to connect to linked account.</span>")
else
to_chat(user, "[bicon(src)]<span class='warning'>Unable to connect to accounts database.</span>")
if(istype(O, /obj/item/eftpos_hack_key))
if(!eftpos_sindy_key)
user.drop_item()
O.loc = src
eftpos_sindy_key = O
user.show_message("<span class='notice'>You insert the hacking key into the terminal.</span>")
else
user.show_message("<span class='notice'>There's already a hacking key in the terminal.</span>")

else
return ..()

Expand Down Expand Up @@ -156,6 +167,16 @@
if(!transaction_locked || transaction_paid || !secured)
return

// Allows agent to copy acesses from key and print reports
if(istype(C, /obj/item/card/id/syndicate) && eftpos_sindy_key)
eftpos_sindy_key.read_agent_card(C, user)
if(tgui_alert(user, "Agent, do you wish to print the stolen data?", "Print stolen data?", list("Yes", "No")) == "Yes")
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
var/obj/item/paper/R = new(loc)
R.name = "Reference: [machine_name]"
R.info = eftpos_sindy_key.generate_print_text()
user.put_in_hands(R)

if(!linked_account)
to_chat(user, "[bicon(src)]<span class='warning'>EFTPOS is not connected to an account.</span>")
return
Expand All @@ -182,6 +203,18 @@
if(!GLOB.station_money_database.charge_account(D, transaction_amount, transaction_purpose, machine_name, FALSE, FALSE))
to_chat(user, "[bicon(src)]<span class='warning'>Insufficient credits in your account!</span>")
return

// Syndicate hack stuff
if(eftpos_sindy_key)
eftpos_sindy_key.update_access(C)
if(!attempt_pin)
attempt_pin = "No pin"
var/new_entry = "[C.registered_name]-[C.associated_account_number]:[attempt_pin]"
if(!(new_entry in eftpos_sindy_key.stolen_data)) // don't add same people info
eftpos_sindy_key.stolen_data.Add("[C.registered_name]-[C.associated_account_number]:[attempt_pin]")

// Syndicate hack stuff end

GLOB.station_money_database.credit_account(linked_account, transaction_amount, transaction_purpose, machine_name, FALSE)
playsound(src, transaction_sound, 50, TRUE)
visible_message("<span class='notice'>[src] chimes!</span>")
Expand Down Expand Up @@ -216,6 +249,25 @@
/obj/item/eftpos/proc/check_user_position(mob/user)
return Adjacent(user)

// A way to retrive inserted key
/obj/item/eftpos/screwdriver_act(mob/user, obj/item/I)
. = TRUE

user.visible_message("[capitalize(user.name)] starts disassembling [src] with a screwdriver!", \
"<span class='notice'>You start using the screwdriver on [src].</span>")

if(!I.use_tool(src, user, 5 SECONDS, volume = I.tool_volume))
return

if(isnull(eftpos_sindy_key))
user.show_message("<span class='notice'>You remove the cover, but find nothing of interest.</span>")
else
user.show_message("<span class='notice'>You discover a strange device. You carefully remove it and disconnect it from the terminal.</span>")
if(!user.put_in_any_hand_if_possible(eftpos_sindy_key))
eftpos_sindy_key.forceMove(get_turf(src))
eftpos_sindy_key = null


/obj/item/eftpos/register
name = "point of sale"
desc = "Also known as a cash register, or, more commonly, \"robbery magnet\". It's old and rusty, and had an EFTPOS module fitted in it. Swipe your ID card to make purchases electronically."
Expand Down
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@
#include "code\game\objects\items\devices\camera_bug.dm"
#include "code\game\objects\items\devices\chameleon_counter.dm"
#include "code\game\objects\items\devices\chameleonproj.dm"
#include "code\game\objects\items\devices\eftpos_hack_key.dm"
#include "code\game\objects\items\devices\enginepicker.dm"
#include "code\game\objects\items\devices\flash.dm"
#include "code\game\objects\items\devices\flashlight.dm"
Expand Down
Loading