Skip to content

Commit

Permalink
qol: kitchen and grinder machinery hotkeys (#6245)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlitchTime authored Dec 15, 2024
1 parent 53f085c commit 9364fba
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 14 deletions.
35 changes: 32 additions & 3 deletions code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,31 @@
to_chat(user, span_warning("You have no idea how to cook with [I]."))
return ATTACK_CHAIN_PROCEED|ATTACK_CHAIN_NO_AFTERATTACK

/obj/machinery/kitchen_machine/AltClick(mob/living/carbon/human/human)
if(!istype(human) || !human.Adjacent(src))
return

if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return

if(operating)
return

add_fingerprint(human)
cook()

/obj/machinery/kitchen_machine/CtrlShiftClick(mob/living/carbon/human/human)
if(!istype(human) || !human.Adjacent(src))
return

if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return

if(operating)
return

add_fingerprint(human)
dispose(human)

/obj/machinery/kitchen_machine/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
Expand Down Expand Up @@ -458,13 +483,16 @@
update_icon(UPDATE_ICON_STATE)
updateUsrDialog()

/obj/machinery/kitchen_machine/proc/dispose()
/obj/machinery/kitchen_machine/proc/dispose(mob/user)
for(var/obj/O in contents)
O.forceMove(loc)

if(reagents.total_volume)
dirty++

reagents.clear_reagents()
to_chat(usr, "<span class='notice'>You dispose of \the [src]'s contents.</span>")
to_chat(user, span_notice("You dispose of \the [src]'s contents."))

updateUsrDialog()

/obj/machinery/kitchen_machine/proc/muck_start()
Expand Down Expand Up @@ -525,7 +553,8 @@
cook()

if("dispose")
dispose()
dispose(usr)

return


Expand Down
47 changes: 36 additions & 11 deletions code/modules/reagents/chemistry/machinery/reagentgrinder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
return
default_unfasten_wrench(user, I)


/obj/machinery/reagentgrinder/attackby(obj/item/I, mob/user, params)
if(user.a_intent == INTENT_HARM)
return ..()
Expand Down Expand Up @@ -232,7 +231,31 @@
updateUsrDialog()
return ATTACK_CHAIN_BLOCKED_ALL

/obj/machinery/reagentgrinder/AltClick(mob/living/carbon/human/human)
if(!istype(human) || !human.Adjacent(src))
return

if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return

if(operating)
return

add_fingerprint(human)
grind()

/obj/machinery/reagentgrinder/CtrlShiftClick(mob/living/carbon/human/human)
if(!istype(human) || !human.Adjacent(src))
return

if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return

if(operating)
return

add_fingerprint(human)
detach(human)

/obj/machinery/reagentgrinder/attack_ai(mob/user)
return FALSE
Expand Down Expand Up @@ -305,18 +328,20 @@
if("eject")
eject()
if ("detach")
detach()
detach(usr)

/obj/machinery/reagentgrinder/proc/detach()
/obj/machinery/reagentgrinder/proc/detach(mob/user)
if(user.stat)
return

if (usr.stat != 0)
return
if (!beaker)
return
beaker.loc = src.loc
beaker = null
update_icon(UPDATE_ICON_STATE)
updateUsrDialog()
if(!beaker)
return

beaker.forceMove(get_turf(src))
beaker = null

update_icon(UPDATE_ICON_STATE)
updateUsrDialog()

/obj/machinery/reagentgrinder/proc/eject()

Expand Down

0 comments on commit 9364fba

Please sign in to comment.