Skip to content

Commit

Permalink
доработка
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Dec 11, 2024
1 parent 02afe36 commit 6c28c38
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
24 changes: 16 additions & 8 deletions code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,33 +147,37 @@
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
/obj/machinery/kitchen_machine/AltClick(mob/living/carbon/human/human)
if(!istype(human))
return

if(!Adjacent(human))
return

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

if(operating)
return

add_fingerprint(user)
add_fingerprint(human)
cook()

/obj/machinery/kitchen_machine/CtrlShiftClick(mob/user)
var/mob/living/carbon/human/human = user
/obj/machinery/kitchen_machine/CtrlShiftClick(mob/living/carbon/human/human)
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(user)
add_fingerprint(human)
dispose(human)

/obj/machinery/kitchen_machine/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
Expand Down Expand Up @@ -488,10 +492,13 @@
/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(user, "<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 @@ -553,6 +560,7 @@

if("dispose")
dispose(usr)

return


Expand Down
30 changes: 18 additions & 12 deletions code/modules/reagents/chemistry/machinery/reagentgrinder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,33 +231,37 @@
updateUsrDialog()
return ATTACK_CHAIN_BLOCKED_ALL

/obj/machinery/reagentgrinder/AltClick(mob/user)
var/mob/living/carbon/human/human = user
/obj/machinery/reagentgrinder/AltClick(mob/living/carbon/human/human)
if(!istype(human))
return

if(!Adjacent(human))
return

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

if(operating)
return

add_fingerprint(user)
add_fingerprint(human)
grind()

/obj/machinery/reagentgrinder/CtrlShiftClick(mob/user)
var/mob/living/carbon/human/human = user
/obj/machinery/reagentgrinder/CtrlShiftClick(mob/living/carbon/human/human)
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()
add_fingerprint(human)
detach(human)

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

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

Check failure on line 341 in code/modules/reagents/chemistry/machinery/reagentgrinder.dm

View workflow job for this annotation

GitHub Actions / Run Linters

inconsistent indentation: 3 % 2 != 0

if (usr.stat != 0)
return
if (!beaker)

Check failure on line 343 in code/modules/reagents/chemistry/machinery/reagentgrinder.dm

View workflow job for this annotation

GitHub Actions / Run Linters

possible unreachable code here
return
return

Check failure on line 344 in code/modules/reagents/chemistry/machinery/reagentgrinder.dm

View workflow job for this annotation

GitHub Actions / Run Linters

inconsistent indentation: 3 % 2 != 0

beaker.loc = src.loc
beaker = null

update_icon(UPDATE_ICON_STATE)
updateUsrDialog()

Expand Down

0 comments on commit 6c28c38

Please sign in to comment.