Merge pull request #14723 from AnturK/notsorandomfixes

Fixes
This commit is contained in:
tkdrg
2016-01-24 13:46:42 -03:00
8 changed files with 130 additions and 87 deletions
+5
View File
@@ -612,3 +612,8 @@ var/const/GALOSHES_DONT_HELP = 4
nutrition -= lost_nutrition
adjustToxLoss(-3)
return 1
/mob/living/carbon/fully_replace_character_name(oldname,newname)
..()
if(dna)
dna.real_name = real_name
@@ -870,4 +870,10 @@
last_special = world.time + CLICK_CD_BREAKOUT
cuff_resist(wear_suit)
else
..()
..()
/mob/living/carbon/human/replace_records_name(oldname,newname) // Only humans have records right now, move this up if changed.
for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked))
var/datum/data/record/R = find_record("name", oldname, L)
if(R)
R.fields["name"] = newname
+18 -2
View File
@@ -77,7 +77,7 @@ var/list/ai_list = list()
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
..()
rename_self("ai", 1)
rename_self("ai")
name = real_name
anchored = 1
canmove = 0
@@ -121,6 +121,7 @@ var/list/ai_list = list()
else
if (B.brainmob.mind)
B.brainmob.mind.transfer_to(src)
rename_self("ai")
if(mind.special_role)
mind.store_memory("As an AI, you must obey your silicon laws above all else. Your objectives will consider you to be dead.")
src << "<span class='userdanger'>You have been installed as an AI! </span>"
@@ -848,4 +849,19 @@ var/list/ai_list = list()
raw_message = lang_treat(speaker, message_langs, raw_message, spans)
var/name_used = speaker.GetVoice()
var/rendered = "<i><span class='game say'>Relayed Speech: <span class='name'>[name_used]</span> <span class='message'>[raw_message]</span></span></i>"
show_message(rendered, 2)
show_message(rendered, 2)
/mob/living/silicon/ai/fully_replace_character_name(oldname,newname)
..()
if(oldname != real_name)
if(eyeobj)
eyeobj.name = "[newname] (AI Eye)"
// Notify Cyborgs
for(var/mob/living/silicon/robot/Slave in connected_robots)
Slave.show_laws()
/mob/living/silicon/ai/replace_identification_name(oldname,newname)
if(aiPDA)
aiPDA.owner = newname
aiPDA.name = newname + " (" + aiPDA.ownjob + ")"
@@ -1171,3 +1171,11 @@
if(health < -maxHealth*0.5)
if(uneq_module(module_state_1))
src << "<span class='warning'>CRITICAL ERROR: All modules OFFLINE.</span>"
/mob/living/silicon/robot/fully_replace_character_name(oldname,newname)
..()
if(oldname != real_name)
notify_ai(3, oldname, newname)
if(camera)
camera.c_tag = real_name
custom_name = newname
+87
View File
@@ -966,3 +966,90 @@ var/next_mob_id = 0
if(F in target.faction)
return 1
return 0
//This will update a mob's name, real_name, mind.name, data_core records, pda, id and traitor text
//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(oldname,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.
replace_records_name(oldname,newname)
//update our pda and id if we have them on our person
replace_identification_name(oldname,newname)
for(var/datum/mind/T in ticker.minds)
for(var/datum/objective/obj in T.objectives)
// Only update if this player is a target
if(obj.target && obj.target.current && obj.target.current.real_name == name)
obj.update_explanation_text()
return 1
/mob/living/carbon/fully_replace_character_name(oldname,newname)
..()
if(dna)
dna.real_name = real_name
/mob/living/silicon/ai/fully_replace_character_name(oldname,newname)
..()
if(oldname != real_name)
if(eyeobj)
eyeobj.name = "[newname] (AI Eye)"
// Notify Cyborgs
for(var/mob/living/silicon/robot/Slave in connected_robots)
Slave.show_laws()
/mob/living/silicon/robot/fully_replace_character_name(oldname,newname)
..()
if(oldname != real_name)
notify_ai(3, oldname, newname)
if(camera)
camera.c_tag = real_name
custom_name = newname
//Updates data_core records with new name , see mob/living/carbon/human
/mob/proc/replace_records_name(oldname,newname)
return
/mob/living/carbon/human/replace_records_name(oldname,newname) // Only humans have records right now, move this up if changed.
for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked))
var/datum/data/record/R = find_record("name", oldname, L)
if(R)
R.fields["name"] = newname
/mob/proc/replace_identification_name(oldname,newname)
var/list/searching = GetAllContents()
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.update_label()
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.update_label()
if(!search_id)
break
search_pda = 0
/mob/living/silicon/ai/replace_identification_name(oldname,newname)
if(aiPDA)
aiPDA.owner = newname
aiPDA.name = newname + " (" + aiPDA.ownjob + ")"
+3 -3
View File
@@ -303,7 +303,7 @@
O.job = "AI"
O.rename_self("ai",1)
O.rename_self("ai")
. = O
qdel(src)
return
@@ -348,7 +348,7 @@
O.update_pipe_vision()
if (config.rename_cyborg)
O.rename_self("cyborg", 1)
O.rename_self("cyborg")
O.loc = loc
O.job = "Cyborg"
@@ -441,7 +441,7 @@
G.key = key
G.job = "Deity"
G.rename_self("deity", 0)
G.rename_self("deity")
G.update_icons()
. = G
+1 -1
View File
@@ -74,7 +74,7 @@
if(!istype(user_turf))
return 0
var/obj/dummy = new(user_turf)
dummy.pass_flags |= PASSTABLE & PASSGLASS & PASSGRILLE //Grille/Glass so it can be used through common windows
dummy.pass_flags |= PASSTABLE|PASSGLASS|PASSGRILLE //Grille/Glass so it can be used through common windows
for(var/turf/turf in getline(user_turf,target))
if(turf.density)
qdel(dummy)