diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index 70fae57a0bb8..fad5063ec7e7 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -426,6 +426,10 @@ var/read_only = 0 //Well, it's still a floppy disk obj_flags = UNIQUE_RENAME +/obj/item/disk/plantgene/syndicate // Monkestation item + gene = new /datum/plant_gene/trait/noreact + read_only = 1 + /obj/item/disk/plantgene/Initialize(mapload) . = ..() add_overlay("datadisk_gene") diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 274a88418671..b014ecf116e8 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -42,6 +42,8 @@ var/alt_icon /// Should we pixel offset ourselves at init? for mapping var/offset_at_init = TRUE + //This volume can be altered by densified chemicals trait + var/volume_rate = 1 //Monkestation Edit /obj/item/food/grown/Initialize(mapload, obj/item/seeds/new_seed) if(!tastes) @@ -65,16 +67,26 @@ make_dryable() // Go through all traits in their genes and call on_new_plant from them. + //TODO: We need a priority queue for traits,some of them need to be called first for(var/datum/plant_gene/trait/trait in seed.genes) trait.on_new_plant(src, loc) + //Needs to be run after traits are called because some of them alter max_volume and volume_rate + //Since traits do not know in which order they were run we need to do it here + max_volume *= volume_rate //Monkestation Edit + // Set our default bitesize: bite size = 1 + (potency * 0.05) * (max_volume * 0.01) * modifier // A 100 potency, non-densified plant = 1 + (5 * 1 * modifier) = 6u bite size // For reference, your average 100 potency tomato has 14u of reagents - So, with no modifier it is eaten in 3 bites bite_consumption = 1 + round(max((seed.potency * BITE_SIZE_POTENCY_MULTIPLIER), 1) * (max_volume * BITE_SIZE_VOLUME_MULTIPLIER) * bite_consumption_mod) . = ..() //Only call it here because we want all the genes and shit to be applied before we add edibility. God this code is a mess. - + //Monkestation Edit Begin + //We want this trait to run after reagents component is added to the plant + var/datum/plant_gene/trait/trait_noreact = seed.get_gene(/datum/plant_gene/trait/noreact) + if(trait_noreact) + trait_noreact.on_new_plant(src, loc) + //Monkestation Edit End seed.prepare_result(src) transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency! diff --git a/code/modules/hydroponics/grown/mushrooms.dm b/code/modules/hydroponics/grown/mushrooms.dm index 8d88dba452f6..f00b980b793e 100644 --- a/code/modules/hydroponics/grown/mushrooms.dm +++ b/code/modules/hydroponics/grown/mushrooms.dm @@ -232,7 +232,7 @@ potency = 30 //-> brightness growthstages = 4 rarity = 20 - genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/trait/potencylimit) + genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' possible_mutations = list(/datum/hydroponics/plant_mutation/glow_cap, /datum/hydroponics/plant_mutation/shadow_shroom) reagents_add = list(/datum/reagent/uranium/radium = 0.1, /datum/reagent/phosphorus = 0.1, /datum/reagent/consumable/nutriment = 0.04) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 4f92ba56807e..337e5b448bf4 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -587,8 +587,7 @@ var/obj/item/food/grown/grown_plant = our_plant if(istype(grown_plant, /obj/item/food/grown)) - //Grown foods use the edible component so we need to change their max_volume var - grown_plant.max_volume *= rate + grown_plant.volume_rate = rate //Monkestation Edit else //Grown inedibles however just use a reagents holder, so. our_plant.reagents?.maximum_volume *= rate @@ -1025,8 +1024,3 @@ /datum/plant_gene/trait/plant_type/alien_properties name ="?????" icon = "reddit-alien" - -/datum/plant_gene/trait/seedless - name = "Seedless" - description = "The plant is unable to produce seeds" - mutability_flags = PLANT_GENE_REMOVABLE | PLANT_GENE_MUTATABLE | PLANT_GENE_GRAFTABLE diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index e5f2a15b6f81..0da6d6a811a4 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -429,11 +429,6 @@ return var/max_potency = MAX_PLANT_YIELD - for(var/datum/plant_gene/trait/trait in genes) - if(trait.trait_flags & TRAIT_LIMIT_POTENCY) - max_potency = 100 - break - potency = clamp(potency + adjustamt, 0, max_potency) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) if(C) diff --git a/code/modules/hydroponics/unique_plant_genes.dm b/code/modules/hydroponics/unique_plant_genes.dm index 61bde105bc9f..938ecadb78d8 100644 --- a/code/modules/hydroponics/unique_plant_genes.dm +++ b/code/modules/hydroponics/unique_plant_genes.dm @@ -499,7 +499,6 @@ . = ..() if(!.) return - var/obj/item/food/grown/grown_plant = our_plant if(istype(grown_plant)) grown_plant.max_volume = new_capcity diff --git a/monkestation/code/modules/hydroponics/plant_genes.dm b/monkestation/code/modules/hydroponics/plant_genes.dm index 293eb65d1d40..60d8e6519f38 100644 --- a/monkestation/code/modules/hydroponics/plant_genes.dm +++ b/monkestation/code/modules/hydroponics/plant_genes.dm @@ -2,14 +2,26 @@ * this limits potency, it is used for plants that have strange behavior above 100 potency. * */ -/datum/plant_gene/trait/potencylimit - name = "potency limiter" - icon = "lightbulb" - description = "limits potency to 100, used for some plants to avoid lag and similar issues." - trait_flags = TRAIT_LIMIT_POTENCY - mutability_flags = PLANT_GENE_GRAFTABLE - -/datum/plant_gene/trait/potencylimit/on_new_plant(obj/item/our_plant, newloc) + +/datum/plant_gene/trait/seedless + name = "Seedless" + description = "The plant is unable to produce seeds" + mutability_flags = PLANT_GENE_REMOVABLE | PLANT_GENE_MUTATABLE | PLANT_GENE_GRAFTABLE + +/datum/plant_gene/trait/noreact + name = "Catalytic Inhibitor Serum" + description = "This genetic trait enables the plant to produce a serum that effectively halts chemical reactions within its tissues." + mutability_flags = PLANT_GENE_REMOVABLE | PLANT_GENE_GRAFTABLE + +/datum/plant_gene/trait/noreact/on_new_plant(obj/item/our_plant, newloc) . = ..() if(!.) return + ENABLE_BITFIELD(our_plant.reagents.flags, NO_REACT) + RegisterSignal(our_plant, COMSIG_PLANT_ON_SQUASH, PROC_REF(noreact_on_squash)) + +/datum/plant_gene/trait/noreact/proc/noreact_on_squash(obj/item/our_plant, atom/target) + SIGNAL_HANDLER + + DISABLE_BITFIELD(our_plant.reagents.flags, NO_REACT) + our_plant.reagents.handle_reactions() diff --git a/monkestation/code/modules/uplink/uplink_items/job.dm b/monkestation/code/modules/uplink/uplink_items/job.dm index 2395ddbf650a..b69c2d2de964 100644 --- a/monkestation/code/modules/uplink/uplink_items/job.dm +++ b/monkestation/code/modules/uplink/uplink_items/job.dm @@ -63,3 +63,11 @@ pod.custom_objective = objective pod.RefreshParts() pod.locked = TRUE // The pod shouldn't be eligible for cloner event. + +/datum/uplink_item/role_restricted/syndicate_plant_gene + name = "Catalytic Inhibitor Serum Plant Data Disk" + desc = "This plant data disk contains the genetic blueprint for the Catalytic Inhibitor Serum gene.\ + enabling plants to produce a serum that halts all internal chemical reactions" + item = /obj/item/disk/plantgene/syndicate + cost = 20 + restricted_roles = list(JOB_BOTANIST)