diff --git a/code/modules/food_and_drinks/machinery/microwave.dm b/code/modules/food_and_drinks/machinery/microwave.dm index 88256eaf1d2..99108f18a2a 100644 --- a/code/modules/food_and_drinks/machinery/microwave.dm +++ b/code/modules/food_and_drinks/machinery/microwave.dm @@ -114,6 +114,7 @@ QDEL_LIST(ingredients) QDEL_NULL(wires) QDEL_NULL(soundloop) + QDEL_NULL(particles) if(!isnull(cell)) QDEL_NULL(cell) return ..() @@ -541,8 +542,9 @@ /obj/machinery/microwave/proc/eject() var/atom/drop_loc = drop_location() - for(var/atom/movable/movable_ingredient as anything in ingredients) - movable_ingredient.forceMove(drop_loc) + for(var/obj/item/item_ingredient as anything in ingredients) + item_ingredient.forceMove(drop_loc) + item_ingredient.dropped() //Mob holders can be on the ground if we don't do this open(autoclose = 1.4 SECONDS) /obj/machinery/microwave/proc/start_cycle(mob/user) @@ -674,10 +676,34 @@ if(MICROWAVE_PRE) pre_success(cooker) return + + if(cycles == 1) //Only needs to try to shock mobs once, towards the end of the loop + var/successful_shock + var/list/microwave_contents = list() + microwave_contents += get_all_contents() //Mobs are often hid inside of mob holders, which could be fried and made into a burger... + for(var/mob/living/victim in microwave_contents) + if(victim.electrocute_act(shock_damage = 100, source = src, siemens_coeff = 1, flags = SHOCK_NOGLOVES)) + successful_shock = TRUE + if(victim.stat == DEAD) //This is mostly so humans that can_be_held don't get gibbed from one microwave run alone, but mice become burnt messes + victim.gib() + muck() + if(successful_shock) //We only want to give feedback once, regardless of how many mobs got shocked + var/list/cant_smell = list() + for(var/mob/smeller in get_hearers_in_view(DEFAULT_MESSAGE_RANGE, src)) + if(HAS_TRAIT(smeller, TRAIT_ANOSMIA)) + cant_smell += smeller + visible_message(span_danger("You smell a burnt smell coming from [src]!"), ignored_mobs = cant_smell) + particles = new /particles/smoke() + addtimer(CALLBACK(src, PROC_REF(remove_smoke)), 10 SECONDS) + Shake(duration = 1 SECONDS) + cycles-- use_energy(active_power_usage) addtimer(CALLBACK(src, PROC_REF(cook_loop), type, cycles, wait, cooker), wait) +/obj/machinery/microwave/proc/remove_smoke() + QDEL_NULL(particles) + /obj/machinery/microwave/power_change() . = ..() if(cell_powered) diff --git a/code/modules/mob/living/basic/vermin/mouse.dm b/code/modules/mob/living/basic/vermin/mouse.dm index 3cce5e34817..724833af16f 100644 --- a/code/modules/mob/living/basic/vermin/mouse.dm +++ b/code/modules/mob/living/basic/vermin/mouse.dm @@ -117,11 +117,19 @@ . = ..(TRUE) // Now if we were't ACTUALLY gibbed, spawn the dead mouse if(!gibbed) - var/obj/item/food/deadmouse/mouse = new(loc) - mouse.copy_corpse(src) - if(HAS_TRAIT(src, TRAIT_BEING_SHOCKED)) - mouse.desc = "They're toast." - mouse.add_atom_colour("#3A3A3A", FIXED_COLOUR_PRIORITY) + var/make_a_corpse = TRUE + var/place_to_make_corpse = loc + if(istype(loc, /obj/item/clothing/head/mob_holder))//If our mouse is dying in place holder we want to put the dead mouse where the place holder was + var/obj/item/clothing/head/mob_holder/found_holder = loc + place_to_make_corpse = found_holder.loc + if(istype(found_holder.loc, /obj/machinery/microwave))//Microwaves gib things that die when cooked, so we don't need to make a dead body too + make_a_corpse = FALSE + if(make_a_corpse) + var/obj/item/food/deadmouse/mouse = new(place_to_make_corpse) + mouse.copy_corpse(src) + if(HAS_TRAIT(src, TRAIT_BEING_SHOCKED)) + mouse.desc = "They're toast." + mouse.add_atom_colour("#3A3A3A", FIXED_COLOUR_PRIORITY) qdel(src) /mob/living/basic/mouse/UnarmedAttack(atom/attack_target, proximity_flag, list/modifiers)