This commit is contained in:
DragonTrance
2021-02-21 08:37:10 -07:00
parent 58b69503e3
commit 24cb27b67c
30 changed files with 637 additions and 45 deletions
+15
View File
@@ -307,6 +307,17 @@
seed.genes -= G
if(istype(G, /datum/plant_gene/reagent))
seed.reagents_from_genes()
if(istype(G, /datum/plant_gene/trait/modified_color))
var/datum/plant_gene/trait/modified_color/found
for(var/datum/plant_gene/trait/modified_color/T in seed.genes)
if(istype(T, /datum/plant_gene/trait/modified_color) && T.type != G.type)
found = T
break
if(found)
seed.color = found.color
else
seed.color = null
seed.modified_colors = FALSE
repaint_seed()
if("extract")
if(disk && !disk.read_only)
@@ -343,6 +354,10 @@
seed.genes += disk.gene.Copy()
if(istype(disk.gene, /datum/plant_gene/reagent))
seed.reagents_from_genes()
if(istype(disk.gene, /datum/plant_gene/trait/modified_color) && !seed.modified_colors)
var/datum/plant_gene/trait/modified_color/M = disk.gene
seed.color = M.color
seed.modified_colors = TRUE
disk.gene.apply_vars(seed)
repaint_seed()
+1
View File
@@ -20,6 +20,7 @@
var/distill_reagent //If NULL and this object can be distilled, it uses a generic fruit_wine reagent and adjusts its variables.
var/wine_flavor //If NULL, this is automatically set to the fruit's flavor. Determines the flavor of the wine if distill_reagent is NULL.
var/wine_power = 10 //Determines the boozepwr of the wine if distill_reagent is NULL.
var/modified_colors = FALSE
/obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, obj/item/seeds/new_seed)
. = ..()
+1 -2
View File
@@ -30,8 +30,7 @@
/obj/item/reagent_containers/food/snacks/grown/banana/generate_trash(atom/location)
. = ..()
var/obj/item/grown/bananapeel/peel = .
if(istype(peel))
peel.grind_results = list(/datum/reagent/consumable/banana_peel = seed.potency * 0.2)
peel.grind_results = list(/datum/reagent/consumable/banana_peel = seed.potency * 0.2)
/obj/item/reagent_containers/food/snacks/grown/banana/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is aiming [src] at [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!</span>")
+2 -2
View File
@@ -29,7 +29,7 @@
// Oat
/obj/item/seeds/wheat/oat
name = "pack of oat seeds"
desc = "These may, or may not, grow into oat."
desc = "Oat's just a matter of time..."
icon_state = "seed-oat"
species = "oat"
plantname = "Oat Stalks"
@@ -53,7 +53,7 @@
// Rice
/obj/item/seeds/wheat/rice
name = "pack of rice seeds"
desc = "These may, or may not, grow into rice."
desc = "Rice, rice, baby!"
icon_state = "seed-rice"
species = "rice"
plantname = "Rice Stalks"
-1
View File
@@ -114,7 +114,6 @@
icon_grow = "lime-grow"
icon_dead = "lime-dead"
genes = list(/datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/firelemon)
reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05)
/obj/item/reagent_containers/food/snacks/grown/citrus/lemon
+103 -3
View File
@@ -22,6 +22,37 @@
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
reagents_add = list(/datum/reagent/medicine/morphine = 0.35, /datum/reagent/medicine/charcoal = 0.35, /datum/reagent/consumable/nutriment = 0)
mutatelist = list(/obj/item/seeds/reishi/negative)
/*
/obj/item/seeds/reishi/dark
name = "pack of dark reishi mycelium"
desc = "This mycelium grows into something that'll put you into a trance."
plantname = "Dark Reishi"
lifespan = 2
endurance = 8
maturation = 6
production = 1
yield = 0
potency = 0
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/modified_color/bw)
reagents_add = list(/datum/reagent/medicine/morphine = 0.2, /datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.02)
mutatelist = list(/obj/item/seeds/reishi/negative)
*/
/obj/item/seeds/reishi/negative
name = "pack of light-abosrbing reishi mycelium"
desc = "This mycelium grows into something so tranquil, you'll never want to wake up from its trance."
plantname = "Light-Absorbing Reishi"
lifespan = 1
endurance = 2 //Better use that enduro grow
maturation = 10
production = 6
yield = 0
potency = 0
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/modified_color)
reagents_add = list(/datum/reagent/medicine/morphine = 0.2, /datum/reagent/toxin/amanitin = 0.05, /datum/reagent/consumable/nutriment = 0.04, /datum/reagent/consumable/nutriment/vitamin = 0.02)
mutatelist = list(/obj/item/seeds/reishi)
/obj/item/reagent_containers/food/snacks/grown/mushroom/reishi
seed = /obj/item/seeds/reishi
@@ -173,7 +204,7 @@
to_chat(user, "<span class='notice'>You plant the walking mushroom.</span>")
// Chanterelle
/obj/item/seeds/chanter
/obj/item/seeds/chanterelle
name = "pack of chanterelle mycelium"
desc = "This mycelium grows into chanterelle mushrooms."
icon_state = "mycelium-chanter"
@@ -190,10 +221,10 @@
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
reagents_add = list(/datum/reagent/consumable/nutriment = 0.1)
mutatelist = list(/obj/item/seeds/chanterelle/jupitercup)
mutatelist = list(/obj/item/seeds/chanterelle/jupitercup, /obj/item/seeds/chanterelle/jupitercup/hollow, /obj/item/seeds/chanterelle/jupitercup/monochrome)
/obj/item/reagent_containers/food/snacks/grown/mushroom/chanterelle
seed = /obj/item/seeds/chanter
seed = /obj/item/seeds/chanterelle
name = "chanterelle cluster"
desc = "<I>Cantharellus Cibarius</I>: These jolly yellow little shrooms sure look tasty!"
icon_state = "chanterelle"
@@ -215,6 +246,7 @@
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/reagent/teslium, /datum/plant_gene/trait/plant_type/carnivory)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
reagents_add = list(/datum/reagent/consumable/nutriment = 0.1)
mutatelist = list()
/obj/item/seeds/chanterelle/jupitercup/Initialize(mapload, nogenes = FALSE)
. = ..()
@@ -222,6 +254,36 @@
unset_mutability(/datum/plant_gene/reagent/teslium, PLANT_GENE_EXTRACTABLE)
unset_mutability(/datum/plant_gene/trait/plant_type/carnivory, PLANT_GENE_REMOVABLE)
/obj/item/seeds/chanterelle/jupitercup/hollow
name = "pack of hollow-cup mycelium"
desc = "This mycelium grows into hollow-cup mushrooms. These mushrooms require only the upmost attention."
plantname = "Hollow-cup Mushrooms"
lifespan = 1 //starts decaying before it can even be harvested once
production = 4
endurance = 5
yield = 0
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/plant_type/carnivory, /datum/plant_gene/trait/modified_color/opaque)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
reagents_add = list(/datum/reagent/consumable/nutriment = 0.1)
mutatelist = list(/obj/item/seeds/chanterelle/jupitercup)
color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0.66,0.66,0.66,0.66, 0,0,0,0)
modified_colors = TRUE
/obj/item/seeds/chanterelle/jupitercup/monochrome
name = "pack of silver-cup mycelium"
desc = "This mycelium grows into silver-cup mushrooms. These mushrooms require only the upmost attention."
plantname = "Silver-cup Mushrooms"
lifespan = 1
production = 5
endurance = 7
yield = 0
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/plant_type/carnivory, /datum/plant_gene/trait/modified_color/monochrome)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
reagents_add = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/nothing = 0.02)
mutatelist = list(/obj/item/seeds/chanterelle/jupitercup)
color = list(0.5,0.5,0.5,0, 0.5,0.5,0.5,0, 0.5,0.5,0.5,0, 0,0,0,1, 0,0,0,0)
modified_colors = TRUE
/obj/item/reagent_containers/food/snacks/grown/mushroom/jupitercup
seed = /obj/item/seeds/chanterelle/jupitercup
name = "jupiter cup"
@@ -386,6 +448,24 @@
product = /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_cap
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
mutatelist = list(/obj/item/seeds/lavaland/inocybe/magenta)
/obj/item/seeds/lavaland/inocybe/magenta
name = "pack of dilated inocybe mycelium"
desc = "This mycelium grows into a specially-colored inocybe mushroom, their shifted cells make them appear red."
plantname = "Magenta Inocybe Mushrooms"
lifespan = 4
endurance = 5
maturation = 3
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/modified_color/magenta)
mutatelist = list()
color = list(
0.25, 0.5, 1, 0,
1, 0.25, 0.5, 0,
0.5, 1, 0.25, 0,
0,0,0,1,
0,0,0,0)
modified_colors = TRUE
// Embershroom (Mushroom stem)
@@ -398,3 +478,23 @@
product = /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_stem
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/glow)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
mutatelist = list(/obj/item/seeds/lavaland/ember/cyan)
/obj/item/seeds/lavaland/ember/cyan
name = "pack of dilated embershroom mycelium"
desc = "This mycelium grows into a specially-colored embershroom mushroom, their shifted cells make them appear blue."
plantname = "Magenta Embershroom Mushrooms"
lifespan = 6
endurance = 10
maturation = 4
yield = 2
potency = 25
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/glow/blue, /datum/plant_gene/trait/modified_color/cyan)
mutatelist = list()
color = list(
0.25, 1, 0.5, 0,
0.5, 0.25, 1, 0,
1, 0.5, 0.25, 0,
0,0,0,1,
0,0,0,0)
modified_colors = TRUE
+53 -1
View File
@@ -198,4 +198,56 @@
/obj/item/reagent_containers/glass/bottle/killer/pestkiller
name = "bottle of pest spray"
desc = "Contains a pesticide."
list_reagents = list(/datum/reagent/toxin/pestkiller = 50)
list_reagents = list(/datum/reagent/toxin/pestkiller = 50)
/*
/obj/item/plant_debugger
name = "plant debugger"
desc = "You should never be able to see this."
icon = 'icons/obj/device.dmi'
icon_state = "hydro"
flags_1 = ABSTRACT
var/mode = 0
var/list/traits_list = list(
/datum/plant_gene/trait/modified_color/monochrome/yellow,
/datum/plant_gene/trait/modified_color/monochrome/green,
/datum/plant_gene/trait/modified_color/vibrant,
/datum/plant_gene/trait/modified_color/random,
/datum/plant_gene/trait/modified_color/monochrome/dark/,
/datum/plant_gene/trait/modified_color/monochrome/dark/red,
/datum/plant_gene/trait/modified_color/monochrome/dark/green,
/datum/plant_gene/trait/modified_color/monochrome/dark/blue)
var/trait_to_add = null
/obj/item/plant_debugger/attack_self(mob/user)
. = ..()
mode++
if(mode > traits_list.len)
mode = 1
trait_to_add = traits_list[mode]
to_chat(user, "Now injecting: [trait_to_add]")
/obj/item/plant_debugger/pre_attack(atom/A, mob/living/user, params)
if(!istype(A, /obj/machinery/hydroponics))
return
var/obj/machinery/hydroponics/H = A
if(!H.myseed)
to_chat(user, "This tray does not have a seed in it!")
return
for(var/G in H.myseed.genes)
if(istype(G, /datum/plant_gene/trait/modified_color))
var/datum/plant_gene/trait/T = new trait_to_add
G = T
T.apply_vars(H.myseed)
H.update_icon()
to_chat(user, "Converted old modified_color to [trait_to_add]")
return
var/datum/plant_gene/trait/T = new trait_to_add
H.myseed.genes += T
T.apply_vars(H.myseed)
H.update_icon()
to_chat(user, "Added [trait_to_add]")
/obj/item/plant_debugger/attack()
return
*/
+5 -1
View File
@@ -310,6 +310,8 @@
else
var/t_growthstate = clamp(round((age / myseed.maturation) * myseed.growthstages), 1, myseed.growthstages)
plant_overlay.icon_state = "[myseed.icon_grow][t_growthstate]"
if(myseed.modified_colors) //In case we get a different color from other things
plant_overlay.color = myseed.color
add_overlay(plant_overlay)
/obj/machinery/hydroponics/proc/update_icon_lights()
@@ -374,7 +376,7 @@
if(10 to 11)
myseed = new /obj/item/seeds/amanita(src)
if(8 to 9)
myseed = new /obj/item/seeds/chanter(src)
myseed = new /obj/item/seeds/chanterelle(src)
if(6 to 7)
myseed = new /obj/item/seeds/tower(src)
if(4 to 5)
@@ -554,6 +556,8 @@
age = 1
plant_health = myseed.endurance
lastcycle = world.time
for(var/datum/plant_gene/trait/G in myseed.genes)
G.apply_vars(myseed)
update_icon()
return
else
+158
View File
@@ -337,6 +337,164 @@ datum/plant_gene/trait/glow/white
name = "Pink Bioluminescence"
glow_color = "#FFB3DA"
//Change grow, harvest, and crafted food's color
//Made for mostly being fancy with stuff. Should be rare or hard to obtain, with the exception of strange seeds
/datum/plant_gene/trait/modified_color
name = "Dilated Light (Negative)"
var/color = list(-1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,1, 1,1,1,0) //Negative Colors
var/long_calculation = FALSE //For advanced color matrices
/datum/plant_gene/trait/modified_color/on_new(obj/item/reagent_containers/food/snacks/grown/G, newloc)
if(G.modified_colors)
return
for(var/datum/plant_gene/trait/I in G.seed.genes) //Have ones first added give priority
if(istype(I, /datum/plant_gene/trait/modified_color) && I.type != type)
return
if(long_calculation)
calculate()
G.color = color
G.modified_colors = TRUE
//same as above but for the gene modder
/datum/plant_gene/trait/modified_color/apply_vars(obj/item/seeds/S)
S.color = color
S.modified_colors = TRUE
/datum/plant_gene/trait/modified_color/proc/calculate()
return
/datum/plant_gene/trait/modified_color/opaque
name = "Dilated Light (Flimsy)"
color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, -0.3,-0.3,-0.3,0.7, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome
name = "Dilated Light (Monochrome)"
color = list(0.5,0.5,0.5,0, 0.5,0.5,0.5,0, 0.5,0.5,0.5,0, 0,0,0,1, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome/red
name = "Dilated Light (Red)"
color = list(0.8,0,0,0, 0.8,0.5,0.5,0, 0.8,0.5,0.5,0, 0,0,0,1, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome/green
name = "Dilated Light (Green)"
color = list(0.5,0.8,0.5,0, 0,0.8,0,0, 0.5,0.8,0.5,0, 0,0,0,1, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome/blue
name = "Dilated Light (Blue)"
color = list(0.5,0.5,0.8,0, 0.5,0.5,0.8,0, 0,0,0.8,0, 0,0,0,1, 0,0,0,0)
/*
/datum/plant_gene/trait/modified_color/monochrome/yellow
name = "Dilated Light (Yellow)"
color = list(0.8,0,0,0, 0,0.4,0,0, 0.8,0.4,0.5,0, 0,0,0,1, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome/green
name = "Dilated Light (Green)"
color = list(0.5,0.8,0.4,0, 0,0.8,0,0, 0,0,0.4,0, 0,0,0,1, 0,0,0,0)
*/
/datum/plant_gene/trait/modified_color/monochrome/dark/
name = "Dilated Light (Dark)"
color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, -0.3, -0.3, -0.3, 0)
/*
/datum/plant_gene/trait/modified_color/monochrome/dark/red //for vyx
name = "Dilated Light (Dark Red)"
color = list(1,0,0,0, 0.5,0.5,0.5,0, 0.5,0.5,0.5,0, 0,0,0,1, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome/dark/green
name = "Dilated Light (Dark Green)"
color = list(0.5,0.5,0.5,0, 0,1,0,0, 0.5,0.5,0.5,0, 0,0,0,1, 0,0,0,0)
/datum/plant_gene/trait/modified_color/monochrome/dark/blue
name = "Dilated Light (Dark Blue)"
color = list(0.5,0.5,0.,0, 0.5,0.5,0.5,0, 0,0,1,0, 0,0,0,1, 0,0,0,0)
*/
/datum/plant_gene/trait/modified_color/vibrant
name = "Dilated Light (Strong)"
color = list(2,-1,-1,0, -1,2,-1,0, -1,-1,2,0, 0,0,0,1, 0,0,0,0) //Any higher starts to look like clown vomit
/datum/plant_gene/trait/modified_color/cyan
name = "Dilated Light (Shift R)"
color = list(
0.25, 1, 0.5, 0,
0.5, 0.25, 1, 0,
1, 0.5, 0.25, 0,
0,0,0,1,
0,0,0,0)
/datum/plant_gene/trait/modified_color/magenta
name = "Dilated Light (Shift L)"
color = list(
0.25, 0.5, 1, 0,
1, 0.25, 0.5, 0,
0.5, 1, 0.25, 0,
0,0,0,1,
0,0,0,0)
/datum/plant_gene/trait/modified_color/sunset
name = "Dilated Light (Shift S)"
color = list(
1, 0.25, 0, 0,
0.25, 1, 0, 0,
0.25, 0.125, 0.35,0,
0,0,0,1,
0,0,0,0)
/datum/plant_gene/trait/modified_color/random
name = "Dilated Light (Shift C)"
color = list()
long_calculation = TRUE
//Calculations
/*
/datum/plant_gene/trait/modified_color/shift_red/calculate()
var/list/M = color
M[5] += 0.5 * M[1]
M[6] += 0.5 * M[2]
M[7] += 0.5 * M[3]
color = M
/datum/plant_gene/trait/modified_color/shift_green/calculate()
var/list/M = color
M[9] += 0.5 * M[5]
M[10] += 0.5 * M[6]
M[11] += 0.5 * M[7]
color = M
/datum/plant_gene/trait/modified_color/shift_blue/calculate()
var/list/M = color
M[13] += 0.5 * M[9]
M[14] += 0.5 * M[10]
M[15] += 0.5 * M[11]
color = M
*/
/datum/plant_gene/trait/modified_color/random/calculate()
var/R = rand(0,255) / 255
var/G = rand(0,255) / 255
var/B = rand(0,255) / 255
var/A = rand(200,255)/ 255
if(prob(50))
color = list(R,0,0,0,
0,G,0,0,
0,0,B,0,
0,0,0,1,
0,0,0,0)
else
color = list(R,0,0,0,
0,G,0,0,
0,0,B,0,
0,0,0,A,
0,0,0,0)
var/D = rand(1,20)
if(color[D] != 0)
color[D] *= 1.5
else
color[D] = rand(-100, 100) * 0.01
/datum/plant_gene/trait/teleport
// Makes plant teleport people when squashed or slipped on.
+1 -1
View File
@@ -18,4 +18,4 @@
/obj/item/seeds/sample/alienweed
name = "alien weed sample"
icon_state = "alienweed"
sample_color = null
sample_color = null
+17 -1
View File
@@ -36,6 +36,7 @@
var/weed_rate = 1 //If the chance below passes, then this many weeds sprout during growth
var/weed_chance = 5 //Percentage chance per tray update to grow weeds
var/modified_colors = FALSE
/obj/item/seeds/Initialize(mapload, nogenes = 0)
. = ..()
@@ -73,6 +74,8 @@
/obj/item/seeds/examine(mob/user)
. = ..()
if(modified_colors)
. += "It looks a bit funky..."
. += "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
if(reagents_add && user.can_see_reagents())
. += "<span class='notice'>- Plant Reagents -</span>"
@@ -99,6 +102,9 @@
var/datum/plant_gene/G = g
S.genes += G.Copy()
S.reagents_add = reagents_add.Copy() // Faster than grabbing the list from genes.
if(modified_colors)
S.modified_colors = TRUE
S.color = color
return S
/obj/item/seeds/proc/get_gene(typepath)
@@ -191,6 +197,10 @@
result.Add(t_prod) // User gets a consumable
if(!t_prod)
return
if(modified_colors)
t_prod.color = color
t_prod.modified_colors = TRUE
t_amount++
product_name = parent.myseed.plantname
if(getYield() >= 1)
@@ -470,10 +480,16 @@
/obj/item/seeds/proc/add_random_traits(lower = 0, upper = 2)
var/amount_random_traits = rand(lower, upper)
for(var/i in 1 to amount_random_traits)
var/random_trait = pick((subtypesof(/datum/plant_gene/trait)-typesof(/datum/plant_gene/trait/plant_type)))
var/random_trait
if(!istype(src, /obj/item/seeds/random) || prob(30)) //70% chance to not get modified_color when rolling traits as strange seeds
random_trait = pick((subtypesof(/datum/plant_gene/trait)-typesof(/datum/plant_gene/trait/plant_type)))
else
random_trait = pick((subtypesof(/datum/plant_gene/trait)-typesof(/datum/plant_gene/trait/plant_type)-typesof(/datum/plant_gene/trait/modified_color)))
var/datum/plant_gene/trait/T = new random_trait
if(T.can_add(src) && !is_gene_forbidden(random_trait))
genes += T
T.apply_vars(src)
else
qdel(T)