From ca13d1d5d8be612eaae8474bb2999e60379d053e Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 15 Oct 2014 10:05:50 +1030 Subject: [PATCH] Fixes chem splicing, bioluminescence and seed packets for xenobotany. --- code/controllers/master_controller.dm | 3 - code/controllers/verbs.dm | 2 +- code/modules/admin/admin_verbs.dm | 1 + code/modules/hydroponics/hydro_tray.dm | 3 +- code/modules/hydroponics/seed_datums.dm | 130 +++++++++++-------- code/modules/mining/drilling/distribution.dm | 7 +- code/world.dm | 5 + 7 files changed, 88 insertions(+), 63 deletions(-) diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 9b18e243567..358fc2ebc6a 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -121,9 +121,6 @@ datum/controller/game_controller/proc/setup_objects() //Set up spawn points. populate_spawn_points() - //Set up roundstart seed list. - populate_seed_list() - world << "\red \b Initializations complete." sleep(-1) diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index b4ff1ed7ca8..4ab6742b837 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -9,7 +9,7 @@ if(!holder) return if(master_controller && master_controller.asteroid_ore_map) - master_controller.asteroid_ore_map.print_distribution_map() + master_controller.asteroid_ore_map.print_distribution_map(usr) /client/proc/remake_distribution_map() set category = "Debug" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index f6605059d01..403dfd40498 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -149,6 +149,7 @@ var/list/admin_verbs_debug = list( /client/proc/restart_controller, /client/proc/remake_distribution_map, /client/proc/show_distribution_map, + /client/proc/show_plant_genes, /client/proc/enable_debug_verbs, /client/proc/callproc, /client/proc/toggledebuglogs, diff --git a/code/modules/hydroponics/hydro_tray.dm b/code/modules/hydroponics/hydro_tray.dm index 1012543db51..f51420a11b4 100644 --- a/code/modules/hydroponics/hydro_tray.dm +++ b/code/modules/hydroponics/hydro_tray.dm @@ -176,7 +176,7 @@ weedlevel += 1 * HYDRO_SPEED_MULTIPLIER // There's a chance for a weed explosion to happen if the weeds take over. - // Plants that are themselves weeds (weed_tolernace > 10) are unaffected. + // Plants that are themselves weeds (weed_tolerance > 10) are unaffected. if (weedlevel >= 10 && prob(10)) if(!seed || weedlevel >= seed.weed_tolerance) weed_invasion() @@ -184,6 +184,7 @@ // If there is no seed data (and hence nothing planted), // or the plant is dead, process nothing further. if(!seed || dead) + if(draw_warnings) update_icon() //Harvesting would fail to set alert icons properly. return // Advance plant age. diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 7b6710f6c43..50b28c755fd 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -1,6 +1,21 @@ var/global/list/seed_types = list() // A list of all seed data. var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious trial and error goodness. +// Debug for testing seed genes. +/client/proc/show_plant_genes() + set category = "Debug" + set name = "Show Plant Genes" + set desc = "Prints the round's plant gene masks." + + if(!holder) return + + if(!gene_tag_masks) + usr << "Gene masks not set." + return + + for(var/mask in gene_tag_masks) + usr << "[mask]: [gene_tag_masks[mask]]" + // Predefined/roundstart varieties use a string key to make it // easier to grab the new variety when mutating. Post-roundstart // and mutant varieties use their uid converted to a string instead. @@ -130,49 +145,50 @@ proc/populate_seed_list() var/additional_chems = rand(0,5) - var/list/possible_chems = list( - "bicaridine", - "hyperzine", - "cryoxadone", - "blood", - "water", - "potassium", - "plasticide", - "slimetoxin", - "aslimetoxin", - "inaprovaline", - "space_drugs", - "paroxetine", - "mercury", - "sugar", - "radium", - "ryetalyn", - "alkysine", - "thermite", - "tramadol", - "cryptobiolin", - "dermaline", - "dexalin", - "phoron", - "synaptizine", - "impedrezene", - "hyronalin", - "peridaxon", - "toxin", - "rezadone", - "ethylredoxrazine", - "slimejelly", - "cyanide", - "mindbreaker", - "stoxin" - ) + if(additional_chems) + var/list/possible_chems = list( + "bicaridine", + "hyperzine", + "cryoxadone", + "blood", + "water", + "potassium", + "plasticide", + "slimetoxin", + "aslimetoxin", + "inaprovaline", + "space_drugs", + "paroxetine", + "mercury", + "sugar", + "radium", + "ryetalyn", + "alkysine", + "thermite", + "tramadol", + "cryptobiolin", + "dermaline", + "dexalin", + "phoron", + "synaptizine", + "impedrezene", + "hyronalin", + "peridaxon", + "toxin", + "rezadone", + "ethylredoxrazine", + "slimejelly", + "cyanide", + "mindbreaker", + "stoxin" + ) - for(var/x=1;x<=additional_chems;x++) - if(!possible_chems.len) - break - var/new_chem = pick(possible_chems) - possible_chems -= new_chem - chems[new_chem] = list(rand(1,10),rand(10,20)) + for(var/x=1;x<=additional_chems;x++) + if(!possible_chems.len) + break + var/new_chem = pick(possible_chems) + possible_chems -= new_chem + chems[new_chem] = list(rand(1,10),rand(10,20)) if(prob(90)) requires_nutrients = 1 @@ -291,7 +307,7 @@ proc/populate_seed_list() source_turf.visible_message("\blue \The [display_name] begins to glow!") if(prob(degree*2)) biolum_colour = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]" - source_turf.visible_message("\blue \The [display_name]'s glow changes colour!") + source_turf.visible_message("\blue \The [display_name]'s glow changes colour!") else source_turf.visible_message("\blue \The [display_name]'s glow dims...") if(11) @@ -332,24 +348,21 @@ proc/populate_seed_list() var/list/gene_chem = gene_value[rid] - if(chems[rid]) + if(!chems[rid]) + chems[rid] = gene_chem.Copy() + continue - var/list/chem_value = chems[rid] + for(var/i=1;i<=gene_chem.len;i++) - chems[rid][1] = max(1,round((gene_chem[1] + chem_value[1])/2)) + if(isnull(gene_chem[i])) gene_chem[i] = 0 - if(gene_chem.len > 1) - if(chem_value > 1) - chems[rid][2] = max(1,round((gene_chem[2] + chem_value[2])/2)) - else - chems[rid][2] = gene_chem[2] - - else - var/list/new_chem = gene_chem[rid] - chems[rid] = new_chem.Copy() + if(chems[rid][i]) + chems[rid][i] = max(1,round((gene_chem[i] + chems[rid][i])/2)) + else + chems[rid][i] = gene_chem[i] var/list/new_gasses = gene.values[3] - if(istype(new_gasses)) + if(islist(new_gasses)) if(!exude_gasses) exude_gasses = list() exude_gasses |= new_gasses for(var/gas in exude_gasses) @@ -485,6 +498,7 @@ proc/populate_seed_list() //Place the plant products at the feet of the user. /datum/seed/proc/harvest(var/mob/user,var/yield_mod,var/harvest_sample) + if(!user) return @@ -522,6 +536,10 @@ proc/populate_seed_list() for(var/i = 0;i