Fixed a bug from 1607. Observing and the like should work properly now regardless of config. May need more testing but looks solid on my end.

DONT_DEL_NEWMOB in config.txt is no longer necessary and you can remove it entirely.
Respawn character now uses ckey() matching so it doesn't matter what case you type in a person's key. It also takes into account space ninjas and death commandos if you want to respawn them. Also fixed a few bugs dealing with special roles.
Revised code for checking security records and added missing ranks as per bug report by Magicbones.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1614 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
noisomehollow@lycos.com
2011-05-23 23:35:31 +00:00
parent f7dabfae1e
commit fd0133d920
8 changed files with 525 additions and 514 deletions
-3
View File
@@ -182,9 +182,6 @@
if ("usewhitelist")
config.usewhitelist = 1
if ("dont_del_newmob")
config.del_new_on_log = 0
if ("feature_object_spell_system")
config.feature_object_spell_system = 1
+22 -22
View File
@@ -32,13 +32,8 @@ ________________________________________________________________________________
alert("No spawn location could be found. Aborting.")
return
var/obj/landmark/STARTLOC = pick(LOCLIST)
var/mob/living/carbon/human/new_ninja = new(STARTLOC.loc)
new_ninja.create_ninja()
var/admin_name = src
var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(LOCLIST))
var/mob/dead/observer/G
var/list/candidates = list()
@@ -61,13 +56,14 @@ ________________________________________________________________________________
new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess.
new_ninja.internals.icon_state = "internal1"
new_ninja.mind.store_memory("<B>Mission:</B> \red [input].")
new_ninja << "\blue \nYou are an elite mercenary assassin of the Spider Clan, [new_ninja.real_name]. The dreaded \red <B>SPACE NINJA</B>!\blue You have a variety of abilities at your disposal, thanks to your nano-enhanced cyber armor. Remember your training (initialize your suit by right clicking on it)! \nYour current mission is: \red <B>[input]</B>"
message_admins("\blue [admin_name] has spawned [new_ninja.key] as a Space Ninja. Hide yo children!", 1)
log_admin("[admin_name] used Spawn Space Ninja.")
/mob/proc/create_ninja()
var/mob/living/carbon/human/new_ninja = src
client/proc/create_space_ninja(obj/spawn_point)
var/mob/living/carbon/human/new_ninja = new(spawn_point.loc)
var/ninja_title = pick(ninja_titles)
var/ninja_name = pick(ninja_names)
new_ninja.gender = pick(MALE, FEMALE)
@@ -79,22 +75,26 @@ ________________________________________________________________________________
new_ninja.dna.ready_dna(new_ninja)
new_ninja.mind = new
new_ninja.mind.current = new_ninja
new_ninja.mind.assigned_role = "Space Ninja"
new_ninja.mind.assigned_role = "MODE"
new_ninja.mind.special_role = "Space Ninja"
new_ninja.resistances += "alien_embryo"
new_ninja.equip_space_ninja()
return new_ninja
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(new_ninja)
new_ninja.equip_if_possible(R, new_ninja.slot_ears)
new_ninja.equip_if_possible(new /obj/item/clothing/under/color/black(new_ninja), new_ninja.slot_w_uniform)
new_ninja.equip_if_possible(new /obj/item/clothing/shoes/space_ninja(new_ninja), new_ninja.slot_shoes)
new_ninja.equip_if_possible(new /obj/item/clothing/suit/space/space_ninja(new_ninja), new_ninja.slot_wear_suit)
new_ninja.equip_if_possible(new /obj/item/clothing/gloves/space_ninja(new_ninja), new_ninja.slot_gloves)
new_ninja.equip_if_possible(new /obj/item/clothing/head/helmet/space/space_ninja(new_ninja), new_ninja.slot_head)
new_ninja.equip_if_possible(new /obj/item/clothing/mask/gas/voice/space_ninja(new_ninja), new_ninja.slot_wear_mask)
new_ninja.equip_if_possible(new /obj/item/device/flashlight(new_ninja), new_ninja.slot_belt)
new_ninja.equip_if_possible(new /obj/item/weapon/plastique(new_ninja), new_ninja.slot_r_store)
new_ninja.equip_if_possible(new /obj/item/weapon/plastique(new_ninja), new_ninja.slot_l_store)
new_ninja.equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(new_ninja), new_ninja.slot_s_store)
/mob/living/carbon/human/proc/equip_space_ninja()
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
equip_if_possible(R, slot_ears)
equip_if_possible(new /obj/item/clothing/under/color/black(src), slot_w_uniform)
equip_if_possible(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes)
equip_if_possible(new /obj/item/clothing/suit/space/space_ninja(src), slot_wear_suit)
equip_if_possible(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves)
equip_if_possible(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head)
equip_if_possible(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask)
equip_if_possible(new /obj/item/device/flashlight(src), slot_belt)
equip_if_possible(new /obj/item/weapon/plastique(src), slot_r_store)
equip_if_possible(new /obj/item/weapon/plastique(src), slot_l_store)
equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
resistances += "alien_embryo"
return 1
//VERB MODIFIERS===================================
+1
View File
@@ -372,6 +372,7 @@ Pod/Blast Doors computer
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
//End locked reporting
+351 -369
View File
@@ -1,14 +1,14 @@
/obj/machinery/computer/secure_data/attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/screwdriver))
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
playsound(loc, 'Screwdriver.ogg', 50, 1)
if(do_after(user, 20))
if (src.stat & BROKEN)
if (stat & BROKEN)
user << "\blue The broken glass falls out."
var/obj/computerframe/A = new /obj/computerframe( src.loc )
new /obj/item/weapon/shard( src.loc )
var/obj/computerframe/A = new /obj/computerframe( loc )
new /obj/item/weapon/shard( loc )
var/obj/item/weapon/circuitboard/secure_data/M = new /obj/item/weapon/circuitboard/secure_data( A )
for (var/obj/C in src)
C.loc = src.loc
C.loc = loc
A.circuit = M
A.state = 3
A.icon_state = "3"
@@ -16,417 +16,399 @@
del(src)
else
user << "\blue You disconnect the monitor."
var/obj/computerframe/A = new /obj/computerframe( src.loc )
var/obj/computerframe/A = new /obj/computerframe( loc )
var/obj/item/weapon/circuitboard/secure_data/M = new /obj/item/weapon/circuitboard/secure_data( A )
for (var/obj/C in src)
C.loc = src.loc
C.loc = loc
A.circuit = M
A.state = 4
A.icon_state = "4"
A.anchored = 1
del(src)
else
src.attack_hand(user)
attack_hand(user)
return
/obj/machinery/computer/secure_data/attack_ai(mob/user as mob)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/computer/secure_data/attack_paw(mob/user as mob)
return src.attack_hand(user)
return attack_hand(user)
//Someone needs to break down the dat += into chunks instead of long ass lines.
/obj/machinery/computer/secure_data/attack_hand(mob/user as mob)
if(..())
return
var/dat
if (src.temp)
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];temp=1'>Clear Screen</A>", src.temp, src)
if (temp)
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];choice=Clear Screen'>Clear Screen</A>", temp, src)
else
dat = text("Confirm Identity: <A href='?src=\ref[];scan=1'>[]</A><HR>", src, (src.scan ? text("[]", src.scan.name) : "----------"))
if (src.authenticated)
switch(src.screen)
dat = text("Confirm Identity: <A href='?src=\ref[];choice=Confirm Identity'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
if (authenticated)
switch(screen)
if(1.0)
dat += text("<A href='?src=\ref[];search=1'>Search Records</A><BR>\n<A href='?src=\ref[];list=1'>List Records</A><BR>\n<A href='?src=\ref[];search_f=1'>Search Fingerprints</A><BR>\n<A href='?src=\ref[];new_r=1'>New Record</A><BR>\n<BR>\n<A href='?src=\ref[];rec_m=1'>Record Maintenance</A><BR>\n<A href='?src=\ref[];logout=1'>{Log Out}</A><BR>\n", src, src, src, src, src, src)
dat += text("<A href='?src=\ref[];choice=Search Records'>Search Records</A><BR>\n<A href='?src=\ref[];choice=List Records'>List Records</A><BR>\n<A href='?src=\ref[];choice=Search Fingerprints'>Search Fingerprints</A><BR>\n<A href='?src=\ref[];choice=New Record (General)'>New General Record</A><BR>\n<BR>\n<A href='?src=\ref[];choice=Record Maintenance'>Record Maintenance</A><BR>\n<A href='?src=\ref[];choice=Log Out'>{Log Out}</A><BR>\n", src, src, src, src, src, src)
if(2.0)
dat += "<B>Record List</B>:<HR>"
for(var/datum/data/record/R in data_core.general)
dat += text("<A href='?src=\ref[];d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
//Foreach goto(136)
dat += text("<HR><A href='?src=\ref[];main=1'>Back</A>", src)
dat += text("<A href='?src=\ref[];choice=Browse Record;d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
dat += text("<HR><A href='?src=\ref[];choice=Return'>Back</A>", src)
if(3.0)
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];main=1'>Back</A>", src, src, src, src)
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];choice=Delete All Records'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];choice=Return'>Back</A>", src, src)
if(4.0)
dat += "<CENTER><B>Security Record</B></CENTER><BR>"
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
dat += text("Name: <A href='?src=\ref[];field=name'>[]</A> ID: <A href='?src=\ref[];field=id'>[]</A><BR>\nSex: <A href='?src=\ref[];field=sex'>[]</A><BR>\nAge: <A href='?src=\ref[];field=age'>[]</A><BR>\nRank: <A href='?src=\ref[];field=rank'>[]</A><BR>\nFingerprint: <A href='?src=\ref[];field=fingerprint'>[]</A><BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src, src.active1.fields["name"], src, src.active1.fields["id"], src, src.active1.fields["sex"], src, src.active1.fields["age"], src, src.active1.fields["rank"], src, src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
dat += text("Name: <A href='?src=\ref[];choice=Edit Field;field=name'>[]</A> ID: <A href='?src=\ref[];choice=Edit Field;field=id'>[]</A><BR>\nSex: <A href='?src=\ref[];choice=Edit Field;field=sex'>[]</A><BR>\nAge: <A href='?src=\ref[];choice=Edit Field;field=age'>[]</A><BR>\nRank: <A href='?src=\ref[];choice=Edit Field;field=rank'>[]</A><BR>\nFingerprint: <A href='?src=\ref[];choice=Edit Field;field=fingerprint'>[]</A><BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src, active1.fields["name"], src, active1.fields["id"], src, active1.fields["sex"], src, active1.fields["age"], src, active1.fields["rank"], src, active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"])
else
dat += "<B>General Record Lost!</B><BR>"
if ((istype(src.active2, /datum/data/record) && data_core.security.Find(src.active2)))
dat += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: <A href='?src=\ref[];field=criminal'>[]</A><BR>\n<BR>\nMinor Crimes: <A href='?src=\ref[];field=mi_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=mi_crim_d'>[]</A><BR>\n<BR>\nMajor Crimes: <A href='?src=\ref[];field=ma_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=ma_crim_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, src.active2.fields["criminal"], src, src.active2.fields["mi_crim"], src, src.active2.fields["mi_crim_d"], src, src.active2.fields["ma_crim"], src, src.active2.fields["ma_crim_d"], src, src.active2.fields["notes"])
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
dat += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: <A href='?src=\ref[];choice=Edit Field;field=criminal'>[]</A><BR>\n<BR>\nMinor Crimes: <A href='?src=\ref[];choice=Edit Field;field=mi_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];choice=Edit Field;field=mi_crim_d'>[]</A><BR>\n<BR>\nMajor Crimes: <A href='?src=\ref[];choice=Edit Field;field=ma_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];choice=Edit Field;field=ma_crim_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];choice=Edit Field;field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, active2.fields["criminal"], src, active2.fields["mi_crim"], src, active2.fields["mi_crim_d"], src, active2.fields["ma_crim"], src, active2.fields["ma_crim_d"], src, active2.fields["notes"])
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
dat += text("[]<BR><A href='?src=\ref[];del_c=[]'>Delete Entry</A><BR><BR>", src.active2.fields[text("com_[]", counter)], src, counter)
while(active2.fields[text("com_[]", counter)])
dat += text("[]<BR><A href='?src=\ref[];choice=Delete Entry;del_c=[]'>Delete Entry</A><BR><BR>", active2.fields[text("com_[]", counter)], src, counter)
counter++
dat += text("<A href='?src=\ref[];add_c=1'>Add Entry</A><BR><BR>", src)
dat += text("<A href='?src=\ref[];del_r=1'>Delete Record (Security Only)</A><BR><BR>", src)
dat += text("<A href='?src=\ref[];choice=Add Entry'>Add Entry</A><BR><BR>", src)
dat += text("<A href='?src=\ref[];choice=Delete Record (Security)'>Delete Record (Security Only)</A><BR><BR>", src)
else
dat += "<B>Security Record Lost!</B><BR>"
dat += text("<A href='?src=\ref[];new=1'>New Record</A><BR><BR>", src)
dat += text("\n<A href='?src=\ref[];dela_r=1'>Delete Record (ALL)</A><BR><BR>\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];list=1'>Back</A><BR>", src, src, src)
dat += text("<A href='?src=\ref[];choice=New Record (Security)'>New Security Record</A><BR><BR>", src)
dat += text("\n<A href='?src=\ref[];choice=Delete Record (ALL)'>Delete Record (ALL)</A><BR><BR>\n<A href='?src=\ref[];choice=Print Record'>Print Record</A><BR>\n<A href='?src=\ref[];choice=Return'>Back</A><BR>", src, src, src)
else
else
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
dat += text("<A href='?src=\ref[];choice=Log In'>{Log In}</A>", src)
user << browse(text("<HEAD><TITLE>Security Records</TITLE></HEAD><TT>[]</TT>", dat), "window=secure_rec")
onclose(user, "secure_rec")
return
/*Revised /N
I can't be bothered to look more of the actual code outside of switch but that probably needs revising too.
What a mess.*/
/obj/machinery/computer/secure_data/Topic(href, href_list)
if(..())
return
if (!( data_core.general.Find(src.active1) ))
src.active1 = null
if (!( data_core.security.Find(src.active2) ))
src.active2 = null
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
if (!( data_core.general.Find(active1) ))
active1 = null
if (!( data_core.security.Find(active2) ))
active2 = null
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
if (href_list["temp"])
src.temp = null
if (href_list["scan"])
if (src.scan)
src.scan.loc = src.loc
src.scan = null
else
var/obj/item/I = usr.equipped()
if (istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
src.scan = I
else
if (href_list["logout"])
src.authenticated = null
src.screen = null
src.active1 = null
src.active2 = null
else
if (href_list["login"])
if (istype(usr, /mob/living/silicon))
src.active1 = null
src.active2 = null
src.authenticated = 1
src.rank = "AI"
src.screen = 1
if (istype(src.scan, /obj/item/weapon/card/id))
src.active1 = null
src.active2 = null
if(check_access(src.scan))
src.authenticated = src.scan.registered
src.rank = src.scan.assignment
src.screen = 1
if (src.authenticated)
if (href_list["list"])
src.screen = 2
src.active1 = null
src.active2 = null
else
if (href_list["rec_m"])
src.screen = 3
src.active1 = null
src.active2 = null
switch(href_list["choice"])
//BASIC FUNCTIONS
if("Clear Screen")
temp = null
if ("Return")
screen = 1
active1 = null
active2 = null
if("Confirm Identity")
if (scan)
scan.loc = loc
scan = null
else
if (href_list["del_all"])
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
var/obj/item/I = usr.equipped()
if (istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
scan = I
if("Log Out")
authenticated = null
screen = null
active1 = null
active2 = null
if("Log In")
if (istype(usr, /mob/living/silicon))
active1 = null
active2 = null
authenticated = 1
rank = "AI"
screen = 1
else if (istype(scan, /obj/item/weapon/card/id))
active1 = null
active2 = null
if(check_access(scan))
authenticated = scan.registered
rank = scan.assignment
screen = 1
//RECORD FUNCTIONS
if("List Records")
screen = 2
active1 = null
active2 = null
if("Search Records")
var/t1 = input("Search String: (Name or ID)", "Secure. records", null, null) as text
if ((!( t1 ) || usr.stat || !( authenticated ) || usr.restrained() || !in_range(src, usr)))
return
active1 = null
active2 = null
t1 = lowertext(t1)
for(var/datum/data/record/R in data_core.general)
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"])))
active1 = R
if (!( active1 ))
temp = text("Could not locate record [].", t1)
else
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == active1.fields["name"] || E.fields["id"] == active1.fields["id"]))
active2 = E
screen = 4
if("Record Maintenance")
screen = 3
active1 = null
active2 = null
if ("Browse Record")
var/datum/data/record/R = locate(href_list["d_rec"])
var/S = locate(href_list["d_rec"])
if (!( data_core.general.Find(R) ))
temp = "Record Not Found!"
else
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
S = E
active1 = R
active2 = S
screen = 4
if ("Search Fingerprints")
var/t1 = input("Search String: (Fingerprint)", "Secure. records", null, null) as text
if ((!( t1 ) || usr.stat || !( authenticated ) || usr.restrained() || (!in_range(src, usr)) && (!istype(usr, /mob/living/silicon))))
return
active1 = null
active2 = null
t1 = lowertext(t1)
for(var/datum/data/record/R in data_core.general)
if (lowertext(R.fields["fingerprint"]) == t1)
active1 = R
else
if (href_list["del_all2"])
for(var/datum/data/record/R in data_core.security)
//R = null
del(R)
//Foreach goto(497)
src.temp = "All records deleted."
else
if (href_list["main"])
src.screen = 1
src.active1 = null
src.active2 = null
//Foreach continue //goto(3414)
if (!( active1 ))
temp = text("Could not locate record [].", t1)
else
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == active1.fields["name"] || E.fields["id"] == active1.fields["id"]))
active2 = E
screen = 4
if ("Print Record")
if (!( printing ))
printing = 1
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc )
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", active1.fields["name"], active1.fields["id"], active1.fields["sex"], active1.fields["age"], active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"])
else
P.info += "<B>General Record Lost!</B><BR>"
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
P.info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []<BR>\n<BR>\nMinor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nMajor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", active2.fields["criminal"], active2.fields["mi_crim"], active2.fields["mi_crim_d"], active2.fields["ma_crim"], active2.fields["ma_crim_d"], active2.fields["notes"])
var/counter = 1
while(active2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", active2.fields[text("com_[]", counter)])
counter++
else
P.info += "<B>Security Record Lost!</B><BR>"
P.info += "</TT>"
P.name = "paper- 'Security Record'"
printing = null
//RECORD DELETE
if ("Delete All Records")
temp = ""
temp += "Are you sure you wish to delete all Security records?<br>"
temp += "<a href='?src=\ref[src];choice=Purge All Records'>Yes</a><br>"
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if ("Purge All Records")
for(var/datum/data/record/R in data_core.security)
del(R)
temp = "All Security records deleted."
if ("Add Entry")
if (!( istype(active2, /datum/data/record) ))
return
var/a2 = active2
var/t1 = input("Add Comment:", "Secure. records", null, null) as message
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
var/counter = 1
while(active2.fields[text("com_[]", counter)])
counter++
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053<BR>[]", authenticated, rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
if ("Delete Record (ALL)")
if (active1)
temp = "<h5>Are you sure you wish to delete the record (ALL)?</h5>"
temp += "<a href='?src=\ref[src];choice=Delete Record (ALL) Execute'>Yes</a><br>"
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if ("Delete Record (Security)")
if (active2)
temp = "<h5>Are you sure you wish to delete the record (Security Portion Only)?</h5>"
temp += "<a href='?src=\ref[src];choice=Delete Record (Security) Execute'>Yes</a><br>"
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if ("Delete Entry")
if ((istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])]))
active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
//RECORD CREATE
if ("New Record (Security)")
if ((istype(active1, /datum/data/record) && !( istype(active2, /datum/data/record) )))
var/datum/data/record/R = new /datum/data/record()
R.fields["name"] = active1.fields["name"]
R.fields["id"] = active1.fields["id"]
R.name = text("Security Record #[]", R.fields["id"])
R.fields["criminal"] = "None"
R.fields["mi_crim"] = "None"
R.fields["mi_crim_d"] = "No minor crime convictions."
R.fields["ma_crim"] = "None"
R.fields["ma_crim_d"] = "No major crime convictions."
R.fields["notes"] = "No notes."
data_core.security += R
active2 = R
screen = 4
if ("New Record (General)")
var/datum/data/record/G = new /datum/data/record()
G.fields["name"] = "New Record"
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
G.fields["rank"] = "Unassigned"
G.fields["sex"] = "Male"
G.fields["age"] = "Unknown"
G.fields["fingerprint"] = "Unknown"
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
data_core.general += G
active1 = G
active2 = null
//FIELD FUNCTIONS
if ("Edit Field")
var/a1 = active1
var/a2 = active2
switch(href_list["field"])
if("name")
if (istype(active1, /datum/data/record))
var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
return
active1.fields["name"] = t1
if("id")
if (istype(active2, /datum/data/record))
var/t1 = input("Please input id:", "Secure. records", active1.fields["id"], null) as text
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["id"] = t1
if("fingerprint")
if (istype(active1, /datum/data/record))
var/t1 = input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["fingerprint"] = t1
if("sex")
if (istype(active1, /datum/data/record))
if (active1.fields["sex"] == "Male")
active1.fields["sex"] = "Female"
else
if (href_list["field"])
var/a1 = src.active1
var/a2 = src.active2
switch(href_list["field"])
if("name")
if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input name:", "Secure. records", src.active1.fields["name"], null) as text
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || src.active1 != a1)
return
src.active1.fields["name"] = t1
if("id")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input id:", "Secure. records", src.active1.fields["id"], null) as text
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["id"] = t1
if("fingerprint")
if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input fingerprint hash:", "Secure. records", src.active1.fields["fingerprint"], null) as text
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["fingerprint"] = t1
if("sex")
if (istype(src.active1, /datum/data/record))
if (src.active1.fields["sex"] == "Male")
src.active1.fields["sex"] = "Female"
else
src.active1.fields["sex"] = "Male"
if("age")
if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input age:", "Secure. records", src.active1.fields["age"], null) as text
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["age"] = t1
if("mi_crim")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input minor disabilities list:", "Secure. records", src.active2.fields["mi_crim"], null) as text
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_crim"] = t1
if("mi_crim_d")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize minor dis.:", "Secure. records", src.active2.fields["mi_crim_d"], null) as message
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_crim_d"] = t1
if("ma_crim")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input major diabilities list:", "Secure. records", src.active2.fields["ma_crim"], null) as text
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_crim"] = t1
if("ma_crim_d")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize major dis.:", "Secure. records", src.active2.fields["ma_crim_d"], null) as message
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_crim_d"] = t1
if("notes")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize notes:", "Secure. records", src.active2.fields["notes"], null) as message
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["notes"] = t1
if("criminal")
if (istype(src.active2, /datum/data/record))
src.temp = text("<B>Criminal Status:</B><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=none'>None</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=arrest'>*Arrest*</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=incarcerated'>Incarcerated</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=parolled'>Parolled</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=released'>Released</A><BR>", src, src, src, src, src)
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI" )
if ((istype(src.active1, /datum/data/record) && L.Find(src.rank)))
src.temp = text("<B>Rank:</B><BR>\n<B>Assistants:</B><BR>\n<A href='?src=\ref[];temp=1;rank=res_assist'>Assistant</A><BR>\n<B>Technicians:</B><BR>\n<A href='?src=\ref[];temp=1;rank=foren_tech'>Detective</A><BR>\n<A href='?src=\ref[];temp=1;rank=atmo_tech'>Atmospheric Technician</A><BR>\n<A href='?src=\ref[];temp=1;rank=engineer'>Station Engineer</A><BR>\n<B>Researchers:</B><BR>\n<A href='?src=\ref[];temp=1;rank=med_res'>Geneticist</A><BR>\n<A href='?src=\ref[];temp=1;rank=tox_res'>Scientist</A><BR>\n<B>Officers:</B><BR>\n<A href='?src=\ref[];temp=1;rank=med_doc'>Medical Doctor</A><BR>\n<A href='?src=\ref[];temp=1;rank=secure_off'>Security Officer</A><BR>\n<B>Higher Officers:</B><BR>\n<A href='?src=\ref[];temp=1;rank=hoperson'>Head of Security</A><BR>\n<A href='?src=\ref[];temp=1;rank=hosecurity'>Head of Personnel</A><BR>\n<A href='?src=\ref[];temp=1;rank=captain'>Captain</A><BR>", src, src, src, src, src, src, src, src, src, src, src)
else
alert(usr, "You do not have the required rank to do this!")
else
else
if (href_list["rank"])
if (src.active1)
switch(href_list["rank"])
if("res_assist")
src.active1.fields["rank"] = "Assistant"
if("foren_tech")
src.active1.fields["rank"] = "Detective"
if("atmo_tech")
src.active1.fields["rank"] = "Atmospheric Technician"
if("engineer")
src.active1.fields["rank"] = "Station Engineer"
if("med_res")
src.active1.fields["rank"] = "Geneticist"
if("tox_res")
src.active1.fields["rank"] = "Scientist"
if("med_doc")
src.active1.fields["rank"] = "Medical Doctor"
if("secure_off")
src.active1.fields["rank"] = "Security Officer"
if("hoperson")
src.active1.fields["rank"] = "Head of Security"
if("hosecurity")
src.active1.fields["rank"] = "Head of Personnel"
if("captain")
src.active1.fields["rank"] = "Captain"
if("barman")
src.active1.fields["rank"] = "Barman"
if("chemist")
src.active1.fields["rank"] = "Chemist"
if("janitor")
src.active1.fields["rank"] = "Janitor"
if("clown")
src.active1.fields["rank"] = "Clown"
active1.fields["sex"] = "Male"
if("age")
if (istype(active1, /datum/data/record))
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as text
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["age"] = t1
if("mi_crim")
if (istype(active2, /datum/data/record))
var/t1 = input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
if (istype(active2, /datum/data/record))
var/t1 = input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim_d"] = t1
if("notes")
if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["notes"] = t1
if("criminal")
if (istype(active2, /datum/data/record))
temp = "<h5>Criminal Status:</h5>"
temp += "<ul>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=none'>None</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=arrest'>*Arrest*</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=incarcerated'>Incarcerated</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=parolled'>Parolled</a></li>"
temp += "<li><a href='?src=\ref[src];choice=Change Criminal Status;criminal2=released'>Released</a></li>"
temp += "</ul>"
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI" )
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
if ((istype(active1, /datum/data/record) && L.Find(rank)))
temp = "<h5>Rank:</h5>"
temp += "<ul>"
for(var/rank in get_all_jobs())
temp += "<li><a href='?src=\ref[src];choice=Change Rank;rank=[rank]'>[rank]</a></li>"
temp += "</ul>"
else
alert(usr, "You do not have the required rank to do this!")
//TEMPORARY MENU FUNCTIONS
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
if ("Change Rank")
if (active1)
active1.fields["rank"] = href_list["rank"]
else
if (href_list["criminal2"])
if (src.active2)
switch(href_list["criminal2"])
if("none")
src.active2.fields["criminal"] = "None"
if("arrest")
src.active2.fields["criminal"] = "*Arrest*"
if("incarcerated")
src.active2.fields["criminal"] = "Incarcerated"
if("parolled")
src.active2.fields["criminal"] = "Parolled"
if("released")
src.active2.fields["criminal"] = "Released"
if ("Change Criminal Status")
if (active2)
switch(href_list["criminal2"])
if("none")
active2.fields["criminal"] = "None"
if("arrest")
active2.fields["criminal"] = "*Arrest*"
if("incarcerated")
active2.fields["criminal"] = "Incarcerated"
if("parolled")
active2.fields["criminal"] = "Parolled"
if("released")
active2.fields["criminal"] = "Released"
else
if (href_list["del_r"])
if (src.active2)
src.temp = text("Are you sure you wish to delete the record (Security Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
else
if (href_list["del_r2"])
if (src.active2)
//src.active2 = null
del(src.active2)
else
if (href_list["dela_r"])
if (src.active1)
src.temp = text("Are you sure you wish to delete the record (ALL)?<br>\n\t<A href='?src=\ref[];temp=1;dela_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
else
if (href_list["dela_r2"])
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == src.active1.fields["name"] || R.fields["id"] == src.active1.fields["id"]))
//R = null
del(R)
else
if (src.active2)
//src.active2 = null
del(src.active2)
if (src.active1)
//src.active1 = null
del(src.active1)
else
if (href_list["d_rec"])
var/datum/data/record/R = locate(href_list["d_rec"])
var/S = locate(href_list["d_rec"])
if (!( data_core.general.Find(R) ))
src.temp = "Record Not Found!"
return
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
S = E
else
//Foreach continue //goto(2614)
src.active1 = R
src.active2 = S
src.screen = 4
else
if (href_list["new_r"])
var/datum/data/record/G = new /datum/data/record( )
G.fields["name"] = "New Record"
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
G.fields["rank"] = "Unassigned"
G.fields["sex"] = "Male"
G.fields["age"] = "Unknown"
G.fields["fingerprint"] = "Unknown"
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
data_core.general += G
src.active1 = G
src.active2 = null
else
if (href_list["new"])
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
var/datum/data/record/R = new /datum/data/record( )
R.fields["name"] = src.active1.fields["name"]
R.fields["id"] = src.active1.fields["id"]
R.name = text("Security Record #[]", R.fields["id"])
R.fields["criminal"] = "None"
R.fields["mi_crim"] = "None"
R.fields["mi_crim_d"] = "No minor crime convictions."
R.fields["ma_crim"] = "None"
R.fields["ma_crim_d"] = "No major crime convictions."
R.fields["notes"] = "No notes."
data_core.security += R
src.active2 = R
src.screen = 4
else
if (href_list["add_c"])
if (!( istype(src.active2, /datum/data/record) ))
return
var/a2 = src.active2
var/t1 = input("Add Comment:", "Secure. records", null, null) as message
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
counter++
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053<BR>[]", src.authenticated, src.rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
else
if (href_list["del_c"])
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
else
if (href_list["search_f"])
var/t1 = input("Search String: (Fingerprint)", "Secure. records", null, null) as text
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || (!in_range(src, usr)) && (!istype(usr, /mob/living/silicon))))
return
src.active1 = null
src.active2 = null
t1 = lowertext(t1)
for(var/datum/data/record/R in data_core.general)
if (lowertext(R.fields["fingerprint"]) == t1)
src.active1 = R
else
//Foreach continue //goto(3414)
if (!( src.active1 ))
src.temp = text("Could not locate record [].", t1)
else
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == src.active1.fields["name"] || E.fields["id"] == src.active1.fields["id"]))
src.active2 = E
else
//Foreach continue //goto(3502)
src.screen = 4
else
if (href_list["search"])
var/t1 = input("Search String: (Name or ID)", "Secure. records", null, null) as text
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || !in_range(src, usr)))
return
src.active1 = null
src.active2 = null
t1 = lowertext(t1)
for(var/datum/data/record/R in data_core.general)
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"])))
src.active1 = R
else
//Foreach continue //goto(3708)
if (!( src.active1 ))
src.temp = text("Could not locate record [].", t1)
else
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == src.active1.fields["name"] || E.fields["id"] == src.active1.fields["id"]))
src.active2 = E
else
//Foreach continue //goto(3813)
src.screen = 4
else
if (href_list["print_p"])
if (!( src.printing ))
src.printing = 1
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"], src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
else
P.info += "<B>General Record Lost!</B><BR>"
if ((istype(src.active2, /datum/data/record) && data_core.security.Find(src.active2)))
P.info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []<BR>\n<BR>\nMinor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nMajor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src.active2.fields["criminal"], src.active2.fields["mi_crim"], src.active2.fields["mi_crim_d"], src.active2.fields["ma_crim"], src.active2.fields["ma_crim_d"], src.active2.fields["notes"])
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", src.active2.fields[text("com_[]", counter)])
counter++
else
P.info += "<B>Security Record Lost!</B><BR>"
P.info += "</TT>"
P.name = "paper- 'Security Record'"
src.printing = null
src.add_fingerprint(usr)
src.updateUsrDialog()
if ("Delete Record (Security) Execute")
if (active2)
del(active2)
if ("Delete Record (ALL) Execute")
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
del(R)
else
if (active2)
del(active2)
if (active1)
del(active1)
else
temp = "This function does not appear to be working at the moment. Our apologies."
add_fingerprint(usr)
updateUsrDialog()
return
+33 -13
View File
@@ -335,13 +335,13 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!authenticated || !holder)
src << "Only administrators may use this command."
return
var/input = input(src, "Please specify which key will be respawned. Make sure their key is properly capitalized (if that doesn't work, try all lower case).", "Key", "")
var/input = input(src, "Please specify which key will be respawned.", "Key", "")
if(!input)
return
var/mob/dead/observer/G_found
for(var/mob/dead/observer/G in world)
if(G.client&&G.key==input)
if(G.client&&ckey(G.key)==ckey(input))
G_found = G
break
@@ -355,7 +355,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
/*Second, we try and locate a record for the person being respawned through data_core.
This isn't an exact science but it does the trick more often than not.*/
var/datum/data/record/record_found//Referenced to later to either randomize or not randomize the character.
if(G_found.mind)
if(G_found.mind)//They must have a mind to reference the record.
var/id = md5("[G_found.real_name][G_found.mind.assigned_role]")
for(var/datum/data/record/t in data_core.locked)
if(t.fields["id"]==id)
@@ -369,20 +369,23 @@ Traitors and the like can also be revived with the previous role mostly intact.
else
new_character.mind = new()
if(!record_found)//We have to pick their role if they have no record.
var/assigned_role = input("Please specify which job the character will be respawned as.", "Assigned role") as null|anything in get_all_jobs()
if(!assigned_role) new_character.mind.assigned_role = "Assistant"//Defaults to assistant.
else new_character.mind.assigned_role = assigned_role
if(G_found.mind&&G_found.mind.assigned_role)//But they may have an assigned role already.
new_character.mind.assigned_role = G_found.mind.assigned_role//Also makes sure our MODE people are equipped right later on.
else
var/assigned_role = input("Please specify which job the character will be respawned as.", "Assigned role") as null|anything in get_all_jobs()
if(!assigned_role) new_character.mind.assigned_role = "Assistant"//Defaults to assistant.
else new_character.mind.assigned_role = assigned_role
if(!new_character.mind.assigned_role) new_character.mind.assigned_role = "Assistant"//If they somehow got a null assigned role.
new_character.mind.key = G_found.key//In case it's someone else playing as that character.
new_character.mind.current = new_character//So that it can properly reference later if needed.
new_character.mind.memory = ""//Memory erased so it doesn't get clunkered up with useless info.
new_character.mind.memory = ""//Memory erased so it doesn't get clunkered up with useless info. This means they may forget their previous mission--this is usually handled through objective code and recalling memory.
//Here we either load their saved appearance or randomize it.
var/datum/preferences/A = new()
if(A.savefile_load(G_found))//If they have a save file. This will automatically load their parameters.
//Note: savefile appearances are overwritten later on if the character has a data_core entry. By appearance, I mean the physical appearance.
var/name_safety = G_found.real_name//Their saved parameters may include a random name.
var/name_safety = G_found.real_name//Their saved parameters may include a random name. Also a safety in case they are playing a character that got their name after round start.
A.copy_to(new_character)
new_character.real_name = name_safety
new_character.name = name_safety
@@ -407,8 +410,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(record_found)//Pull up their name from database records if they did have a mind.
new_character.dna = new()//Let's first give them a new DNA.
new_character.dna.unique_enzymes = record_found.fields["b_dna"]//Enzymes are based on real name but we'll use the record for conformity.
new_character.dna.struc_enzymes = record_found.fields["enzymes"]//This is the default of enzymes so I think it's safe to go with.
new_character.dna.uni_identity = record_found.fields["identity"]//DNA identity is carried over.
new_character.dna.struc_enzymes = "2013E85C944C19A4B00185144725785DC6406A4508"//This is the default of enzymes so I think it's safe to go with.
updateappearance(new_character,new_character.dna.uni_identity)//Now we configure their appearance based on their unique identity, same as with a DNA machine or somesuch.
else//If they have no records, we just do a random DNA for them, based on their random appearance/savefile.
new_character.dna.ready_dna(new_character)
@@ -416,6 +419,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
//Here we need to find where to spawn them.
var/spawn_here = pick(latejoin)//"JoinLate" is a landmark which is deleted on round start. So, latejoin has to be used instead.
new_character.loc = spawn_here
//If they need to spawn elsewhere, they will be transferred there momentarily.
/*
The code below functions with the assumption that the mob is already a traitor if they have a special role.
@@ -445,6 +449,21 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(synd_spawn)
new_character.loc = get_turf(synd_spawn)
call(/datum/game_mode/nuclear/proc/equip_syndicate)(new_character)
if("Space Ninja")
var/ninja_spawn[] = list()
for(var/obj/landmark/L in world)
if(L.name=="carpspawn")
ninja_spawn += L
new_character.equip_space_ninja()
new_character.internal = new_character.s_store
new_character.internals.icon_state = "internal1"
if(ninja_spawn.len)
var/obj/landmark/ninja_spawn_here = pick(ninja_spawn)
new_character.loc = ninja_spawn_here.loc
if("Death Commando")//Leaves them at late-join spawn.
new_character.equip_death_commando()
new_character.internal = new_character.s_store
new_character.internals.icon_state = "internal1"
else//They may also be a cyborg or AI.
switch(new_character.mind.assigned_role)
if("Cyborg")//More rigging to make em' work and check if they're traitor.
@@ -460,11 +479,12 @@ Traitors and the like can also be revived with the previous role mostly intact.
//Announces the character on all the systems, based on the record.
if(!issilicon(new_character))//If they are not a cyborg/AI.
if(!record_found)//If there are no records for them. If they have a record, this info is already in there.
if(alert("Warning: No data core entry detected. Would you like to announce the arrival of this character by addeding them to various databases, such as medical records? Wizards and nuke operatives will not be added.",,"No","Yes")=="Yes")
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)
if(alert("Would you like an active AI to announce this character? Wizards and nuke operatives won't be announced.",,"No","Yes")=="Yes")
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)
message_admins("\blue [admin] has respawned [player_key] as [new_character.real_name].", 1)
@@ -472,7 +492,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
new_character << "You have been fully respawned. Enjoy the game."
del(G_found)//Don't want to leave ghosts around.
return
return new_character
/client/proc/cmd_admin_add_freeform_ai_law()
set category = "Fun"
+93 -83
View File
@@ -35,7 +35,6 @@ var/global/sent_strike_team = 0
var/commando_number = 6 //for selecting a leader
var/leader_selected = 0 //when the leader is chosen. The last person spawned.
var/commando_leader_rank = pick("Lieutenant", "Captain", "Major")
//Code for spawning a nuke auth code.
var/nuke_code = "[rand(10000, 99999.0)]"
@@ -58,89 +57,15 @@ var/global/sent_strike_team = 0
//Spawns commandos and equips them.
for (var/obj/landmark/STARTLOC in world)
if (STARTLOC.name == "Commando")
var/mob/living/carbon/human/new_commando = new(STARTLOC.loc)
var/commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
var/commando_name = pick(last_names)
new_commando.gender = pick(MALE, FEMALE)
if (commando_number == 1)
if (commando_number == 1)//Leader is always the last guy spawned.
leader_selected = 1
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(new_commando)
if (leader_selected == 0)
new_commando.real_name = "[commando_rank] [commando_name]"
else
new_commando.real_name = "[commando_leader_rank] [commando_name]"
if (leader_selected == 0)
new_commando.age = rand(23,35)
else
new_commando.age = rand(35,45)
new_commando.dna.ready_dna(new_commando) //Creates DNA
//Creates mind stuff.
new_commando.mind = new
new_commando.mind.current = new_commando
new_commando.mind.assigned_role = "Centcom Contractor"
new_commando.mind.special_role = "Death Commando"
new_commando.mind.store_memory("<B>Nuke Code:</B> \red [nuke_code].")//So they don't forget their code or mission.
new_commando.mind.store_memory("<B>Mission:</B> \red [input].")
new_commando.resistances += "alien_embryo"
del(STARTLOC)
var/obj/machinery/camera/camera = new /obj/machinery/camera(new_commando) //Gives all the commandos internals cameras.
camera.network = "CREED"
camera.c_tag = new_commando.real_name
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(new_commando)
R.set_frequency(1441)
new_commando.equip_if_possible(R, new_commando.slot_ears)
if (leader_selected == 0)
new_commando.equip_if_possible(new /obj/item/clothing/under/color/green(new_commando), new_commando.slot_w_uniform)
else
new_commando.equip_if_possible(new /obj/item/clothing/under/rank/centcom_officer(new_commando), new_commando.slot_w_uniform)
new_commando.equip_if_possible(new /obj/item/clothing/shoes/swat(new_commando), new_commando.slot_shoes)
new_commando.equip_if_possible(new /obj/item/clothing/suit/armor/swat(new_commando), new_commando.slot_wear_suit)
new_commando.equip_if_possible(new /obj/item/clothing/gloves/swat(new_commando), new_commando.slot_gloves)
new_commando.equip_if_possible(new /obj/item/clothing/head/helmet/swat(new_commando), new_commando.slot_head)
new_commando.equip_if_possible(new /obj/item/clothing/mask/gas/swat(new_commando), new_commando.slot_wear_mask)
new_commando.equip_if_possible(new /obj/item/clothing/glasses/thermal(new_commando), new_commando.slot_glasses)
new_commando.equip_if_possible(new /obj/item/weapon/storage/backpack(new_commando), new_commando.slot_back)
new_commando.equip_if_possible(new /obj/item/weapon/ammo/a357(new_commando), new_commando.slot_in_backpack)
new_commando.equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(new_commando), new_commando.slot_in_backpack)
new_commando.equip_if_possible(new /obj/item/weapon/storage/flashbang_kit(new_commando), new_commando.slot_in_backpack)
new_commando.equip_if_possible(new /obj/item/device/flashlight(new_commando), new_commando.slot_in_backpack)
if (leader_selected == 0)
new_commando.equip_if_possible(new /obj/item/weapon/plastique(new_commando), new_commando.slot_in_backpack)
else
new_commando.equip_if_possible(new /obj/item/weapon/pinpointer(new_commando), new_commando.slot_in_backpack)
if (leader_selected == 1)
new_commando.equip_if_possible(new /obj/item/weapon/disk/nuclear(new_commando), new_commando.slot_in_backpack)
new_commando.equip_if_possible(new /obj/item/weapon/sword(new_commando), new_commando.slot_l_store)
new_commando.equip_if_possible(new /obj/item/weapon/flashbang(new_commando), new_commando.slot_r_store)
new_commando.equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(new_commando), new_commando.slot_s_store)
var/obj/item/weapon/gun/revolver/GUN = new /obj/item/weapon/gun/revolver/mateba(new_commando)
GUN.bullets = 7
new_commando.equip_if_possible(GUN, new_commando.slot_belt)
// new_commando.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle(new_commando), new_commando.slot_l_hand)
/*Commented out because Commandos now have their rifles spawn in front of them, along with operation manuals.
Useful for copy pasta since I'm lazy.*/
var/obj/item/weapon/card/id/W = new(new_commando)
W.name = "[new_commando.real_name]'s ID Card"
W.access = get_all_accesses()
W.assignment = "Death Commando"
W.registered = new_commando.real_name
new_commando.equip_if_possible(W, new_commando.slot_wear_id)
var/mob/living/carbon/human/new_commando = create_death_commando(STARTLOC, leader_selected)
if(commandos.len)
G = pick(commandos)
new_commando.mind.key = G.key//For mind stuff.
new_commando.client = G.client
new_commando.key = G.key
new_commando.internal = new_commando.s_store
new_commando.internals.icon_state = "internal1"
del(G)
@@ -148,12 +73,15 @@ Useful for copy pasta since I'm lazy.*/
new_commando.key = "null"
new_commando.mind.key = new_commando.key
commando_number--
new_commando.mind.store_memory("<B>Nuke Code:</B> \red [nuke_code].")//So they don't forget their code or mission.
new_commando.mind.store_memory("<B>Mission:</B> \red [input].")
if (leader_selected == 0)
new_commando << "\blue \nYou are a Special Ops. commando in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red<B>[input]</B>"
if (!leader_selected)
new_commando << "\blue You are a Special Ops. commando in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red<B>[input]</B>"
else
new_commando << "\blue \nYou are a Special Ops. <B>LEADER</B> in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red<B>[input]</B>"
new_commando << "\blue You are a Special Ops. <B>LEADER</B> in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red<B>[input]</B>"
commando_number--
//Targets any nukes in the world and changes their auth code as needed.
//Bad news for Nuke operatives--or great news.
@@ -174,4 +102,86 @@ Useful for copy pasta since I'm lazy.*/
del(BOMB)
message_admins("\blue [key_name_admin(usr)] has spawned a CentCom strike squad.", 1)
log_admin("[key_name(usr)] used Spawn Death Squad.")
log_admin("[key_name(usr)] used Spawn Death Squad.")
/client/proc/create_death_commando(obj/spawn_location, leader_selected = 0)
var/mob/living/carbon/human/new_commando = new(spawn_location.loc)
var/commando_leader_rank = pick("Lieutenant", "Captain", "Major")
var/commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
var/commando_name = pick(last_names)
new_commando.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(new_commando)
if (!leader_selected)
new_commando.real_name = "[commando_rank] [commando_name]"
else
new_commando.real_name = "[commando_leader_rank] [commando_name]"
if (!leader_selected)
new_commando.age = rand(23,35)
else
new_commando.age = rand(35,45)
new_commando.dna.ready_dna(new_commando)//Creates DNA.
//Creates mind stuff.
new_commando.mind = new
new_commando.mind.current = new_commando
new_commando.mind.assigned_role = "MODE"
new_commando.mind.special_role = "Death Commando"
new_commando.equip_death_commando(leader_selected)
del(spawn_location)
return new_commando
/mob/living/carbon/human/proc/equip_death_commando(leader_selected = 0)
var/obj/machinery/camera/camera = new /obj/machinery/camera(src) //Gives all the commandos internals cameras.
camera.network = "CREED"
camera.c_tag = real_name
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
R.set_frequency(1441)
equip_if_possible(R, slot_ears)
if (leader_selected == 0)
equip_if_possible(new /obj/item/clothing/under/color/green(src), slot_w_uniform)
else
equip_if_possible(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
equip_if_possible(new /obj/item/clothing/shoes/swat(src), slot_shoes)
equip_if_possible(new /obj/item/clothing/suit/armor/swat(src), slot_wear_suit)
equip_if_possible(new /obj/item/clothing/gloves/swat(src), slot_gloves)
equip_if_possible(new /obj/item/clothing/head/helmet/swat(src), slot_head)
equip_if_possible(new /obj/item/clothing/mask/gas/swat(src), slot_wear_mask)
equip_if_possible(new /obj/item/clothing/glasses/thermal(src), slot_glasses)
equip_if_possible(new /obj/item/weapon/storage/backpack(src), slot_back)
equip_if_possible(new /obj/item/weapon/ammo/a357(src), slot_in_backpack)
equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack)
equip_if_possible(new /obj/item/weapon/storage/flashbang_kit(src), slot_in_backpack)
equip_if_possible(new /obj/item/device/flashlight(src), slot_in_backpack)
if (!leader_selected)
equip_if_possible(new /obj/item/weapon/plastique(src), slot_in_backpack)
else
equip_if_possible(new /obj/item/weapon/pinpointer(src), slot_in_backpack)
equip_if_possible(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack)
equip_if_possible(new /obj/item/weapon/sword(src), slot_l_store)
equip_if_possible(new /obj/item/weapon/flashbang(src), slot_r_store)
equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
var/obj/item/weapon/gun/revolver/GUN = new /obj/item/weapon/gun/revolver/mateba(src)
GUN.bullets = 7
equip_if_possible(GUN, slot_belt)
//equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_l_hand)
/*Commented out because Commandos now have their rifles spawn in front of them, along with operation manuals.
Useful for copy pasta since I'm lazy.*/
var/obj/item/weapon/card/id/W = new(src)
W.name = "[real_name]'s ID Card"
W.access = get_all_accesses()
W.assignment = "Death Commando"
W.registered = real_name
equip_if_possible(W, slot_wear_id)
resistances += "alien_embryo"
return 1
+17 -17
View File
@@ -1,7 +1,7 @@
mob/new_player
var/datum/preferences/preferences
var/ready = 0
var/spawning = 0
var/spawning = 0//Referenced when you want to delete the new_player later on in the code.
invisibility = 101
@@ -25,8 +25,8 @@ mob/new_player
new_player_panel()
var/starting_loc = pick(newplayer_start)
src.loc = starting_loc
src.sight |= SEE_TURFS
loc = starting_loc
sight |= SEE_TURFS
var/list/watch_locations = list()
for(var/obj/landmark/landmark in world)
if(landmark.tag == "landmark*new_player")
@@ -37,12 +37,12 @@ mob/new_player
if(!preferences.savefile_load(src, 0))
preferences.ShowChoices(src)
if (src.client.changes)
src.changes()
if (client.changes)
changes()
else
var/lastchangelog = length('changelog.html')
if (!src.client.changes && preferences.lastchangelog!=lastchangelog)
src.changes()
if (!client.changes && preferences.lastchangelog!=lastchangelog)
changes()
preferences.lastchangelog = lastchangelog
preferences.savefile_save(src)
//PDA Resource Initialisation =======================================================>
@@ -93,9 +93,8 @@ mob/new_player
Logout()
ready = 0
..()
if(!config.del_new_on_log)
return
if(!spawning)
if(!spawning)//Here so that if they are spawning and log out, the other procs can play out and they will have a mob to come back to.
key = null//We null their key before deleting the mob, so they are properly kicked out.
del(src)
return
@@ -105,7 +104,7 @@ mob/new_player
var/output = "<HR><B>New Player Options</B><BR>"
output += "<HR><br><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A><BR><BR>"
//if(istester(src.key))
//if(istester(key))
if(!ticker || ticker.current_state <= GAME_STATE_PREGAME)
if(!ready)
output += "<a href='byond://?src=\ref[src];ready=1'>Declare Ready</A><BR>"
@@ -161,7 +160,7 @@ mob/new_player
if(alert(src,"Are you sure you wish to observe? You will not be able to play this round!","Player Setup","Yes","No") == "Yes")
var/mob/dead/observer/observer = new()
src.spawning = 1
spawning = 1
close_spawn_windows()
var/obj/O = locate("landmark*Observer-Start")
@@ -348,6 +347,7 @@ mob/new_player
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
//End locked reporting
@@ -448,8 +448,8 @@ mob/new_player
src << browse(dat, "window=latechoices;size=300x640;can_close=0")
proc/create_character()
src.spawning = 1
var/mob/living/carbon/human/new_character = new(src.loc)
spawning = 1
var/mob/living/carbon/human/new_character = new(loc)
close_spawn_windows()
@@ -577,10 +577,10 @@ mob/new_player
if (!message)
return
log_say("[src.key] : [message]")
log_say("[key] : [message]")
if (src.muted)
if (muted)
return
. = src.say_dead(message)
. = say_dead(message)
*/
+8 -7
View File
@@ -56,7 +56,7 @@ datum/preferences
underwear = pick(0,1)
b_type = pick("A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-")
age = rand(19,35)
copy_to(H)
copy_to(H,1)
proc/randomize_name()
if (gender == MALE)
@@ -823,7 +823,7 @@ datum/preferences
ShowChoices(user)
proc/copy_to(mob/living/carbon/human/character)
proc/copy_to(mob/living/carbon/human/character, safety = 0)
if(be_random_name)
randomize_name()
character.real_name = real_name
@@ -910,11 +910,12 @@ datum/preferences
character.update_face()
character.update_body()
spawn(10)
if(character)
character.client.midis = midis
character.client.ooccolor = ooccolor
character.client.be_alien = be_alien
if(!safety)//To prevent run-time errors due to null datum when using randomize_appearance_for()
spawn(10)//as they should already have these set at game spawn.
if(character)
character.client.midis = midis
character.client.ooccolor = ooccolor
character.client.be_alien = be_alien
/*