Merge pull request #13314 from TheObserver-sys/ArcaneNutriMutaPort

No more chemspam: Ports portions of ArcaneMusic's botany rework from TG.
This commit is contained in:
silicons
2020-10-01 12:15:49 -07:00
committed by GitHub
39 changed files with 668 additions and 482 deletions

12
code/__DEFINES/botany.dm Normal file
View File

@@ -0,0 +1,12 @@
#define TRAY_NAME_UPDATE name = myseed ? "[initial(name)] ([myseed.plantname])" : initial(name)
#define YIELD_WEED_MINIMUM 3
#define YIELD_WEED_MAXIMUM 10
#define STATIC_NUTRIENT_CAPACITY 10
//Both available scanning modes for the plant analyzer.
#define PLANT_SCANMODE_STATS 0
#define PLANT_SCANMODE_CHEMICALS 1
//Seed flags.
#define MUTATE_EARLY (1<<0)

View File

@@ -22,6 +22,7 @@
endurance = 25
yield = 6
potency = 5
instability = 30
icon_dead = "ambrosia-dead"
genes = list(/datum/plant_gene/trait/repeated_harvest)
mutatelist = list(/obj/item/seeds/ambrosia/deus)

View File

@@ -8,6 +8,7 @@
product = /obj/item/reagent_containers/food/snacks/grown/banana
lifespan = 50
endurance = 30
instability = 10
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
icon_dead = "banana-dead"
genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest)

View File

@@ -10,6 +10,7 @@
maturation = 5
production = 5
yield = 2
instability = 30
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
icon_grow = "berry-grow" // Uses one growth icons set for all the subtypes
icon_dead = "berry-dead" // Same for the dead icon

View File

@@ -9,6 +9,7 @@
maturation = 8
potency = 20
growthstages = 1
instability = 40
growing_icon = 'goon/icons/obj/hydroponics.dmi'
icon_grow = "cannabis-grow" // Uses one growth icons set for all the subtypes
icon_dead = "cannabis-dead" // Same for the dead icon

View File

@@ -9,6 +9,7 @@
production = 1
yield = 4
potency = 15
instability = 20
icon_dead = "wheat-dead"
mutatelist = list(/obj/item/seeds/wheat/oat, /obj/item/seeds/wheat/meat)
reagents_add = list(/datum/reagent/consumable/nutriment = 0.04)

View File

@@ -11,6 +11,7 @@
production = 5
yield = 4
potency = 20
instability = 30
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
icon_grow = "chili-grow" // Uses one growth icons set for all the subtypes
icon_dead = "chili-dead" // Same for the dead icon

View File

@@ -10,6 +10,7 @@
maturation = 5
production = 5
yield = 2
instability = 20
growthstages = 5
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
icon_grow = "cocoapod-grow"

View File

@@ -8,6 +8,7 @@
product = /obj/item/reagent_containers/food/snacks/grown/corn
maturation = 8
potency = 20
instability = 50 // Corn used to be wheatgrass, but through generations of selective cultivation...
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
icon_grow = "corn-grow" // Uses one growth icons set for all the subtypes

View File

@@ -12,6 +12,7 @@
production = 1
yield = 2
potency = 50
instability = 15
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing.dmi'
icon_dead = "cotton-dead"

View File

@@ -11,6 +11,7 @@
maturation = 2
production = 5
yield = 5
instability = 10
growthstages = 2
icon_grow = "grass-grow"
icon_dead = "grass-dead"

View File

@@ -11,6 +11,7 @@
lifespan = 20
endurance = 10
yield = 4
instability = 55
growthstages = 4
rarity = 30
var/list/mutations = list()

View File

@@ -8,6 +8,7 @@
product = /obj/item/reagent_containers/food/snacks/grown/watermelon
lifespan = 50
endurance = 40
instability = 20
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
icon_dead = "watermelon-dead"
genes = list(/datum/plant_gene/trait/repeated_harvest)
@@ -75,4 +76,4 @@
to_chat(user, "<span class='warning'>[src] rapidly turns into ash!</span>")
qdel(src)
new /obj/effect/decal/cleanable/ash(drop_location())
*/
*/

View File

@@ -11,6 +11,7 @@
production = 1
yield = 6
potency = 10
instability = 35
growthstages = 3
grind_results = list(/datum/reagent/mustardgrind = 1)
growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi'
@@ -111,6 +112,7 @@
maturation = 3
production = 5
yield = 4
instability = 10
growthstages = 1
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
genes = list(/datum/plant_gene/trait/repeated_harvest)
@@ -140,6 +142,7 @@
endurance = 50
maturation = 3
yield = 4
instability = 15
growthstages = 2
reagents_add = list(/datum/reagent/consumable/sugar = 0.25)
mutatelist = list(/obj/item/seeds/bamboo)
@@ -534,4 +537,4 @@
/obj/item/reagent_containers/food/snacks/grown/aloe/microwave_act(obj/machinery/microwave/M)
new /obj/item/stack/medical/aloe(drop_location(), 2)
qdel(src)
qdel(src)

View File

@@ -18,6 +18,7 @@
production = 5
yield = 4
potency = 15
instability = 30
growthstages = 4
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
@@ -43,6 +44,7 @@
maturation = 10
production = 5
yield = 4
instability = 30
growthstages = 3
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
@@ -187,6 +189,7 @@
production = 1
yield = 5
potency = 15
instability = 20
growthstages = 3
genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism)
growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
@@ -244,6 +247,7 @@
production = 1
yield = 3 //-> spread
potency = 30 //-> brightness
instability = 20
growthstages = 4
rarity = 20
genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/plant_type/fungal_metabolism)
@@ -334,4 +338,4 @@
/obj/item/reagent_containers/food/snacks/grown/mushroom/glowshroom/shadowshroom/attack_self(mob/user)
. = ..()
if(.)
investigate_log("was planted by [key_name(user)] at [AREACOORD(user)]", INVESTIGATE_BOTANY)
investigate_log("was planted by [key_name(user)] at [AREACOORD(user)]", INVESTIGATE_BOTANY)

View File

@@ -8,6 +8,7 @@
lifespan = 30
endurance = 40 // tuff like a toiger
yield = 4
instability = 25
growthstages = 5
genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/plant_type/weed_hardy)
mutatelist = list(/obj/item/seeds/nettle/death)

View File

@@ -10,6 +10,7 @@
production = 4
yield = 6
endurance = 25
instability = 10
growthstages = 3
weed_chance = 3
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'

View File

@@ -8,6 +8,7 @@
product = /obj/item/reagent_containers/food/snacks/grown/peas
maturation = 3
potency = 25
instability = 15
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
icon_grow = "peas-grow"
@@ -79,6 +80,7 @@
potency = 75
yield = 1
production = 10
instability = 45 //The world is a very unstable place. Constantly changing.
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
icon_grow = "worldpeas-grow"

View File

@@ -9,6 +9,7 @@
maturation = 10
production = 1
yield = 5
instability = 15
growthstages = 3
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
mutatelist = list(/obj/item/seeds/carrot/parsnip)
@@ -69,6 +70,7 @@
lifespan = 60
endurance = 50
yield = 6
instability = 10
growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi'
icon_dead = "whitebeet-dead"
mutatelist = list(/obj/item/seeds/redbeet)

View File

@@ -79,6 +79,7 @@
maturation = 5
production = 5
yield = 5
instability = 20
growthstages = 5
icon_dead = "coffee-dead"
genes = list(/datum/plant_gene/trait/repeated_harvest)

View File

@@ -6,6 +6,7 @@
species = "tomato"
plantname = "Tomato Plants"
product = /obj/item/reagent_containers/food/snacks/grown/tomato
instability = 25
maturation = 8
growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi'
icon_grow = "tomato-grow"

View File

@@ -1,7 +1,7 @@
// Plant analyzer
/obj/item/plant_analyzer
name = "plant analyzer"
desc = "A scanner used to evaluate a plant's various areas of growth."
desc = "A scanner used to evaluate a plant's various areas of growth, and genetic traits."
icon = 'icons/obj/device.dmi'
icon_state = "hydro"
item_state = "analyzer"
@@ -10,6 +10,25 @@
w_class = WEIGHT_CLASS_TINY
slot_flags = ITEM_SLOT_BELT
custom_materials = list(/datum/material/iron=30, /datum/material/glass=20)
var/scan_mode = PLANT_SCANMODE_STATS
/obj/item/plant_analyzer/attack_self(mob/user)
. = ..()
scan_mode = !scan_mode
to_chat(user, "<span class='notice'>You switch [src] to [scan_mode == PLANT_SCANMODE_CHEMICALS ? "scan for chemical reagents and traits" : "scan for plant growth statistics"].</span>")
/obj/item/plant_analyzer/attack(mob/living/M, mob/living/carbon/human/user)
//Checks if target is a podman
if(ispodperson(M))
user.visible_message("<span class='notice'>[user] analyzes [M]'s vitals.</span>", \
"<span class='notice'>You analyze [M]'s vitals.</span>")
if(scan_mode== PLANT_SCANMODE_STATS)
healthscan(user, M, advanced = TRUE)
else
chemscan(user, M)
add_fingerprint(user)
return
return ..()
// *************************************
// Hydroponics Tools

