More fixings.

This commit is contained in:
Rob Nelson
2013-12-01 00:16:40 -08:00
parent 4706800f9c
commit 0094fefd1b
11 changed files with 259 additions and 64 deletions

View File

@@ -104,13 +104,13 @@
var/datum/data/record/L = new() var/datum/data/record/L = new()
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]")
L.fields["name"] = H.real_name L.fields["name"] = H.real_name
L.fields["rank"] = H.mind.assigned_role L.fields["rank"] = H.mind.assigned_role
L.fields["age"] = H.age L.fields["age"] = H.age
L.fields["sex"] = H.gender L.fields["sex"] = H.gender
L.fields["b_type"] = H.b_type L.fields["b_type"] = H.b_type
L.fields["b_dna"] = H.dna.unique_enzymes L.fields["b_dna"] = H.dna.unique_enzymes
L.fields["enzymes"] = H.dna.struc_enzymes L.fields["enzymes"] = H.dna.SE // Used in respawning
L.fields["identity"] = H.dna.uni_identity L.fields["identity"] = H.dna.UI // "
L.fields["image"] = getFlatIcon(H,0) //This is god-awful L.fields["image"] = getFlatIcon(H,0) //This is god-awful
locked += L locked += L
return return

View File

@@ -43,9 +43,7 @@
src.original_dna["SE"] = affected_mob.dna.SE src.original_dna["SE"] = affected_mob.dna.SE
affected_mob << "\red You don't feel like yourself.." affected_mob << "\red You don't feel like yourself.."
affected_mob.dna.UI = strain_data["UI"] affected_mob.UpdateAppearance(strain_data["UI"])
affected_mob.dna.UpdateUI()
affected_mob.UpdateAppearance()
affected_mob.dna.SE = strain_data["SE"] affected_mob.dna.SE = strain_data["SE"]
affected_mob.dna.UpdateSE() affected_mob.dna.UpdateSE()
affected_mob.real_name = strain_data["name"] affected_mob.real_name = strain_data["name"]
@@ -58,9 +56,7 @@
/datum/disease/dnaspread/Del() /datum/disease/dnaspread/Del()
if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"])) if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"]))
affected_mob.dna.UI = original_dna["UI"] affected_mob.UpdateAppearance(original_dna["UI"])
affected_mob.dna.UpdateUI()
affected_mob.UpdateAppearance()
affected_mob.dna.SE = original_dna["SE"] affected_mob.dna.SE = original_dna["SE"]
affected_mob.dna.UpdateSE() affected_mob.dna.UpdateSE()
affected_mob.real_name = original_dna["name"] affected_mob.real_name = original_dna["name"]

View File

