diff --git a/baystation12.dme b/baystation12.dme index b6b7eb4e0d4..94ebc4d3618 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -207,6 +207,8 @@ #include "code\game\dna\dna_modifier.dm" #include "code\game\dna\genes\disabilities.dm" #include "code\game\dna\genes\gene.dm" +#include "code\game\dna\genes\goon_disabilities.dm" +#include "code\game\dna\genes\goon_powers.dm" #include "code\game\dna\genes\monkey.dm" #include "code\game\dna\genes\powers.dm" #include "code\game\gamemodes\events.dm" diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 0c4a605a7b1..8fc97fa5514 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -16,17 +16,6 @@ #define DNA_HARDER_BOUNDS list(1,3049,3050,4095) #define DNA_HARD_BOUNDS list(1,3490,3500,4095) -// Defines which values mean "on" or "off". -// This is to make some of the more OP superpowers a larger PITA to activate, -// and to tell our new DNA datum which values to set in order to turn something -// on or off. -var/global/list/dna_activity_bounds[STRUCDNASIZE] - -// Used to determine what each block means (admin hax and species stuff on /vg/, mostly) -var/global/list/assigned_blocks[STRUCDNASIZE] - -var/global/list/datum/dna/gene/dna_genes[0] - // UI Indices (can change to mutblock style, if desired) #define DNA_UI_HAIR_R 1 #define DNA_UI_HAIR_G 2 @@ -43,6 +32,19 @@ var/global/list/datum/dna/gene/dna_genes[0] #define DNA_UI_HAIR_STYLE 13 #define DNA_UI_LENGTH 13 // Update this when you add something, or you WILL break shit. +#define DNA_SE_LENGTH 50 // Was STRUCDNASIZE, size 27. 15 new blocks added = 42, plus room to grow. + +// Defines which values mean "on" or "off". +// This is to make some of the more OP superpowers a larger PITA to activate, +// and to tell our new DNA datum which values to set in order to turn something +// on or off. +var/global/list/dna_activity_bounds[DNA_SE_LENGTH] + +// Used to determine what each block means (admin hax and species stuff on /vg/, mostly) +var/global/list/assigned_blocks[DNA_SE_LENGTH] + +var/global/list/datum/dna/gene/dna_genes[0] + ///////////////// // GENE DEFINES ///////////////// @@ -64,7 +66,7 @@ var/global/list/datum/dna/gene/dna_genes[0] // Okay to read, but you're an idiot if you do. // BLOCK = VALUE - var/list/SE[STRUCDNASIZE] + var/list/SE[DNA_SE_LENGTH] var/list/UI[DNA_UI_LENGTH] // From old dna. @@ -84,7 +86,7 @@ var/global/list/datum/dna/gene/dna_genes[0] new_dna.mutantrace=mutantrace new_dna.real_name=real_name new_dna.species=species - for(var/b=1;b<=STRUCDNASIZE;b++) + for(var/b=1;b<=DNA_SE_LENGTH;b++) new_dna.SE[b]=SE[b] if(b<=DNA_UI_LENGTH) new_dna.UI[b]=UI[b] @@ -224,7 +226,7 @@ var/global/list/datum/dna/gene/dna_genes[0] // "Zeroes out" all of the blocks. /datum/dna/proc/ResetSE() - for(var/i = 1, i <= STRUCDNASIZE, i++) + for(var/i = 1, i <= DNA_SE_LENGTH, i++) SetSEValue(i,rand(1,1024),1) UpdateSE() @@ -335,7 +337,7 @@ var/global/list/datum/dna/gene/dna_genes[0] if(UI.len != DNA_UI_LENGTH) ResetUIFrom(character) - if(length(struc_enzymes)!= 3*STRUCDNASIZE) + if(length(struc_enzymes)!= 3*DNA_SE_LENGTH) ResetSE() if(length(unique_enzymes) != 32) @@ -343,7 +345,7 @@ var/global/list/datum/dna/gene/dna_genes[0] else if(length(uni_identity) != 3*DNA_UI_LENGTH) uni_identity = "00600200A00E0110148FC01300B0095BD7FD3F4" - if(length(struc_enzymes)!= 3*STRUCDNASIZE) + if(length(struc_enzymes)!= 3*DNA_SE_LENGTH) struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6" // BACK-COMPAT! @@ -355,4 +357,3 @@ var/global/list/datum/dna/gene/dna_genes[0] unique_enzymes = md5(character.real_name) reg_dna[unique_enzymes] = character.real_name - diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index f8efe170597..d7a98d57255 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -38,7 +38,7 @@ /proc/randmuti(var/mob/living/M) if(!M) return M.dna.check_integrity() - M.dna.SetUIValue(rand(1,UNIDNASIZE),rand(1,4095)) + M.dna.SetUIValue(rand(1,DNA_UI_LENGTH),rand(1,4095)) // Scramble UI or SE. /proc/scramble(var/UI, var/mob/M, var/prob) @@ -52,7 +52,7 @@ M.UpdateAppearance() else - for(var/i = 1, i <= STRUCDNASIZE-1, i++) + for(var/i = 1, i <= DNA_SE_LENGTH-1, i++) if(prob(prob)) M.dna.SetSEValue(i,rand(1,4095),1) M.dna.UpdateSE() diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index aefc5d18e92..6128693e43f 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -647,7 +647,7 @@ if (href_list["selectSEBlock"] && href_list["selectSESubblock"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes) var/select_block = text2num(href_list["selectSEBlock"]) var/select_subblock = text2num(href_list["selectSESubblock"]) - if ((select_block <= STRUCDNASIZE) && (select_block >= 1)) + if ((select_block <= DNA_SE_LENGTH) && (select_block >= 1)) src.selected_se_block = select_block if ((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1)) src.selected_se_subblock = select_subblock @@ -675,9 +675,9 @@ 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) + if (src.selected_se_block > 1 && src.selected_se_block < DNA_SE_LENGTH/2) real_SE_block++ - else if (src.selected_se_block > STRUCDNASIZE/2 && src.selected_se_block < STRUCDNASIZE) + else if (src.selected_se_block > DNA_SE_LENGTH/2 && src.selected_se_block < DNA_SE_LENGTH) 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)":""]!") diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index c842bf9cd57..52f7fde243d 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -125,4 +125,18 @@ disability=NEARSIGHTED New() - block=GLASSESBLOCK \ No newline at end of file + block=GLASSESBLOCK + + +/datum/dna/gene/disability/lisp + name = "Lisp" + desc = "I wonder wath thith doeth." + activation_message = "Thomething doethn't feel right." + deactivation_message = "You now feel able to pronounce consonants." + + New() + ..() + block=LISPBLOCK + + OnSay(var/mob/M, var/message) + return replacetext(replacetext(message,"S","TH"),"s","th") \ No newline at end of file diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm index 3bf5b5e5f75..fc6fec4863b 100644 --- a/code/game/dna/genes/gene.dm +++ b/code/game/dna/genes/gene.dm @@ -23,6 +23,12 @@ // Any of a number of GENE_ flags. var/flags=0 +/** +* Is the gene active in this mob's DNA? +*/ +/datum/dna/gene/proc/is_active(var/mob/M) + return M.active_genes && type in M.active_genes + // Return 1 if we can activate. // HANDLE MUTCHK_FORCED HERE! /datum/dna/gene/proc/can_activate(var/mob/M, var/flags) @@ -32,11 +38,43 @@ /datum/dna/gene/proc/activate(var/mob/M, var/connected, var/flags) return -// Called when the gene deactivates. Undo your magic here. -// Only called when the block is deactivated. +/** +* Called when the gene deactivates. Undo your magic here. +* Only called when the block is deactivated. +*/ /datum/dna/gene/proc/deactivate(var/mob/M, var/connected, var/flags) return +// This section inspired by goone's bioEffects. + +/** +* Called in each life() tick. +*/ +/datum/dna/gene/proc/OnMobLife(var/mob/M) + return + +/** +* Called when the mob dies +*/ +/datum/dna/gene/proc/OnMobDeath(var/mob/M) + return + +/** +* Called when the mob says shit +*/ +/datum/dna/gene/proc/OnSay(var/mob/M, var/message) + return message + +/** +* Called after the mob runs update_icons. +* +* @params M The subject. +* @params g Gender (m or f) +* @params fat Fat? (0 or 1) +*/ +/datum/dna/gene/proc/OnDrawUnderlays(var/mob/M, var/g, var/fat) + return 0 + ///////////////////// // BASIC GENES diff --git a/code/game/dna/genes/goon_disabilities.dm b/code/game/dna/genes/goon_disabilities.dm index d56ba71f195..4491462fc85 100644 --- a/code/game/dna/genes/goon_disabilities.dm +++ b/code/game/dna/genes/goon_disabilities.dm @@ -205,7 +205,7 @@ suffix = copytext(cword,length(cword)-1,length(cword) ) if(length(cword)) rearranged += cword - return "[prefix][uppertext(dd_list2text(rearranged," "))]!!" + return "[prefix][uppertext(list2text(rearranged," "))]!!" // WAS: /datum/bioEffect/toxic_farts /datum/dna/gene/disability/toxic_farts diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 5df70c36800..38c12c4dd22 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -63,6 +63,9 @@ M.verbs += /mob/living/carbon/human/proc/morph + OnDrawUnderlays(var/mob/M,var/g,var/fat) + return "cold[fat]_s" + /datum/dna/gene/basic/cold_resist name="Cold Resistance" activation_messages=list("Your body is filled with warmth.") @@ -72,12 +75,14 @@ block=FIREBLOCK can_activate(var/mob/M,var/flags) - // Probability check var/_prob=30 if(probinj(_prob,(flags&MUTCHK_FORCED))) return 1 + OnDrawUnderlays(var/mob/M,var/g,var/fat) + return "fire[fat]_s" + /datum/dna/gene/basic/noprints name="No Prints" activation_messages=list("Your fingers feel numb.") @@ -126,6 +131,22 @@ return 0 return ..(M,flags) + OnDrawUnderlays(var/mob/M,var/g,var/fat) + if(fat) + return "hulk_[fat]_s" + else + return "hulk_[g]_s" + return 0 + + OnMobLife(var/mob/living/carbon/human/M) + if(!istype(M)) return + if(M.health <= 25) + M.mutations.Remove(HULK) + M.update_mutations() //update our mutation overlays + M << "\red You suddenly feel very weak." + M.Weaken(3) + M.emote("collapse") + /datum/dna/gene/basic/xray name="X-Ray Vision" activation_messages=list("The walls suddenly disappear.") @@ -141,4 +162,7 @@ activation_prob=15 New() - block=TELEBLOCK \ No newline at end of file + block=TELEBLOCK + + OnDrawUnderlays(var/mob/M,var/g,var/fat) + return "telekinesishead[fat]_s" diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 52c220ada76..528fa1d5c43 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -19,7 +19,7 @@ // SE blocks to assign. var/list/numsToAssign=new() - for(var/i=1;i0) testing("Setting up genetics for [species.name] (needs [english_list(species.default_block_names)])") species.default_blocks.Cut() - for(var/block=1;block 100) @@ -968,11 +968,13 @@ if (nutrition > 450) if(overeatduration < 800) //capped so people don't take forever to unfat overeatduration++ -/* + else if(overeatduration > 1) - overeatduration -= 2 //doubled the unfat rate -*/ + if(M_OBESITY in mutations) + overeatduration -= 1 // Those with obesity gene take twice as long to unfat + else + overeatduration -= 2 if(species.flags & REQUIRE_LIGHT) if(nutrition < 200) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index c737143e026..1bb59e5801e 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -1,6 +1,55 @@ /mob/living/carbon/human/say(var/message) if(miming) - return + if(length(message) >= 2) + if(mind && mind.changeling) + if(copytext(message, 1, 2) != "*" && department_radio_keys[copytext(message, 1, 3)] != "changeling") + return + else + return ..(message) + if(stat == DEAD) + return ..(message) + + if(length(message) >= 1) //In case people forget the '*help' command, this will slow them the message and prevent people from saying one letter at a time + if (copytext(message, 1, 2) != "*") + return + + if(dna) + if(length(message) >= 2) + if (copytext(message, 1, 2) != "*" && department_radio_keys[copytext(message, 1, 3)] != "changeling") + for(var/datum/dna/gene/gene in dna_genes) + if(!gene.block) + continue + if(gene.is_active(src)) + message = gene.OnSay(src,message) + /* + if(dna.mutantrace == "lizard") + if(copytext(message, 1, 2) != "*") + message = replacetext(message, "s", stutter("ss")) + + if(dna.mutantrace == "slime" && prob(5)) + if(copytext(message, 1, 2) != "*") + if(copytext(message, 1, 2) == ";") + message = ";" + else + message = "" + message += "SKR" + var/imax = rand(5,20) + for(var/i = 0,i