Hydroponics Tray USB Port (plus a tiny refactor needed to fit it in) (#62652)

Adds a USB port to constructable hydroponic trays. I had to refactor some hydro tray code, which is kinda old, to fit the USB circuit and the new signals in.
This commit is contained in:
Ghom
2021-11-15 17:44:22 +00:00
committed by GitHub
parent a68452f375
commit 326e8bfafc
20 changed files with 462 additions and 264 deletions
@@ -42,13 +42,13 @@
seed.set_potency(100) // Sets the seed potency to 100.
seed.set_instability(0) // Sets the seed instability to 0, to prevent mutations.
tray.myseed = seed
tray.set_seed(seed)
seed.forceMove(tray)
tray.name = tray.myseed ? "[initial(tray.name)] ([tray.myseed.plantname])" : initial(tray.name)
tray.plant_health = seed.endurance
tray.set_plant_health(seed.endurance)
tray.age = 20
tray.harvest = TRUE
tray.set_plant_status(HYDROTRAY_PLANT_HARVESTABLE)
/datum/unit_test/hydroponics_harvest/proc/test_seed(obj/machinery/hydroponics/tray, obj/item/seeds/seed, mob/living/carbon/user)
tray.reagents.add_reagent(/datum/reagent/plantnutriment/eznutriment, 20)
@@ -91,9 +91,8 @@
TEST_ASSERT_EQUAL(found_vitamins, expected_vitamins * max_volume, "Hydroponics harvest from [saved_name] has a [expected_vitamins] vitamin gene (expecting [expected_nutriments * max_volume]) but only had [found_vitamins] units of vitamins inside.")
if(tray.myseed)
tray.harvest = FALSE
tray.age = 0
tray.plant_health = 0
tray.set_plant_health(0)
QDEL_NULL(tray.myseed)
tray.set_seed(null)
tray.name = tray.myseed ? "[initial(tray.name)] ([tray.myseed.plantname])" : initial(tray.name)