Dumping things into microwave en-masse is done via RMB or drag'n'drop (#85530)

## About The Pull Request

Closes #85523
Subjective but feels like a better solution to just blacklisting RPEDs
and leaving everything else in. Drag'n'drop won't work until #85512 gets
merged but this PR should be good to go even without it

## Changelog
🆑
qol: Dumping things into microwave en-masse is done via RMB (drag'n'drop
support coming soon!)
fix: RPEDs can now upgrade microwaves
fix: Spies can finally steal microwaves (Use RMB!)
/🆑
This commit is contained in:
SmArtKar
2024-08-16 20:35:00 +02:00
committed by GitHub
parent 00b5bc5f0c
commit 5a5c0aa0be
@@ -416,32 +416,7 @@
balloon_alert(user, "max 1 device!")
return ITEM_INTERACT_BLOCKING
if(istype(item, /obj/item/storage))
var/obj/item/storage/tray = item
var/loaded = 0
if(!istype(item, /obj/item/storage/bag/tray))
// Non-tray dumping requires a do_after
to_chat(user, span_notice("You start dumping out the contents of [item] into [src]..."))
if(!do_after(user, 2 SECONDS, target = tray))
return ITEM_INTERACT_BLOCKING
for(var/obj/tray_item in tray.contents)
if(!IS_EDIBLE(tray_item))
continue
if(ingredients.len >= max_n_of_items)
balloon_alert(user, "it's full!")
return ITEM_INTERACT_BLOCKING
if(tray.atom_storage.attempt_remove(tray_item, src))
loaded++
ingredients += tray_item
if(loaded)
open(autoclose = 0.6 SECONDS)
to_chat(user, span_notice("You insert [loaded] items into \the [src]."))
update_appearance()
return ITEM_INTERACT_SUCCESS
if(item.w_class <= WEIGHT_CLASS_NORMAL && !user.combat_mode)
if(item.w_class <= WEIGHT_CLASS_NORMAL && !user.combat_mode && isnull(item.atom_storage))
if(ingredients.len >= max_n_of_items)
balloon_alert(user, "it's full!")
return ITEM_INTERACT_BLOCKING
@@ -455,6 +430,43 @@
update_appearance()
return ITEM_INTERACT_SUCCESS
/obj/machinery/microwave/item_interaction_secondary(mob/living/user, obj/item/tool, list/modifiers)
if (isnull(tool.atom_storage))
return
handle_dumping(user, tool)
return ITEM_INTERACT_BLOCKING
/obj/machinery/microwave/proc/handle_dumping(mob/living/user, obj/item/tool)
if(isnull(tool.atom_storage))
return
var/loaded = 0
if(!istype(tool, /obj/item/storage/bag/tray))
// Non-tray dumping requires a do_after
to_chat(user, span_notice("You start dumping out the contents of [tool] into [src]..."))
if(!do_after(user, 2 SECONDS, target = tool))
return
for(var/obj/tray_item in tool.contents)
if(!IS_EDIBLE(tray_item))
continue
if(ingredients.len >= max_n_of_items)
balloon_alert(user, "it's full!")
return
if(tool.atom_storage.attempt_remove(tray_item, src))
loaded++
ingredients += tray_item
if(loaded)
open(autoclose = 0.6 SECONDS)
to_chat(user, span_notice("You insert [loaded] items into \the [src]."))
update_appearance()
/obj/machinery/microwave/mouse_drop_receive(obj/item/tool, mob/user, params)
if (!istype(tool) || isnull(tool.atom_storage))
return
handle_dumping(user, tool)
/obj/machinery/microwave/attack_hand_secondary(mob/user, list/modifiers)
if(user.can_perform_action(src, ALLOW_SILICON_REACH))
if(!length(ingredients))