View File

@@ -6,9 +6,10 @@
pixel_z = 8
obj_flags = CAN_BE_HIT | UNIQUE_RENAME
circuit = /obj/item/circuitboard/machine/hydroponics
idle_power_usage = 0
var/waterlevel = 100 //The amount of water in the tray (max 100)
var/maxwater = 100 //The maximum amount of water in the tray
var/nutrilevel = 10 //The amount of nutrient in the tray (max 10)
var/nutridrain = 1 // How many units of nutrient will be drained in the tray
var/maxnutri = 10 //The maximum nutrient of water in the tray
var/pestlevel = 0 //The amount of pests in the tray (max 10)
var/weedlevel = 0 //The amount of weeds in the tray (max 10)
@@ -16,21 +17,25 @@
var/mutmod = 1 //Nutriment's effect on mutations
var/toxic = 0 //Toxicity in the tray?
var/age = 0 //Current age
var/dead = 0 //Is it dead?
var/dead = FALSE //Is it dead?
var/plant_health //Its health
var/lastproduce = 0 //Last time it was harvested
var/lastcycle = 0 //Used for timing of cycles.
var/cycledelay = 200 //About 10 seconds / cycle
var/harvest = 0 //Ready to harvest?
var/harvest = FALSE //Ready to harvest?
var/obj/item/seeds/myseed = null //The currently planted seed
var/rating = 1
var/unwrenchable = 1
var/unwrenchable = TRUE
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant
var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses
var/self_sufficiency_req = 20 //Required total dose to make a self-sufficient hydro tray. 1:1 with earthsblood.
var/self_sufficiency_progress = 0
var/mob/lastuser //Last user to add reagents to a tray. Mostly for logging.
var/self_sustaining = FALSE //If the tray generates nutrients and water on its own
var/canirrigate = TRUE //tin
// Here lies irrigation. You won't be missed, because you were never used.
/obj/machinery/hydroponics/Initialize()
//Here lies "nutrilevel", killed by ArcaneMusic 20??-2019. Finally, we strive for a better future. Please use "reagents" instead
create_reagents(20)
reagents.add_reagent(/datum/reagent/plantnutriment/eznutriment, 10) //Half filled nutrient trays for dirt trays to have more to grow with in prison/lavaland.
. = ..()
/obj/machinery/hydroponics/constructable
name = "hydroponics tray"
@@ -43,14 +48,18 @@
tmp_capacity += M.rating
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
maxwater = tmp_capacity * 50 // Up to 400
maxnutri = (tmp_capacity * 5) + STATIC_NUTRIENT_CAPACITY // Up to 50 Maximum
reagents.maximum_volume = maxnutri
nutridrain = 1/rating
/obj/machinery/hydroponics/constructable/examine(mob/user)
. = ..()
. += "<span class='notice'>Use <b>Ctrl-Click</b> to activate autogrow. <b>Alt-Click</b> to empty the tray's nutrients.</span>"
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Tray efficiency at <b>[rating*100]%</b>.</span>"
/obj/machinery/hydroponics/Destroy()
if(myseed)
qdel(myseed)
@@ -62,34 +71,11 @@
// handle opening the panel
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
return
// handle deconstructing the machine, if permissible
if (I.tool_behaviour == TOOL_CROWBAR && using_irrigation)
to_chat(user, "<span class='warning'>Disconnect the hoses first!</span>")
return
else if(default_deconstruction_crowbar(I))
if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/hydroponics/proc/FindConnected()
var/list/connected = list()
var/list/processing_atoms = list(src)
while(processing_atoms.len)
var/atom/a = processing_atoms[1]
for(var/step_dir in GLOB.cardinals)
var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir)
// Soil plots aren't dense
if(h && h.using_irrigation && h.density && !(h in connected) && !(h in processing_atoms))
processing_atoms += h
processing_atoms -= a
connected += a
return connected
/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
if(!myseed)
return ..()
@@ -107,12 +93,16 @@
if(myseed && (myseed.loc != src))
myseed.forceMove(src)
if(self_sustaining)
adjustNutri(1)
adjustWater(rand(3,5))
adjustWeeds(-2)
adjustPests(-2)
adjustToxic(-2)
if(!powered() && self_sustaining)
visible_message("<span class='warning'>[name]'s auto-grow functionality shuts off!</span>")
idle_power_usage = 0
self_sustaining = FALSE
update_icon()
else if(self_sustaining)
adjustWater(rand(1,2))
adjustWeeds(-1)
adjustPests(-1)
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
@@ -124,13 +114,17 @@
needs_update = 1
//Nutrients//////////////////////////////////////////////////////////////
// Nutrients deplete slowly
if(prob(50))
adjustNutri(-1 / rating)
//Nutrients//////////////////////////////////////////////////////////////
// Nutrients deplete at a constant rate, since new nutrients can boost stats far easier.
apply_chemicals(lastuser)
if(self_sustaining)
reagents.remove_any(min(0.5, nutridrain))
else
reagents.remove_any(nutridrain)
// Lack of nutrients hurts non-weeds
if(nutrilevel <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
if(reagents.total_volume <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-rand(1,3))
//Photosynthesis/////////////////////////////////////////////////////////
@@ -156,7 +150,7 @@
adjustHealth(-rand(0,2) / rating)
// Sufficient water level and nutrient level = plant healthy but also spawns weeds
else if(waterlevel > 10 && nutrilevel > 0)
else if(waterlevel > 10 && reagents.total_volume > 0)
adjustHealth(rand(1,2) / rating)
if(myseed && prob(myseed.weed_chance))
adjustWeeds(myseed.weed_rate)
@@ -201,6 +195,21 @@
if(weedlevel >= 5 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-1 / rating)
//This is where stability mutations exist now.
if(myseed.instability >= 80)
var/mutation_chance = myseed.instability - 75
mutate(0, 0, 0, 0, 0, 0, 0, mutation_chance, 0) //Scaling odds of a random trait or chemical
if(myseed.instability >= 60)
if(prob((myseed.instability)/2) && !self_sustaining && length(myseed.mutatelist)) //Minimum 30%, Maximum 50% chance of mutating every age tick when not on autogrow.
mutatespecie()
myseed.instability = myseed.instability/2
if(myseed.instability >= 40)
if(prob(myseed.instability))
hardmutate()
if(myseed.instability >= 20 )
if(prob(myseed.instability))
mutate()
//Health & Age///////////////////////////////////////////////////////////
// Plant dies if plant_health <= 0
@@ -214,15 +223,14 @@
// Harvest code
if(age > myseed.production && (age - lastproduce) > myseed.production && (!harvest && !dead))
nutrimentMutation()
if(myseed && myseed.yield != -1) // Unharvestable shouldn't be harvested
harvest = 1
harvest = TRUE
else
lastproduce = age
if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase
adjustPests(1 / rating)
else
if(waterlevel > 10 && nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10%
if(waterlevel > 10 && reagents.total_volume > 0 && prob(10)) // If there's no plant, the percentage chance is 10%
adjustWeeds(1 / rating)
// Weeeeeeeeeeeeeeedddssss
@@ -243,25 +251,6 @@
selectedtrait.on_grow(src)
return
/obj/machinery/hydroponics/proc/nutrimentMutation()
if (mutmod == 0)
return
if (mutmod == 1)
if(prob(80)) //80%
mutate()
else if(prob(75)) //15%
hardmutate()
return
if (mutmod == 2)
if(prob(50)) //50%
mutate()
else if(prob(50)) //25%
hardmutate()
else if(prob(50)) //12.5%
mutatespecie()
return
return
/obj/machinery/hydroponics/update_icon()
//Refreshes the icon and sets the luminosity
cut_overlays()
@@ -273,8 +262,6 @@
add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "gaia_blessing"))
set_light(3)
update_icon_hoses()
if(myseed)
update_icon_plant()
update_icon_lights()
@@ -288,15 +275,6 @@
return
/obj/machinery/hydroponics/proc/update_icon_hoses()
var/n = 0
for(var/Dir in GLOB.cardinals)
var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir)
if(t && t.using_irrigation && using_irrigation)
n += Dir
icon_state = "hoses-[n]"
/obj/machinery/hydroponics/proc/update_icon_plant()
var/mutable_appearance/plant_overlay = mutable_appearance(myseed.growing_icon, layer = OBJ_LAYER + 0.01)
if(dead)
@@ -314,7 +292,7 @@
/obj/machinery/hydroponics/proc/update_icon_lights()
if(waterlevel <= 10)
add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lowwater3"))
if(nutrilevel <= 2)
if(reagents.total_volume <= 2)
add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lownutri3"))
if(plant_health <= (myseed.endurance / 2))
add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lowhealth3"))
@@ -337,19 +315,17 @@
else
. += "<span class='info'>It's empty.</span>"
if(!self_sustaining)
. += "<span class='info'>Water: [waterlevel]/[maxwater].</span>"
. += "<span class='info'>Nutrient: [nutrilevel]/[maxnutri].</span>"
if(self_sufficiency_progress > 0)
var/percent_progress = round(self_sufficiency_progress * 100 / self_sufficiency_req)
. += "<span class='info'>Treatment for self-sustenance are [percent_progress]% complete.</span>"
else
. += "<span class='info'>It doesn't require any water or nutrients.</span>"
. += "<span class='info'>Water: [waterlevel]/[maxwater].</span>\n"+\
"<span class='info'>Nutrient: [reagents.total_volume]/[maxnutri].</span>"
if(self_sustaining)
. += "<span class='info'>The tray's autogrow is active, halving active reagent drain, and actively maintaning the plant.</span>"
if(weedlevel >= 5)
. += "<span class='warning'>It's filled with weeds!</span>"
to_chat(user, "<span class='warning'>It's filled with weeds!</span>")
if(pestlevel >= 5)
. += "<span class='warning'>It's filled with tiny worms!</span>"
to_chat(user, "<span class='warning'>It's filled with tiny worms!</span>")
to_chat(user, "" )
/obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens.
@@ -424,11 +400,7 @@
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>[oldPlantName] suddenly mutates into [myseed.plantname]!</span>")
name = "hydroponics tray ([myseed.plantname])"
if(myseed.product)
desc = initial(myseed.product.desc)
else
desc = initial(desc)
TRAY_NAME_UPDATE
/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
if( weedlevel > 5 )
@@ -448,18 +420,23 @@
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>The mutated weeds in [src] spawn some [myseed.plantname]!</span>")
TRAY_NAME_UPDATE
else
to_chat(usr, "<span class='warning'>The few weeds in [src] seem to react, but only for a moment...</span>")
/obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier
/**
* Plant Death Proc.
* Cleans up various stats for the plant upon death, including pests, harvestability, and plant health.
*/
/obj/machinery/hydroponics/proc/plantdies()
plant_health = 0
harvest = 0
harvest = FALSE
pestlevel = 0 // Pests die
lastproduce = 0
if(!dead)
update_icon()
dead = 1
dead = TRUE
/obj/machinery/hydroponics/proc/mutatepest(mob/user)
@@ -471,250 +448,6 @@
else
to_chat(user, "<span class='warning'>The pests seem to behave oddly, but quickly settle down...</span>")
/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S, mob/user)
if(myseed)
myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines
// Requires 5 mutagen to possibly change species.// Poor man's mutagen.
if(S.has_reagent(/datum/reagent/toxin/mutagen, 5) || S.has_reagent(/datum/reagent/radium, 10) || S.has_reagent(/datum/reagent/uranium, 10))
switch(rand(100))
if(91 to 100)
adjustHealth(-10)
to_chat(user, "<span class='warning'>The plant shrivels and burns.</span>")
if(81 to 90)
mutatespecie()
if(66 to 80)
hardmutate()
if(41 to 65)
mutate()
if(21 to 41)
to_chat(user, "<span class='notice'>The plants don't seem to react...</span>")
if(11 to 20)
mutateweed()
if(1 to 10)
mutatepest(user)
else
to_chat(user, "<span class='notice'>Nothing happens...</span>")
// 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen
else if(S.has_reagent(/datum/reagent/toxin/mutagen, 2) || S.has_reagent(/datum/reagent/radium, 5) || S.has_reagent(/datum/reagent/uranium, 5))
hardmutate()
else if(S.has_reagent(/datum/reagent/toxin/mutagen, 1) || S.has_reagent(/datum/reagent/radium, 2) || S.has_reagent(/datum/reagent/uranium, 2))
mutate()
// After handling the mutating, we now handle the damage from adding crude radioactives...
if(S.has_reagent(/datum/reagent/uranium, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/uranium) * 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/uranium) * 2))
if(S.has_reagent(/datum/reagent/radium, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/radium) * 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/radium) * 3)) // Radium is harsher (OOC: also easier to produce)
// Nutriments
if(S.has_reagent(/datum/reagent/plantnutriment/eznutriment, 1))
yieldmod = 1
mutmod = 1
adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/eznutriment) * 1))
if(S.has_reagent(/datum/reagent/plantnutriment/left4zednutriment, 1))
yieldmod = 0
mutmod = 2
adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/left4zednutriment) * 1))
if(S.has_reagent(/datum/reagent/plantnutriment/robustharvestnutriment, 1))
yieldmod = 1.3
mutmod = 0
adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/robustharvestnutriment) *1 ))
// Ambrosia Gaia produces earthsblood.
if(S.has_reagent(/datum/reagent/medicine/earthsblood))
self_sufficiency_progress += S.get_reagent_amount(/datum/reagent/medicine/earthsblood)
if(self_sufficiency_progress >= self_sufficiency_req)
become_self_sufficient()
else if(!self_sustaining)
to_chat(user, "<span class='notice'>[src] warms as it might on a spring day under a genuine Sun.</span>")
// Antitoxin binds shit pretty well. So the tox goes significantly down
if(S.has_reagent(/datum/reagent/medicine/charcoal, 1))
adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/charcoal) * 2))
// Toxins, not good for anything
if(S.has_reagent(/datum/reagent/toxin, 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin) * 2))
// Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now...
if(S.has_reagent(/datum/reagent/consumable/milk, 1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.1))
adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.9))
// Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay?
if(S.has_reagent(/datum/reagent/consumable/ethanol/beer, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.05))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.25))
adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.7))
// Fluorine one of the most corrosive and deadly gasses
if(S.has_reagent(/datum/reagent/fluorine, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 2))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/fluorine) * 2.5))
adjustWater(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 0.5))
adjustWeeds(-rand(1,4))
// Chlorine one of the most corrosive and deadly gasses
if(S.has_reagent(/datum/reagent/chlorine, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/chlorine) * 1.5))
adjustWater(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 0.5))
adjustWeeds(-rand(1,3))
// White Phosphorous + water -> phosphoric acid. That's not a good thing really.
// Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much.
if(S.has_reagent(/datum/reagent/phosphorus, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.75))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.1))
adjustWater(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.5))
adjustWeeds(-rand(1,2))
// Plants should not have sugar, they can't use it and it prevents them getting water/nutients, it is good for mold though...
if(S.has_reagent(/datum/reagent/consumable/sugar, 1))
adjustWeeds(rand(1,2))
adjustPests(rand(1,2))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sugar) * 0.1))
// It is water!
if(S.has_reagent(/datum/reagent/water, 1))
adjustWater(round(S.get_reagent_amount(/datum/reagent/water) * 1))
// Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~
if(S.has_reagent(/datum/reagent/water/holywater, 1))
adjustWater(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 0.1))
// A variety of nutrients are dissolved in club soda, without sugar.
// These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth.
if(S.has_reagent(/datum/reagent/consumable/sodawater, 1))
adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1))
// Sulphuric Acid
if(S.has_reagent(/datum/reagent/toxin/acid, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1.5))
adjustWeeds(-rand(1,2))
// Acid
if(S.has_reagent(/datum/reagent/toxin/acid/fluacid, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 2))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 3))
adjustWeeds(-rand(1,4))
// Plant-B-Gone is just as bad
if(S.has_reagent(/datum/reagent/toxin/plantbgone, 1))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 5))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 6))
adjustWeeds(-rand(4,8))
// Napalm, not known for being good for anything organic
if(S.has_reagent(/datum/reagent/napalm, 1))
if(!(myseed.resistance_flags & FIRE_PROOF))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/napalm) * 6))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/napalm) * 7))
adjustWeeds(-rand(5,9))
//Weed Spray
if(S.has_reagent(/datum/reagent/toxin/plantbgone/weedkiller, 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone/weedkiller) * 0.5))
//old toxicity was 4, each spray is default 10 (minimal of 5) so 5 and 2.5 are the new ammounts
adjustWeeds(-rand(1,2))
//Pest Spray
if(S.has_reagent(/datum/reagent/toxin/pestkiller, 1))
adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/pestkiller) * 0.5))
adjustPests(-rand(1,2))
// Healing
if(S.has_reagent(/datum/reagent/medicine/cryoxadone, 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3))
adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3))
// Ammonia is bad ass.
if(S.has_reagent(/datum/reagent/ammonia, 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.5))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/ammonia) * 1))
if(myseed)
myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.01))
// Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants
if(S.has_reagent(/datum/reagent/saltpetre, 1))
var/salt = S.get_reagent_amount(/datum/reagent/saltpetre)
adjustHealth(round(salt * 0.25))
if (myseed)
myseed.adjust_production(-round(salt/100)-prob(salt%100))
myseed.adjust_potency(round(salt*0.5))
// Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer
if(S.has_reagent(/datum/reagent/ash, 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/ash) * 0.25))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/ash) * 0.5))
adjustWeeds(-1)
// Diethylamine is more bad ass, and pests get hurt by the corrosive nature of it, not the plant.
if(S.has_reagent(/datum/reagent/diethylamine, 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 2))
if(myseed)
myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 0.02))
adjustPests(-rand(1,2))
// Nutriment Compost, effectively
if(S.has_reagent(/datum/reagent/consumable/nutriment, 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 0.5))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 1))
// Virusfood Compost for EVERYTHING
if(S.has_reagent(/datum/reagent/toxin/mutagen/mutagenvirusfood, 1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5))
// Blood
if(S.has_reagent(/datum/reagent/blood, 1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/blood) * 1))
adjustPests(rand(2,4))
// Strange reagent
if(S.has_reagent(/datum/reagent/medicine/strange_reagent, 1))
spawnplant()
// Honey, Pests are dieing of sugar, so is the plant
if(S.has_reagent(/datum/reagent/consumable/honey, 1))
adjustPests(-rand(2,5))
adjustHealth(-round(S.get_reagent_amount(/datum/reagent/consumable/honey) * 1))
// Buzz Fuzz, a drink seemingly made for plants...
if(S.has_reagent(/datum/reagent/consumable/buzz_fuzz, 1))
adjustPests(-rand(2,5))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/buzz_fuzz) * 0.1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/buzz_fuzz) * 0.5))
// Adminordrazine the best stuff there is. For testing/debugging.
if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 1))
adjustWater(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1))
adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1))
adjustNutri(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1))
adjustPests(-rand(1,5))
adjustWeeds(-rand(1,5))
if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 5))
switch(rand(100))
if(66 to 100)
mutatespecie()
if(33 to 65)
mutateweed()
if(1 to 32)
mutatepest(user)
else
to_chat(user, "<span class='warning'>Nothing happens...</span>")
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params)
//Called when mob user "attacks" it with object O
if(istype(O, /obj/item/reagent_containers) ) // Syringe stuff (and other reagent containers now too)
@@ -730,13 +463,20 @@
to_chat(user, "<span class='notice'>[reagent_source] is empty.</span>")
return 1
if(reagents.total_volume >= reagents.maximum_volume && !reagent_source.reagents.has_reagent(/datum/reagent/water, 1))
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 = ""
var/irrigate = 0 //How am I supposed to irrigate pill contents?
var/transfer_amount
if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill))
if(istype(reagent_source, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/R = reagent_source
if (R.trash)
R.generate_trash(get_turf(user))
visi_msg="[user] composts [reagent_source], spreading it through [target]"
transfer_amount = reagent_source.reagents.total_volume
else
@@ -746,41 +486,27 @@
visi_msg="[user] injects [target] with [syr]"
if(syr.reagents.total_volume <= syr.amount_per_transfer_from_this)
syr.mode = 0
else if(istype(reagent_source, /obj/item/reagent_containers/spray/))
visi_msg="[user] sprays [target] with [reagent_source]"
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
irrigate = 1
else if(transfer_amount) // Droppers, cans, beakers, what have you.
visi_msg="[user] uses [reagent_source] on [target]"
irrigate = 1
// Beakers, bottles, buckets, etc.
if(reagent_source.is_drainable())
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
if(irrigate && transfer_amount > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation)
trays = FindConnected()
if (trays.len > 1)
visi_msg += ", setting off the irrigation system"
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
if(visi_msg)
visible_message("<span class='notice'>[visi_msg].</span>")
var/split = round(transfer_amount/trays.len)
for(var/obj/machinery/hydroponics/H in trays)
//cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener
var/datum/reagents/S = new /datum/reagents() //This is a strange way, but I don't know of a better one so I can't fix it at the moment...
S.my_atom = H
reagent_source.reagents.trans_to(S,split)
//This was originally in apply_chemicals, but due to apply_chemicals only holding nutrients, we handle it here now.
if(reagent_source.reagents.has_reagent(/datum/reagent/water, 1))
var/water_amt = reagent_source.reagents.get_reagent_amount(/datum/reagent/water) * transfer_amount / reagent_source.reagents.total_volume
H.adjustWater(round(water_amt))
reagent_source.reagents.remove_reagent(/datum/reagent/water, water_amt)
reagent_source.reagents.trans_to(H.reagents, transfer_amount)
if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill))
qdel(reagent_source)
H.applyChemicals(S, user)
S.clear_reagents()
qdel(S)
lastuser = user
H.update_icon()
return 1
H.update_icon()
if(reagent_source) // If the source wasn't composted and destroyed
reagent_source.update_icon()
@@ -793,39 +519,43 @@
if(!user.transferItemToLoc(O, src))
return
to_chat(user, "<span class='notice'>You plant [O].</span>")
dead = 0
dead = FALSE
myseed = O
name = "hydroponics tray ([myseed.plantname])"
if(!myseed.productdesc) //we haven't changed our produce's description
if(myseed.product)
myseed.productdesc = initial(myseed.product.desc)
else if(myseed.desc)
myseed.productdesc = myseed.desc
else
myseed.productdesc = "A fascinating specimen."
desc = myseed.productdesc
TRAY_NAME_UPDATE
age = 1
plant_health = myseed.endurance
lastcycle = world.time
update_icon()
return
else
to_chat(user, "<span class='warning'>[src] already has seeds in it!</span>")
return
else if(istype(O, /obj/item/plant_analyzer))
var/obj/item/plant_analyzer/P_analyzer = O
if(myseed)
to_chat(user, "*** <B>[myseed.plantname]</B> ***" )
to_chat(user, "- Plant Age: <span class='notice'>[age]</span>")
var/list/text_string = myseed.get_analyzer_text()
if(text_string)
to_chat(user, text_string)
if(P_analyzer.scan_mode == PLANT_SCANMODE_STATS)
to_chat(user, "*** <B>[myseed.plantname]</B> ***" )
to_chat(user, "- Plant Age: <span class='notice'>[age]</span>")
var/list/text_string = myseed.get_analyzer_text()
if(text_string)
to_chat(user, text_string)
to_chat(user, "*---------*")
if(myseed.reagents_add && P_analyzer.scan_mode == PLANT_SCANMODE_CHEMICALS)
to_chat(user, "- <B>Plant Reagents</B> -")
to_chat(user, "*---------*")
for(var/datum/plant_gene/reagent/G in myseed.genes)
to_chat(user, "<span class='notice'>- [G.get_name()] -</span>")
to_chat(user, "*---------*")
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>")
to_chat(user, "- Toxicity level: <span class='notice'>[toxic] / 100</span>")
to_chat(user, "- Water level: <span class='notice'>[waterlevel] / [maxwater]</span>")
to_chat(user, "- Nutrition level: <span class='notice'>[nutrilevel] / [maxnutri]</span>")
to_chat(user, "- Nutrition level: <span class='notice'>[reagents.total_volume] / [maxnutri]</span>")
to_chat(user, "")
return
else if(istype(O, /obj/item/cultivator))
if(weedlevel > 0)
@@ -843,18 +573,6 @@
else if(default_unfasten_wrench(user, O))
return
else if(istype(O, /obj/item/wirecutters) && unwrenchable)
if (!anchored)
to_chat(user, "<span class='warning'>Anchor the tray first!</span>")
return
if(canirrigate)
using_irrigation = !using_irrigation
O.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.</span>", \
"<span class='notice'>You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.</span>")
for(var/obj/machinery/hydroponics/h in range(1,src))
h.update_icon()
else if(istype(O, /obj/item/shovel/spade))
if(!myseed && !weedlevel)
to_chat(user, "<span class='warning'>[src] doesn't have any plants or weeds!</span>")
@@ -882,14 +600,12 @@
if (!unwrenchable) // case also covered by NODECONSTRUCT checks in default_unfasten_wrench
return CANT_UNFASTEN
if (using_irrigation)
if (!silent)
to_chat(user, "<span class='warning'>Disconnect the hoses first!</span>")
return FAILED_UNFASTEN
return ..()
/obj/machinery/hydroponics/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
/obj/machinery/hydroponics/attack_hand(mob/user)
. = ..()
if(.)
return
if(issilicon(user)) //How does AI know what plant is?
return
if(harvest)
@@ -897,41 +613,62 @@
return
else if(dead)
dead = 0
dead = FALSE
to_chat(user, "<span class='notice'>You remove the dead plant from [src].</span>")
qdel(myseed)
myseed = null
update_icon()
name = initial(name)
desc = initial(desc)
TRAY_NAME_UPDATE
else
if(user)
examine(user)
/obj/machinery/hydroponics/CtrlClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(!powered())
to_chat(user, "<span class='warning'>[name] has no power.</span>")
return
if(!anchored)
return
self_sustaining = !self_sustaining
idle_power_usage = self_sustaining ? 2500 : 0
to_chat(user, "<span class='notice'>You [self_sustaining ? "activate" : "deactivated"] [src]'s autogrow function[self_sustaining ? ", maintaining the tray's health while using high amounts of power" : ""].")
update_icon()
/obj/machinery/hydroponics/AltClick(mob/user)
. = ..()
if(!anchored)
update_icon()
return FALSE
var/warning = alert(user, "Are you sure you wish to empty the tray's nutrient beaker?","Empty Tray Nutrients?", "Yes", "No")
if(warning == "Yes" && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
reagents.clear_reagents()
to_chat(user, "<span class='warning'>You empty [src]'s nutrient tank.</span>")
/obj/machinery/hydroponics/proc/update_tray(mob/user)
harvest = 0
harvest = FALSE
lastproduce = age
if(istype(myseed, /obj/item/seeds/replicapod))
if(user)//runtimes
to_chat(user, "<span class='notice'>You harvest from the [myseed.plantname].</span>")
to_chat(user, "<span class='notice'>You harvest from the [myseed.plantname].</span>")
else if(myseed.getYield() <= 0)
if(user)
to_chat(user, "<span class='warning'>You fail to harvest anything useful!</span>")
to_chat(user, "<span class='warning'>You fail to harvest anything useful!</span>")
else
if(user)
to_chat(user, "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>")
to_chat(user, "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>")
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
qdel(myseed)
myseed = null
dead = 0
dead = FALSE
name = initial(name)
desc = initial(desc)
TRAY_NAME_UPDATE
if(self_sustaining) //No reason to pay for an empty tray.
idle_power_usage = 0
self_sustaining = FALSE
update_icon()
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
nutrilevel = clamp(nutrilevel + adjustamt, 0, maxnutri)
/obj/machinery/hydroponics/proc/adjustWater(adjustamt)
waterlevel = clamp(waterlevel + adjustamt, 0, maxwater)
@@ -957,11 +694,6 @@
var/mob/living/simple_animal/hostile/C = new chosen
C.faction = list("plants")
/obj/machinery/hydroponics/proc/become_self_sufficient() // Ambrosia Gaia effect
visible_message("<span class='boldnotice'>[src] begins to glow with a beautiful light!</span>")
self_sustaining = TRUE
update_icon()
///////////////////////////////////////////////////////////////////////////////
/obj/machinery/hydroponics/soil //Not actually hydroponics at all! Honk!
name = "soil"
@@ -974,9 +706,6 @@
flags_1 = NODECONSTRUCT_1
unwrenchable = FALSE
/obj/machinery/hydroponics/soil/update_icon_hoses()
return // Has no hoses
/obj/machinery/hydroponics/soil/update_icon_lights()
return // Has no lights
@@ -986,3 +715,6 @@
qdel(src)
else
return ..()
/obj/machinery/hydroponics/soil/CtrlClick(mob/user)
return //Dirt doesn't have electricity, last I checked.

View File

@@ -0,0 +1,32 @@
/**
*This is NOW the gradual affects that each chemical applies on every process() proc. Nutrients now use a more robust reagent holder in order to apply less insane
* stat changes as opposed to 271 lines of individual statline effects. Shoutout to the original comments on chems, I just cleaned a few up.
*/
/obj/machinery/hydroponics/proc/apply_chemicals(mob/user)
///Contains the reagents within the tray.
if(myseed)
myseed.on_chem_reaction(reagents) //In case seeds have some special interactions with special chems, currently only used by vines
for(var/c in reagents.reagent_list)
var/datum/reagent/chem = c
chem.on_hydroponics_apply(myseed, reagents, src, user)
/obj/machinery/hydroponics/proc/mutation_roll(mob/user)
switch(rand(100))
if(91 to 100)
adjustHealth(-10)
visible_message("<span class='warning'>\The [myseed.plantname] starts to wilt and burn!</span>")
return
if(41 to 90)
if(myseed && !self_sustaining) //Stability
myseed.adjust_instability(5)
return
if(21 to 40)
visible_message("<span class='notice'>\The [myseed.plantname] appears unusually reactive...</span>")
return
if(11 to 20)
mutateweed()
return
if(1 to 10)
mutatepest(user)
return

View File

@@ -89,6 +89,12 @@
/datum/plant_gene/core/potency/apply_stat(obj/item/seeds/S)
S.potency = value
/datum/plant_gene/core/instability
name = "Stability"
value = 10
/datum/plant_gene/core/instability/apply_stat(obj/item/seeds/S)
S.instability = value
/datum/plant_gene/core/weed_rate
name = "Weed Growth Rate"

View File

@@ -24,6 +24,7 @@
var/yield = 3 // Amount of growns created per harvest. If is -1, the plant/shroom/weed is never meant to be harvested.
var/potency = 10 // The 'power' of a plant. Generally effects the amount of reagent in a plant, also used in other ways.
var/growthstages = 6 // Amount of growth sprites the plant has.
var/instability = 5 //Chance that a plant will mutate in each stage of it's life.
var/rarity = 0 // How rare the plant is. Used for giving points to cargo when shipping off to CentCom.
var/list/mutatelist = list() // The type of plants that this plant can mutate into.
var/list/genes = list() // Plant genes are stored here, see plant_genes.dm for more info.
@@ -36,6 +37,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/seed_flags = MUTATE_EARLY //Determines if a plant is allowed to mutate early at 30+ instability
/obj/item/seeds/Initialize(mapload, nogenes = 0)
. = ..()
@@ -61,6 +63,7 @@
genes += new /datum/plant_gene/core/production(production)
if(potency != -1)
genes += new /datum/plant_gene/core/potency(potency)
genes += new /datum/plant_gene/core/instability(instability)
for(var/p in genes)
if(ispath(p))
@@ -74,6 +77,10 @@
/obj/item/seeds/examine(mob/user)
. = ..()
. += "<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>"
for(var/datum/plant_gene/reagent/G in genes)
. += "<span class='notice'>- [G.get_name()] -</span>"
/obj/item/seeds/proc/Copy()
var/obj/item/seeds/S = new type(null, 1)
@@ -85,6 +92,7 @@
S.yield = yield
S.potency = potency
S.weed_rate = weed_rate
S.instability = instability
S.weed_chance = weed_chance
S.name = name
S.plantname = plantname
@@ -121,18 +129,20 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
if(g)
g.mutability_flags &= ~mutability
/obj/item/seeds/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0)
/obj/item/seeds/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0, stabmut = 3)
adjust_lifespan(rand(-lifemut,lifemut))
adjust_endurance(rand(-endmut,endmut))
adjust_production(rand(-productmut,productmut))
adjust_yield(rand(-yieldmut,yieldmut))
adjust_potency(rand(-potmut,potmut))
adjust_instability(rand(-stabmut,stabmut))
adjust_weed_rate(rand(-wrmut, wrmut))
adjust_weed_chance(rand(-wcmut, wcmut))
if(prob(traitmut))
add_random_traits(1, 1)
if(prob(50))
add_random_traits(1, 1)
else
add_random_reagents(1, 1)
/obj/item/seeds/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
if(istype(Proj, /obj/item/projectile/energy/florayield))
@@ -165,13 +175,40 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
/obj/item/seeds/proc/harvest(mob/user)
///Reference to the tray/soil the seeds are planted in.
var/obj/machinery/hydroponics/parent = loc //for ease of access
///Count used for creating the correct amount of results to the harvest.
var/t_amount = 0
///List of plants all harvested from the same batch.
var/list/result = list()
///Tile of the harvester to deposit the growables.
var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK
///Name of the grown products.
var/product_name
while(t_amount < getYield())
var/obj/item/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src)
///The Number of products produced by the plant, typically the yield.
var/product_count = getYield()
while(t_amount < product_count)
var/obj/item/reagent_containers/food/snacks/grown/t_prod
if(instability >= 30 && (seed_flags & MUTATE_EARLY) && LAZYLEN(mutatelist) && prob(instability/3))
var/obj/item/seeds/new_prod = pick(mutatelist)
t_prod = initial(new_prod.product)
if(!t_prod)
continue
t_prod = new t_prod(output_loc, src)
t_prod.seed = new new_prod
t_prod.seed.name = initial(new_prod.name)
t_prod.seed.desc = initial(new_prod.desc)
t_prod.seed.plantname = initial(new_prod.plantname)
t_prod.transform = initial(t_prod.transform)
t_prod.transform *= TRANSFORM_USING_VARIABLE(t_prod.seed.potency, 100) + 0.5
t_amount++
if(t_prod.seed)
//t_prod.seed = new new_prod
t_prod.seed.instability = round(instability * 0.5)
continue
else
t_prod = new product(output_loc, src)
if(parent.myseed.plantname != initial(parent.myseed.plantname))
t_prod.name = lowertext(parent.myseed.plantname)
if(productdesc)
@@ -186,8 +223,8 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
product_name = parent.myseed.plantname
if(getYield() >= 1)
SSblackbox.record_feedback("tally", "food_harvested", getYield(), product_name)
parent.investigate_log("[user] harvested [getYield()] of [src], with seed traits [english_list(genes)] and reagents_add [english_list(reagents_add)] and potency [potency].", INVESTIGATE_BOTANY)
parent.update_tray(user)
return result
/obj/item/seeds/proc/harvest_userless()
@@ -263,6 +300,14 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
if(C)
C.value = production
/obj/item/seeds/proc/adjust_instability(adjustamt)
if(instability == -1)
return
instability = clamp(instability + adjustamt, 0, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/instability)
if(C)
C.value = instability
/obj/item/seeds/proc/adjust_potency(adjustamt)
if(potency != -1)
potency = clamp(potency + adjustamt, 0, 100)
@@ -320,6 +365,14 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
if(C)
C.value = potency
/obj/item/seeds/proc/set_instability(adjustamt)
if(instability == -1)
return
instability = clamp(adjustamt, 0, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/instability)
if(C)
C.value = instability
/obj/item/seeds/proc/set_weed_rate(adjustamt)
weed_rate = clamp(adjustamt, 0, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
@@ -352,6 +405,7 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
text += "- Production speed: [production]\n"
text += "- Endurance: [endurance]\n"
text += "- Lifespan: [lifespan]\n"
text += "- Instability: [instability]\n"
text += "- Weed Growth Rate: [weed_rate]\n"
text += "- Weed Vulnerability: [weed_chance]\n"
if(rarity)
@@ -362,9 +416,7 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
continue
all_traits += " [traits.get_name()]"
text += "- Plant Traits:[all_traits]\n"
text += "*---------*"
return text
/obj/item/seeds/proc/on_chem_reaction(datum/reagents/S) //in case seeds have some special interaction with special chems
@@ -373,9 +425,19 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
/obj/item/seeds/attackby(obj/item/O, mob/user, params)
if (istype(O, /obj/item/plant_analyzer))
to_chat(user, "<span class='info'>*---------*\n This is \a <span class='name'>[src]</span>.</span>")
var/text = get_analyzer_text()
if(text)
to_chat(user, "<span class='notice'>[text]</span>")
var/text
var/obj/item/plant_analyzer/P_analyzer = O
if(P_analyzer.scan_mode == PLANT_SCANMODE_STATS)
text = get_analyzer_text()
if(text)
to_chat(user, "<span class='notice'>[text]</span>")
if(reagents_add && P_analyzer.scan_mode == PLANT_SCANMODE_CHEMICALS)
to_chat(user, "<span class='notice'>- Plant Reagents -</span>")
to_chat(user, "<span class='notice'>*---------*</span>")
for(var/datum/plant_gene/reagent/G in genes)
to_chat(user, "<span class='notice'>- [G.get_name()] -</span>")
to_chat(user, "<span class='notice'>*---------*</span>")
return

View File

@@ -261,13 +261,11 @@
set_pin_data(IC_OUTPUT, 12, H.pestlevel)
set_pin_data(IC_OUTPUT, 13, H.toxic)
set_pin_data(IC_OUTPUT, 14, H.waterlevel)
set_pin_data(IC_OUTPUT, 15, H.nutrilevel)
set_pin_data(IC_OUTPUT, 15, H.reagents.total_volume)
set_pin_data(IC_OUTPUT, 16, H.harvest)
set_pin_data(IC_OUTPUT, 17, H.dead)
set_pin_data(IC_OUTPUT, 18, H.plant_health)
set_pin_data(IC_OUTPUT, 19, H.self_sustaining)
set_pin_data(IC_OUTPUT, 20, H.using_irrigation)
set_pin_data(IC_OUTPUT, 21, H.FindConnected())
push_data()
activate_pin(2)

View File

@@ -19,30 +19,26 @@
// Hydroponics trays have no reagents holder and handle reagents in their own snowflakey way.
// This is a dirty hack to make injecting reagents into them work.
// TODO: refactor that.
/obj/item/integrated_circuit/reagent/proc/inject_tray(obj/machinery/hydroponics/tray, atom/movable/source, amount)
var/atom/movable/acting_object = get_object()
var/list/trays = list(tray)
var/visi_msg = "[acting_object] transfers fluid into [tray]"
//Time for someone to refactor this. Trays can now hold reagents.
//obj/item/integrated_circuit/reagent/proc/inject_tray(obj/machinery/hydroponics/tray, atom/movable/source, amount)
//var/atom/movable/acting_object = get_object()
//var/list/trays = list(tray)
//var/visi_msg = "[acting_object] transfers fluid into [tray]"
if(amount > 30 && source.reagents.total_volume >= 30 && tray.using_irrigation)
trays = tray.FindConnected()
if (trays.len > 1)
visi_msg += ", setting off the irrigation system"
//acting_object.visible_message("<span class='notice'>[visi_msg].</span>")
//playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
acting_object.visible_message("<span class='notice'>[visi_msg].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
//var/split = round(amount/trays.len)
var/split = round(amount/trays.len)
//for(var/obj/machinery/hydroponics/H in trays)
//var/datum/reagents/temp_reagents = new /datum/reagents()
//temp_reagents.my_atom = H
for(var/obj/machinery/hydroponics/H in trays)
var/datum/reagents/temp_reagents = new /datum/reagents()
temp_reagents.my_atom = H
//source.reagents.trans_to(temp_reagents, split)
//H.on_hydroponics_apply(temp_reagents)
source.reagents.trans_to(temp_reagents, split)
H.applyChemicals(temp_reagents)
temp_reagents.clear_reagents()
qdel(temp_reagents)
//temp_reagents.clear_reagents()
//qdel(temp_reagents)
/obj/item/integrated_circuit/reagent/injector
name = "integrated hypo-injector"
@@ -116,10 +112,10 @@
return
if(!AM.reagents)
if(istype(AM, /obj/machinery/hydroponics) && direction_mode == SYRINGE_INJECT && reagents.total_volume && transfer_amount)//injection into tray.
inject_tray(AM, src, transfer_amount)
activate_pin(2)
return
//if(istype(AM, /obj/machinery/hydroponics) && direction_mode == SYRINGE_INJECT && reagents.total_volume && transfer_amount)//injection into tray.
//inject_tray(AM, src, transfer_amount)
//activate_pin(2)
//return
activate_pin(3)
return
@@ -242,13 +238,14 @@
if(!source.reagents)
return
if(!target.reagents)
//if(!target.reagents)
// Hydroponics trays have no reagents holder and handle reagents in their own snowflakey way.
// This is a dirty hack to make injecting reagents into them work.
if(istype(target, /obj/machinery/hydroponics) && source.reagents.total_volume)
inject_tray(target, source, transfer_amount)
activate_pin(2)
return
//Someone should redo this. Trays should hold reagents now.
//if(istype(target, /obj/machinery/hydroponics) && source.reagents.total_volume)
//inject_tray(target, source, transfer_amount)
//activate_pin(2)
//return
if(!source.is_drainable() || !target.is_refillable())
return

View File

@@ -4,8 +4,6 @@
icon_state = "hydrotray4"
obj_flags = CAN_BE_HIT | UNIQUE_RENAME
circuit = /obj/item/circuitboard/machine/hydroponics/automagic
self_sufficiency_req = 400 //automating hydroponics makes gaia sad so she needs more drugs to turn they tray godly.
canirrigate = FALSE
/obj/machinery/hydroponics/constructable/automagic/attackby(obj/item/O, mob/user, params)
@@ -44,7 +42,7 @@
/obj/machinery/hydroponics/constructable/automagic/process()
if(reagents)
applyChemicals(reagents)
reagents.add_reagent(reagents)
reagents.clear_reagents()
if(dead)
dead = 0

View File

@@ -213,6 +213,16 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
if(prob(30))
to_chat(M, "<span class='boldannounce'>You're not feeling good at all! You really need some [name].</span>")
/**
* New, standardized method for chemicals to affect hydroponics trays.
* Defined on a per-chem level as opposed to by the tray.
* Can affect plant's health, stats, or cause the plant to react in certain ways.
*/
/datum/reagent/proc/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
if(!mytray || !chems)
return
return
/proc/pretty_string_from_reagent_list(list/reagent_list)
//Convert reagent list to a printable string for logging etc
var/list/rs = list()

View File

@@ -90,6 +90,13 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_desc = "A freezing pint of beer."
pH = 4
// Beer is a chemical composition of alcohol and various other things. It's a garbage nutrient but hey, it's still one. Also alcohol is bad, mmmkay?
/datum/reagent/consumable/ethanol/beer/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(src.type) * 0.05))
mytray.adjustWater(round(chems.get_reagent_amount(src.type) * 0.7))
/datum/reagent/consumable/ethanol/beer/light
name = "Light Beer"
description = "An alcoholic beverage brewed since ancient times on Old Earth. This variety has reduced calorie and alcohol content."

