diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index abad7f3b0cf5..fc319d4e24d0 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -1029,12 +1029,13 @@ return if(issilicon(user)) //How does AI know what plant is? return - var/growth_mult = (1.01 ** -myseed.maturation) - if(growth >= myseed.harvest_age * growth_mult) - //if(myseed.harvest_age < age * max(myseed.production * 0.044, 0.5) && (myseed.harvest_age) < (age - lastproduce) * max(myseed.production * 0.044, 0.5) && (!harvest && !dead)) - nutrimentMutation() - if(myseed && myseed.yield != -1) // Unharvestable shouldn't be harvested - set_plant_status(HYDROTRAY_PLANT_HARVESTABLE) + if(myseed) + var/growth_mult = (1.01 ** -myseed.maturation) + if(growth >= myseed.harvest_age * growth_mult) + //if(myseed.harvest_age < age * max(myseed.production * 0.044, 0.5) && (myseed.harvest_age) < (age - lastproduce) * max(myseed.production * 0.044, 0.5) && (!harvest && !dead)) + nutrimentMutation() + if(myseed && myseed.yield != -1) // Unharvestable shouldn't be harvested + set_plant_status(HYDROTRAY_PLANT_HARVESTABLE) if(plant_status == HYDROTRAY_PLANT_HARVESTABLE) return myseed.harvest(user) @@ -1048,6 +1049,30 @@ if(user) user.examinate(src) +/obj/machinery/hydroponics/attack_hand_secondary(mob/user, list/modifiers) + . = ..() + if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN) + return + if(issilicon(user)) + return + + if(reagents.total_volume) + to_chat(user, span_notice("You begin to dump out the tray's nutrient mix.")) + if(do_after(user, 4 SECONDS, target = src)) + playsound(user.loc, 'sound/effects/slosh.ogg', 50, TRUE, -1) + //dump everything on the floor + var/turf/user_loc = user.loc + if(istype(user_loc, /turf/open)) + user_loc.add_liquid_from_reagents(reagents) + else + user_loc = get_step_towards(user_loc, src) + user_loc.add_liquid_from_reagents(reagents) + adjust_plant_nutriments(100) //PURGE + else + to_chat(user, span_warning("The tray's nutrient mix is already empty!")) + + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + /** * Update Tray Proc * Handles plant harvesting on the tray side, by clearing the seed, names, description, and dead stat. @@ -1179,7 +1204,7 @@ ///The usb port circuit /obj/item/circuit_component/hydroponics - display_name = "Hydropnics Tray" + display_name = "Hydroponics Tray" desc = "Automate the means of botanical production. Trigger to toggle auto-grow." circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL