Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduces Gene Shears to Botany, and several other QOL tweaks. #50387

Merged
merged 16 commits into from Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions code/modules/hydroponics/hydroitemdefines.dm
Expand Up @@ -185,6 +185,24 @@
attack_verb = list("slashed", "sliced", "cut", "clawed")
hitsound = 'sound/weapons/bladeslice.ogg'

/obj/item/geneshears
name = "Botanogenetic Plant Shears"
desc = "A high tech, high fidelity pair of plant shears, capable of cutting genetic traits out of a plant."
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "genesheers"
item_state = "secateurs"
lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi'
flags_1 = CONDUCT_1
force = 10
throwforce = 8
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
custom_materials = list(/datum/material/iron=4000, /datum/material/uranium=1500, /datum/material/gold=500)
attack_verb = list("slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'


// *************************************
// Nutrient defines for hydroponics
// *************************************
Expand Down
55 changes: 42 additions & 13 deletions code/modules/hydroponics/hydroponics.dm
Expand Up @@ -62,7 +62,7 @@
/obj/machinery/hydroponics/Initialize()
//ALRIGHT YOU DEGENERATES. YOU HAD REAGENT HOLDERS FOR AT LEAST 4 YEARS AND NONE OF YOU MADE HYDROPONICS TRAYS HOLD NUTRIENT CHEMS INSTEAD OF USING "Points".
//SO HERE LIES THE "nutrilevel" VAR. IT'S DEAD AND I PUT IT OUT OF IT'S MISERY. USE "reagents" INSTEAD. ~ArcaneMusic, accept no substitutes.
create_reagents(10)
create_reagents(20)
. = ..()


Expand All @@ -78,8 +78,8 @@
for (var/obj/item/stock_parts/manipulator/M in component_parts)
rating = M.rating
maxwater = tmp_capacity * 50 // Up to 300
maxnutri = tmp_capacity * 5 // Up to 30
reagents.maximum_volume = maxnutri
maxnutri = (tmp_capacity * 5) +10 // Up to 30
reagents.maximum_volume = maxnutri + 10
ArcaneMusic marked this conversation as resolved.
Show resolved Hide resolved
nutridrain = 1/rating

/obj/machinery/hydroponics/constructable/examine(mob/user)
Expand Down Expand Up @@ -252,10 +252,9 @@

//This is where stability mutations exist now.
switch(myseed.instability)
if(80 to 100)
if(prob(20))
mutate(0, 0, 0, 0, 0, 0, 0, 10, 0) //Exceedingly low odds of gaining a trait.
if(60 to 79)
if(100 to 80)
mutate(0, 0, 0, 0, 0, 0, 0, 2, 0) //Exceedingly low odds of gaining a trait.
if(79 to 60)
if(prob((myseed.instability)/2) && !self_sustaining)
mutatespecie()
myseed.instability = myseed.instability/2
Expand Down Expand Up @@ -382,11 +381,11 @@
else
. += "<span class='info'>It's empty.</span>"

if(!self_sustaining)

. += "<span class='info'>Water: [waterlevel]/[maxwater].</span>\n"+\
"<span class='info'>Nutrient: [reagents.total_volume]/[maxnutri].</span>"
else
. += "<span class='info'>It doesn't require any water or nutrients.</span>"
if(self_sustaining)
. += "<span class='info'>The tray's autogrow is active, protecting it from species mutations, weeds, and pests.</span>"

if(weedlevel >= 5)
to_chat(user, "<span class='warning'>It's filled with weeds!</span>")
Expand Down Expand Up @@ -536,6 +535,10 @@
to_chat(user, "<span class='warning'>[reagent_source] is empty!</span>")
return 1

if(reagents.total_volume >= reagents.maximum_volume)
to_chat(user, "<span class='notice'>[src] is full.</span>")
return

var/list/trays = list(src)//makes the list just this in cases of syringes and compost etc
var/target = myseed ? myseed.plantname : src
var/visi_msg = ""
Expand Down Expand Up @@ -619,8 +622,6 @@
var/list/text_string = myseed.get_analyzer_text()
if(text_string)
to_chat(user, text_string)
return
else
to_chat(user, "<B>No plant found.</B>")
to_chat(user, "- Weed level: <span class='notice'>[weedlevel] / 10</span>")
to_chat(user, "- Pest level: <span class='notice'>[pestlevel] / 10</span>")
Expand Down Expand Up @@ -648,7 +649,7 @@
to_chat(user, "<span class='notice'>This plant must be harvestable in order to be grafted.</span>")
return
else if(myseed.grafted)
to_chat(user, "<span class='notice'>This plant has already been grafted.</span>")
to_chat(user, "<span class='notice'>This plant has already had something sheared or grafted off from it.</span>")
ArcaneMusic marked this conversation as resolved.
Show resolved Hide resolved
return
else
user.visible_message("<span class='notice'>[user] grafts off a limb from [src].</span>", "<span class='notice'>You carefully graft off a portion of [src].</span>")
Expand All @@ -660,6 +661,34 @@
adjustHealth(-5)
return

else if(istype(O, /obj/item/geneshears))
if(!myseed)
to_chat(user, "<span class='notice'>The tray is empty.</span>")
return
if(plant_health <= 15)
to_chat(user, "<span class='notice'>This plant looks too unhealty to be sheared right now.</span>")
return

var/list/current_traits = list()
for(var/datum/plant_gene/gene in myseed.genes)
if(istype(gene, /datum/plant_gene/core) || (istype(gene,/datum/plant_gene/trait/plant_type)) || islist(gene))
continue
current_traits[gene.name] = gene
var/removed_trait = (input(user, "Select a trait to remove from the [myseed.plantname].", "Plant Trait Removal") as null|anything in sortList(current_traits))
if(removed_trait == null)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
for(var/datum/plant_gene/gene in myseed.genes)
if(gene.name == removed_trait)
if(myseed.genes.Remove(gene))
qdel(gene)
break
myseed.reagents_from_genes()
adjustHealth(-15)
to_chat(user, "<span class='notice'>You carefully shear the genes off of the [myseed.plantname], but leaving the plant looking a bit weak.</span>")
return

else if(istype(O, /obj/item/graft))
var/obj/item/graft/snip = O
var/datum/plant_gene/trait/new_trait = snip.stored_trait
Expand Down
6 changes: 3 additions & 3 deletions code/modules/hydroponics/hydroponics_chemreact.dm
Expand Up @@ -7,9 +7,9 @@
if(myseed)
myseed.on_chem_reaction(reagents) //In case seeds have some special interactions with special chems, currently only used by vines
//FINE WE'LL DO IT THIS WAY.
for(var/c in reagents.reagent_list)
var/datum/reagent/chem = c
chem.on_hydroponics_apply(myseed, reagents, src, user)
for(var/datum/reagent/chem in reagents.reagent_list)
if(chem)
chem.on_hydroponics_apply(myseed, reagents, src, user)
ArcaneMusic marked this conversation as resolved.
Show resolved Hide resolved

/obj/machinery/hydroponics/proc/mutation_roll(mob/user)
switch(rand(100))
Expand Down
10 changes: 0 additions & 10 deletions code/modules/hydroponics/seeds.dm
Expand Up @@ -536,13 +536,3 @@
for(var/i in 1 to amount_random_reagents)
var/datum/reagent/chemical = pick(reagents_add)
qdel(chemical)

/obj/item/seeds/proc/remove_random_traits(lower = 0, upper = 2)
var/list/genepool = list()
var/amount_random_traits = rand(lower, upper)
for(var/datum/plant_gene/trait in genes)
genepool += trait

for(var/i in 1 to amount_random_traits)
var/datum/plant_gene/planted_gene = pick(genepool)
qdel(planted_gene)
38 changes: 0 additions & 38 deletions code/modules/reagents/chemistry/reagents/toxin_reagents.dm
Expand Up @@ -972,41 +972,3 @@
to_chat(M, "<span class='notice'>Ah, what was that? You thought you heard something...</span>")
M.confused += 5
return ..()

/datum/reagent/toxin/plantthinner
name = "Plant Thinner"
description = "Contains a chemical that can help in weeding out unwanted chemical traits in plants."
color = "#3b7269" // rgb: 127, 132, 0
toxpwr = 0.6
taste_description = "burnt grass"

/datum/reagent/plantthinner/on_mob_life(mob/living/carbon/M)
M.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.3)
M.confused += 1
return ..()