View File

@@ -214,6 +214,14 @@
pH = 6.5
value = REAGENT_VALUE_VERY_COMMON
// Milk is good for humans, but bad for plants. The sugars cannot be used by plants, and the milk fat harms growth. Not shrooms though. I can't deal with this now...
/datum/reagent/consumable/milk/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustWater(round(chems.get_reagent_amount(type) * 0.3))
if(myseed)
myseed.adjust_potency(-chems.get_reagent_amount(type) * 0.5)
/datum/reagent/consumable/milk/on_mob_life(mob/living/carbon/M)
if(HAS_TRAIT(M, TRAIT_CALCIUM_HEALER))
M.heal_bodypart_damage(1.5,0, 0)
@@ -607,6 +615,15 @@
glass_name = "honeycomb of Buzz Fuzz"
glass_desc = "Stinging with flavour."
//This drink seems to be just made for plants.. how curious.
/datum/reagent/consumable/buzz_fuzz/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src,1))
mytray.adjustPests(-rand(2,5))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 0.1))
if(myseed)
myseed.adjust_potency(round(chems.get_reagent_amount(src.type) * 0.5))
/datum/reagent/consumable/buzz_fuzz/on_mob_life(mob/living/carbon/M)
M.reagents.add_reagent(/datum/reagent/consumable/sugar,1)
if(prob(5))
@@ -678,6 +695,15 @@
glass_name = "glass of soda water"
glass_desc = "Soda water. Why not make a scotch and soda?"
// A variety of nutrients are dissolved in club soda, without sugar.
// These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth.
/datum/reagent/consumable/sodawater/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustWater(round(chems.get_reagent_amount(type) * 1))
mytray.adjustHealth(round(chems.get_reagent_amount(type) * 0.1))
/datum/reagent/consumable/sodawater/on_mob_life(mob/living/carbon/M)
M.dizziness = max(0,M.dizziness-5)
M.drowsyness = max(0,M.drowsyness-3)