@@ -22,7 +22,7 @@
// on or off. // on or off.
var/global/list/dna_activity_bounds[STRUCDNASIZE] var/global/list/dna_activity_bounds[STRUCDNASIZE]
// Used to determine what each block means (admin hax and species stuff, mostly) // Used to determine what each block means (admin hax and species stuff on /vg/, mostly)
var/global/list/assigned_blocks[STRUCDNASIZE] var/global/list/assigned_blocks[STRUCDNASIZE]
// UI Indices (can change to mutblock style, if desired) // UI Indices (can change to mutblock style, if desired)
@@ -39,22 +39,7 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
#define DNA_UI_GENDER 11 #define DNA_UI_GENDER 11
#define DNA_UI_BEARD_STYLE 12 #define DNA_UI_BEARD_STYLE 12
#define DNA_UI_HAIR_STYLE 13 #define DNA_UI_HAIR_STYLE 13
#define DNA_UI_LENGTH 13 // Update this or you WILL break shit. #define DNA_UI_LENGTH 13 // Update this when you add something, or you WILL break shit.
/proc/add_zero2(t, u)
var/temp1
while (length(t) < u)
t = "0[t]"
temp1 = t
if (length(t) > u)
temp1 = copytext(t,2,u+1)
return temp1
/proc/GetDNABounds(var/block)
var/list/BOUNDS=dna_activity_bounds[block]
if(!istype(BOUNDS))
return DNA_DEFAULT_BOUNDS
return BOUNDS
/datum/dna /datum/dna
// READ-ONLY, GETS OVERWRITTEN // READ-ONLY, GETS OVERWRITTEN
@@ -76,7 +61,6 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
var/b_type = "A+" // Should probably change to an integer => string map but I'm lazy. var/b_type = "A+" // Should probably change to an integer => string map but I'm lazy.
var/mutantrace = null // The type of mutant race the player is, if applicable (i.e. potato-man) var/mutantrace = null // The type of mutant race the player is, if applicable (i.e. potato-man)
var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings, var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings,
/////////////////////////////////////// ///////////////////////////////////////
// UNIQUE IDENTITY // UNIQUE IDENTITY
/////////////////////////////////////// ///////////////////////////////////////
@@ -125,6 +109,7 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// Set a DNA UI block's raw value. // Set a DNA UI block's raw value.
/datum/dna/proc/SetUIValue(var/block,var/value,var/defer=0) /datum/dna/proc/SetUIValue(var/block,var/value,var/defer=0)
if (block<=0) return
ASSERT(value>=0) ASSERT(value>=0)
ASSERT(value<=4095) ASSERT(value<=4095)
UI[block]=value UI[block]=value
@@ -134,24 +119,34 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// Get a DNA UI block's raw value. // Get a DNA UI block's raw value.
/datum/dna/proc/GetUIValue(var/block) /datum/dna/proc/GetUIValue(var/block)
if (block<=0) return 0
return UI[block] return UI[block]
// Set a DNA UI block's value, given a value and a max possible value. // Set a DNA UI block's value, given a value and a max possible value.
// Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list) // Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list)
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue) /datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue)
if (block<=0) return
ASSERT(maxvalue<=4095) ASSERT(maxvalue<=4095)
var/range = round(4095 / maxvalue) var/range = round(4095 / maxvalue)
if(value) if(value)
SetUIValue(block,value * range - rand(1,range-1)) SetUIValue(block,value * range - rand(1,range-1))
// Getter version of above.
/datum/dna/proc/GetUIValueRange(var/block,var/maxvalue) /datum/dna/proc/GetUIValueRange(var/block,var/maxvalue)
if (block<=0) return 0
var/value = GetUIValue(block) var/value = GetUIValue(block)
return round(1 +(value / 4096)*maxvalue) return round(1 +(value / 4096)*maxvalue)
// Is the UI gene "on" or "off"?
// For UI, this is simply a check of if the value is > 2050.
/datum/dna/proc/GetUIState(var/block) /datum/dna/proc/GetUIState(var/block)
if (block<=0) return
return UI[block] > 2050 return UI[block] > 2050
// Set UI gene "on" (1) or "off" (0)
/datum/dna/proc/SetUIState(var/block,var/on,var/defer=0) /datum/dna/proc/SetUIState(var/block,var/on,var/defer=0)
if (block<=0) return
var/val var/val
if(on) if(on)
val=rand(2050,4095) val=rand(2050,4095)
@@ -159,17 +154,26 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
val=rand(1,2049) val=rand(1,2049)
SetUIValue(block,val,defer) SetUIValue(block,val,defer)
// Get a hex-encoded UI block.
/datum/dna/proc/GetUIBlock(var/block) /datum/dna/proc/GetUIBlock(var/block)
return EncodeDNABlock(GetUIValue(block)) return EncodeDNABlock(GetUIValue(block))
// Do not use this unless you absolutely have to. // Do not use this unless you absolutely have to.
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetUIBlock(var/block,var/value,var/defer=0) /datum/dna/proc/SetUIBlock(var/block,var/value,var/defer=0)
if (block<=0) return
return SetUIValue(block,hex2num(value),defer) return SetUIValue(block,hex2num(value),defer)
// Get a sub-block from a block.
/datum/dna/proc/GetUISubBlock(var/block,var/subBlock) /datum/dna/proc/GetUISubBlock(var/block,var/subBlock)
return copytext(GetUIBlock(block),subBlock,subBlock+1) return copytext(GetUIBlock(block),subBlock,subBlock+1)
// Do not use this unless you absolutely have to.
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetUISubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0) /datum/dna/proc/SetUISubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0)
if (block<=0) return
var/oldBlock=GetUIBlock(block) var/oldBlock=GetUIBlock(block)
var/newBlock="" var/newBlock=""
for(var/i=1, i<=length(oldBlock), i++) for(var/i=1, i<=length(oldBlock), i++)
@@ -183,7 +187,7 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// STRUCTURAL ENZYMES // STRUCTURAL ENZYMES
/////////////////////////////////////// ///////////////////////////////////////
// Zeroes out all of the blocks. // "Zeroes out" all of the blocks.
/datum/dna/proc/ResetSE() /datum/dna/proc/ResetSE()
for(var/i = 1, i <= STRUCDNASIZE, i++) for(var/i = 1, i <= STRUCDNASIZE, i++)
SetSEValue(i,rand(1,1024),1) SetSEValue(i,rand(1,1024),1)
@@ -192,6 +196,7 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// Set a DNA SE block's raw value. // Set a DNA SE block's raw value.
/datum/dna/proc/SetSEValue(var/block,var/value,var/defer=0) /datum/dna/proc/SetSEValue(var/block,var/value,var/defer=0)
//testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]") //testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]")
if (block<=0) return
ASSERT(value>=0) ASSERT(value>=0)
ASSERT(value<=4095) ASSERT(value<=4095)
SE[block]=value SE[block]=value
@@ -201,22 +206,28 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// Get a DNA SE block's raw value. // Get a DNA SE block's raw value.
/datum/dna/proc/GetSEValue(var/block) /datum/dna/proc/GetSEValue(var/block)
if (block<=0) return 0
return SE[block] return SE[block]
// Set a DNA SE block's value, given a value and a max possible value. // Set a DNA SE block's value, given a value and a max possible value.
// Might be used for species? // Might be used for species?
/datum/dna/proc/SetSEValueRange(var/block,var/value,var/maxvalue) /datum/dna/proc/SetSEValueRange(var/block,var/value,var/maxvalue)
if (block<=0) return
ASSERT(maxvalue<=4095) ASSERT(maxvalue<=4095)
var/range = round(4095 / maxvalue) var/range = round(4095 / maxvalue)
if(value) if(value)
SetSEValue(block, value * range - rand(1,range-1)) SetSEValue(block, value * range - rand(1,range-1))
// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.)
/datum/dna/proc/GetSEState(var/block) /datum/dna/proc/GetSEState(var/block)
if (block<=0) return 0
var/list/BOUNDS=GetDNABounds(block) var/list/BOUNDS=GetDNABounds(block)
var/value=GetSEValue(block) var/value=GetSEValue(block)
return (value > BOUNDS[DNA_ON_LOWERBOUND]) return (value > BOUNDS[DNA_ON_LOWERBOUND])
// Set a block "on" or "off".
/datum/dna/proc/SetSEState(var/block,var/on,var/defer=0) /datum/dna/proc/SetSEState(var/block,var/on,var/defer=0)
if (block<=0) return
var/list/BOUNDS=GetDNABounds(block) var/list/BOUNDS=GetDNABounds(block)
var/val var/val
if(on) if(on)
@@ -225,11 +236,15 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
val=rand(BOUNDS[DNA_OFF_LOWERBOUND],BOUNDS[DNA_OFF_UPPERBOUND]) val=rand(BOUNDS[DNA_OFF_LOWERBOUND],BOUNDS[DNA_OFF_UPPERBOUND])
SetSEValue(block,val,defer) SetSEValue(block,val,defer)
// Get hex-encoded SE block.
/datum/dna/proc/GetSEBlock(var/block) /datum/dna/proc/GetSEBlock(var/block)
return EncodeDNABlock(GetSEValue(block)) return EncodeDNABlock(GetSEValue(block))
// Do not use this unless you absolutely have to. // Do not use this unless you absolutely have to.
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetSEBlock(var/block,var/value,var/defer=0) /datum/dna/proc/SetSEBlock(var/block,var/value,var/defer=0)
if (block<=0) return
var/nval=hex2num(value) var/nval=hex2num(value)
//testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]") //testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]")
return SetSEValue(block,nval,defer) return SetSEValue(block,nval,defer)
@@ -237,7 +252,11 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
/datum/dna/proc/GetSESubBlock(var/block,var/subBlock) /datum/dna/proc/GetSESubBlock(var/block,var/subBlock)
return copytext(GetSEBlock(block),subBlock,subBlock+1) return copytext(GetSEBlock(block),subBlock,subBlock+1)
// Do not use this unless you absolutely have to.
// Set a sub-block from a hex character. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetSESubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0) /datum/dna/proc/SetSESubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0)
if (block<=0) return
var/oldBlock=GetSEBlock(block) var/oldBlock=GetSEBlock(block)
var/newBlock="" var/newBlock=""
for(var/i=1, i<=length(oldBlock), i++) for(var/i=1, i<=length(oldBlock), i++)

