Dirt not powered, var cleanup, plumbing enable

This commit is contained in:
The0bserver
2020-10-01 04:43:02 -04:00
parent 48df6a9494
commit 5a03688bdb
+12 -4
View File
@@ -28,8 +28,6 @@
var/unwrenchable = TRUE
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant
var/mob/lastuser //Last user to add reagents to a tray. Mostly for logging.
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/self_sustaining = FALSE //If the tray generates nutrients and water on its own
// Here lies irrigation. You won't be missed, because you were never used.
@@ -44,6 +42,14 @@
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "hydrotray3"
/obj/machinery/hydroponics/constructable/ComponentInitialize()
. = ..()
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated))
AddComponent(/datum/component/plumbing/simple_demand)
/obj/machinery/hydroponics/constructable/proc/can_be_rotated(mob/user, rotation_type)
return !anchored
/obj/machinery/hydroponics/constructable/RefreshParts()
var/tmp_capacity = 0
for (var/obj/item/stock_parts/matter_bin/M in component_parts)
@@ -634,7 +640,7 @@
if(!anchored)
return
self_sustaining = !self_sustaining
idle_power_usage = self_sustaining ? 4000 : 0
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()
@@ -716,4 +722,6 @@
qdel(src)
else
return ..()
/obj/machinery/hydroponics/soil/CtrlClick(mob/user)
return //Dirt doesn't have electricity, last I checked.