Fixes chem splicing, bioluminescence and seed packets for xenobotany.

This commit is contained in:
Zuhayr
2014-10-15 10:05:50 +10:30
parent be7d30630d
commit ca13d1d5d8
7 changed files with 88 additions and 63 deletions

View File

@@ -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)

View File

@@ -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"

View File

@@ -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,

View File

@@ -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.

View File

@@ -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 <font=[biolum_colour]>changes colour</font>!")
source_turf.visible_message("\blue \The [display_name]'s glow <font color='[biolum_colour]'>changes colour</font>!")
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<total_yield;i++)
var/product_type = pick(products)
var/obj/item/product = new product_type(get_turf(user))
if(biolum)
if(biolum_colour)
product.l_color = biolum_colour
product.SetLuminosity(biolum)
//Handle spawning in living, mobile products (like dionaea).
if(istype(product,/mob/living))

View File

@@ -103,12 +103,15 @@ Deep minerals:
for(var/y = 1, y <= real_size, y++)
map[MAP_CELL] = 0
/datum/ore_distribution/proc/print_distribution_map()
/datum/ore_distribution/proc/print_distribution_map(var/mob/usr)
var/line = ""
for(var/x = 1, x <= real_size, x++)
for(var/y = 1, y <= real_size, y++)
line += num2text(round(map[MAP_CELL]/25.5))
world << line
if(usr)
usr << line
else
world << line
line = ""
/datum/ore_distribution/proc/generate_distribution_map(var/x,var/y,var/input_size)

View File

@@ -41,6 +41,11 @@
sleep_offline = 1
// Set up roundstart seed list. This is here because vendors were
// bugging out and not populating with the correct packet names
// due to this list not being instantiated.
populate_seed_list()
master_controller = new /datum/controller/game_controller()
spawn(1)
master_controller.setup()