Skip to content

Commit

Permalink
bugfix: Final Genes Patch (#5221)
Browse files Browse the repository at this point in the history
* Final Genes Patch

* A-panel
  • Loading branch information
Gottfrei authored Jun 16, 2024
1 parent f7e9d83 commit 61ba6dc
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 79 deletions.
10 changes: 9 additions & 1 deletion code/_globalvars/genetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ GLOBAL_VAR_INIT(teleblock, 0)
GLOBAL_VAR_INIT(fireblock, 0)
GLOBAL_VAR_INIT(xrayblock, 0)
GLOBAL_VAR_INIT(clumsyblock, 0)
GLOBAL_VAR_INIT(fakeblock, 0)
GLOBAL_VAR_INIT(coughblock, 0)
GLOBAL_VAR_INIT(glassesblock, 0)
GLOBAL_VAR_INIT(epilepsyblock, 0)
Expand Down Expand Up @@ -68,3 +67,12 @@ GLOBAL_VAR_INIT(dizzyblock, 0)

GLOBAL_LIST_EMPTY(reg_dna)
GLOBAL_LIST_EMPTY(global_mutations)

// Currently empty blocks, you can use these for your own powers
GLOBAL_VAR_INIT(fakeblock1, 0)
GLOBAL_VAR_INIT(fakeblock2, 0)
GLOBAL_VAR_INIT(fakeblock3, 0)
GLOBAL_VAR_INIT(fakeblock4, 0)
GLOBAL_VAR_INIT(fakeblock5, 0)
GLOBAL_VAR_INIT(fakeblock6, 0)

34 changes: 31 additions & 3 deletions code/game/dna/genes/gene.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,40 @@
to_chat(mutant, span_warning("[msg]"))


/datum/dna/gene/basic/fake // placeholder for empty FAKE gene
// placeholders for empty FAKE genes
// you can remake these into your own powers

/datum/dna/gene/basic/fake
name = "Ordinary Gene"
desc = "Just another link in the DNA strand."


/datum/dna/gene/basic/fake/New()
/datum/dna/gene/basic/fake/fake1/New()
..()
block = GLOB.fakeblock1


/datum/dna/gene/basic/fake/fake2/New()
..()
block = GLOB.fakeblock2


/datum/dna/gene/basic/fake/fake3/New()
..()
block = GLOB.fakeblock3


/datum/dna/gene/basic/fake/fake4/New()
..()
block = GLOB.fakeblock4


/datum/dna/gene/basic/fake/fake5/New()
..()
block = GLOB.fakeblock5


/datum/dna/gene/basic/fake/fake6/New()
..()
block = GLOB.fakeblock
block = GLOB.fakeblock6

130 changes: 65 additions & 65 deletions code/game/gamemodes/setupgame.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/proc/getAssignedBlock(var/name,var/list/blocksLeft, var/activity_bounds=DNA_DEFAULT_BOUNDS, var/good=0)
if(blocksLeft.len==0)
/proc/getAssignedBlock(name, list/blocksLeft, activity_bounds = DNA_DEFAULT_BOUNDS, good = FALSE)
if(!length(blocksLeft))
warning("[name]: No more blocks left to assign!")
return 0
var/assigned = pick(blocksLeft)
Expand All @@ -8,106 +8,106 @@
GLOB.good_blocks += assigned
else
GLOB.bad_blocks += assigned
GLOB.assigned_blocks[assigned]=name
GLOB.dna_activity_bounds[assigned]=activity_bounds
//Debug message_admins("[name] assigned to block #[assigned].")
// testing("[name] assigned to block #[assigned].")
GLOB.assigned_blocks[assigned] = name
GLOB.dna_activity_bounds[assigned] = activity_bounds
return assigned


/proc/setupgenetics()

if(prob(50))
GLOB.blockadd = rand(-300,300)
if(prob(75))
GLOB.diffmut = rand(0,20)


//Thanks to nexis for the fancy code
// BITCH I AIN'T DONE YET

// SE blocks to assign.
var/list/numsToAssign=new()
for(var/i=1;i<DNA_SE_LENGTH;i++)
var/list/numsToAssign= list()
for(var/i in 1 to DNA_SE_LENGTH)
numsToAssign += i

// testing("Assigning DNA blocks:")
//message_admins("Assigning DNA blocks:")

// Standard muts
GLOB.blindblock = getAssignedBlock("BLINDNESS", numsToAssign)
GLOB.colourblindblock = getAssignedBlock("COLOURBLIND", numsToAssign)
GLOB.deafblock = getAssignedBlock("DEAF", numsToAssign)
GLOB.hulkblock = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.teleblock = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.fireblock = getAssignedBlock("FIRE", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.xrayblock = getAssignedBlock("XRAY", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.clumsyblock = getAssignedBlock("CLUMSY", numsToAssign)
GLOB.fakeblock = getAssignedBlock("FAKE", numsToAssign)
GLOB.coughblock = getAssignedBlock("COUGH", numsToAssign)
GLOB.glassesblock = getAssignedBlock("GLASSES", numsToAssign)
GLOB.epilepsyblock = getAssignedBlock("EPILEPSY", numsToAssign)
GLOB.twitchblock = getAssignedBlock("TWITCH", numsToAssign)
GLOB.nervousblock = getAssignedBlock("NERVOUS", numsToAssign)
GLOB.wingdingsblock = getAssignedBlock("WINGDINGS", numsToAssign)
GLOB.blindblock = getAssignedBlock("BLINDNESS", numsToAssign)
GLOB.colourblindblock = getAssignedBlock("COLOURBLIND", numsToAssign)
GLOB.deafblock = getAssignedBlock("DEAF", numsToAssign)
GLOB.hulkblock = getAssignedBlock("HULK", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.teleblock = getAssignedBlock("TELE", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.fireblock = getAssignedBlock("FIRE", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.xrayblock = getAssignedBlock("XRAY", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.clumsyblock = getAssignedBlock("CLUMSY", numsToAssign)
GLOB.coughblock = getAssignedBlock("COUGH", numsToAssign)
GLOB.glassesblock = getAssignedBlock("GLASSES", numsToAssign)
GLOB.epilepsyblock = getAssignedBlock("EPILEPSY", numsToAssign)
GLOB.twitchblock = getAssignedBlock("TWITCH", numsToAssign)
GLOB.nervousblock = getAssignedBlock("NERVOUS", numsToAssign)
GLOB.wingdingsblock = getAssignedBlock("WINGDINGS", numsToAssign)

// fake empty genes
GLOB.fakeblock1 = getAssignedBlock("", numsToAssign)
GLOB.fakeblock2 = getAssignedBlock("", numsToAssign)
GLOB.fakeblock3 = getAssignedBlock("", numsToAssign)
GLOB.fakeblock4 = getAssignedBlock("", numsToAssign)
GLOB.fakeblock5 = getAssignedBlock("", numsToAssign)
GLOB.fakeblock6 = getAssignedBlock("", numsToAssign)

// Bay muts
GLOB.breathlessblock = getAssignedBlock("BREATHLESS", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.remoteviewblock = getAssignedBlock("REMOTEVIEW", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.regenerateblock = getAssignedBlock("REGENERATE", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.increaserunblock = getAssignedBlock("INCREASERUN", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.remotetalkblock = getAssignedBlock("REMOTETALK", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.morphblock = getAssignedBlock("MORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.coldblock = getAssignedBlock("COLD", numsToAssign, good=1)
GLOB.hallucinationblock = getAssignedBlock("HALLUCINATION", numsToAssign)
GLOB.noprintsblock = getAssignedBlock("NOPRINTS", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.shockimmunityblock = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good=1)
GLOB.smallsizeblock = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.breathlessblock = getAssignedBlock("BREATHLESS", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.remoteviewblock = getAssignedBlock("REMOTEVIEW", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.regenerateblock = getAssignedBlock("REGENERATE", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.increaserunblock = getAssignedBlock("INCREASERUN", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.remotetalkblock = getAssignedBlock("REMOTETALK", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.morphblock = getAssignedBlock("MORPH", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.coldblock = getAssignedBlock("COLD", numsToAssign, good = TRUE)
GLOB.hallucinationblock = getAssignedBlock("HALLUCINATION", numsToAssign)
GLOB.noprintsblock = getAssignedBlock("NOPRINTS", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.shockimmunityblock = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good = TRUE)
GLOB.smallsizeblock = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)

//
// Goon muts
/////////////////////////////////////////////

// Disabilities
GLOB.lispblock = getAssignedBlock("LISP", numsToAssign)
GLOB.muteblock = getAssignedBlock("MUTE", numsToAssign)
GLOB.radblock = getAssignedBlock("RAD", numsToAssign)
GLOB.fatblock = getAssignedBlock("FAT", numsToAssign)
GLOB.swedeblock = getAssignedBlock("SWEDE", numsToAssign)
GLOB.scrambleblock = getAssignedBlock("SCRAMBLE", numsToAssign)
GLOB.weakblock = getAssignedBlock("WEAK", numsToAssign)
GLOB.hornsblock = getAssignedBlock("HORNS", numsToAssign)
GLOB.comicblock = getAssignedBlock("COMIC", numsToAssign)
GLOB.lispblock = getAssignedBlock("LISP", numsToAssign)
GLOB.muteblock = getAssignedBlock("MUTE", numsToAssign)
GLOB.radblock = getAssignedBlock("RAD", numsToAssign)
GLOB.fatblock = getAssignedBlock("FAT", numsToAssign)
GLOB.swedeblock = getAssignedBlock("SWEDE", numsToAssign)
GLOB.scrambleblock = getAssignedBlock("SCRAMBLE", numsToAssign)
GLOB.weakblock = getAssignedBlock("WEAK", numsToAssign)
GLOB.hornsblock = getAssignedBlock("HORNS", numsToAssign)
GLOB.comicblock = getAssignedBlock("COMIC", numsToAssign)

// Powers
GLOB.soberblock = getAssignedBlock("SOBER", numsToAssign, good=1)
GLOB.psyresistblock = getAssignedBlock("PSYRESIST", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.shadowblock = getAssignedBlock("SHADOW", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.chameleonblock = getAssignedBlock("CHAMELEON", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.cryoblock = getAssignedBlock("CRYO", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.eatblock = getAssignedBlock("EAT", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.jumpblock = getAssignedBlock("JUMP", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.immolateblock = getAssignedBlock("IMMOLATE", numsToAssign)
GLOB.empathblock = getAssignedBlock("EMPATH", numsToAssign, DNA_HARD_BOUNDS, good=1)
GLOB.polymorphblock = getAssignedBlock("POLYMORPH", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.strongblock = getAssignedBlock("STRONG", numsToAssign, DNA_HARDER_BOUNDS, good=1)
GLOB.soberblock = getAssignedBlock("SOBER", numsToAssign, good = TRUE)
GLOB.psyresistblock = getAssignedBlock("PSYRESIST", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.shadowblock = getAssignedBlock("SHADOW", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.chameleonblock = getAssignedBlock("CHAMELEON", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.cryoblock = getAssignedBlock("CRYO", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.eatblock = getAssignedBlock("EAT", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.jumpblock = getAssignedBlock("JUMP", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.immolateblock = getAssignedBlock("IMMOLATE", numsToAssign)
GLOB.empathblock = getAssignedBlock("EMPATH", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
GLOB.polymorphblock = getAssignedBlock("POLYMORPH", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)
GLOB.strongblock = getAssignedBlock("STRONG", numsToAssign, DNA_HARDER_BOUNDS, good = TRUE)

//
// /vg/ Blocks
/////////////////////////////////////////////

// Disabilities
GLOB.loudblock = getAssignedBlock("LOUD", numsToAssign)
GLOB.dizzyblock = getAssignedBlock("DIZZY", numsToAssign)
GLOB.loudblock = getAssignedBlock("LOUD", numsToAssign)
GLOB.dizzyblock = getAssignedBlock("DIZZY", numsToAssign)

// Paradise220 Disabilities
GLOB.auld_imperial_block = getAssignedBlock("AULD_IMPERIAL", numsToAssign)
// Paradise1984 Disabilities
GLOB.auld_imperial_block = getAssignedBlock("AULD_IMPERIAL", numsToAssign)

//
// Static Blocks
/////////////////////////////////////////////.

// Monkeyblock is always last.
GLOB.monkeyblock = DNA_SE_LENGTH
GLOB.assigned_blocks[DNA_SE_LENGTH] = ""

// And the genes that actually do the work. (domutcheck improvements)
var/list/blocks_assigned[DNA_SE_LENGTH]
Expand Down
19 changes: 9 additions & 10 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,18 @@ GLOBAL_VAR_INIT(nologevent, 0)
if(M.dna && iscarbon(M))
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<=DNA_SE_LENGTH;block++)
if(((block-1)%5)==0)
body += "</tr><tr><th>[block-1]</th>"
bname = GLOB.assigned_blocks[block]
for(var/block in 1 to DNA_SE_LENGTH)
if(!((block - 1) % 5))
body += "</tr><tr><th>[block - 1]</th>"

body += "<td>"
if(bname)
var/bstate=M.dna.GetSEState(block)
var/bcolor="[(bstate)?"#006600":"#ff0000"]"
body += "<A href='?_src_=holder;togmutate=[M.UID()];block=[block]' style='color:[bcolor];'>[bname]</A><sub>[block]</sub>"
var/gene_name = GLOB.assigned_blocks[block]
if(gene_name)
var/text_color = "[M.dna.GetSEState(block) ? "#006600" : "#ff0000"]"
body += "<A href='?_src_=holder;togmutate=[M.UID()];block=[block]' style='color:[text_color];'>[gene_name]</A><sub>[block]</sub>"
else
body += "[block]"
body+="</td>"
body += "</td>"
body += "</tr></table>"

body += {"<br><br>
Expand Down

0 comments on commit 61ba6dc

Please sign in to comment.