mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01: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:
@@ -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)
|
||||
O.rename_self("ai",1)
|
||||
. = O
|
||||
del(src)
|
||||
|
||||
spawn(0)
|
||||
ainame(O)
|
||||
world << text("<b>[O.real_name] is the AI!</b>")
|
||||
|
||||
spawn(50)
|
||||
world << sound('newAI.ogg')
|
||||
|
||||
del(src)
|
||||
|
||||
return O
|
||||
|
||||
//human -> robot
|
||||
/mob/living/carbon/human/proc/Robotize()
|
||||
|
||||
Reference in New Issue
Block a user