View File

@@ -157,6 +157,13 @@
taste_description = "sweetness"
value = REAGENT_VALUE_NONE
// Plants should not have sugar, they can't use it and it prevents them getting water/ nutients, it is good for mold though...
/datum/reagent/consumable/sugar/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustWeeds(rand(2,3))
mytray.adjustPests(rand(1,2))
/datum/reagent/consumable/sugar/overdose_start(mob/living/M)
to_chat(M, "<span class='userdanger'>You go into hyperglycaemic shock! Lay off the twinkies!</span>")
M.AdjustSleeping(600, FALSE)
@@ -174,6 +181,12 @@
color = "#899613" // rgb: 137, 150, 19
taste_description = "watery milk"
// Compost for EVERYTHING
/datum/reagent/consumable/virus_food/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(type) * 0.5))
/datum/reagent/consumable/soysauce
name = "Soysauce"
description = "A salty sauce made from the soy plant."

View File

@@ -36,6 +36,25 @@
taste_description = "badmins"
value = REAGENT_VALUE_GLORIOUS
// The best stuff there is. For testing/debugging.
/datum/reagent/medicine/adminordrazine/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustWater(round(chems.get_reagent_amount(type) * 1))
mytray.adjustHealth(round(chems.get_reagent_amount(type) * 1))
mytray.adjustPests(-rand(1,5))
mytray.adjustWeeds(-rand(1,5))
if(chems.has_reagent(type, 3))
switch(rand(100))
if(66 to 100)
mytray.mutatespecie()
if(33 to 65)
mytray.mutateweed()
if(1 to 32)
mytray.mutatepest(user)
else if(prob(20))
mytray.visible_message("<span class='warning'>Nothing happens...</span>")
/datum/reagent/medicine/adminordrazine/on_mob_life(mob/living/carbon/M)
M.reagents.remove_all_type(/datum/reagent/toxin, 5*REM, 0, 1)
M.setCloneLoss(0, 0)
@@ -1168,6 +1187,11 @@
..()
. = 1
// Antitoxin binds plants pretty well. So the tox goes significantly down
/datum/reagent/medicine/antitoxin/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
mytray.adjustToxic(-round(chems.get_reagent_amount(type) * 2))
/datum/reagent/medicine/inaprovaline
name = "Inaprovaline"
description = "Stabilizes the breathing of patients. Good for those in critical condition."
@@ -1297,6 +1321,21 @@
pH = 11
value = REAGENT_VALUE_COMMON //not any higher. Ambrosia is a milestone for hydroponics already.
//Earthsblood is still a wonderdrug. Just... don't expect to be able to mutate something that makes plants so healthy.
/datum/reagent/medicine/earthsblood/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustPests(-rand(1,3))
mytray.adjustWeeds (-rand(1,3))
if(myseed)
myseed.adjust_instability(-round(chems.get_reagent_amount(src.type) * 1.3))
myseed.adjust_potency(round(chems.get_reagent_amount(src.type) *1))
myseed.adjust_yield(round(chems.get_reagent_amount(src.type) * 1))
myseed.adjust_endurance(round(chems.get_reagent_amount(src.type) * 0.5))
myseed.adjust_production(-round(chems.get_reagent_amount(src.type) * 0.5))
/datum/reagent/medicine/earthsblood/on_mob_life(mob/living/carbon/M)
M.adjustBruteLoss(-3 * REM, FALSE)
M.adjustFireLoss(-3 * REM, FALSE)

