diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 0051a1a9de4..4d51e371541 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -116,7 +116,7 @@ if(last_char_group == 1) output = copytext(output,1,length(output)) //removes the last character (in this case a space) - for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names + for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai","plating")) //prevents these common metagamey names if(cmptext(output,bad_name)) return //(not case sensitive) return output diff --git a/code/game/objects/items/devices/uplink_items.dm b/code/game/objects/items/devices/uplink_items.dm index 610e43acd4e..932f96a58e8 100644 --- a/code/game/objects/items/devices/uplink_items.dm +++ b/code/game/objects/items/devices/uplink_items.dm @@ -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 diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 17a27aa85e5..e01340aa682 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -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 << "It is too far away." + +/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 = ("
") + dat += text("Name: []
", registered_name) + dat += text("Sex: []
\n", sex) + dat += text("Age: []
\n", age) + dat += text("Rank: []
\n", assignment) + dat += text("Fingerprint: []
\n", fingerprint_hash) + dat += text("Blood Type: []
\n", blood_type) + dat += text("DNA Hash: []

\n", dna_hash) + dat +="
Photo:
\ +
" /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