[MIRROR] You can now see the food in the microwave [MDB IGNORE] (#16641)

* You can now see the food in the microwave (#70203)

* Move microwaves to their own file

* Put food in the microwave window

* Shrink down how far stuff goes

* Update code/modules/food_and_drinks/machinery/microwave.dm

Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>

* You can now see the food in the microwave

* [MERGE INTO #16641][THAT MEANS THIS PR TOUCHES A MIRROR][I THINK IT WORKED][MODULAR][MDB IGNORE] You can now see the food in SKYRAT's microwaves (#16678)

* our version of micrwvae

* (Optional Commit) update butcher racks and (not used) synthesizer

* newlin

* Automatic changelog generation for PR #16678 [ci skip]

* Microwave item offsets

* blep

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: ShizCalev <ShizCalev@ users.noreply.github.com>
Co-authored-by: OrionTheFox <76465278+OrionTheFox@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2022-10-08 18:17:28 -04:00
committed by GitHub
co-authored by ShizCalev Mothblocks OrionTheFox Gandalf tastyfish
parent 0de4349cfa
commit ed4fbf1179
7 changed files with 110 additions and 20 deletions
@@ -3,8 +3,9 @@
/obj/machinery/microwave//SKYRAT EDIT - ICON OVERRIDEN BY AESTHETICS - SEE MODULE
name = "microwave oven"
desc = "Cooks and boils stuff."
icon = 'icons/obj/kitchen.dmi'
icon_state = "mw"
icon = 'icons/obj/machines/microwave.dmi'
icon_state = "map_icon"
appearance_flags = KEEP_TOGETHER | LONG_GLIDE | PIXEL_SCALE
layer = BELOW_OBJ_LAYER
density = TRUE
circuit = /obj/item/circuitboard/machine/microwave
@@ -16,6 +17,7 @@
var/dirty = 0 // 0 to 100 // Does it need cleaning?
var/dirty_anim_playing = FALSE
var/broken = 0 // 0, 1 or 2 // How broken is it???
var/open = FALSE
var/max_n_of_items = 10
var/efficiency = 0
var/datum/looping_sound/microwave/soundloop
@@ -31,11 +33,14 @@
/obj/machinery/microwave/Initialize(mapload)
. = ..()
wires = new /datum/wires/microwave(src)
create_reagents(100)
soundloop = new(src, FALSE)
set_on_table()
update_appearance(UPDATE_ICON)
/obj/machinery/microwave/Destroy()
eject()
if(wires)
@@ -91,23 +96,94 @@
"[span_notice("- Capacity: <b>[max_n_of_items]</b> items.")]\n"+\
span_notice("- Cook time reduced by <b>[(efficiency - 1) * 25]%</b>.")
#define MICROWAVE_INGREDIENT_OVERLAY_SIZE 24
/obj/machinery/microwave/update_overlays()
// When this is the nth ingredient, whats its pixel_x?
var/static/list/ingredient_shifts = list(
// SKYRAT EDIT CHANGE START - All values offset by -3 from original
-3,
0,
-6,
1,
-7,
-1,
-5,
// SKYRAT EDIT CHANGE END
)
. = ..()
// All of these will use a full icon state instead
if (panel_open || dirty == 100 || broken || dirty_anim_playing)
return .
var/ingredient_count = 0
for (var/atom/movable/ingredient as anything in ingredients)
var/image/ingredient_overlay = image(ingredient, src)
var/icon/ingredient_icon = icon(ingredient.icon, ingredient.icon_state)
ingredient_overlay.transform = ingredient_overlay.transform.Scale(
MICROWAVE_INGREDIENT_OVERLAY_SIZE / ingredient_icon.Width(),
MICROWAVE_INGREDIENT_OVERLAY_SIZE / ingredient_icon.Height(),
)
ingredient_overlay.pixel_y = -4
ingredient_overlay.layer = FLOAT_LAYER
ingredient_overlay.plane = FLOAT_PLANE
ingredient_overlay.blend_mode = BLEND_INSET_OVERLAY
ingredient_overlay.pixel_x = ingredient_shifts[(ingredient_count % ingredient_shifts.len) + 1]
ingredient_count += 1
. += ingredient_overlay
var/border_icon_state
var/door_icon_state
if (open)
door_icon_state = "door_open"
border_icon_state = "mwo"
else if (operating)
door_icon_state = "door_on"
border_icon_state = "mw1"
else
door_icon_state = "door_off"
border_icon_state = "mw"
. += mutable_appearance(
icon,
door_icon_state,
alpha = ingredients.len > 0 ? 128 : 255,
)
. += border_icon_state
if (!open)
. += "door_handle"
return .
#undef MICROWAVE_INGREDIENT_OVERLAY_SIZE
/obj/machinery/microwave/update_icon_state()
if(broken)
if (broken)
icon_state = "mwb"
return ..()
if(dirty_anim_playing)
else if (dirty_anim_playing)
icon_state = "mwbloody1"
return ..()
if(dirty == 100)
icon_state = "mwbloody"
return ..()
if(operating)
icon_state = "mw1"
return ..()
if(panel_open)
else if (dirty == 100)
icon_state = open ? "mwbloodyo" : "mwbloody"
else if(operating)
icon_state = "back_on"
else if(open)
icon_state = "back_open"
else if(panel_open)
icon_state = "mw-o"
return ..()
icon_state = "mw"
else
icon_state = "back_off"
return ..()
/obj/machinery/microwave/wrench_act(mob/living/user, obj/item/tool)
@@ -205,6 +281,7 @@
ingredients += O
user.visible_message(span_notice("[user] adds \a [O] to \the [src]."), span_notice("You add [O] to \the [src]."))
update_appearance()
return
..()
@@ -251,7 +328,7 @@
var/atom/movable/AM = i
AM.forceMove(drop_location())
ingredients.Cut()
flick("[dirty == 100 ? "mwbloodyo" : "mwo"]", src)
open()
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
@@ -379,8 +456,16 @@
/obj/machinery/microwave/proc/after_finish_loop()
set_light(0)
soundloop.stop()
open()
/obj/machinery/microwave/proc/open()
open = TRUE
update_appearance()
addtimer(CALLBACK(src, .proc/close), 0.8 SECONDS)
/obj/machinery/microwave/proc/close()
open = FALSE
update_appearance()
flick("[dirty == 100 ? "mwbloodyo" : "mwo"]", src)
/// Go on top of a table if we're anchored & not varedited
/obj/machinery/microwave/proc/set_on_table()
@@ -0,0 +1,4 @@
author: "OrionTheFox"
delete-after: True
changes:
- imageadd: "You can now see food inside the microwave. (Skyrat edition!)"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -1,6 +1,3 @@
/obj/machinery/microwave
icon = 'modular_skyrat/modules/aesthetics/kitchen/kitchen.dmi'
/obj/structure/kitchenspike_frame
icon = 'modular_skyrat/modules/aesthetics/kitchen/kitchen.dmi'
@@ -21,3 +18,7 @@
/obj/machinery/gibber
icon = 'modular_skyrat/modules/aesthetics/kitchen/kitchen.dmi'
//Different icon file, but it will still go in the kitchen folder!!!
/obj/machinery/microwave
icon = 'modular_skyrat/modules/aesthetics/kitchen/microwave.dmi'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB