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
/**
+2 -2
View File
@@ -932,10 +932,10 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e
MO.desc = "Looks like this was \an [src] some time ago."
..()
/obj/item/proc/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver)
/obj/item/proc/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver, randomize_pixel_offset)
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(src, COMSIG_ITEM_MICROWAVE_ACT, microwave_source, microwaver)
return SEND_SIGNAL(src, COMSIG_ITEM_MICROWAVE_ACT, microwave_source, microwaver, randomize_pixel_offset)
/obj/item/proc/grind_requirements(obj/machinery/reagentgrinder/R) //Used to check for extra requirements for grinding an object
+1 -1
View File
@@ -242,7 +242,7 @@
. = ..()
. += "[icon_state]-[result]"
/obj/item/dice/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver)
/obj/item/dice/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver, randomize_pixel_offset)
if(microwave_riggable)
rigged = DICE_BASICALLY_RIGGED
rigged_value = result
+1 -1
View File
@@ -77,7 +77,7 @@
return
return ..()
/obj/item/clothing/head/costume/foilhat/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver)
/obj/item/clothing/head/costume/foilhat/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver, randomize_pixel_offset)
. = ..()
if(warped)
return
@@ -64,6 +64,11 @@
/obj/machinery/microwave/Exited(atom/movable/gone, direction)
if(gone in ingredients)
ingredients -= gone
if(!QDELING(gone) && ingredients.len && isitem(gone))
var/obj/item/itemized_ingredient = gone
if(!(itemized_ingredient.item_flags & NO_PIXEL_RANDOM_DROP))
itemized_ingredient.pixel_x = itemized_ingredient.base_pixel_x + rand(-6, 6)
itemized_ingredient.pixel_y = itemized_ingredient.base_pixel_y + rand(-5, 6)
return ..()
@@ -451,7 +456,7 @@
var/metal_amount = 0
for(var/obj/item/cooked_item in ingredients)
var/sigreturn = cooked_item.microwave_act(src, cooker)
var/sigreturn = cooked_item.microwave_act(src, cooker, randomize_pixel_offset = ingredients.len)
if(sigreturn & COMPONENT_MICROWAVE_SUCCESS)
if(isstack(cooked_item))
var/obj/item/stack/cooked_stack = cooked_item
+1 -1
View File
@@ -206,7 +206,7 @@
reagents.clear_reagents()
/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver)
/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/microwave_source, mob/microwaver, randomize_pixel_offset)
reagents.expose_temperature(1000)
return ..() | COMPONENT_MICROWAVE_SUCCESS