Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qol: kitchen and grinder machinery hotkeys #6245

Merged
merged 16 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Antoonij marked this conversation as resolved.
Show resolved Hide resolved
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
Loading