//It's paint thinner, for plants!
/datum/reagent/plantthinner/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(prob(40))
myseed.remove_random_reagents(1,1)
mytray.adjustToxic(3)

/datum/reagent/toxin/plantthinner/trait
name = "Trait Thinner"
description = "Contains a stronger variant of plant thinner, capable of genetically stunting certain traits out of plants."
color = "#31100a" // rgb: 127, 132, 0
toxpwr = 1.5
taste_description = "burnt hair"

/datum/reagent/plantthinner/trait/on_mob_life(mob/living/carbon/M)
M.adjustOrganLoss(ORGAN_SLOT_LUNGS, 1.1)
M.confused += 3
return ..()

//It's paint thinner, for plants!
/datum/reagent/plantthinner/trait/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(prob(40))
myseed.remove_random_traits(1,1)
mytray.adjustToxic(6)
9 changes: 9 additions & 0 deletions code/modules/reagents/chemistry/recipes/others.dm
Expand Up @@ -49,6 +49,15 @@
for(var/i = 1, i <= created_volume, i++)
new /obj/item/stack/sheet/mineral/gold(location)

/datum/chemical_reaction/uraniumsolidification
required_reagents = list(/datum/reagent/consumable/frostoil = 5, /datum/reagent/uranium = 20, /datum/reagent/potassium = 1)
mob_react = FALSE

