mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +01:00
Id cards are now cool when examined.
This commit is contained in:
@@ -586,7 +586,7 @@ var/image/default_abstract_uplink_icon
|
||||
|
||||
/datum/uplink_item/abstract/announcements/fake_crew_arrival
|
||||
name = "Crew Arrival Announcement/Records"
|
||||
desc = "Creates a fake crew arrival announcement as well as fake crew records, using your current appearance (including held items!) and worn id card."
|
||||
desc = "Creates a fake crew arrival announcement as well as fake crew records, using your current appearance (including held items!) and worn id card. Trigger with care!"
|
||||
item_cost = 4
|
||||
|
||||
/datum/uplink_item/abstract/announcements/fake_crew_arrival/New()
|
||||
@@ -614,7 +614,7 @@ var/image/default_abstract_uplink_icon
|
||||
general.fields["name"] = user.real_name
|
||||
|
||||
var/datum/data/record/medical = data_core.CreateMedicalRecord(general.fields["name"], general.fields["id"])
|
||||
var/datum/data/record/security = data_core.CreateSecurityRecord(general.fields["name"], general.fields["id"])
|
||||
data_core.CreateSecurityRecord(general.fields["name"], general.fields["id"])
|
||||
|
||||
general.fields["rank"] = assignment
|
||||
general.fields["real_rank"] = assignment
|
||||
|
||||
@@ -97,27 +97,75 @@
|
||||
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
|
||||
var/dat
|
||||
|
||||
//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
|
||||
var/dorm = 0 // determines if this ID has claimed a dorm already
|
||||
|
||||
/obj/item/weapon/card/id/New()
|
||||
..()
|
||||
spawn(30)
|
||||
if(istype(loc, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
blood_type = H.dna.b_type
|
||||
dna_hash = H.dna.unique_enzymes
|
||||
fingerprint_hash = md5(H.dna.uni_identity)
|
||||
if(istype(loc, /mob/living/carbon/human))
|
||||
SetOwnerInfo(loc)
|
||||
|
||||
/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/show(mob/user as mob)
|
||||
user << browse_rsc(front, "front.png")
|
||||
user << browse_rsc(side, "side.png")
|
||||
var/datum/browser/popup = new(user, "idcard", name, 600, 200)
|
||||
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/syndicate/proc/set_id_photo(var/mob/M)
|
||||
front = getFlatIcon(M, SOUTH, always_use_defdir = 1)
|
||||
side = getFlatIcon(M, WEST, always_use_defdir = 1)
|
||||
|
||||
/obj/item/weapon/card/id/proc/SetOwnerInfo(var/mob/living/carbon/human/H)
|
||||
if(!H || !H.dna)
|
||||
return
|
||||
|
||||
sex = capitalize(H.gender)
|
||||
age = H.age
|
||||
blood_type = H.dna.b_type
|
||||
dna_hash = H.dna.unique_enzymes
|
||||
fingerprint_hash = md5(H.dna.uni_identity)
|
||||
set_id_photo(H)
|
||||
|
||||
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)
|
||||
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></tr></table>"
|
||||
|
||||
/obj/item/weapon/card/id/attack_self(mob/user as mob)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("[] shows you: \icon[] []: assignment: []", user, src, src.name, src.assignment), 1)
|
||||
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
|
||||
@@ -139,7 +187,6 @@
|
||||
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."
|
||||
@@ -178,7 +225,6 @@
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/attack_self(mob/user as mob)
|
||||
if(!src.registered_name)
|
||||
//Stop giving the players unsanitized unputs! You are giving ways for players to intentionally crash clients! -Nodrak
|
||||
var t = sanitizeName(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN)
|
||||
if(!t) //Same as mob/new_player/prefrences.dm
|
||||
alert("Invalid name.")
|
||||
@@ -200,8 +246,8 @@
|
||||
|
||||
switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show"))
|
||||
if("Rename")
|
||||
var t = sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name), 26)
|
||||
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
|
||||
var t = sanitizeName(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name), 26)
|
||||
if(!t)
|
||||
alert("Invalid name.")
|
||||
return
|
||||
src.registered_name = t
|
||||
|
||||
Reference in New Issue
Block a user