Created a check to see if there is a registered user of the syndicate card,

if there isn't it assignes the first person who tries to change their name with it as the registered user.
This commit is contained in:
Ccomp5950
2013-11-29 15:07:39 -06:00
parent 287860b377
commit 05492cc921
+6 -4
View File
@@ -199,19 +199,18 @@
name = "agent card"
access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
origin_tech = "syndicate=3"
registered_name=null
var/registered_user=null
/obj/item/weapon/card/id/syndicate/New(mob/user as mob)
..()
var t = reject_bad_name(input(user, "What name would you like to put on this card?\nNode: You can change this later by clicking on the ID card while it's in your hand.", "Agent card name", ishuman(user) ? user.real_name : user.name))
var/t = reject_bad_name(input(user, "What name would you like to put on this card?\nNode: You can change this later by clicking on the ID card while it's in your hand.", "Agent card name", ishuman(user) ? user.real_name : user.name))
if(!t)
alert("Invalid name.")
if(!registered_name)
registered_name = ishuman(user) ? user.real_name : user.name
else
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")),1,MAX_MESSAGE_LEN)
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")),1,MAX_MESSAGE_LEN)
if(!u)
alert("Invalid assignment.")
assignment = "Assistant"
@@ -249,7 +248,10 @@
src.name = "[src.registered_name]'s ID Card ([src.assignment])"
user << "\blue You successfully forge the ID card."
registered_user = user
else if(registered_user == user)
else if(!registered_user || registered_user == user)
if(registered_user) registered_user = user // First one to pick it up is the owner if there is ever a wild case New() doens't work.
switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show"))
if("Rename")
var t = copytext(sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name)),1,26)