View File

@@ -1,12 +1,33 @@
/////////////////////////////
// Helpers for DNA2
/////////////////////////////
// Random Bad Mutation // Pads 0s to t until length == u
/proc/add_zero2(t, u)
var/temp1
while (length(t) < u)
t = "0[t]"
temp1 = t
if (length(t) > u)
temp1 = copytext(t,2,u+1)
return temp1
// DNA Gene activation boundaries, see dna2.dm.
// Returns a list object with 4 numbers.
/proc/GetDNABounds(var/block)
var/list/BOUNDS=dna_activity_bounds[block]
if(!istype(BOUNDS))
return DNA_DEFAULT_BOUNDS
return BOUNDS
// Give Random Bad Mutation to M
/proc/randmutb(var/mob/living/M) /proc/randmutb(var/mob/living/M)
if(!M) return if(!M) return
M.dna.check_integrity() M.dna.check_integrity()
var/block = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK) var/block = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK)
M.dna.SetSEState(block, 1) M.dna.SetSEState(block, 1)
// Random Good Mutation // Give Random Good Mutation to M
/proc/randmutg(var/mob/living/M) /proc/randmutg(var/mob/living/M)
if(!M) return if(!M) return
M.dna.check_integrity() M.dna.check_integrity()
@@ -146,9 +167,15 @@
else else
return 0 return 0
// Used below, simple injection modifier.
/proc/probinj(var/pr, var/inj) /proc/probinj(var/pr, var/inj)
return prob(pr+inj*pr) return prob(pr+inj*pr)
// (Re-)Apply mutations.
// TODO: Turn into a /mob proc, change inj to a bitflag for various forms of differing behavior.
// M: Mob to mess with
// connected: Machine we're in, type unchecked so I doubt it's used beyond monkeying
// inj: 1 for if we're checking this from an injector, screws with manifestation probability calc.
/proc/domutcheck(mob/living/M as mob, connected, inj) /proc/domutcheck(mob/living/M as mob, connected, inj)
if (!M) return if (!M) return