View File

@@ -13,6 +13,12 @@
shot_glass_icon_state = "shotglassred"
pH = 7.4
// FEED ME,SEYMOUR!
/datum/reagent/blood/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustPests(rand(2,3))
/datum/reagent/blood/reaction_mob(mob/living/L, method = TOUCH, reac_volume)
if(data && data["viruses"])
for(var/thing in data["viruses"])
@@ -313,6 +319,13 @@
metabolization_rate = 45 * REAGENTS_METABOLISM
. = 1
///For weird backwards situations where water manages to get added to trays nutrients, as opposed to being snowflaked away like usual.
/datum/reagent/water/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
if(chems.has_reagent(src.type, 1))
mytray.adjustWater(round(chems.get_reagent_amount(src.type) * 1))
//You don't belong in this world, monster!
chems.remove_reagent(/datum/reagent/water, chems.get_reagent_amount(src.type))
/datum/reagent/water/hollowwater
name = "Hollow Water"
description = "An ubiquitous chemical substance that is composed of hydrogen and oxygen, but it looks kinda hollow."
@@ -329,6 +342,14 @@
glass_desc = "A glass of holy water."
pH = 7.5 //God is alkaline
// Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits. Also ALSO increases instability.
/datum/reagent/water/holywater/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
if(chems.has_reagent(src.type, 1))
mytray.adjustWater(round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 0.1))
if(myseed)
myseed.adjust_instability(round(chems.get_reagent_amount(src.type) * 0.15))
/datum/reagent/water/holywater/on_mob_metabolize(mob/living/L)
. = ..()
ADD_TRAIT(L, TRAIT_HOLY, type)
@@ -401,6 +422,13 @@
qdel(R)
T.Bless()
/datum/reagent/water/holywater/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
mytray.adjustWater(round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 0.1))
if(myseed)
myseed.adjust_instability(round(chems.get_reagent_amount(src.type) * 0.15))
/datum/reagent/fuel/unholywater //if you somehow managed to extract this from someone, dont splash it on yourself and have a smoke
name = "Unholy Water"
overdose_threshold = 150 //Same as normal water
@@ -973,6 +1001,15 @@
taste_description = "chlorine"
pH = 7.4
// You're an idiot for thinking that one of the most corrosive and deadly gasses would be beneficial
/datum/reagent/chlorine/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustToxic(round(chems.get_reagent_amount(src.type) * 1.5))
mytray.adjustWater(-round(chems.get_reagent_amount(src.type) * 0.5))
mytray.adjustWeeds(-rand(1,3))
/datum/reagent/chlorine/on_mob_life(mob/living/carbon/M)
M.take_bodypart_damage(1*REM, 0, 0, 0)
. = 1
@@ -986,6 +1023,15 @@
taste_description = "acid"
pH = 2
// You're an idiot for thinking that one of the most corrosive and deadly gasses would be beneficial
/datum/reagent/fluorine/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(src.type) * 2))
mytray.adjustToxic(round(chems.get_reagent_amount(src.type) * 2.5))
mytray.adjustWater(-round(chems.get_reagent_amount(src.type) * 0.5))
mytray.adjustWeeds(-rand(1,4))
/datum/reagent/fluorine/on_mob_life(mob/living/carbon/M)
M.adjustToxLoss(1*REM, 0)
. = 1
@@ -1037,6 +1083,12 @@
taste_description = "the colour blue and regret"
pH = 10
/datum/reagent/radium/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustToxic(round(chems.get_reagent_amount(src.type) * 1))
/datum/reagent/radium/on_mob_life(mob/living/carbon/M)
M.apply_effect(2*REM/M.metabolism_efficiency,EFFECT_IRRADIATE,0)
..()
@@ -1148,6 +1200,14 @@
GG = new/obj/effect/decal/cleanable/greenglow(T)
GG.reagents.add_reagent(/datum/reagent/uranium, reac_volume)
//Mutagenic chem side-effects.
/datum/reagent/uranium/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
mytray.mutation_roll(user)
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustToxic(round(chems.get_reagent_amount(src.type) * 2))
/datum/reagent/bluespace
name = "Bluespace Dust"
description = "A dust composed of microscopic bluespace crystals, with minor space-warping properties."
@@ -1406,6 +1466,15 @@
taste_description = "mordant"
pH = 11.6
/datum/reagent/ammonia/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
// Ammonia is bad ass.
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 0.12))
if(myseed && prob(10))
myseed.adjust_yield(1)
myseed.adjust_instability(1)
/datum/reagent/diethylamine
name = "Diethylamine"
description = "A secondary amine, mildly corrosive."
@@ -1413,6 +1482,16 @@
taste_description = "iron"
pH = 12
// This is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. The new trade off is it culls stability.
/datum/reagent/diethylamine/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustPests(-rand(1,2))
if(myseed)
myseed.adjust_yield(round(chems.get_reagent_amount(src.type) * 1))
myseed.adjust_instability(-round(chems.get_reagent_amount(src.type) * 1))
/datum/reagent/carbondioxide
name = "Carbon Dioxide"
reagent_state = GAS
@@ -1606,24 +1685,68 @@
/datum/reagent/plantnutriment/eznutriment
name = "E-Z-Nutrient"
description = "Cheap and extremely common type of plant nutriment."
description = "Contains electrolytes. It's what plants crave."
color = "#376400" // RBG: 50, 100, 0
tox_prob = 10
pH = 2.5
/datum/reagent/plantnutriment/eznutriment/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_instability(0.2)
myseed.adjust_potency(round(chems.get_reagent_amount(src.type) * 0.3))
myseed.adjust_yield(round(chems.get_reagent_amount(src.type) * 0.1))
/datum/reagent/plantnutriment/left4zednutriment
name = "Left 4 Zed"
description = "Unstable nutriment that makes plants mutate more often than usual."
color = "#1A1E4D" // RBG: 26, 30, 77
tox_prob = 25
pH = 3.5
/datum/reagent/plantnutriment/left4zednutriment/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_instability(round(chems.get_reagent_amount(src.type) * 0.2))
/datum/reagent/plantnutriment/robustharvestnutriment
name = "Robust Harvest"
description = "Very potent nutriment that prevents plants from mutating."
description = "Very potent nutriment that slows plants from mutating."
color = "#9D9D00" // RBG: 157, 157, 0
tox_prob = 15
pH = 2.5
/datum/reagent/plantnutriment/robustharvestnutriment/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_instability(-0.25)
myseed.adjust_potency(round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_yield(round(chems.get_reagent_amount(src.type) * 0.2))
/datum/reagent/plantnutriment/endurogrow
name = "Enduro Grow"
description = "A specialized nutriment, which decreases product quantity and potency, but strengthens the plants endurance."
color = "#a06fa7" // RBG: 160, 111, 167
tox_prob = 15
/datum/reagent/plantnutriment/endurogrow/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_potency(-round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_yield(-round(chems.get_reagent_amount(src.type) * 0.075))
myseed.adjust_endurance(round(chems.get_reagent_amount(src.type) * 0.35))
/datum/reagent/plantnutriment/liquidearthquake
name = "Liquid Earthquake"
description = "A specialized nutriment, which increases the plant's production speed, as well as it's susceptibility to weeds."
color = "#912e00" // RBG: 145, 46, 0
tox_prob = 25
/datum/reagent/plantnutriment/liquidearthquake/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray)
. = ..()
if(myseed && chems.has_reagent(src.type, 1))
myseed.adjust_weed_rate(round(chems.get_reagent_amount(src.type) * 0.1))
myseed.adjust_weed_chance(round(chems.get_reagent_amount(src.type) * 0.3))
myseed.adjust_production(-round(chems.get_reagent_amount(src.type) * 0.075))
// GOON OTHERS
@@ -1679,6 +1802,13 @@
taste_description = "ash"
pH = 6.5
// Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer
/datum/reagent/ash/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
mytray.adjustHealth(round(chems.get_reagent_amount(src.type) * 1))
mytray.adjustWeeds(-1)
/datum/reagent/acetone
name = "Acetone"
description = "A slick, slightly carcinogenic liquid. Has a multitude of mundane uses in everyday life."
@@ -1799,6 +1929,16 @@
taste_description = "alkali" //who put ACID for NaOH ????
pH = 11.9
// Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants
/datum/reagent/saltpetre/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(src.type, 1))
var/salt = chems.get_reagent_amount(src.type)
mytray.adjustHealth(round(salt * 0.18))
if(myseed)
myseed.adjust_production(-round(salt/10)-prob(salt%10))
myseed.adjust_potency(round(salt*1))
/datum/reagent/drying_agent
name = "Drying agent"
description = "A desiccant. Can be used to dry things."

