Files
Aurora.3/code/game/objects/items/weapons/cards_ids.dm
PsiOmegaDelta 1e7251ded4 Id card handling changes.
Equipment now first checks if an id card may be removed, rather than always forcefully doing so.
Station synthetics now have a custom id, rather than re-using the captain's spare, as utilizing robotic storage would otherwise make their id cards available for public use.
2015-08-21 14:04:06 +02:00

253 lines
7.2 KiB
Plaintext

/* Cards
* Contains:
* DATA CARD
* ID CARD
* FINGERPRINT CARD HOLDER
* FINGERPRINT CARD
*/
/*
* DATA CARDS - Used for the teleporter
*/
/obj/item/weapon/card
name = "card"
desc = "Does card things."
icon = 'icons/obj/card.dmi'
w_class = 1.0
var/associated_account_number = 0
var/list/files = list( )
/obj/item/weapon/card/data
name = "data disk"
desc = "A disk of data."
icon_state = "data"
var/function = "storage"
var/data = "null"
var/special = null
item_state = "card-id"
/obj/item/weapon/card/data/verb/label(t as text)
set name = "Label Disk"
set category = "Object"
set src in usr
if (t)
src.name = text("data disk- '[]'", t)
else
src.name = "data disk"
src.add_fingerprint(usr)
return
/obj/item/weapon/card/data/clown
name = "\proper the coordinates to clown planet"
icon_state = "data"
item_state = "card-id"
layer = 3
level = 2
desc = "This card contains coordinates to the fabled Clown Planet. Handle with care."
function = "teleporter"
data = "Clown Land"
/*
* ID CARDS
*/
/obj/item/weapon/card/emag_broken
desc = "It's a card with a magnetic strip attached to some circuitry. It looks too busted to be used for anything but salvage."
name = "broken cryptographic sequencer"
icon_state = "emag"
item_state = "card-id"
origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 2)
/obj/item/weapon/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"
origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 2)
var/uses = 10
/obj/item/weapon/card/emag/resolve_attackby(atom/A, mob/user)
var/used_uses = A.emag_act(uses, user)
if(used_uses < 0)
return ..(A, user)
uses -= used_uses
A.add_fingerprint(user)
log_and_message_admins("emagged \an [A].")
if(uses<1)
user.visible_message("<span class='warning'>\The [src] fizzles and sparks - it seems it's been used once too often, and is now spent.</span>")
user.drop_item()
var/obj/item/weapon/card/emag_broken/junk = new(user.loc)
junk.add_fingerprint(user)
qdel(src)
return 1
/obj/item/weapon/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"
var/access = list()
var/registered_name = "Unknown" // The name registered_name on the card
slot_flags = SLOT_ID
var/age = "\[UNSET\]"
var/blood_type = "\[UNSET\]"
var/dna_hash = "\[UNSET\]"
var/fingerprint_hash = "\[UNSET\]"
var/sex = "\[UNSET\]"
var/icon/front
var/icon/side
//alt titles are handled a bit weirdly in order to unobtrusively integrate into existing ID system
var/assignment = null //can be alt title or the actual job
var/rank = null //actual job
var/dorm = 0 // determines if this ID has claimed a dorm already
/obj/item/weapon/card/id/examine(mob/user)
set src in oview(1)
if(in_range(usr, src))
show(usr)
usr << desc
else
usr << "<span class='warning'>It is too far away.</span>"
/obj/item/weapon/card/id/proc/prevent_tracking()
return 0
/obj/item/weapon/card/id/proc/show(mob/user as mob)
if(front && side)
user << browse_rsc(front, "front.png")
user << browse_rsc(side, "side.png")
var/datum/browser/popup = new(user, "idcard", name, 600, 250)
popup.set_content(dat())
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/item/weapon/card/id/proc/update_name()
name = "[src.registered_name]'s ID Card ([src.assignment])"
/obj/item/weapon/card/id/proc/set_id_photo(var/mob/M)
front = getFlatIcon(M, SOUTH, always_use_defdir = 1)
side = getFlatIcon(M, WEST, always_use_defdir = 1)
/mob/proc/set_id_info(var/obj/item/weapon/card/id/id_card)
id_card.age = 0
id_card.registered_name = real_name
id_card.sex = capitalize(gender)
id_card.set_id_photo(src)
if(dna)
id_card.blood_type = dna.b_type
id_card.dna_hash = dna.unique_enzymes
id_card.fingerprint_hash= md5(dna.uni_identity)
id_card.update_name()
/mob/living/carbon/human/set_id_info(var/obj/item/weapon/card/id/id_card)
..()
id_card.age = age
/obj/item/weapon/card/id/proc/dat()
var/dat = ("<table><tr><td>")
dat += text("Name: []</A><BR>", registered_name)
dat += text("Sex: []</A><BR>\n", sex)
dat += text("Age: []</A><BR>\n", age)
dat += text("Rank: []</A><BR>\n", assignment)
dat += text("Fingerprint: []</A><BR>\n", fingerprint_hash)
dat += text("Blood Type: []<BR>\n", blood_type)
dat += text("DNA Hash: []<BR><BR>\n", dna_hash)
if(front && side)
dat +="<td align = center valign = top>Photo:<br><img src=front.png height=80 width=80 border=4><img src=side.png height=80 width=80 border=4></td>"
dat += "</tr></table>"
return dat
/obj/item/weapon/card/id/attack_self(mob/user as mob)
user.visible_message("\The [user] shows you: \icon[src] [src.name]. The assignment on the card: [src.assignment]",\
"You flash your ID card: \icon[src] [src.name]. The assignment on the card: [src.assignment]")
src.add_fingerprint(user)
return
/obj/item/weapon/card/id/GetAccess()
return access
/obj/item/weapon/card/id/GetID()
return src
/obj/item/weapon/card/id/verb/read()
set name = "Read ID Card"
set category = "Object"
set src in usr
usr << text("\icon[] []: The current assignment on the card is [].", src, src.name, src.assignment)
usr << "The blood type on the card is [blood_type]."
usr << "The DNA hash on the card is [dna_hash]."
usr << "The fingerprint hash on the card is [fingerprint_hash]."
return
/obj/item/weapon/card/id/silver
name = "identification card"
desc = "A silver card which shows honour and dedication."
icon_state = "silver"
item_state = "silver_id"
/obj/item/weapon/card/id/gold
name = "identification card"
desc = "A golden card which shows power and might."
icon_state = "gold"
item_state = "gold_id"
/obj/item/weapon/card/id/syndicate_command
name = "syndicate ID card"
desc = "An ID straight from the Syndicate."
registered_name = "Syndicate"
assignment = "Syndicate Overlord"
access = list(access_syndicate, access_external_airlocks)
/obj/item/weapon/card/id/captains_spare
name = "captain's spare ID"
desc = "The spare ID of the High Lord himself."
icon_state = "gold"
item_state = "gold_id"
registered_name = "Captain"
assignment = "Captain"
/obj/item/weapon/card/id/captains_spare/New()
access = get_all_station_access()
..()
/obj/item/weapon/card/id/synthetic
name = "\improper Synthetic ID"
desc = "Access module for NanoTrasen Synthetics"
icon_state = "id-robot"
item_state = "tdgreen"
assignment = "Synthetic"
/obj/item/weapon/card/id/synthetic/New()
access = get_all_station_access()
..()
/obj/item/weapon/card/id/centcom
name = "\improper CentCom. ID"
desc = "An ID straight from Cent. Com."
icon_state = "centcom"
registered_name = "Central Command"
assignment = "General"
New()
access = get_all_centcom_access()
..()
/obj/item/weapon/card/id/centcom/ERT
name = "\improper Emergency Response Team ID"
assignment = "Emergency Response Team"
/obj/item/weapon/card/id/centcom/ERT/New()
..()
access |= get_all_station_access()