diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index c51f265e78c..d4b1a0d44a6 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -67,6 +67,10 @@ var/global/list/bad_blocks[0] var/struc_enzymes="" // Encoded SE var/unique_enzymes="" // MD5 of player name + // Original Encoded SE, for use with Ryetalin + var/struc_enzymes_original="" // Encoded SE + var/list/SE_original[DNA_SE_LENGTH] + // Internal dirtiness checks var/dirtyUI=0 var/dirtySE=0 @@ -89,6 +93,7 @@ var/global/list/bad_blocks[0] /datum/dna/proc/Clone() var/datum/dna/new_dna = new() new_dna.unique_enzymes=unique_enzymes + new_dna.struc_enzymes_original=struc_enzymes_original // will make clone's SE the same as the original, do we want this? new_dna.b_type=b_type new_dna.mutantrace=mutantrace new_dna.real_name=real_name @@ -362,10 +367,16 @@ var/global/list/bad_blocks[0] // BACK-COMPAT! // Initial DNA setup. I'm kind of wondering why the hell this doesn't just call the above. +// ready_dna is (hopefully) only used on mob creation, and sets the struc_enzymes_original and SE_original only once - Bone White + /datum/dna/proc/ready_dna(mob/living/carbon/human/character) + ResetUIFrom(character) ResetSE() + struc_enzymes_original = struc_enzymes // sets the original struc_enzymes when ready_dna is called + SE_original = SE + unique_enzymes = md5(character.real_name) reg_dna[unique_enzymes] = character.real_name diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 0466235341e..d9d14e37579 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -1115,11 +1115,25 @@ datum on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom - var/needs_update = M.mutations.len > 0 + var/needs_update = 1 //M.mutations.len > 0 + //Ryetalyn now cures by a random chance per on_mob_life call - Bone White + // 1 volume = ~2% chance + // 10 volume = ~17% chance + // 30 volume = ~38% chance + if (rand(0, 50+volume) > 50 && ishuman(M)) + for(var/block=1;block<=DNA_SE_LENGTH;block++) + M.dna.SetSEState(block,0) + genemutcheck(M,block,null,MUTCHK_FORCED) + M.update_mutations() + + M.dna.struc_enzymes = M.dna.struc_enzymes_original + + /* Old Code (non-functional) M.mutations = list() M.disabilities = 0 M.sdisabilities = 0 + */ // Might need to update appearance for hulk etc. if(needs_update && ishuman(M))