View File

@@ -848,9 +848,7 @@
if (src.buffers[bufferId]["ue"]) if (src.buffers[bufferId]["ue"])
src.connected.occupant.real_name = src.buffers[bufferId]["owner"] src.connected.occupant.real_name = src.buffers[bufferId]["owner"]
src.connected.occupant.name = src.buffers[bufferId]["owner"] src.connected.occupant.name = src.buffers[bufferId]["owner"]
src.connected.occupant.dna.UI = src.buffers[bufferId]["data"] src.connected.occupant.UpdateAppearance(src.buffers[bufferId]["data"])
src.connected.occupant.dna.UpdateUI()
src.connected.occupant.UpdateAppearance()
else if (src.buffers[bufferId]["type"] == "se") else if (src.buffers[bufferId]["type"] == "se")
src.connected.occupant.dna.SE = src.buffers[bufferId]["data"] src.connected.occupant.dna.SE = src.buffers[bufferId]["data"]
src.connected.occupant.dna.UpdateSE() src.connected.occupant.dna.UpdateSE()

View File

@@ -385,8 +385,8 @@
R.fields["ckey"] = subject.ckey R.fields["ckey"] = subject.ckey
R.fields["name"] = subject.real_name R.fields["name"] = subject.real_name
R.fields["id"] = copytext(md5(subject.real_name), 2, 6) R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
R.fields["UI"] = subject.dna.uni_identity R.fields["UI"] = subject.dna.UI
R.fields["SE"] = subject.dna.struc_enzymes R.fields["SE"] = subject.dna.SE
//Add an implant if needed //Add an implant if needed
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject) var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)

View File

