DNA2: New powers from Paradise's release of Goon's genetic code. Also added lisp disability.

Conflicts:
	code/modules/mob/living/carbon/human/life.dm
	code/modules/mob/living/carbon/human/say.dm
	html/changelog.html
This commit is contained in:
Rob Nelson
2014-01-20 02:10:58 -05:00
committed by ZomgPonies
parent fbabcb9117
commit ace34c60b0
17 changed files with 237 additions and 46 deletions
+2
View File
@@ -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"
+18 -17
View File
@@ -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
+2 -2
View File
@@ -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()
+3 -3
View File
@@ -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)":""]!")
+15 -1
View File
@@ -125,4 +125,18 @@
disability=NEARSIGHTED
New()
block=GLASSESBLOCK
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")
+40 -2
View File
@@ -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
+1 -1
View File
@@ -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
+26 -2
View File
@@ -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
block=TELEBLOCK
OnDrawUnderlays(var/mob/M,var/g,var/fat)
return "telekinesishead[fat]_s"
+26 -3
View File
@@ -19,7 +19,7 @@
// SE blocks to assign.
var/list/numsToAssign=new()
for(var/i=1;i<STRUCDNASIZE;i++)
for(var/i=1;i<DNA_SE_LENGTH;i++)
numsToAssign += i
testing("Assigning DNA blocks:")
@@ -52,8 +52,31 @@
SHOCKIMMUNITYBLOCK = getAssignedBlock("SHOCKIMMUNITY", numsToAssign)
SMALLSIZEBLOCK = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS)
//
// Goon muts
/////////////////////////////////////////////
// Disabilities
LISPBLOCK = getAssignedBlock("LISP", numsToAssign)
MUTEBLOCK = getAssignedBlock("MUTE", numsToAssign)
RADBLOCK = getAssignedBlock("RAD", numsToAssign)
FATBLOCK = getAssignedBlock("FAT", numsToAssign)
STUTTERBLOCK = getAssignedBlock("STUTTER", numsToAssign)
CHAVBLOCK = getAssignedBlock("CHAV", numsToAssign)
SWEDEBLOCK = getAssignedBlock("SWEDE", numsToAssign)
SCRAMBLEBLOCK = getAssignedBlock("SCRAMBLE", numsToAssign)
TOXICFARTBLOCK = getAssignedBlock("TOXICFART", numsToAssign)
STRONGBLOCK = getAssignedBlock("STRONG", numsToAssign)
HORNSBLOCK = getAssignedBlock("HORNS", numsToAssign)
// Powers
SOBERBLOCK = getAssignedBlock("SOBER", numsToAssign)
PSYRESISTBLOCK = getAssignedBlock("PSYRESIST", numsToAssign, DNA_HARD_BOUNDS)
SHADOWBLOCK = getAssignedBlock("SHADOW", numsToAssign, DNA_HARDER_BOUNDS)
CHAMELEONBLOCK = getAssignedBlock("CHAMELEON", numsToAssign, DNA_HARDER_BOUNDS)
// And the genes that actually do the work. (domutcheck improvements)
var/list/blocks_assigned[STRUCDNASIZE]
var/list/blocks_assigned[DNA_SE_LENGTH]
for(var/gene_type in typesof(/datum/dna/gene))
var/datum/dna/gene/G = new gene_type
if(G.block)
@@ -76,7 +99,7 @@
if(species.default_block_names.len>0)
testing("Setting up genetics for [species.name] (needs [english_list(species.default_block_names)])")
species.default_blocks.Cut()
for(var/block=1;block<STRUCDNASIZE;block++)
for(var/block=1;block<DNA_SE_LENGTH;block++)
if(assigned_blocks[block] in species.default_block_names)
testing(" Found [assigned_blocks[block]] ([block])")
species.default_blocks.Add(block)
+1 -1
View File
@@ -60,7 +60,7 @@
Initialize()
buf.types=DNA2_BUF_SE
var/list/new_SE=list(0x098,0x3E8,0x403,0x44C,0x39F,0x4B0,0x59D,0x514,0x5FC,0x578,0x5DC,0x640,0x6A4)
for(var/i=new_SE.len;i<=STRUCDNASIZE;i++)
for(var/i=new_SE.len;i<=DNA_SE_LENGTH;i++)
new_SE += rand(1,1024)
buf.dna.SE=new_SE
buf.dna.SetSEValue(MONKEYBLOCK,0xFFF)
+2
View File
@@ -171,6 +171,8 @@
//..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak
return
/obj/machinery/door/window/attack_ghost(mob/user as mob)
return
/obj/machinery/door/window/attack_ai(mob/user as mob)
return src.attack_hand(user)
+22
View File
@@ -65,6 +65,28 @@ var/NOPRINTSBLOCK = 0
var/SHOCKIMMUNITYBLOCK = 0
var/SMALLSIZEBLOCK = 0
///////////////////////////////
// Goon Stuff
///////////////////////////////
// Disabilities
var/LISPBLOCK = 0
var/MUTEBLOCK = 0
var/RADBLOCK = 0
var/FATBLOCK = 0
var/STUTTERBLOCK = 0
var/CHAVBLOCK = 0
var/SWEDEBLOCK = 0
var/SCRAMBLEBLOCK = 0
var/TOXICFARTBLOCK = 0
var/STRONGBLOCK = 0
var/HORNSBLOCK = 0
// Powers
var/SOBERBLOCK = 0
var/PSYRESISTBLOCK = 0
var/SHADOWBLOCK = 0
var/CHAMELEONBLOCK = 0
var/skipupdate = 0
///////////////
var/eventchance = 10 //% per 5 mins
+1 -1
View File
@@ -125,7 +125,7 @@ var/global/floorIsLava = 0
body += "<br><br>"
body += "<b>DNA Blocks:</b><br><table border='0'><tr><th>&nbsp;</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th>"
var/bname
for(var/block=1;block<STRUCDNASIZE;block++)
for(var/block=1;block<DNA_SE_LENGTH;block++)
if(((block-1)%5)==0)
body += "</tr><tr><th>[block-1]</th>"
bname = assigned_blocks[block]
+11 -9
View File
@@ -240,12 +240,12 @@
if((COLD_RESISTANCE in mutations) || (prob(1)))
heal_organ_damage(0,1)
if ((HULK in mutations) && health <= 25)
mutations.Remove(HULK)
update_mutations() //update our mutation overlays
src << "\red You suddenly feel very weak."
Weaken(3)
emote("collapse")
for(var/datum/dna/gene/gene in dna_genes)
if(!gene.block)
continue
if(gene.is_active(src))
gene.OnMobLife(src)
if (radiation)
if (radiation > 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)
+50 -1
View File
@@ -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<imax,i++)
message += "E"*/
if(stat != DEAD)
for(var/datum/disease/pierrot_throat/D in viruses)
var/list/temp_message = text2list(message, " ") //List each word in the message
var/list/pick_list = list()
for(var/i = 1, i <= temp_message.len, i++) //Create a second list for excluding words down the line
pick_list += i
for(var/i=1, ((i <= D.stage) && (i <= temp_message.len)), i++) //Loop for each stage of the disease or until we run out of words
if(prob(3 * D.stage)) //Stage 1: 3% Stage 2: 6% Stage 3: 9% Stage 4: 12%
var/H = pick(pick_list)
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
temp_message[H] = "HONK"
pick_list -= H //Make sure that you dont HONK the same word twice
message = list2text(temp_message, " ")
if(wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja) && wear_mask:voice == "Unknown")
@@ -383,8 +383,17 @@ proc/get_damage_icon_part(damage_state, body_part)
var/add_image = 0
var/g = "m"
if(gender == FEMALE) g = "f"
for(var/datum/dna/gene/gene in dna_genes)
if(!gene.block)
continue
if(gene.is_active(src))
var/underlay=gene.OnDrawUnderlays(src,g,fat)
if(underlay)
standing.underlays += underlay
add_image = 1
for(var/mut in mutations)
switch(mut)
/*
if(HULK)
if(fat)
standing.underlays += "hulk_[fat]_s"
@@ -397,6 +406,7 @@ proc/get_damage_icon_part(damage_state, body_part)
if(TK)
standing.underlays += "telekinesishead[fat]_s"
add_image = 1
*/
if(LASER)
standing.overlays += "lasereyes_s"
add_image = 1
+7 -3
View File
@@ -310,9 +310,6 @@ var/MAX_EXPLOSION_RANGE = 14
// mob/var/list/mutations
#define STRUCDNASIZE 27
#define UNIDNASIZE 13
// Used in preferences.
#define DISABILITY_FLAG_NEARSIGHTED 1
#define DISABILITY_FLAG_FAT 2
@@ -361,6 +358,13 @@ var/MAX_EXPLOSION_RANGE = 14
#define mShock 109 // insulated hands
#define mSmallsize 110 // table climbing
// Goon muts
#define M_OBESITY 200
#define M_TOXIC_FARTS 201
#define M_STRONG 202
#define M_SOBER 203
#define M_PSY_RESIST 204
//disabilities
#define NEARSIGHTED 1
#define EPILEPSY 2