Merge pull request #6072 from Verkister/garbobutton

Couple more recycling tweaks
This commit is contained in:
Nadyr
2023-04-15 21:11:23 -04:00
committed by GitHub
3 changed files with 31 additions and 7 deletions
@@ -10,6 +10,7 @@
active_power_usage = 100
var/operating = FALSE
var/obj/machinery/recycling/crusher/crusher //Connects to regular crusher
var/obj/machinery/button/garbosystem/button
var/list/affecting
var/voracity = 5 //How much stuff is swallowed at once.
@@ -17,13 +18,20 @@
. = ..()
for(var/dir in cardinal)
src.crusher = locate(/obj/machinery/recycling/crusher, get_step(src, dir))
if(src.crusher) break
src.button = locate(/obj/machinery/button/garbosystem, get_step(src, dir))
if(crusher)
crusher.hand_fed = FALSE
if(button)
button.grinder = src
return
/obj/machinery/v_garbosystem/attack_hand(mob/living/user as mob)
operating = !operating
update()
/obj/machinery/v_garbosystem/attack_ai(mob/user as mob)
return attack_hand(user)
/obj/machinery/v_garbosystem/power_change()
if((. = ..()))
update()
@@ -118,3 +126,14 @@
else
to_chat(user, "Unable to empty filter while the machine is running.")
return ..()
/obj/machinery/button/garbosystem
name = "garbage grinder switch"
desc = "A power button for the big grinder."
icon = 'icons/obj/machines/doorbell_vr.dmi'
icon_state = "doorbell-standby"
var/obj/machinery/v_garbosystem/grinder
/obj/machinery/button/garbosystem/attack_hand(mob/living/user as mob)
if(grinder)
return grinder.attack_hand(user)