@@ -84,6 +84,7 @@
dat += text("\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];screen=2'>Back</A><BR>", src, src) dat += text("\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];screen=2'>Back</A><BR>", src, src)
if(5.0) if(5.0)
dat += "<CENTER><B>Virus Database</B></CENTER>" dat += "<CENTER><B>Virus Database</B></CENTER>"
/* Advanced diseases is weak! Feeble! Glory to virus2!
for(var/Dt in typesof(/datum/disease/)) for(var/Dt in typesof(/datum/disease/))
var/datum/disease/Dis = new Dt(0) var/datum/disease/Dis = new Dt(0)
if(istype(Dis, /datum/disease/advance)) if(istype(Dis, /datum/disease/advance))
@@ -91,6 +92,11 @@
if(!Dis.desc) if(!Dis.desc)
continue continue
dat += "<br><a href='?src=\ref[src];vir=[Dt]'>[Dis.name]</a>" dat += "<br><a href='?src=\ref[src];vir=[Dt]'>[Dis.name]</a>"
*/
for (var/ID in virusDB)
var/datum/data/record/v = virusDB[ID]
dat += "<br><a href='?src=\ref[src];vir=\ref[v]'>[v.fields["name"]]</a>"
dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>" dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>"
if(6.0) if(6.0)
@@ -136,8 +142,19 @@
src.temp = null src.temp = null
if (href_list["scan"]) if (href_list["scan"])
if (src.scan) if (src.scan)
src.scan.loc = src.loc
src.scan = null if(ishuman(usr))
scan.loc = usr.loc
if(!usr.get_active_hand())
usr.put_in_hands(scan)
scan = null
else
src.scan.loc = src.loc
src.scan = null
else else
var/obj/item/I = usr.get_active_hand() var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id)) if (istype(I, /obj/item/weapon/card/id))
@@ -149,13 +166,24 @@
src.screen = null src.screen = null
src.active1 = null src.active1 = null
src.active2 = null src.active2 = null
else if (href_list["login"]) else if (href_list["login"])
if (istype(usr, /mob/living/silicon))
if (istype(usr, /mob/living/silicon/ai))
src.active1 = null src.active1 = null
src.active2 = null src.active2 = null
src.authenticated = 1 src.authenticated = usr.name
src.rank = "AI" src.rank = "AI"
src.screen = 1 src.screen = 1
else if (istype(usr, /mob/living/silicon/robot))
src.active1 = null
src.active2 = null
src.authenticated = usr.name
var/mob/living/silicon/robot/R = usr
src.rank = "[R.modtype] [R.braintype]"
src.screen = 1
else if (istype(src.scan, /obj/item/weapon/card/id)) else if (istype(src.scan, /obj/item/weapon/card/id))
src.active1 = null src.active1 = null
src.active2 = null src.active2 = null
@@ -174,20 +202,12 @@
src.active2 = null src.active2 = null
if(href_list["vir"]) if(href_list["vir"])
var/type = href_list["vir"] var/datum/data/record/v = locate(href_list["vir"])
var/datum/disease/Dis = new type(0) src.temp = "<center>GNAv2 based virus lifeform V-[v.fields["id"]]</center>"
var/AfS = "" src.temp += "<br><b>Name:</b> <A href='?src=\ref[src];field=vir_name;edit_vir=\ref[v]'>[v.fields["name"]]</A>"
for(var/Str in Dis.affected_species) src.temp += "<br><b>Antigen:</b> [v.fields["antigen"]]"
AfS += " [Str];" src.temp += "<br><b>Spread:</b> [v.fields["spread type"]] "
src.temp = {"<b>Name:</b> [Dis.name] src.temp += "<br><b>Details:</b><br> <A href='?src=\ref[src];field=vir_desc;edit_vir=\ref[v]'>[v.fields["description"]]</A>"
<BR><b>Number of stages:</b> [Dis.max_stages]
<BR><b>Spread:</b> [Dis.spread] Transmission
<BR><b>Possible Cure:</b> [(Dis.cure||"none")]
<BR><b>Affected Species:</b>[AfS]
<BR>
<BR><b>Notes:</b> [Dis.desc]
<BR>
<BR><b>Severity:</b> [Dis.severity]"}
if (href_list["del_all"]) 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) 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)
@@ -290,6 +310,20 @@
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1)) if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return return
src.active1.fields["dna"] = t1 src.active1.fields["dna"] = t1
if("vir_name")
var/datum/data/record/v = locate(href_list["edit_vir"])
if (v)
var/t1 = copytext(sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
v.fields["name"] = t1
if("vir_desc")
var/datum/data/record/v = locate(href_list["edit_vir"])
if (v)
var/t1 = copytext(sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
v.fields["description"] = t1
else else
if (href_list["p_stat"]) if (href_list["p_stat"])
@@ -297,12 +331,14 @@
switch(href_list["p_stat"]) switch(href_list["p_stat"])
if("deceased") if("deceased")
src.active1.fields["p_stat"] = "*Deceased*" src.active1.fields["p_stat"] = "*Deceased*"
if("unconscious") if("ssd")
src.active1.fields["p_stat"] = "*Unconscious*" src.active1.fields["p_stat"] = "*SSD*"
if("active") if("active")
src.active1.fields["p_stat"] = "Active" src.active1.fields["p_stat"] = "Active"
if("unfit") if("unfit")
src.active1.fields["p_stat"] = "Physically Unfit" src.active1.fields["p_stat"] = "Physically Unfit"
if("disabled")
src.active1.fields["p_stat"] = "Disabled"
if (href_list["m_stat"]) if (href_list["m_stat"])
if (src.active1) if (src.active1)
@@ -393,7 +429,7 @@
var/counter = 1 var/counter = 1
while(src.active2.fields[text("com_[]", counter)]) while(src.active2.fields[text("com_[]", counter)])
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) src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")]<BR>[t1]")
if (href_list["del_c"]) if (href_list["del_c"])
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
@@ -464,7 +500,7 @@
if(4) if(4)
R.fields["b_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+") R.fields["b_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+")
if(5) if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit") R.fields["p_stat"] = pick("*SSD*", "Active", "Physically Unfit", "Disabled")
if(6) if(6)
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
continue continue

