/* Cards * Contains: * DATA CARD * ID CARD * FINGERPRINT CARD HOLDER * FINGERPRINT CARD */ /* * DATA CARDS - Used for the IC data card reader */ /obj/item/card name = "card" desc = "Does card things." icon = 'icons/obj/card.dmi' w_class = WEIGHT_CLASS_TINY var/list/files = list() /obj/item/card/suicide_act(mob/living/carbon/user) user.visible_message("[user] begins to swipe [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") return BRUTELOSS /obj/item/card/data name = "data card" desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has a stripe running down the middle." icon_state = "data_1" obj_flags = UNIQUE_RENAME var/function = "storage" var/data = "null" var/special = null item_state = "card-id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' var/detail_color = COLOR_ASSEMBLY_ORANGE /obj/item/card/data/Initialize() .=..() update_icon() /obj/item/card/data/update_icon() cut_overlays() if(detail_color == COLOR_FLOORTILE_GRAY) return var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/card.dmi', "[icon_state]-color") detail_overlay.color = detail_color add_overlay(detail_overlay) /obj/item/proc/GetCard() /obj/item/card/data/GetCard() return src /obj/item/card/data/full_color desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has the entire card colored." icon_state = "data_2" /obj/item/card/data/disk desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one inexplicibly looks like a floppy disk." icon_state = "data_3" /* * ID CARDS */ /obj/item/card/emag desc = "It's a card with a magnetic strip attached to some circuitry." name = "cryptographic sequencer" icon_state = "emag" item_state = "card-id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' item_flags = NO_MAT_REDEMPTION | NOBLUDGEON var/prox_check = TRUE //If the emag requires you to be in range /obj/item/card/emag/bluespace name = "bluespace cryptographic sequencer" desc = "It's a blue card with a magnetic strip attached to some circuitry. It appears to have some sort of transmitter attached to it." color = rgb(40, 130, 255) prox_check = FALSE /obj/item/card/emag/attack() return /obj/item/card/emag/afterattack(atom/target, mob/user, proximity) . = ..() var/atom/A = target if(!proximity && prox_check) return log_combat(user, A, "attempted to emag") A.emag_act(user) /obj/item/card/emagfake desc = "It's a card with a magnetic strip attached to some circuitry. Closer inspection shows that this card is a poorly made replica, with a \"DonkCo\" logo stamped on the back." name = "cryptographic sequencer" icon_state = "emag" item_state = "card-id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' /obj/item/card/emagfake/afterattack() . = ..() playsound(src, 'sound/items/bikehorn.ogg', 50, 1) /obj/item/card/id name = "identification card" desc = "A card used to provide ID and determine access across the station." icon_state = "id" item_state = "card-id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' slot_flags = ITEM_SLOT_ID armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100) resistance_flags = FIRE_PROOF | ACID_PROOF var/id_type_name = "identification card" var/list/access = list() var/registered_name = null // The name registered_name on the card var/assignment = null var/access_txt // mapping aid var/datum/bank_account/registered_account var/obj/machinery/paystand/my_store var/uses_overlays = TRUE var/icon/cached_flat_icon /obj/item/card/id/Initialize(mapload) . = ..() if(mapload && access_txt) access = text2access(access_txt) /obj/item/card/id/Destroy() if (registered_account) registered_account.bank_cards -= src if (my_store && my_store.my_card == src) my_store.my_card = null return ..() /obj/item/card/id/attack_self(mob/user) if(Adjacent(user)) user.visible_message("[user] shows you: [icon2html(src, viewers(user))] [src.name].", "You show \the [src.name].") add_fingerprint(user) /obj/item/card/id/vv_edit_var(var_name, var_value) . = ..() if(.) switch(var_name) if("assignment","registered_name") update_label() /obj/item/card/id/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/holochip)) insert_money(W, user) return else if(istype(W, /obj/item/stack/spacecash)) insert_money(W, user, TRUE) return else if(istype(W, /obj/item/coin)) insert_money(W, user, TRUE) return else return ..() /obj/item/card/id/proc/insert_money(obj/item/I, mob/user, physical_currency) var/cash_money = I.get_item_credit_value() if(!cash_money) to_chat(user, "[I] doesn't seem to be worth anything!") return if(!registered_account) to_chat(user, "[src] doesn't have a linked account to deposit [I] into!") return registered_account.adjust_money(cash_money) if(physical_currency) to_chat(user, "You stuff [I] into [src]. It disappears in a small puff of bluespace smoke, adding [cash_money] credits to the linked account.") else to_chat(user, "You insert [I] into [src], adding [cash_money] credits to the linked account.") to_chat(user, "The linked account now reports a balance of $[registered_account.account_balance].") qdel(I) /obj/item/card/id/proc/alt_click_can_use_id(mob/living/user) if(!isliving(user)) return if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return return TRUE // Returns true if new account was set. /obj/item/card/id/proc/set_new_account(mob/living/user) . = FALSE var/datum/bank_account/old_account = registered_account var/new_bank_id = input(user, "Enter your account ID number.", "Account Reclamation", 111111) as num if(!alt_click_can_use_id(user)) return if(!new_bank_id || new_bank_id < 111111 || new_bank_id > 999999) to_chat(user, "The account ID number needs to be between 111111 and 999999.") return if (registered_account && registered_account.account_id == new_bank_id) to_chat(user, "The account ID was already assigned to this card.") return for(var/A in SSeconomy.bank_accounts) var/datum/bank_account/B = A if(B.account_id == new_bank_id) if (old_account) old_account.bank_cards -= src B.bank_cards += src registered_account = B to_chat(user, "The provided account has been linked to this ID card.") return TRUE to_chat(user, "The account ID number provided is invalid.") return /obj/item/card/id/AltClick(mob/living/user) if(!alt_click_can_use_id(user)) return if(!registered_account) set_new_account(user) return if (world.time < registered_account.withdrawDelay) registered_account.bank_card_talk("ERROR: UNABLE TO LOGIN DUE TO SCHEDULED MAINTENANCE. MAINTENANCE IS SCHEDULED TO COMPLETE IN [(registered_account.withdrawDelay - world.time)/10] SECONDS.", TRUE) return var/amount_to_remove = FLOOR(input(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) as num, 1) if(!amount_to_remove || amount_to_remove < 0) to_chat(user, "You're pretty sure that's not how money works.") return if(!alt_click_can_use_id(user)) return if(registered_account.adjust_money(-amount_to_remove)) var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove) user.put_in_hands(holochip) to_chat(user, "You withdraw [amount_to_remove] credits into a holochip.") return else var/difference = amount_to_remove - registered_account.account_balance registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", TRUE) /obj/item/card/id/examine(mob/user) . = ..() if(registered_account) . += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of $[registered_account.account_balance]." if(registered_account.account_job) var/datum/bank_account/D = SSeconomy.get_dep_account(registered_account.account_job.paycheck_department) if(D) . += "The [D.account_holder] reports a balance of $[D.account_balance]." . += "Alt-Click the ID to pull money from the linked account in the form of holochips." . += "You can insert credits into the linked account by pressing holochips, cash, or coins against the ID." if(registered_account.account_holder == user.real_name) . += "If you lose this ID card, you can reclaim your account by Alt-Clicking a blank ID card while holding it and entering your account ID number." else . += "There is no registered account linked to this card. Alt-Click to add one." /obj/item/card/id/GetAccess() return access /obj/item/card/id/GetID() return src /obj/item/card/id/update_icon(blank=FALSE) cut_overlays() cached_flat_icon = null if(!uses_overlays) return var/job = assignment ? ckey(GetJobName()) : null var/list/add_overlays = list() if(!blank) add_overlays += mutable_appearance(icon, "assigned") if(job) add_overlays += mutable_appearance(icon, "id[job]") add_overlay(add_overlays) update_in_wallet(add_overlays) /obj/item/card/id/proc/update_in_wallet(overlays) if(istype(loc, /obj/item/storage/wallet)) var/obj/item/storage/wallet/powergaming = loc if(powergaming.front_id == src) powergaming.update_label() powergaming.update_icon(overlays) /obj/item/card/id/proc/get_cached_flat_icon() if(!cached_flat_icon) cached_flat_icon = getFlatIcon(src) return cached_flat_icon /obj/item/card/id/get_examine_string(mob/user, thats = FALSE) if(uses_overlays) return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]" //displays all overlays in chat return ..() /* Usage: update_label() Sets the id name to whatever registered_name and assignment is */ /obj/item/card/id/proc/update_label() var/blank = !registered_name name = "[blank ? id_type_name : "[registered_name]'s ID Card"][(!assignment) ? "" : " ([assignment])"]" update_icon(blank) /obj/item/card/id/silver name = "silver identification card" id_type_name = "silver identification card" desc = "A silver card which shows honour and dedication." icon_state = "silver" item_state = "silver_id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' /obj/item/card/id/silver/reaper name = "Thirteen's ID Card (Reaper)" access = list(ACCESS_MAINT_TUNNELS) assignment = "Reaper" registered_name = "Thirteen" /obj/item/card/id/gold name = "gold identification card" id_type_name = "gold identification card" desc = "A golden card which shows power and might." icon_state = "gold" item_state = "gold_id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' /obj/item/card/id/syndicate name = "agent card" access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE) var/anyone = FALSE //Can anyone forge the ID or just syndicate? /obj/item/card/id/syndicate/Initialize() . = ..() var/datum/action/item_action/chameleon/change/id/chameleon_action = new(src) chameleon_action.chameleon_type = /obj/item/card/id chameleon_action.chameleon_name = "ID Card" chameleon_action.initialize_disguises() /obj/item/card/id/syndicate/afterattack(obj/item/O, mob/user, proximity) if(!proximity) return if(istype(O, /obj/item/card/id)) var/obj/item/card/id/I = O src.access |= I.access if(isliving(user) && user.mind) if(user.mind.special_role || anyone) to_chat(usr, "The card's microscanners activate as you pass it over the ID, copying its access.") /obj/item/card/id/syndicate/attack_self(mob/user) if(isliving(user) && user.mind) var/first_use = registered_name ? FALSE : TRUE if(!(user.mind.special_role || anyone)) //Unless anyone is allowed, only syndies can use the card, to stop metagaming. if(first_use) //If a non-syndie is the first to forge an unassigned agent ID, then anyone can forge it. anyone = TRUE else return ..() var/popup_input = alert(user, "Action", "Agent ID", "Show", "Forge", "Change Account ID") if(user.incapacitated()) return if(popup_input == "Forge") var/t = copytext(sanitize_name(input(user, "What name would you like to put on this card?", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name))as text | null),1,26) if(!t) return registered_name = t var/u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant")as text | null),1,MAX_MESSAGE_LEN) if(!u) registered_name = "" return assignment = u update_label() to_chat(user, "You successfully forge the ID card.") // First time use automatically sets the account id to the user. if (first_use && !registered_account) if(ishuman(user)) var/mob/living/carbon/human/accountowner = user for(var/bank_account in SSeconomy.bank_accounts) var/datum/bank_account/account = bank_account if(account.account_id == accountowner.account_id) account.bank_cards += src registered_account = account to_chat(user, "Your account number has been automatically assigned.") return else if (popup_input == "Change Account ID") set_new_account(user) return return ..() /obj/item/card/id/syndicate/anyone anyone = TRUE /obj/item/card/id/syndicate/nuke_leader name = "lead agent card" access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE, ACCESS_SYNDICATE_LEADER) /obj/item/card/id/syndicate_command name = "syndicate ID card" id_type_name = "syndicate ID card" desc = "An ID straight from the Syndicate." registered_name = "Syndicate" assignment = "Syndicate Overlord" icon_state = "syndie" access = list(ACCESS_SYNDICATE) uses_overlays = FALSE /obj/item/card/id/captains_spare name = "captain's spare ID" id_type_name = "captain's spare ID" desc = "The spare ID of the High Lord himself." icon_state = "gold" item_state = "gold_id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' registered_name = "Captain" assignment = "Captain" /obj/item/card/id/captains_spare/Initialize() var/datum/job/captain/J = new/datum/job/captain access = J.get_access() . = ..() update_label() /obj/item/card/id/captains_spare/update_label() //so it doesn't change to Captain's ID card (Captain) on a sneeze if(registered_name == "Captain") name = "[id_type_name][(!assignment || assignment == "Captain") ? "" : " ([assignment])"]" update_icon(TRUE) else ..() /obj/item/card/id/centcom name = "\improper CentCom ID" id_type_name = "\improper CentCom ID" desc = "An ID straight from Central Command." icon_state = "centcom" registered_name = "Central Command" assignment = "General" uses_overlays = FALSE /obj/item/card/id/centcom/Initialize() access = get_all_centcom_access() . = ..() /obj/item/card/id/ert name = "\improper CentCom ID" id_type_name = "\improper CentCom ID" desc = "An ERT ID card." icon_state = "ert_commander" registered_name = "Emergency Response Team Commander" assignment = "Emergency Response Team Commander" uses_overlays = FALSE /obj/item/card/id/ert/Initialize() access = get_all_accesses()+get_ert_access("commander")-ACCESS_CHANGE_IDS . = ..() /obj/item/card/id/ert/Security registered_name = "Security Response Officer" assignment = "Security Response Officer" icon_state = "ert_security" /obj/item/card/id/ert/Security/Initialize() access = get_all_accesses()+get_ert_access("sec")-ACCESS_CHANGE_IDS . = ..() /obj/item/card/id/ert/Engineer registered_name = "Engineer Response Officer" assignment = "Engineer Response Officer" icon_state = "ert_engineer" /obj/item/card/id/ert/Engineer/Initialize() access = get_all_accesses()+get_ert_access("eng")-ACCESS_CHANGE_IDS . = ..() /obj/item/card/id/ert/Medical registered_name = "Medical Response Officer" assignment = "Medical Response Officer" icon_state = "ert_medic" /obj/item/card/id/ert/Medical/Initialize() access = get_all_accesses()+get_ert_access("med")-ACCESS_CHANGE_IDS . = ..() /obj/item/card/id/ert/chaplain registered_name = "Religious Response Officer" assignment = "Religious Response Officer" icon_state = "ert_chaplain" /obj/item/card/id/ert/chaplain/Initialize() access = get_all_accesses()+get_ert_access("sec")-ACCESS_CHANGE_IDS . = ..() /obj/item/card/id/ert/Janitor registered_name = "Janitorial Response Officer" assignment = "Janitorial Response Officer" icon_state = "ert_janitor" /obj/item/card/id/ert/Janitor/Initialize() access = get_all_accesses() . = ..() /obj/item/card/id/prisoner name = "prisoner ID card" id_type_name = "prisoner ID card" desc = "You are a number, you are not a free man." icon_state = "orange" item_state = "orange-id" lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' assignment = "Prisoner" registered_name = "Scum" uses_overlays = FALSE var/goal = 0 //How far from freedom? var/points = 0 /obj/item/card/id/prisoner/attack_self(mob/user) to_chat(usr, "You have accumulated [points] out of the [goal] points you need for freedom.") /obj/item/card/id/prisoner/one name = "Prisoner #13-001" registered_name = "Prisoner #13-001" icon_state = "prisoner_001" /obj/item/card/id/prisoner/two name = "Prisoner #13-002" registered_name = "Prisoner #13-002" icon_state = "prisoner_002" /obj/item/card/id/prisoner/three name = "Prisoner #13-003" registered_name = "Prisoner #13-003" icon_state = "prisoner_003" /obj/item/card/id/prisoner/four name = "Prisoner #13-004" registered_name = "Prisoner #13-004" icon_state = "prisoner_004" /obj/item/card/id/prisoner/five name = "Prisoner #13-005" registered_name = "Prisoner #13-005" icon_state = "prisoner_005" /obj/item/card/id/prisoner/six name = "Prisoner #13-006" registered_name = "Prisoner #13-006" icon_state = "prisoner_006" /obj/item/card/id/prisoner/seven name = "Prisoner #13-007" registered_name = "Prisoner #13-007" icon_state = "prisoner_007" /obj/item/card/id/mining name = "mining ID" access = list(ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MECH_MINING, ACCESS_MAILSORTING, ACCESS_MINERAL_STOREROOM) /obj/item/card/id/mining/Initialize() . = ..() var/static/datum/bank_account/remote/golem_account = new("Liberator") golem_account.bank_cards += src registered_account = golem_account /obj/item/card/id/away name = "a perfectly generic identification card" desc = "A perfectly generic identification card. Looks like it could use some flavor." access = list(ACCESS_AWAY_GENERAL) icon_state = "retro" uses_overlays = FALSE /obj/item/card/id/away/hotel name = "Staff ID" desc = "A staff ID used to access the hotel's doors." access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_MAINT) /obj/item/card/id/away/hotel/securty name = "Officer ID" access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_MAINT, ACCESS_AWAY_SEC) /obj/item/card/id/away/old name = "a perfectly generic identification card" desc = "A perfectly generic identification card. Looks like it could use some flavor." /obj/item/card/id/away/old/sec name = "Charlie Station Security Officer's ID card" desc = "A faded Charlie Station ID card. You can make out the rank \"Security Officer\"." assignment = "Charlie Station Security Officer" access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_SEC) /obj/item/card/id/away/old/sci name = "Charlie Station Scientist's ID card" desc = "A faded Charlie Station ID card. You can make out the rank \"Scientist\"." assignment = "Charlie Station Scientist" access = list(ACCESS_AWAY_GENERAL) /obj/item/card/id/away/old/eng name = "Charlie Station Engineer's ID card" desc = "A faded Charlie Station ID card. You can make out the rank \"Station Engineer\"." assignment = "Charlie Station Engineer" access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_ENGINE) /obj/item/card/id/away/old/apc name = "APC Access ID" desc = "A special ID card that allows access to APC terminals." access = list(ACCESS_ENGINE_EQUIP) /obj/item/card/id/away/deep_storage //deepstorage.dmm space ruin name = "bunker access ID" /obj/item/card/id/departmental_budget name = "departmental card (FUCK)" desc = "Provides access to the departmental budget." icon_state = "budgetcard" uses_overlays = FALSE var/department_ID = ACCOUNT_CIV var/department_name = ACCOUNT_CIV_NAME /obj/item/card/id/departmental_budget/Initialize() . = ..() var/datum/bank_account/B = SSeconomy.get_dep_account(department_ID) if(B) registered_account = B if(!B.bank_cards.Find(src)) B.bank_cards += src name = "departmental card ([department_name])" desc = "Provides access to the [department_name]." SSeconomy.dep_cards += src /obj/item/card/id/departmental_budget/Destroy() SSeconomy.dep_cards -= src return ..() /obj/item/card/id/departmental_budget/update_label() return /obj/item/card/id/departmental_budget/civ department_ID = ACCOUNT_CIV department_name = ACCOUNT_CIV_NAME icon_state = "civ_budget" /obj/item/card/id/departmental_budget/eng department_ID = ACCOUNT_ENG department_name = ACCOUNT_ENG_NAME icon_state = "eng_budget" /obj/item/card/id/departmental_budget/sci department_ID = ACCOUNT_SCI department_name = ACCOUNT_SCI_NAME icon_state = "sci_budget" /obj/item/card/id/departmental_budget/med department_ID = ACCOUNT_MED department_name = ACCOUNT_MED_NAME icon_state = "med_budget" /obj/item/card/id/departmental_budget/srv department_ID = ACCOUNT_SRV department_name = ACCOUNT_SRV_NAME icon_state = "srv_budget" /obj/item/card/id/departmental_budget/car department_ID = ACCOUNT_CAR department_name = ACCOUNT_CAR_NAME icon_state = "car_budget" //saving up for a new tesla /obj/item/card/id/departmental_budget/sec department_ID = ACCOUNT_SEC department_name = ACCOUNT_SEC_NAME icon_state = "sec_budget"