randomizes the pixel offset of stuff when it comes out of a microwave (#71091)

Randomizes the pixel offset of stuff when it comes out of the microwave
This commit is contained in:
ShizCalev
2022-11-06 05:24:27 -05:00
committed by GitHub
parent 0918ad642a
commit 9ebdbe1b3d
6 changed files with 18 additions and 7 deletions
+7 -1
View File
@@ -27,7 +27,7 @@
* Signal proc for [COMSIG_ITEM_MICROWAVE_ACT].
* Handles the actual microwaving part.
*/
/datum/element/microwavable/proc/on_microwaved(atom/source, obj/machinery/microwave/used_microwave, mob/microwaver)
/datum/element/microwavable/proc/on_microwaved(atom/source, obj/machinery/microwave/used_microwave, mob/microwaver, randomize_pixel_offset)
SIGNAL_HANDLER
var/atom/result
@@ -57,6 +57,12 @@
if(istype(result, default_typepath))
recipe_result |= COMPONENT_MICROWAVE_BAD_RECIPE
if(randomize_pixel_offset && isitem(result))
var/obj/item/result_item = result
if(!(result_item.item_flags & NO_PIXEL_RANDOM_DROP))
result_item.pixel_x = result_item.base_pixel_x + rand(-6, 6)
result_item.pixel_y = result_item.base_pixel_y + rand(-5, 6)
return recipe_result
/**