View File

@@ -221,6 +221,127 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
message_admins("\blue [key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].", 1) message_admins("\blue [key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].", 1)
return 1 return 1
/*
Allow admins to set players to be able to respawn/bypass 30 min wait, without the admin having to edit variables directly
Ccomp's first proc.
*/
/client/proc/get_ghosts(var/notify = 0,var/what = 2)
// what = 1, return ghosts ass list.
// what = 2, return mob list
var/list/mobs = list()
var/list/ghosts = list()
var/list/sortmob = sortAtom(mob_list) // get the mob list.
/var/any=0
for(var/mob/dead/observer/M in sortmob)
mobs.Add(M) //filter it where it's only ghosts
any = 1 //if no ghosts show up, any will just be 0
if(!any)
if(notify)
src << "There doesn't appear to be any ghosts for you to select."
return
for(var/mob/M in mobs)
var/name = M.name
ghosts[name] = M //get the name of the mob for the popup list
if(what==1)
return ghosts
else
return mobs
/*
/client/proc/allow_character_respawn()
set category = "Special Verbs"
set name = "Allow player to respawn"
set desc = "Let's the player bypass the 30 minute wait to respawn or allow them to re-enter their corpse."
if(!holder)
src << "Only administrators may use this command."
var/list/ghosts= get_ghosts(1,1)
var/target = input("Please, select a ghost!", "COME BACK TO LIFE!", null, null) as null|anything in ghosts
if(!target)
src << "Hrm, appears you didn't select a ghost" // Sanity check, if no ghosts in the list we don't want to edit a null variable and cause a runtime error.
return
var/mob/dead/observer/G = ghosts[target]
if(G.has_enabled_antagHUD && config.antag_hud_restricted)
var/response = alert(src, "Are you sure you wish to allow this individual to play?","Ghost has used AntagHUD","Yes","No")
if(response == "No") return
G.timeofdeath=-19999 /* time of death is checked in /mob/verb/abandon_mob() which is the Respawn verb.
timeofdeath is used for bodies on autopsy but since we're messing with a ghost I'm pretty sure
there won't be an autopsy.
*/
G.has_enabled_antagHUD = 2
G.can_reenter_corpse = 1
G:show_message(text("\blue <B>You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead.</B>"), 1)
log_admin("[key_name(usr)] allowed [key_name(G)] to bypass the 30 minute respawn limit")
message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the 30 minute respawn limit", 1)
/client/proc/toggle_antagHUD_use()
set category = "Server"
set name = "Toggle antagHUD usage"
set desc = "Toggles antagHUD usage for observers"
if(!holder)
src << "Only administrators may use this command."
var/action=""
if(config.antag_hud_allowed)
for(var/mob/dead/observer/g in get_ghosts())
if(!g.client.holder) //Remove the verb from non-admin ghosts
g.verbs -= /mob/dead/observer/verb/toggle_antagHUD
if(g.antagHUD)
g.antagHUD = 0 // Disable it on those that have it enabled
g.has_enabled_antagHUD = 2 // We'll allow them to respawn
g << "\red <B>The Administrator has disabled AntagHUD </B>"
config.antag_hud_allowed = 0
src << "\red <B>AntagHUD usage has been disabled</B>"
action = "disabled"
else
for(var/mob/dead/observer/g in get_ghosts())
if(!g.client.holder) // Add the verb back for all non-admin ghosts
g.verbs += /mob/dead/observer/verb/toggle_antagHUD
g << "\blue <B>The Administrator has enabled AntagHUD </B>" // Notify all observers they can now use AntagHUD
config.antag_hud_allowed = 1
action = "enabled"
src << "\blue <B>AntagHUD usage has been enabled</B>"
log_admin("[key_name(usr)] has [action] antagHUD usage for observers")
message_admins("Admin [key_name_admin(usr)] has [action] antagHUD usage for observers", 1)
/client/proc/toggle_antagHUD_restrictions()
set category = "Server"
set name = "Toggle antagHUD Restrictions"
set desc = "Restricts players that have used antagHUD from being able to join this round."
if(!holder)
src << "Only administrators may use this command."
var/action=""
if(config.antag_hud_restricted)
for(var/mob/dead/observer/g in get_ghosts())
g << "\blue <B>The administrator has lifted restrictions on joining the round if you use AntagHUD</B>"
action = "lifted restrictions"
config.antag_hud_restricted = 0
src << "\blue <B>AntagHUD restrictions have been lifted</B>"
else
for(var/mob/dead/observer/g in get_ghosts())
g << "\red <B>The administrator has placed restrictions on joining the round if you use AntagHUD</B>"
g << "\red <B>Your AntagHUD has been disabled, you may choose to re-enabled it but will be under restrictions </B>"
g.antagHUD = 0
g.has_enabled_antagHUD = 0
action = "placed restrictions"
config.antag_hud_restricted = 1
src << "\red <B>AntagHUD restrictions have been enabled</B>"
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
message_admins("Admin [key_name_admin(usr)] has [action] on joining the round if they use AntagHUD", 1)
*/
/* /*
If a guy was gibbed and you want to revive him, this is a good way to do so. If a guy was gibbed and you want to revive him, this is a good way to do so.
Works kind of like entering the game with a new character. Character receives a new mind if they didn't have one. Works kind of like entering the game with a new character. Character receives a new mind if they didn't have one.
@@ -327,9 +448,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
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.unique_enzymes = record_found.fields["b_dna"]//Enzymes are based on real name but we'll use the record for conformity.
new_character.dna.SE = record_found.fields["enzymes"]//This is the default of enzymes so I think it's safe to go with. new_character.dna.SE = record_found.fields["enzymes"]//This is the default of enzymes so I think it's safe to go with.
new_character.dna.UpdateSE() new_character.dna.UpdateSE()
new_character.dna.UI = record_found.fields["identity"]//DNA identity is carried over. new_character.UpdateAppearance(record_found.fields["identity"])//Now we configure their appearance based on their unique identity, same as with a DNA machine or somesuch.
new_character.dna.UpdateUI()
new_character.UpdateAppearance()//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. 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) new_character.dna.ready_dna(new_character)

View File

@@ -30,8 +30,8 @@
continue continue
var/datum/disease/dnaspread/D = new var/datum/disease/dnaspread/D = new
D.strain_data["name"] = H.real_name D.strain_data["name"] = H.real_name
D.strain_data["UI"] = H.dna.uni_identity D.strain_data["UI"] = H.dna.UI
D.strain_data["SE"] = H.dna.struc_enzymes D.strain_data["SE"] = H.dna.SE
D.carrier = 1 D.carrier = 1
D.holder = H D.holder = H
D.affected_mob = H D.affected_mob = H

View File

@@ -39,7 +39,7 @@
reagents = R reagents = R
R.my_atom = src R.my_atom = src
if(name == "monkey" || name == "farwa" || name == "stok" || name == "neara" || name == "diona nymph") //Hideous but necessary to stop Pun-Pun becoming generic. if(name == initial(name)) //To stop Pun-Pun becoming generic.
name = "[name] ([rand(1, 1000)])" name = "[name] ([rand(1, 1000)])"
real_name = name real_name = name

View File

@@ -7,7 +7,7 @@
Enjoy! - Doohl Enjoy! - Doohl
Notice: This all gets automatically compiled in a list in dna.dm, so you do not Notice: This all gets automatically compiled in a list in dna2.dm, so you do not
have to define any UI values for sprite accessories manually for hair and facial have to define any UI values for sprite accessories manually for hair and facial
hair. Just add in new hair types and the game will naturally adapt. hair. Just add in new hair types and the game will naturally adapt.