/datum/chemical_reaction/uraniumsolidification/on_reaction(datum/reagents/holder, created_volume)
var/location = get_turf(holder.my_atom)
for(var/i = 1, i <= created_volume, i++)
new /obj/item/stack/sheet/mineral/uranium(location)

/datum/chemical_reaction/capsaicincondensation
results = list(/datum/reagent/consumable/condensedcapsaicin = 5)
required_reagents = list(/datum/reagent/consumable/capsaicin = 1, /datum/reagent/consumable/ethanol = 5)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/research/designs/tool_designs.dm
Expand Up @@ -93,6 +93,16 @@
category = list("Tool Designs")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO

/datum/design/geneshears
name = "Botanogenetic Plant Shears"
desc = "A high tech, high fidelity pair of plant shears, capable of cutting genetic traits out of a plant."
id = "gene_shears"
build_path = /obj/item/geneshears
build_type = PROTOLATHE
materials = list(/datum/material/iron=4000, /datum/material/uranium=1500, /datum/material/silver=500)
category = list("Tool Designs")
departmental_flags = DEPARTMENTAL_FLAG_SERVICE

/////////////////////////////////////////
//////////////Alien Tools////////////////
/////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion code/modules/research/techweb/all_nodes.dm
Expand Up @@ -563,7 +563,7 @@
id = "exp_tools"
display_name = "Experimental Tools"
description = "Highly advanced tools."
design_ids = list("exwelder", "jawsoflife", "handdrill", "laserscalpel", "mechanicalpinches", "searingtool")
design_ids = list("exwelder", "jawsoflife", "handdrill", "laserscalpel", "mechanicalpinches", "searingtool", "gene_shears")
prereq_ids = list("adv_engi")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
export_price = 5000
Expand Down
Binary file modified icons/obj/hydroponics/equipment.dmi
Binary file not shown.