mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Resolves Issue 734
> A clown's medical, crew, and security records are updated with his newname. (read below for details) > reject_bad_name() now checks for dumb names like "space","floor","wall","r-wall","monkey","unknown","inactive ai" (if you know any other important ones let me know) > clname() [clown-name] and ainame() [AI name], procs which allow those players to rename themselves, were merged into /mob/proc/rename_self(var/role, var/allow_numbers=0) This proc gives the mob 3 chances to name itself. It checks names using reject_bad_name() (the same thing that checks the round-start names). If it fails 3 times it will not change the name. If it succeeds it will call the proc in the next bullet point. > /mob/proc/fully_replace_character_name(var/oldname,var/newname) will replace most references to a mob's oldname and replace it with newname. It updates name, real_name, mind.name, updates their id, updates their pda and updates all their data_core records (manifest records like medical, security, general, locked) > data_core procs merged because they were massive and all identical. > accidentally fixed an AI sound which accidentally played upon login. It conflicted with the "Welcome to the station crew" announcement. So I commented that out to try the 'new' fixed one. If people hate it I'll comment it back to how it was. > naming a mob with the big name at the top of viewvars will use fully_replace_character_name() > Removed an uneccessary regenerate_icons() proc from every player which spawns. Should speed up spawns a smidge git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4396 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -4,68 +4,7 @@
|
||||
if(!nosleep)
|
||||
sleep(40)
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
if (!isnull(H.mind) && (H.mind.assigned_role != "MODE"))
|
||||
var/datum/data/record/G = new()
|
||||
var/datum/data/record/M = new()
|
||||
var/datum/data/record/S = new()
|
||||
var/datum/data/record/L = new()
|
||||
var/obj/item/weapon/card/id/C = H.wear_id
|
||||
if (C)
|
||||
G.fields["rank"] = C.assignment
|
||||
else
|
||||
if(H.job)
|
||||
G.fields["rank"] = H.job
|
||||
else
|
||||
G.fields["rank"] = "Unassigned"
|
||||
G.fields["name"] = H.real_name
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
M.fields["name"] = G.fields["name"]
|
||||
M.fields["id"] = G.fields["id"]
|
||||
S.fields["name"] = G.fields["name"]
|
||||
S.fields["id"] = G.fields["id"]
|
||||
if (H.gender == FEMALE)
|
||||
G.fields["sex"] = "Female"
|
||||
else
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = text("[]", H.age)
|
||||
G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity))
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
M.fields["b_type"] = text("[]", H.b_type)
|
||||
M.fields["b_dna"] = H.dna.unique_enzymes
|
||||
M.fields["mi_dis"] = "None"
|
||||
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
M.fields["ma_dis"] = "None"
|
||||
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
M.fields["alg"] = "None"
|
||||
M.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
M.fields["cdi"] = "None"
|
||||
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
M.fields["notes"] = "No notes."
|
||||
S.fields["criminal"] = "None"
|
||||
S.fields["mi_crim"] = "None"
|
||||
S.fields["mi_crim_d"] = "No minor crime convictions."
|
||||
S.fields["ma_crim"] = "None"
|
||||
S.fields["ma_crim_d"] = "No major crime convictions."
|
||||
S.fields["notes"] = "No notes."
|
||||
|
||||
//Begin locked reporting
|
||||
L.fields["name"] = H.real_name
|
||||
L.fields["sex"] = H.gender
|
||||
L.fields["age"] = H.age
|
||||
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]")
|
||||
L.fields["rank"] = H.mind.assigned_role
|
||||
L.fields["b_type"] = H.b_type
|
||||
L.fields["b_dna"] = H.dna.unique_enzymes
|
||||
L.fields["enzymes"] = H.dna.struc_enzymes
|
||||
L.fields["identity"] = H.dna.uni_identity
|
||||
L.fields["image"] = getFlatIcon(H,0)
|
||||
//End locked reporting
|
||||
|
||||
general += G
|
||||
medical += M
|
||||
security += S
|
||||
locked += L
|
||||
manifest_inject(H)
|
||||
return
|
||||
|
||||
/obj/effect/datacore/proc/manifest_modify(var/name, var/assignment)
|
||||
@@ -80,35 +19,38 @@
|
||||
foundrecord.fields["rank"] = assignment
|
||||
|
||||
|
||||
|
||||
/obj/effect/datacore/proc/manifest_inject(var/mob/living/carbon/human/H)
|
||||
if (!isnull(H.mind) && (H.mind.assigned_role != "MODE"))
|
||||
var/datum/data/record/G = new()
|
||||
var/datum/data/record/M = new()
|
||||
var/datum/data/record/S = new()
|
||||
var/datum/data/record/L = new()
|
||||
var/obj/item/weapon/card/id/C = H.wear_id
|
||||
if (C)
|
||||
G.fields["rank"] = C.assignment
|
||||
if(H.mind && (H.mind.assigned_role != "MODE"))
|
||||
var/assignment
|
||||
if(istype(H.wear_id))
|
||||
var/obj/item/weapon/card/id/Card = H.wear_id
|
||||
assignment = Card.assignment
|
||||
else
|
||||
if(H.job)
|
||||
G.fields["rank"] = H.job
|
||||
assignment = H.job
|
||||
else
|
||||
G.fields["rank"] = "Unassigned"
|
||||
assignment = "Unassigned"
|
||||
|
||||
var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the ebst they could come up with? A large random number? *sigh*
|
||||
|
||||
//General Record
|
||||
var/datum/data/record/G = new()
|
||||
G.fields["id"] = id
|
||||
G.fields["name"] = H.real_name
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
M.fields["name"] = G.fields["name"]
|
||||
M.fields["id"] = G.fields["id"]
|
||||
S.fields["name"] = G.fields["name"]
|
||||
S.fields["id"] = G.fields["id"]
|
||||
if (H.gender == FEMALE)
|
||||
G.fields["sex"] = "Female"
|
||||
else
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = text("[]", H.age)
|
||||
G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity))
|
||||
G.fields["rank"] = assignment
|
||||
G.fields["age"] = H.age
|
||||
G.fields["fingerprint"] = md5(H.dna.uni_identity)
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
M.fields["b_type"] = text("[]", H.b_type)
|
||||
G.fields["sex"] = H.gender
|
||||
general += G
|
||||
|
||||
//Medical Record
|
||||
var/datum/data/record/M = new()
|
||||
M.fields["id"] = id
|
||||
M.fields["name"] = H.real_name
|
||||
M.fields["b_type"] = H.b_type
|
||||
M.fields["b_dna"] = H.dna.unique_enzymes
|
||||
M.fields["mi_dis"] = "None"
|
||||
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
@@ -119,27 +61,32 @@
|
||||
M.fields["cdi"] = "None"
|
||||
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
M.fields["notes"] = "No notes."
|
||||
medical += M
|
||||
|
||||
//Security Record
|
||||
var/datum/data/record/S = new()
|
||||
S.fields["id"] = id
|
||||
S.fields["name"] = H.real_name
|
||||
S.fields["criminal"] = "None"
|
||||
S.fields["mi_crim"] = "None"
|
||||
S.fields["mi_crim_d"] = "No minor crime convictions."
|
||||
S.fields["ma_crim"] = "None"
|
||||
S.fields["ma_crim_d"] = "No major crime convictions."
|
||||
S.fields["notes"] = "No notes."
|
||||
security += S
|
||||
|
||||
//Begin locked reporting
|
||||
L.fields["name"] = H.real_name
|
||||
L.fields["sex"] = H.gender
|
||||
L.fields["age"] = H.age
|
||||
//Locked Record
|
||||
var/datum/data/record/L = new()
|
||||
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]")
|
||||
L.fields["name"] = H.real_name
|
||||
L.fields["rank"] = H.mind.assigned_role
|
||||
L.fields["age"] = H.age
|
||||
L.fields["sex"] = H.gender
|
||||
L.fields["b_type"] = H.b_type
|
||||
L.fields["b_dna"] = H.dna.unique_enzymes
|
||||
L.fields["enzymes"] = H.dna.struc_enzymes
|
||||
L.fields["identity"] = H.dna.uni_identity
|
||||
L.fields["image"] = getFlatIcon(H,0)
|
||||
//End locked reporting
|
||||
|
||||
general += G
|
||||
medical += M
|
||||
security += S
|
||||
L.fields["image"] = getFlatIcon(H,0) //This is god-awful
|
||||
locked += L
|
||||
return
|
||||
|
||||
|
||||
@@ -392,34 +392,21 @@ client
|
||||
return html
|
||||
|
||||
/client/proc/view_var_Topic(href,href_list,hsrc)
|
||||
//This will all be moved over to datum/admins/Topic() ~Carn
|
||||
//This should all be moved over to datum/admins/Topic() or something ~Carn
|
||||
if( (usr.client == src) && src.holder )
|
||||
. = 1 //default return
|
||||
if (href_list["Vars"])
|
||||
debug_variables(locate(href_list["Vars"]))
|
||||
|
||||
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
|
||||
//~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records).
|
||||
else if (href_list["rename"])
|
||||
var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN)
|
||||
if(!new_name) return
|
||||
var/mob/M = locate(href_list["rename"])
|
||||
if(!istype(M)) return
|
||||
var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN)
|
||||
if( !new_name || !M ) return
|
||||
|
||||
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].", 1)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
for(var/obj/item/weapon/card/id/ID in M.contents)
|
||||
if(ID.registered_name == M.real_name)
|
||||
ID.name = "[new_name]'s ID Card ([ID.assignment])"
|
||||
ID.registered_name = new_name
|
||||
break
|
||||
for(var/obj/item/device/pda/PDA in M.contents)
|
||||
if(PDA.owner == M.real_name)
|
||||
PDA.name = "PDA-[new_name] ([PDA.ownjob])"
|
||||
PDA.owner = new_name
|
||||
break
|
||||
M.real_name = new_name
|
||||
M.name = new_name
|
||||
if(M.mind) M.mind.name = new_name
|
||||
M.fully_replace_character_name(M.real_name,new_name)
|
||||
href_list["datumrefresh"] = href_list["rename"]
|
||||
|
||||
else if (href_list["varnameedit"])
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
//Filters out undesirable characters from names
|
||||
/proc/reject_bad_name(var/t_in, var/allow_numbers=0, var/max_length=MAX_NAME_LEN)
|
||||
if(t_in == "" || length(t_in) > max_length)
|
||||
if(!t_in || length(t_in) > max_length)
|
||||
return //Rejects the input if it is null or if it is longer then the max length allowed
|
||||
|
||||
var/number_of_alphanumeric = 0
|
||||
@@ -114,7 +114,12 @@
|
||||
|
||||
if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
|
||||
trim_right(t_out)//Remove spaces from the end of the name.
|
||||
if(last_char_group == 1)
|
||||
t_out = copytext(t_out,1,length(t_out)) //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
|
||||
if(cmptext(t_out,bad_name)) return //(not case sensitive)
|
||||
|
||||
return t_out
|
||||
|
||||
|
||||
|
||||
@@ -249,78 +249,79 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/format_frequency(var/f)
|
||||
return "[round(f / 10)].[f % 10]"
|
||||
|
||||
//Handles giving an AI its name
|
||||
/proc/ainame(var/mob/M as mob)
|
||||
var/randomname = M.name
|
||||
var/time_passed = world.time//Pretty basic but it'll do. It's still possible to bypass this by return ainame().
|
||||
|
||||
|
||||
//This will update a mob's name, real_name, mind.name, data_core records, pda and id
|
||||
//Calling this proc without an oldname will only update the mob and skip updating the pda, id and records ~Carn
|
||||
/mob/proc/fully_replace_character_name(var/oldname,var/newname)
|
||||
if(!newname) return 0
|
||||
real_name = newname
|
||||
name = newname
|
||||
if(mind)
|
||||
mind.name = newname
|
||||
|
||||
if(oldname)
|
||||
//update the datacore records! This is goig to be a bit costly.
|
||||
for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked))
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields["name"] == oldname)
|
||||
R.fields["name"] = newname
|
||||
break
|
||||
|
||||
//update our pda and id if we have them on our person
|
||||
var/list/searching = GetAllContents(searchDepth = 3)
|
||||
var/search_id = 1
|
||||
var/search_pda = 1
|
||||
|
||||
for(var/A in searching)
|
||||
if( search_id && istype(A,/obj/item/weapon/card/id) )
|
||||
var/obj/item/weapon/card/id/ID = A
|
||||
if(ID.registered_name == oldname)
|
||||
ID.registered_name = newname
|
||||
ID.name = "[newname]'s ID Card ([ID.assignment])"
|
||||
if(!search_pda) break
|
||||
search_id = 0
|
||||
|
||||
else if( search_pda && istype(A,/obj/item/device/pda) )
|
||||
var/obj/item/device/pda/PDA = A
|
||||
if(PDA.owner == oldname)
|
||||
PDA.owner = newname
|
||||
PDA.name = "PDA-[newname] ([PDA.ownjob])"
|
||||
if(!search_id) break
|
||||
search_pda = 0
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame()
|
||||
//Last modified by Carn
|
||||
/mob/proc/rename_self(var/role, var/allow_numbers=0)
|
||||
spawn(0)
|
||||
var/oldname = real_name
|
||||
|
||||
var/time_passed = world.time
|
||||
var/newname
|
||||
var/iterations = 0
|
||||
while(!newname)
|
||||
switch(iterations)
|
||||
if(0)
|
||||
if(1 to 5) M << "<font color='red'>Invalid name. Your name should be at least 4 alphanumeric characters but under [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and .</font>"
|
||||
else break
|
||||
newname = reject_bad_name(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname),1)
|
||||
iterations++
|
||||
|
||||
if((world.time-time_passed)>300)//If more than 20 game seconds passed.
|
||||
M << "You took too long to decide. Default name selected."
|
||||
return
|
||||
|
||||
for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name.
|
||||
newname = input(src,"You are a [role]. Would you like to change your name to something else?", "Name change",oldname) as text
|
||||
if((world.time-time_passed)>300)
|
||||
return //took too long
|
||||
newname = reject_bad_name(newname,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
|
||||
if(newname)
|
||||
if( newname == "Inactive AI" || findtext(newname,"cyborg") ) //To prevent common meta-gaming name-choices
|
||||
M << "That name is reserved."
|
||||
break //That's a suitable name!
|
||||
src << "Sorry, that [role]-name wasn't appropriate, please try another. It's possibly too long/short or has bad characters."
|
||||
|
||||
if(!newname) //we'll stick with the oldname then
|
||||
return
|
||||
for (var/mob/living/silicon/ai/A in player_list)
|
||||
if (A.real_name == newname && newname!=randomname)
|
||||
M << "There's already an AI with that name."
|
||||
return
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
M.mind.name = newname
|
||||
|
||||
//Handles givving the Clown his/her name
|
||||
/proc/clname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea
|
||||
var/randomname = pick(clown_names)
|
||||
var/newname = copytext(sanitize(input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
|
||||
var/oldname = M.real_name
|
||||
if(cmptext("ai",role))
|
||||
oldname = null//don't bother with the records update crap
|
||||
world << "<b>[newname] is the AI!</b>"
|
||||
world << sound('newAI.ogg')
|
||||
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
fully_replace_character_name(oldname,newname)
|
||||
|
||||
else
|
||||
var/badname = 0
|
||||
newname = trim_right(trim_left(newname)) // " Abe Butts " becomes "Abe Butts"
|
||||
switch(newname)
|
||||
if("Unknown") badname = 1
|
||||
if("floor") badname = 1
|
||||
if("wall") badname = 1
|
||||
if("r-wall") badname = 1
|
||||
if("space") badname = 1
|
||||
if("_") badname = 1
|
||||
|
||||
if(badname)
|
||||
M << "That name is reserved."
|
||||
return clname(M)
|
||||
for (var/mob/A in player_list)
|
||||
if(A.real_name == newname)
|
||||
M << "That name is reserved."
|
||||
return clname(M)
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
M.mind.name = newname
|
||||
|
||||
for (var/obj/item/device/pda/pda in M.contents)
|
||||
if (pda.owner == oldname)
|
||||
pda.owner = newname
|
||||
pda.name = "PDA-[newname] ([pda.ownjob])"
|
||||
break
|
||||
for(var/obj/item/weapon/card/id/id in M.contents)
|
||||
if(id.registered_name == oldname)
|
||||
id.registered_name = newname
|
||||
id.name = "[id.registered_name]'s ID Card ([id.assignment])"
|
||||
break
|
||||
|
||||
//Picks a string of symbols to display as the law number for hacked or ion laws
|
||||
/proc/ionnum()
|
||||
|
||||
@@ -115,9 +115,8 @@ var/global/datum/controller/gameticker/ticker
|
||||
//Deleting Startpoints but we need the ai point to AI-ize people later
|
||||
if (S.name != "AI")
|
||||
del(S)
|
||||
spawn(-1)
|
||||
world << "<FONT color='blue'><B>Enjoy the game!</B></FONT>"
|
||||
world << sound('welcome.ogg') // Skie
|
||||
// world << sound('welcome.ogg') // Skie
|
||||
//Holiday Round-start stuff ~Carn
|
||||
Holiday_Game_Start()
|
||||
|
||||
@@ -243,11 +242,11 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
proc/create_characters()
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player.ready)
|
||||
if(player.mind && player.mind.assigned_role=="AI")
|
||||
if(player.ready && player.mind)
|
||||
if(player.mind.assigned_role=="AI")
|
||||
player.close_spawn_windows()
|
||||
player.AIize()
|
||||
else if(player.mind)
|
||||
else
|
||||
player.create_character()
|
||||
del(player)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ var/global/datum/controller/occupations/job_master
|
||||
|
||||
proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0)
|
||||
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
if((player) && (player.mind) && (rank))
|
||||
if(player && player.mind && rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!job) return 0
|
||||
if(jobban_isbanned(player, rank)) return 0
|
||||
@@ -295,12 +295,7 @@ var/global/datum/controller/occupations/job_master
|
||||
else
|
||||
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."
|
||||
|
||||
spawnId(H,rank)
|
||||
H << "<B>You are the [rank].</B>"
|
||||
H << "<b>As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
|
||||
H.job = rank
|
||||
if(H.mind)
|
||||
H.mind.assigned_role = rank
|
||||
|
||||
if(!joined_late)
|
||||
var/obj/S = null
|
||||
@@ -314,12 +309,17 @@ var/global/datum/controller/occupations/job_master
|
||||
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
|
||||
H.loc = S.loc
|
||||
|
||||
|
||||
|
||||
if(H.mind)
|
||||
if(H.mind.assigned_role == "Cyborg")//This could likely be done somewhere else
|
||||
H.mind.assigned_role = rank
|
||||
|
||||
switch(rank)
|
||||
if("Cyborg")
|
||||
H.Robotize()
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role != "AI" && H.mind.assigned_role != "Clown")
|
||||
if("AI","Clown") //don't need bag preference stuff!
|
||||
else
|
||||
switch(H.backbag)
|
||||
if(1)
|
||||
H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand)
|
||||
@@ -332,8 +332,12 @@ var/global/datum/controller/occupations/job_master
|
||||
new /obj/item/weapon/storage/box/survival(BPK)
|
||||
H.equip_if_possible(BPK, H.slot_back,1)
|
||||
|
||||
H << "<B>You are the [rank].</B>"
|
||||
H << "<b>As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
|
||||
spawnId(H,rank)
|
||||
|
||||
H.equip_if_possible(new /obj/item/device/radio/headset(H), H.slot_ears)
|
||||
H.regenerate_icons()
|
||||
// H.update_icons()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -370,10 +374,6 @@ var/global/datum/controller/occupations/job_master
|
||||
pda.owner = H.real_name
|
||||
pda.ownjob = H.wear_id.assignment
|
||||
pda.name = "PDA-[H.real_name] ([pda.ownjob])"
|
||||
|
||||
if(rank == "Clown")
|
||||
spawn(1)
|
||||
clname(H)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!record_found&&new_character.mind.assigned_role!="MODE")//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway.
|
||||
//Power to the user!
|
||||
if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes")
|
||||
call(/mob/new_player/proc/ManifestLateSpawn)(new_character)
|
||||
data_core.manifest_inject(new_character)
|
||||
|
||||
if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes")
|
||||
call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role)
|
||||
|
||||
@@ -532,7 +532,7 @@
|
||||
var/face_name = get_face_name()
|
||||
var/id_name = get_id_name("")
|
||||
if(id_name && (id_name != face_name))
|
||||
return "[face_name] as ([id_name])"
|
||||
return "[face_name] (as [id_name])"
|
||||
return face_name
|
||||
|
||||
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
|
||||
|
||||
@@ -60,8 +60,6 @@
|
||||
|
||||
job = "AI"
|
||||
|
||||
spawn(0)
|
||||
ainame(src)
|
||||
add_to_mob_list(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -244,17 +244,17 @@
|
||||
src << alert("[rank] is not available. Please try another.")
|
||||
return 0
|
||||
|
||||
var/mob/living/carbon/human/character = create_character()
|
||||
var/icon/char_icon = getFlatIcon(character,0)//We're creating out own cache so it's not needed.
|
||||
job_master.AssignRole(character, rank, 1)
|
||||
job_master.EquipRank(character, rank, 1)
|
||||
job_master.AssignRole(src, rank, 1)
|
||||
|
||||
var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind
|
||||
job_master.EquipRank(character, rank, 1) //equips the human
|
||||
character.loc = pick(latejoin)
|
||||
character.lastarea = get_area(loc)
|
||||
AnnounceArrival(character, rank)
|
||||
|
||||
if(character.mind.assigned_role != "Cyborg")
|
||||
ManifestLateSpawn(character,char_icon)
|
||||
data_core.manifest_inject(character)
|
||||
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
|
||||
AnnounceArrival(character, rank)
|
||||
else
|
||||
character.Robotize()
|
||||
del(src)
|
||||
@@ -271,71 +271,6 @@
|
||||
if((character.mind.assigned_role != "Cyborg") && (character.mind.special_role != "MODE"))
|
||||
announcer.say("[character.real_name] has signed up as [rank].")
|
||||
|
||||
|
||||
proc/ManifestLateSpawn(var/mob/living/carbon/human/H, icon/H_icon) // Attempted fix to add late joiners to various databases -- TLE
|
||||
// This is basically ripped wholesale from the normal code for adding people to the databases during a fresh round
|
||||
if (H.mind && (H.mind.assigned_role != "MODE"))
|
||||
var/datum/data/record/G = new()
|
||||
var/datum/data/record/M = new()
|
||||
var/datum/data/record/S = new()
|
||||
var/datum/data/record/L = new()
|
||||
var/obj/item/weapon/card/id/C = H.wear_id
|
||||
if (C)
|
||||
G.fields["rank"] = C.assignment
|
||||
else
|
||||
G.fields["rank"] = "Unassigned"
|
||||
G.fields["name"] = H.real_name
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
M.fields["name"] = G.fields["name"]
|
||||
M.fields["id"] = G.fields["id"]
|
||||
S.fields["name"] = G.fields["name"]
|
||||
S.fields["id"] = G.fields["id"]
|
||||
if(H.gender == FEMALE)
|
||||
G.fields["sex"] = "Female"
|
||||
else
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = text("[]", H.age)
|
||||
G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity))
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
M.fields["b_type"] = text("[]", H.b_type)
|
||||
M.fields["b_dna"] = H.dna.unique_enzymes
|
||||
M.fields["mi_dis"] = "None"
|
||||
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
M.fields["ma_dis"] = "None"
|
||||
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
M.fields["alg"] = "None"
|
||||
M.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
M.fields["cdi"] = "None"
|
||||
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
M.fields["notes"] = "No notes."
|
||||
S.fields["criminal"] = "None"
|
||||
S.fields["mi_crim"] = "None"
|
||||
S.fields["mi_crim_d"] = "No minor crime convictions."
|
||||
S.fields["ma_crim"] = "None"
|
||||
S.fields["ma_crim_d"] = "No major crime convictions."
|
||||
S.fields["notes"] = "No notes."
|
||||
|
||||
//Begin locked reporting
|
||||
L.fields["name"] = H.real_name
|
||||
L.fields["sex"] = H.gender
|
||||
L.fields["age"] = H.age
|
||||
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]")
|
||||
L.fields["rank"] = H.mind.assigned_role
|
||||
L.fields["b_type"] = H.b_type
|
||||
L.fields["b_dna"] = H.dna.unique_enzymes
|
||||
L.fields["enzymes"] = H.dna.struc_enzymes
|
||||
L.fields["identity"] = H.dna.uni_identity
|
||||
L.fields["image"] = H_icon//What the person looks like. Naked, in this case.
|
||||
//End locked reporting
|
||||
|
||||
data_core.general += G
|
||||
data_core.medical += M
|
||||
data_core.security += S
|
||||
data_core.locked += L
|
||||
return
|
||||
|
||||
|
||||
proc/LateChoices()
|
||||
var/mills = world.time // 1/10 of a second, not real milliseconds but whatever
|
||||
//var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something
|
||||
@@ -362,11 +297,11 @@
|
||||
|
||||
proc/create_character()
|
||||
spawning = 1
|
||||
close_spawn_windows()
|
||||
|
||||
var/mob/living/carbon/human/new_character = new(loc)
|
||||
new_character.lastarea = get_area(loc)
|
||||
|
||||
close_spawn_windows()
|
||||
|
||||
if(ticker.random_players)
|
||||
new_character.gender = pick(MALE, FEMALE)
|
||||
preferences.randomize_name()
|
||||
@@ -376,11 +311,20 @@
|
||||
|
||||
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo
|
||||
|
||||
if(mind)
|
||||
mind.active = 0 //we wish to transfer the key manually
|
||||
if(mind.assigned_role == "Clown") //give them a clownname if they are a clown
|
||||
new_character.real_name = pick(clown_names) //I hate this being here of all places but unfortunately dna is based on real_name!
|
||||
new_character.rename_self("clown")
|
||||
mind.original = new_character
|
||||
mind.transfer_to(new_character) //won't transfer key since the mind is not active
|
||||
|
||||
new_character.name = real_name
|
||||
new_character.dna.ready_dna(new_character)
|
||||
new_character.dna.b_type = preferences.b_type
|
||||
if(mind)
|
||||
mind.transfer_to(new_character)
|
||||
mind.original = new_character
|
||||
|
||||
new_character.key = key //Manually transfer the key to log them in
|
||||
|
||||
return new_character
|
||||
|
||||
|
||||
|
||||
@@ -123,24 +123,13 @@
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_statuschange
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_roster
|
||||
|
||||
// O.verbs += /mob/living/silicon/ai/proc/ai_cancel_call
|
||||
O.job = "AI"
|
||||
O.UI = UI
|
||||
|
||||
if(O.mind)
|
||||
ticker.mode.remove_cultist(O.mind, 1)
|
||||
ticker.mode.remove_revolutionary(O.mind, 1)
|
||||
|
||||
spawn(0)
|
||||
ainame(O)
|
||||
world << text("<b>[O.real_name] is the AI!</b>")
|
||||
|
||||
spawn(50)
|
||||
world << sound('newAI.ogg')
|
||||
|
||||
O.rename_self("ai",1)
|
||||
. = O
|
||||
del(src)
|
||||
|
||||
return O
|
||||
|
||||
//human -> robot
|
||||
/mob/living/carbon/human/proc/Robotize()
|
||||
|
||||
Reference in New Issue
Block a user