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 8 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
31 changes: 29 additions & 2 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,33 @@
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/user)
var/mob/living/carbon/human/human = user
if(!istype(human))
return
if(!Adjacent(human))
return
if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return
if(operating)
return

add_fingerprint(user)
cook()

/obj/machinery/kitchen_machine/CtrlShiftClick(mob/user)
var/mob/living/carbon/human/human = user
if(!istype(human))
return
if(!Adjacent(human))
return
if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return
if(operating)
return

add_fingerprint(user)
dispose()
FlitchTime marked this conversation as resolved.
Show resolved Hide resolved

/obj/machinery/kitchen_machine/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
Expand Down Expand Up @@ -322,7 +349,7 @@
* Machine Menu Handling/Cooking *
************************************/

/obj/machinery/kitchen_machine/proc/cook()
/obj/machinery/kitchen_machine/proc/cook(mob/user)
if(stat & (NOPOWER|BROKEN))
return
start()
Expand Down Expand Up @@ -458,7 +485,7 @@
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)
Expand Down
31 changes: 28 additions & 3 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,33 @@
updateUsrDialog()
return ATTACK_CHAIN_BLOCKED_ALL

/obj/machinery/reagentgrinder/AltClick(mob/user)
var/mob/living/carbon/human/human = user
if(!istype(human))
return
if(!Adjacent(human))
return
if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return
if(operating)
return

add_fingerprint(user)
grind(user)

/obj/machinery/reagentgrinder/CtrlShiftClick(mob/user)
var/mob/living/carbon/human/human = user
if(!istype(human))
return
if(!Adjacent(human))
return
if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED))
return
if(operating)
return

add_fingerprint(user)
detach(user)

/obj/machinery/reagentgrinder/attack_ai(mob/user)
return FALSE
Expand Down Expand Up @@ -307,7 +332,7 @@
if ("detach")
detach()

/obj/machinery/reagentgrinder/proc/detach()
/obj/machinery/reagentgrinder/proc/detach(mob/user)

if (usr.stat != 0)
FlitchTime marked this conversation as resolved.
Show resolved Hide resolved
return
Expand Down Expand Up @@ -409,7 +434,7 @@

remove_object(O)

/obj/machinery/reagentgrinder/proc/grind()
/obj/machinery/reagentgrinder/proc/grind(mob/user)

power_change()
if(stat & (NOPOWER|BROKEN))
Expand Down
Loading