Removed mind.original

All usage of it on silicons is replaced by is_special_character()
is_special_character moved from admin.dm to mob_helpers.dm
Also fixed a runtime having to do with objectives.
This commit is contained in:
MrPerson
2013-03-11 05:40:21 -07:00
parent f74d0c50bc
commit a88b30ab31
14 changed files with 77 additions and 65 deletions
-2
View File
@@ -33,7 +33,6 @@ datum/mind
var/key
var/name //replaces mob/var/original_name
var/mob/living/current
var/mob/living/original //TODO: remove.not used in any meaningful way ~Carn. First I'll need to tweak the way silicon-mobs handle minds.
var/active = 0
var/memory
@@ -1099,7 +1098,6 @@ datum/mind
else
mind = new /datum/mind(key)
mind.original = src
if(ticker)
ticker.minds += mind
else
+1 -1
View File
@@ -396,7 +396,7 @@ proc/display_roundstart_logout_report()
continue //Happy connected client
for(var/mob/dead/observer/D in mob_list)
if(D.mind && (D.mind.original == L || D.mind.current == L))
if(D.mind && D.mind.current == L)
if(L.stat == DEAD)
if(L.suiciding) //Suicider
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] (<font color='red'><b>Suicide</b></font>)\n"
+6 -2
View File
@@ -328,11 +328,15 @@ var/global/datum/controller/gameticker/ticker
aiPlayer.show_laws(1)
if (aiPlayer.connected_robots.len)
var/robolist = "<b>The AI's loyal minions were:</b> "
var/robolist = "<b>[aiPlayer.real_name]'s loyal minions were:</b> "
var/vsrobolist = "\red <b>[aiPlayer.real_name]'s disloyal minions were:</b> \black"
for(var/mob/living/silicon/robot/robo in aiPlayer.connected_robots)
if (is_special_character(robo))
vsrobolist += "[robo.name][robo.stat?" (Deactivated) (Played by: [robo.key]), ":" (Played by: [robo.key]), "]"
continue
robolist += "[robo.name][robo.stat?" (Deactivated) (Played by: [robo.key]), ":" (Played by: [robo.key]), "]"
world << "[robolist]"
world << "[vsrobolist]"
for (var/mob/living/silicon/robot/robo in mob_list)
if (!robo.connected_ai)
if (robo.stat != 2)
+1 -1
View File
@@ -251,7 +251,7 @@ datum/objective/survive
check_completion()
if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current))
return 0 //Brains no longer win survive objectives. --NEO
if(issilicon(owner.current) && owner.current != owner.original)
if(!is_special_character(owner.current)) //This fails borg'd traitors
return 0
return 1
-1
View File
@@ -34,7 +34,6 @@
modePlayer += wizard
wizard.assigned_role = "MODE" //So they aren't chosen for other jobs.
wizard.special_role = "Wizard"
wizard.original = wizard.current
if(wizardstart.len == 0)
wizard.current << "<B>\red A starting location for you could not be found, please report this bug!</B>"
return 0
+2 -2
View File
@@ -123,7 +123,7 @@
else
for(var/n = ++i; n <= optioncount; n++)
dat += "<dd><font color='blue'>&#09;[n]. ---------------</font><br></dd>"
if((istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) && (user.mind.special_role && user.mind.original == user))
if(issilicon(usr) && is_special_character(usr))
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
dat += "<dd><A href='?src=\ref[src];hack=1'><i><font color='Red'>*&@#. Bruteforce Key</font></i></font></a><br></dd>"
else
@@ -351,7 +351,7 @@
//Hack the Console to get the password
if (href_list["hack"])
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
if(issilicon(usr) && is_special_character(usr))
src.hacking = 1
src.screen = 2
src.icon_state = hack_icon
+1 -1
View File
@@ -72,7 +72,7 @@
else
dat += " Independent from AI |"
if (istype(user, /mob/living/silicon))
if((user.mind.special_role && user.mind.original == user) && !R.emagged)
if(issilicon(user) && is_special_character(user) && !R.emagged)
dat += "<A href='?src=\ref[src];magbot=\ref[R]'>(<font color=blue><i>Hack</i></font>)</A> "
dat += "<A href='?src=\ref[src];stopbot=\ref[R]'>(<font color=green><i>[R.canmove ? "Lockdown" : "Release"]</i></font>)</A> "
dat += "<A href='?src=\ref[src];killbot=\ref[R]'>(<font color=red><i>Destroy</i></font>)</A>"
-44
View File
@@ -689,50 +689,6 @@ var/global/floorIsLava = 0
////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS
/proc/is_special_character(mob/M as mob) // returns 1 for specail characters and 2 for heroes of gamemode
if(!ticker || !ticker.mode)
return 0
if (!istype(M))
return 0
if((M.mind in ticker.mode.head_revolutionaries) || (M.mind in ticker.mode.revolutionaries))
if (ticker.mode.config_tag == "revolution")
return 2
return 1
if(M.mind in ticker.mode.cult)
if (ticker.mode.config_tag == "cult")
return 2
return 1
if(M.mind in ticker.mode.malf_ai)
if (ticker.mode.config_tag == "malfunction")
return 2
return 1
if(M.mind in ticker.mode.syndicates)
if (ticker.mode.config_tag == "nuclear")
return 2
return 1
if(M.mind in ticker.mode.wizards)
if (ticker.mode.config_tag == "wizard")
return 2
return 1
if(M.mind in ticker.mode.changelings)
if (ticker.mode.config_tag == "changeling")
return 2
return 1
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
if (ticker.mode.config_tag == "monkey")
return 2
return 1
if(isrobot(M))
var/mob/living/silicon/robot/R = M
if(R.emagged)
return 1
if(M.mind&&M.mind.special_role)//If they have a mind and special role, they are some type of traitor or antagonist.
return 1
return 0
/*
/datum/admins/proc/get_sab_desc(var/target)
switch(target)
+3
View File
@@ -1660,6 +1660,9 @@
//ticker.mode.forge_traitor_objectives(H.mind)
ticker.mode.finalize_traitor(H.mind)
for(var/mob/living/silicon/A in player_list)
if(A.stat == 2 || !A.client || !A.mind) continue
if(ispAI(A)) continue
else if(is_special_character(A)) continue
ticker.mode.traitors += A.mind
A.mind.special_role = "traitor"
var/datum/objective/new_objective = new
+2 -2
View File
@@ -92,8 +92,8 @@
src << "You've lost power!"
// world << "DEBUG CODE TIME! [loc] is the area the AI is sucking power from"
if (!is_special_character(src))
src.set_zeroth_law("")
//if (!is_special_character(src))
//src.set_zeroth_law("")
//src.clear_supplied_laws() // Don't reset our laws.
//var/time = time2text(world.realtime,"hh:mm:ss")
//lawchanges.Add("[time] <b>:</b> [src.name]'s noncore laws have been reset due to power failure")
@@ -19,15 +19,17 @@
else
lawsync()
src << "<b>Laws synced with AI, be sure to note any changes.</b>"
if(mind && mind.special_role == "traitor" && mind.original == src)
src << "<b>Remember, your AI does NOT share or know about your law 0."
if(is_special_character(src))
src << "<b>Remember, your AI does NOT share or know about your law 0.</b>"
if(src.connected_ai.laws.zeroth)
src << "<b>While you are free to disregard it, your AI has a law 0 of its own.</b>"
else
src << "<b>No AI selected to sync laws with, disabling lawsync protocol.</b>"
lawupdate = 0
who << "<b>Obey these laws:</b>"
laws.show_laws(who)
if (mind && (mind.special_role == "traitor" && mind.original == src) && connected_ai)
if (is_special_character(src) && connected_ai)
who << "<b>Remember, [connected_ai.name] is technically your master, but your objective comes first.</b>"
else if (connected_ai)
who << "<b>Remember, [connected_ai.name] is your master, other AIs can be ignored.</b>"
@@ -48,7 +50,7 @@
if (length(temp) > 0)
laws.ion[index] = temp
if (!is_special_character(src) || mind.original != src)
if (!is_special_character(src)) //Don't override the borg's existing law 0, if any
if(master.zeroth_borg) //If the AI has a defined law zero specifically for its borgs, give it that one, otherwise give it the same one. --NEO
temp = master.zeroth_borg
else
+54
View File
@@ -384,4 +384,58 @@ proc/is_blind(A)
var/mob/living/carbon/C = A
if(C.blinded != null)
return 1
return 0
proc/is_special_character(mob/M as mob) // returns 1 for special characters and 2 for heroes of gamemode //moved out of admins.dm because things other than admin procs were calling this.
if(!ticker || !ticker.mode)
return 0
if(!istype(M))
return 0
if(issilicon(M))
if(ispAI(M))
return 0
if(isrobot(M)) //For cyborgs, returns 1 if the cyborg has a law 0 and special_role. Returns 0 if the borg is merely slaved to an AI traitor.
var/mob/living/silicon/robot/R = M
if(R.emagged || R.syndicate) //Count as antags as far as I'm concerned
return 1
if(R.mind && R.mind.special_role && R.laws.zeroth)
if(R.connected_ai) //Make sure the AI isn't the REAL antag here.
if(is_special_character(R.connected_ai) && R.connected_ai.laws.zeroth_borg == R.laws.zeroth)
return 0 //Sorry, just following orders...
else
return 1 //The MAN can't keep me down! Row row fight da powa!
else
return 1 //I'm a strong, beautiful cyborg who don't need no master
if(isAI(M))
var/mob/living/silicon/ai/A = M
if(A.laws && A.laws.zeroth && A.mind && A.mind.special_role)
if(ticker.mode.config_tag == "malfunction" && M.mind in ticker.mode.malf_ai)//Malf law is a law 0
return 2
return 1
return 0
else
world << "Some undefined silicon ran is_special_character! Report this to a coder."
if(M.mind && M.mind.special_role)//If they have a mind and special role, they are some type of traitor or antagonist.
if (ticker.mode.config_tag == "revolution")
if((M.mind in ticker.mode.head_revolutionaries) || (M.mind in ticker.mode.revolutionaries))
return 2
if (ticker.mode.config_tag == "cult")
if(M.mind in ticker.mode.cult)
return 2
if (ticker.mode.config_tag == "nuclear")
if(M.mind in ticker.mode.syndicates)
return 2
if (ticker.mode.config_tag == "changeling")
if(M.mind in ticker.mode.changelings)
return 2
if (ticker.mode.config_tag == "wizard")
if(M.mind in ticker.mode.wizards)
return 2
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
if (ticker.mode.config_tag == "monkey")
return 2
return 1
return 1
return 0
@@ -322,7 +322,6 @@
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
+1 -4
View File
@@ -78,7 +78,6 @@
if(mind)
mind.transfer_to(O)
O.mind.original = O
else
O.key = key
@@ -157,9 +156,7 @@
if(mind) //TODO
mind.transfer_to(O)
if(O.mind.assigned_role == "Cyborg")
O.mind.original = O
else if(mind.special_role)
if(mind.special_role)
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
else
O.key = key