View File

@@ -10,6 +10,12 @@
value = REAGENT_VALUE_COMMON //Encouraging people to mix toxins for reasons beyond harming each other or mixing reagents such as pen acid.
var/toxpwr = 1.5
// Are you a bad enough dude to poison your own plants?
/datum/reagent/toxin/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustToxic(round(chems.get_reagent_amount(type) * 2))
/datum/reagent/toxin/on_mob_life(mob/living/carbon/M)
if(toxpwr)
M.adjustToxLoss(toxpwr*REM, 0)
@@ -54,6 +60,11 @@
C.apply_effect(5,EFFECT_IRRADIATE,0)
return ..()
/datum/reagent/toxin/mutagen/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
mytray.mutation_roll(user)
if(chems.has_reagent(type, 1))
mytray.adjustToxic(1.5) //It is still toxic, mind you, but not to the same degree.
/datum/reagent/toxin/plasma
name = "Plasma"
description = "Plasma in its liquid form."
@@ -245,6 +256,13 @@
pH = 2.7
value = REAGENT_VALUE_NONE
/datum/reagent/toxin/plantbgone/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(type) * 10))
mytray.adjustToxic(round(chems.get_reagent_amount(type) * 6))
mytray.adjustWeeds(-rand(4,8))
/datum/reagent/toxin/plantbgone/reaction_obj(obj/O, reac_volume)
if(istype(O, /obj/structure/alien/weeds))
var/obj/structure/alien/weeds/alien_weeds = O
@@ -270,6 +288,14 @@
pH = 3
value = REAGENT_VALUE_NONE
//Weed Spray
/datum/reagent/toxin/plantbgone/weedkiller/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
if(!mytray)
return
if(chems.has_reagent(type, 1))
mytray.adjustToxic(round(chems.get_reagent_amount(type) * 0.5))
mytray.adjustWeeds(-rand(1,2))
/datum/reagent/toxin/pestkiller
name = "Pest Killer"
description = "A harmful toxic mixture to kill pests. Do not ingest!"
@@ -278,6 +304,14 @@
pH = 3.2
value = REAGENT_VALUE_NONE
//Pest Spray
/datum/reagent/toxin/pestkiller/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
if(!mytray)
return
if(chems.has_reagent(type, 1))
mytray.adjustToxic(round(chems.get_reagent_amount(type) * 1))
mytray.adjustPests(-rand(1,2))
/datum/reagent/toxin/pestkiller/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
..()
if(M.mob_biotypes & MOB_BUG)
@@ -838,6 +872,14 @@
pH = 2.75
value = REAGENT_VALUE_NONE
// Sure, go ahead and pour acid on your precious plants. What's the worst that could happen?
/datum/reagent/toxin/acid/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(type) * 1))
mytray.adjustToxic(round(chems.get_reagent_amount(type) * 1.5))
mytray.adjustWeeds(-rand(1,2))
/datum/reagent/toxin/acid/reaction_mob(mob/living/carbon/C, method=TOUCH, reac_volume)
if(!istype(C))
return
@@ -870,6 +912,14 @@
acidpwr = 42.0
value = REAGENT_VALUE_COMMON
// ACID II: UNHEEDED WARNINGS
/datum/reagent/toxin/acid/fluacid/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
if(chems.has_reagent(type, 1))
mytray.adjustHealth(-round(chems.get_reagent_amount(type) * 2))
mytray.adjustToxic(round(chems.get_reagent_amount(type) * 3))
mytray.adjustWeeds(-rand(1,4))
/datum/reagent/toxin/acid/fluacid/on_mob_life(mob/living/carbon/M)
M.adjustFireLoss(current_cycle/10, 0)
. = 1

View File

@@ -77,6 +77,22 @@
make_reagents = list(/datum/reagent/plantnutriment/robustharvestnutriment = 10)
category = list("initial","Botany Chemicals")
/datum/design/end_gro
name = "30u Enduro Grow"
id = "end_gro"
build_type = BIOGENERATOR
materials = list(/datum/material/biomass= 30)
make_reagents = list(/datum/reagent/plantnutriment/endurogrow = 30)
category = list("initial","Botany Chemicals")
/datum/design/liq_earth
name = "30u Liquid Earthquake"
id = "liq_earth"
build_type = BIOGENERATOR
materials = list(/datum/material/biomass= 30)
make_reagents = list(/datum/reagent/plantnutriment/liquidearthquake = 30)
category = list("initial","Botany Chemicals")
/datum/design/weed_killer
name = "Weed Killer"
id = "weed_killer"