mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
DNA modifiers work now.
This commit is contained in:
@@ -39,13 +39,15 @@
|
||||
|
||||
//Save original dna for when the disease is cured.
|
||||
src.original_dna["name"] = affected_mob.real_name
|
||||
src.original_dna["UI"] = affected_mob.dna.uni_identity
|
||||
src.original_dna["SE"] = affected_mob.dna.struc_enzymes
|
||||
src.original_dna["UI"] = affected_mob.dna.UI
|
||||
src.original_dna["SE"] = affected_mob.dna.SE
|
||||
|
||||
affected_mob << "\red You don't feel like yourself.."
|
||||
affected_mob.dna.uni_identity = strain_data["UI"]
|
||||
updateappearance(affected_mob, affected_mob.dna.uni_identity)
|
||||
affected_mob.dna.struc_enzymes = strain_data["SE"]
|
||||
affected_mob.dna.UI = strain_data["UI"]
|
||||
affected_mob.dna.UpdateUI()
|
||||
affected_mob.UpdateAppearance()
|
||||
affected_mob.dna.SE = strain_data["SE"]
|
||||
affected_mob.dna.UpdateSE()
|
||||
affected_mob.real_name = strain_data["name"]
|
||||
domutcheck(affected_mob)
|
||||
|
||||
@@ -56,9 +58,11 @@
|
||||
|
||||
/datum/disease/dnaspread/Del()
|
||||
if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"]))
|
||||
affected_mob.dna.uni_identity = original_dna["UI"]
|
||||
updateappearance(affected_mob, affected_mob.dna.uni_identity)
|
||||
affected_mob.dna.struc_enzymes = original_dna["SE"]
|
||||
affected_mob.dna.UI = original_dna["UI"]
|
||||
affected_mob.dna.UpdateUI()
|
||||
affected_mob.UpdateAppearance()
|
||||
affected_mob.dna.SE = original_dna["SE"]
|
||||
affected_mob.dna.UpdateSE()
|
||||
affected_mob.real_name = original_dna["name"]
|
||||
|
||||
affected_mob << "\blue You feel more like yourself."
|
||||
|
||||
@@ -707,7 +707,7 @@ datum/mind
|
||||
else
|
||||
current.dna = changeling.absorbed_dna[1]
|
||||
current.real_name = current.dna.real_name
|
||||
updateappearance(current, current.dna.uni_identity)
|
||||
current.UpdateAppearance()
|
||||
domutcheck(current, null)
|
||||
|
||||
else if (href_list["nuclear"])
|
||||
|
||||
@@ -120,8 +120,8 @@
|
||||
potency = 30
|
||||
plant_type = 0
|
||||
growthstages = 6
|
||||
var/ui = null //for storing the guy
|
||||
var/se = null
|
||||
var/list/ui = null //for storing the guy
|
||||
var/list/se = null
|
||||
var/ckey = null
|
||||
var/realName = null
|
||||
var/datum/mind/mind = null
|
||||
|
||||
@@ -77,10 +77,16 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
|
||||
// UNIQUE IDENTITY
|
||||
///////////////////////////////////////
|
||||
|
||||
// Create random UI.
|
||||
/datum/dna/proc/ResetUI(var/defer=0)
|
||||
for(var/i=1,i<=DNA_UI_LENGTH,i++)
|
||||
UI[i]=rand(0,4095)
|
||||
if(!defer)
|
||||
UpdateUI()
|
||||
|
||||
/datum/dna/proc/ResetUIFrom(var/mob/living/carbon/human/character)
|
||||
// INITIALIZE!
|
||||
for(var/i=1,i<=DNA_UI_LENGTH,i++)
|
||||
UI[i]=1
|
||||
ResetUI(1)
|
||||
// Hair
|
||||
// FIXME: Species-specific defaults pls
|
||||
if(!character.h_style)
|
||||
@@ -224,7 +230,9 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
|
||||
|
||||
// Do not use this unless you absolutely have to.
|
||||
/datum/dna/proc/SetSEBlock(var/block,var/value,var/defer=0)
|
||||
return SetSEValue(block,hex2num(value),defer)
|
||||
var/nval=hex2num(value)
|
||||
testing("SetSESBlock([block],[value],[defer]): [value] -> [nval]")
|
||||
return SetSEValue(block,nval,defer)
|
||||
|
||||
/datum/dna/proc/GetSESubBlock(var/block,var/subBlock)
|
||||
return copytext(GetSEBlock(block),subBlock,subBlock+1)
|
||||
@@ -250,9 +258,12 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
|
||||
dirtyUI=0
|
||||
|
||||
/datum/dna/proc/UpdateSE()
|
||||
var/oldse=struc_enzymes
|
||||
struc_enzymes=""
|
||||
for(var/block in SE)
|
||||
struc_enzymes += EncodeDNABlock(block)
|
||||
testing("Old SE: [oldse]")
|
||||
testing("New SE: [struc_enzymes]")
|
||||
dirtySE=0
|
||||
|
||||
// BACK-COMPAT!
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if(prob(prob))
|
||||
M.dna.SetUIValue(i,rand(1,4095),1)
|
||||
M.dna.UpdateUI()
|
||||
updateappearance(M, M.dna.uni_identity)
|
||||
M.UpdateAppearance()
|
||||
|
||||
else
|
||||
for(var/i = 1, i <= STRUCDNASIZE-1, i++)
|
||||
@@ -99,11 +99,17 @@
|
||||
|
||||
return output
|
||||
|
||||
// /proc/updateappearance has changed behavior, so it's been removed
|
||||
// Use mob.UpdateAppearance() instead.
|
||||
|
||||
/proc/updateappearance(var/mob/M, var/datum/dna/dna)
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
M.dna.check_integrity()
|
||||
var/mob/living/carbon/human/H = M
|
||||
// Simpler. Don't specify UI in order for the mob to use its own.
|
||||
/mob/proc/UpdateAppearance(var/list/UI=null)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
if(UI!=null)
|
||||
src.dna.UI=UI
|
||||
src.dna.UpdateUI()
|
||||
dna.check_integrity()
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.r_hair = dna.GetUIValue(DNA_UI_HAIR_R)
|
||||
H.b_hair = dna.GetUIValue(DNA_UI_HAIR_B)
|
||||
H.g_hair = dna.GetUIValue(DNA_UI_HAIR_G)
|
||||
@@ -432,7 +438,7 @@
|
||||
else
|
||||
O.real_name = randomname
|
||||
i++
|
||||
updateappearance(O,O.dna.uni_identity)
|
||||
O.UpdateAppearance()
|
||||
O.take_overall_damage(M.getBruteLoss(), M.getFireLoss())
|
||||
O.adjustToxLoss(M.getToxLoss())
|
||||
O.adjustOxyLoss(M.getOxyLoss())
|
||||
|
||||
@@ -656,7 +656,7 @@
|
||||
if (prob((80 + (src.radiation_duration / 2))))
|
||||
block = miniscrambletarget(num2text(selected_ui_target), src.radiation_intensity, src.radiation_duration)
|
||||
src.connected.occupant.dna.SetUISubBlock(src.selected_ui_block,src.selected_ui_subblock,block)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
else
|
||||
if (prob(20+src.radiation_intensity))
|
||||
@@ -664,7 +664,7 @@
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration)
|
||||
src.connected.locked = lock_state
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
@@ -695,9 +695,9 @@
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
|
||||
if (href_list["pulseSERadiation"])
|
||||
var/block
|
||||
var/oldblock
|
||||
block = src.connected.occupant.dna.GetSESubBlock(src.selected_se_block,src.selected_se_subblock)
|
||||
var/block = src.connected.occupant.dna.GetSESubBlock(src.selected_se_block,src.selected_se_subblock)
|
||||
var/original_block=block
|
||||
testing("Irradiating SE block [src.selected_se_block]:[src.selected_se_subblock] ([block])...")
|
||||
|
||||
irradiating = src.radiation_duration
|
||||
var/lock_state = src.connected.locked
|
||||
@@ -711,20 +711,16 @@
|
||||
if(src.connected.occupant)
|
||||
if (prob((80 + (src.radiation_duration / 2))))
|
||||
// FIXME: Find out what these corresponded to and change them to the WHATEVERBLOCK they need to be.
|
||||
if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20))
|
||||
oldblock = src.selected_se_block
|
||||
//if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20))
|
||||
var/real_SE_block=selected_se_block
|
||||
block = miniscramble(block, src.radiation_intensity, src.radiation_duration)
|
||||
if(prob(20))
|
||||
if (src.selected_se_block > 1 && src.selected_se_block < STRUCDNASIZE/2)
|
||||
src.selected_se_block++
|
||||
real_SE_block++
|
||||
else if (src.selected_se_block > STRUCDNASIZE/2 && src.selected_se_block < STRUCDNASIZE)
|
||||
src.selected_se_block--
|
||||
src.connected.occupant.dna.SetSESubBlock(src.selected_ui_block,src.selected_ui_subblock,block)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
src.selected_se_block = oldblock
|
||||
else
|
||||
//
|
||||
block = miniscramble(block, src.radiation_intensity, src.radiation_duration)
|
||||
real_SE_block--
|
||||
|
||||
testing("Irradiated SE block [real_SE_block]:[src.selected_se_subblock] ([original_block] now [block]) [(real_SE_block!=selected_se_block) ? "(SHIFTED)":""]!")
|
||||
src.connected.occupant.dna.SetSESubBlock(src.selected_ui_block,src.selected_ui_subblock,block)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
@@ -734,7 +730,7 @@
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration)
|
||||
src.connected.locked = lock_state
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
@@ -851,7 +847,7 @@
|
||||
src.connected.occupant.name = src.buffers[bufferId]["owner"]
|
||||
src.connected.occupant.dna.UI = src.buffers[bufferId]["data"]
|
||||
src.connected.occupant.dna.UpdateUI()
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity)
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
else if (src.buffers[bufferId]["type"] == "se")
|
||||
src.connected.occupant.dna.SE = src.buffers[bufferId]["data"]
|
||||
src.connected.occupant.dna.UpdateSE()
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
src.dna = chosen_dna
|
||||
src.real_name = chosen_dna.real_name
|
||||
src.flavor_text = ""
|
||||
updateappearance(src, src.dna.uni_identity)
|
||||
src.UpdateAppearance()
|
||||
domutcheck(src, null)
|
||||
|
||||
src.verbs -= /mob/proc/changeling_transform
|
||||
@@ -327,7 +327,7 @@
|
||||
|
||||
O.loc = C.loc
|
||||
|
||||
updateappearance(O,O.dna.uni_identity)
|
||||
O.UpdateAppearance()
|
||||
domutcheck(O, null)
|
||||
O.setToxLoss(C.getToxLoss())
|
||||
O.adjustBruteLoss(C.getBruteLoss())
|
||||
@@ -761,7 +761,7 @@ var/list/datum/dna/hivemind_bank = list()
|
||||
T.visible_message("<span class='warning'>[T] transforms!</span>")
|
||||
T.dna = chosen_dna
|
||||
T.real_name = chosen_dna.real_name
|
||||
updateappearance(T, T.dna.uni_identity)
|
||||
T.UpdateAppearance()
|
||||
domutcheck(T, null)
|
||||
feedback_add_details("changeling_powers","TS")
|
||||
return 1
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
//Clonepod
|
||||
|
||||
//Start growing a human clone in the pod!
|
||||
/obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/ui, var/se, var/mindref, var/datum/species/mrace)
|
||||
/obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/list/ui, var/list/se, var/mindref, var/datum/species/mrace)
|
||||
if(mess || attempting)
|
||||
return 0
|
||||
var/datum/mind/clonemind = locate(mindref)
|
||||
@@ -203,10 +203,10 @@
|
||||
H.dna = new /datum/dna()
|
||||
H.dna.real_name = H.real_name
|
||||
if(ui)
|
||||
H.dna.uni_identity = ui
|
||||
updateappearance(H, ui)
|
||||
H.UpdateAppearance(ui)
|
||||
if(se)
|
||||
H.dna.struc_enzymes = se
|
||||
H.dna.SE = se
|
||||
H.dna.UpdateSE()
|
||||
randmutb(H) //Sometimes the clones come out wrong.
|
||||
|
||||
H.f_style = "Shaved"
|
||||
|
||||
@@ -1020,10 +1020,10 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
podman.dna = new /datum/dna()
|
||||
podman.dna.real_name = podman.real_name
|
||||
if(ui)
|
||||
podman.dna.uni_identity = ui
|
||||
updateappearance(podman, ui)
|
||||
podman.UpdateAppearance(ui)
|
||||
if(se)
|
||||
podman.dna.struc_enzymes = se
|
||||
podman.dna.SE = se
|
||||
podman.dna.UpdateSE()
|
||||
if(!prob(potency)) //if it fails, plantman!
|
||||
if(podman)
|
||||
// podman.dna.mutantrace = "plant"
|
||||
@@ -1054,9 +1054,8 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
var/mob/living/carbon/human/source = bloodSample.data["donor"] //hacky, since it gets the CURRENT condition of the mob, not how it was when the blood sample was taken
|
||||
if (!istype(source))
|
||||
continue
|
||||
//ui = bloodSample.data["blood_dna"] doesn't work for whatever reason
|
||||
ui = source.dna.uni_identity
|
||||
se = source.dna.struc_enzymes
|
||||
ui = source.dna.UI
|
||||
se = source.dna.SE
|
||||
if(source.ckey)
|
||||
ckey = source.ckey
|
||||
else if(source.mind)
|
||||
|
||||
@@ -56,31 +56,22 @@
|
||||
if (!(NOCLONE in M.mutations)) // prevents drained people from having their DNA changed
|
||||
if (dnatype == "ui")
|
||||
if (!block) //isolated block?
|
||||
M.UpdateAppearance(dna)
|
||||
if (ue) //unique enzymes? yes
|
||||
M.dna.UI = dna
|
||||
M.dna.UpdateUI()
|
||||
updateappearance(M, M.dna.uni_identity)
|
||||
M.real_name = ue
|
||||
M.name = ue
|
||||
uses--
|
||||
else //unique enzymes? no
|
||||
M.dna.UI = dna
|
||||
M.dna.UpdateUI()
|
||||
updateappearance(M, M.dna.uni_identity)
|
||||
uses--
|
||||
else
|
||||
M.dna.SetUIValue(block,src.GetValue())
|
||||
updateappearance(M, M.dna.uni_identity)
|
||||
M.UpdateAppearance()
|
||||
uses--
|
||||
if (dnatype == "se")
|
||||
if (!block) //isolated block?
|
||||
M.dna.SE = dna
|
||||
M.dna.UpdateSE()
|
||||
domutcheck(M, null)
|
||||
uses--
|
||||
else
|
||||
M.dna.SetUIValue(block,src.GetValue())
|
||||
domutcheck(M, null,1)
|
||||
M.dna.SetSEValue(block,src.GetValue())
|
||||
domutcheck(M, null, block!=null)
|
||||
uses--
|
||||
if(prob(5))
|
||||
trigger_side_effect(M)
|
||||
|
||||
@@ -325,9 +325,11 @@ 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.
|
||||
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.
|
||||
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.UI = record_found.fields["identity"]//DNA identity is carried over.
|
||||
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.
|
||||
new_character.dna.ready_dna(new_character)
|
||||
|
||||
|
||||
@@ -48,8 +48,10 @@
|
||||
gender = pick(MALE, FEMALE)
|
||||
dna = new /datum/dna( null )
|
||||
dna.real_name = real_name
|
||||
dna.uni_identity = "00600200A00E0110148FC01300B009"
|
||||
dna.struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6"
|
||||
dna.ResetSE()
|
||||
dna.ResetUI()
|
||||
//dna.uni_identity = "00600200A00E0110148FC01300B009"
|
||||
//dna.struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6"
|
||||
dna.unique_enzymes = md5(name)
|
||||
//////////blah
|
||||
var/gendervar
|
||||
|
||||
@@ -547,9 +547,9 @@ datum/reagent/zed
|
||||
|
||||
Z.gender = pick(MALE, FEMALE)
|
||||
|
||||
/* DNA2 broke this
|
||||
var/flooks = new/list()
|
||||
var/mlooks = new/list()
|
||||
|
||||
flooks += "0990CC0FF000000000DC0000033000902136F93"
|
||||
flooks += "0CC000033000000000DC0000033000C4308DEB4"
|
||||
flooks += "066000033000000000B90000033000E1E03FD3F"
|
||||
@@ -567,8 +567,9 @@ datum/reagent/zed
|
||||
Z.dna.unique_enzymes = pick(mlooks)
|
||||
else
|
||||
Z.dna.unique_enzymes = pick(flooks)
|
||||
*/
|
||||
|
||||
updateappearance(Z, Z.dna.unique_enzymes)
|
||||
Z.UpdateAppearance()
|
||||
|
||||
if(Z.gender == MALE)
|
||||
Z.real_name = text("[] []", pick(first_names_male), pick(last_names))
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
O.name = "monkey"
|
||||
O.dna = dna
|
||||
dna = null
|
||||
O.dna.uni_identity = "00600200A00E0110148FC01300B009"
|
||||
//O.dna.uni_identity = "00600200A00E0110148FC01300B009"
|
||||
//O.dna.struc_enzymes = "0983E840344C39F4B059D5145FC5785DC6406A4BB8"
|
||||
O.dna.struc_enzymes = "[copytext(O.dna.struc_enzymes,1,1+3*(STRUCDNASIZE-1))]BB8"
|
||||
O.dna.SetSEState(MONKEYBLOCK,1)
|
||||
O.loc = loc
|
||||
O.viruses = viruses
|
||||
viruses = list()
|
||||
|
||||
@@ -1098,7 +1098,7 @@ datum
|
||||
else
|
||||
randmutg(M)
|
||||
domutcheck(M, null)
|
||||
updateappearance(M,M.dna.uni_identity)
|
||||
M.UpdateAppearance()
|
||||
return
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M.dna) return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
|
||||
|
||||
Reference in New Issue
Block a user