Merge pull request #2793 from meyar/master

Fixin' the traitor ID
This commit is contained in:
Chinsky
2013-05-18 06:11:46 -07:00
2 changed files with 24 additions and 2 deletions

View File

@@ -105,11 +105,12 @@ var/list/radiochannels = list(
"Engineering" = 1357,
"Security" = 1359,
"Deathsquad" = 1441,
"Response Team" = 1439,
"Syndicate" = 1213,
"Supply" = 1347,
)
//depenging helpers
var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1441,1347)
var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1439,1441,1347)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/SYND_FREQ = 1213

View File

@@ -130,7 +130,7 @@
if(user.mind.special_role)
usr << "\blue The card's microscanners activate as you pass it over the ID, copying its access."
/obj/item/weapon/card/id/syndicate/var/mob/registered_user = null
/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
@@ -148,6 +148,27 @@
src.assignment = u
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)
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)
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
alert("Invalid name.")
return
src.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)
if(!u)
alert("Invalid assignment.")
src.registered_name = ""
return
src.assignment = u
src.name = "[src.registered_name]'s ID Card ([src.assignment])"
user << "\blue You successfully forge the ID card."
return
if("Show")
..()
else
..()