From 6eee45085559e9f83fcd90a7cdb333f1b11ed97d Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Tue, 20 Jan 2015 22:40:44 +0300 Subject: [PATCH] Fixes genetics --- code/datums/goon_mutations_powers.dm | 3 +++ code/datums/mutations.dm | 6 +++--- code/game/dna.dm | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/datums/goon_mutations_powers.dm b/code/datums/goon_mutations_powers.dm index cab817b019e..38069f48488 100644 --- a/code/datums/goon_mutations_powers.dm +++ b/code/datums/goon_mutations_powers.dm @@ -21,6 +21,9 @@ /datum/mutation/human/chameleon name = "Chameleon" + quality = POSITIVE + get_chance = 10 + lowest_value = 256 * 14 text_gain_indication = "You feel one with your surroundings." text_lose_indication = "You feel oddly exposed." diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index d6046324421..a9e7da16668 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -28,9 +28,9 @@ /datum/mutation/human/proc/set_se(se_string, on = 1) if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) return - var/before = copytext(se_string, 1, (dna_block * DNA_BLOCK_SIZE) + 1) - var/injection = num2hex(lowest_value + (rand(1, 256 * 6) * (on ? 1 : -1))) - var/after = copytext(se_string, (dna_block * DNA_BLOCK_SIZE) + DNA_BLOCK_SIZE + 1) + var/before = copytext(se_string, 1, ((dna_block - 1) * DNA_BLOCK_SIZE) + 1) + var/injection = num2hex(on ? rand(lowest_value, (256 * 16) - 1) : rand(0, lowest_value - 1), DNA_BLOCK_SIZE) + var/after = copytext(se_string, (dna_block * DNA_BLOCK_SIZE) + 1, 0) return before + injection + after /datum/mutation/human/proc/set_block(mob/living/carbon/owner, on = 1) diff --git a/code/game/dna.dm b/code/game/dna.dm index 7aa1c3a06cb..6b1ed80bd7a 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -82,9 +82,8 @@ /datum/dna/proc/generate_struc_enzymes(mob/living/carbon/character) var/list/L = list("0","1","2","3","4","5","6") - var/list/sorting = list() - sorting.len = DNA_STRUC_ENZYMES_BLOCKS - var/result + var/list/sorting = new /list(DNA_STRUC_ENZYMES_BLOCKS) + var/result = "" for(var/datum/mutation/human/A in good_mutations + bad_mutations + not_good_mutations) if(A.name == RACEMUT && istype(character,/mob/living/carbon/monkey)) sorting[A.dna_block] = num2hex(A.lowest_value + rand(0, 256 * 6), DNA_BLOCK_SIZE)