Files
Bubberstation/code/datums/components/sizzle.dm
SyncIt21 086a879d61 General maintenance for grilling related stuff. (#81647)
## About The Pull Request

Deals with `/obj/machinery/grill` & its related components & elements.

**1. Qol**
- Adds examines & screen tips for toolacts, adding fuel & food items on
the grill, Converts some chats into balloon alerts
  - Grills can be safely deconstructed with a crowbar when not anchored
- Food items can be grilled & re-grilled any number of times so you can
achieve that perfect crispiness. Its also realistic because there is
nothing physically stopping you from putting that item back on the grill
- Monkey fuel & any other reagent(see examines) can be added into the
grill from any open container & not just from glass bottles
- Grills can now be constructed in the crafting menu. Cargo pack cost
for purchasing grill has been halved

**2. Fixes**
- Grills now won't burn foods into a mouldy mess (if that item did that
that on the girdle). You can safely grill any item without worrying
about losing it. This also means grills no longer cook an item like a
girdle does, for e.g. the grill now won't both cook a meat slab into a
steak & grill it at the same time. You need the girdle for that.
This is only realistic because unlike a girdle which exposes the food to
direct heat the grill only exposes it to light heat & smoke so it does
not have that energy to cook/burn that item. Also this creates
immersion, you now need the girddle to cook the item & the grill to
smoke it so you know more gameplay

- The amount of time an item has been grilled for is now stored on that
food item & not as a locale variable in the grill. This means if you
remove & replace that item on the grill or move that item from 1 grill
to another it will correctly remember how long that item has been
grilled for so you don't have to re-grill that item on a different
machine for the same length of time
  
- Imposes a maximum limit on the amount of fuel you can put into an
grill (roughly 50 coal stacks). Unlimited space for fuel is not
realistic
 
**3. Code Improvements**
- Moved all non combat interactions to `item_interaction()` to end the
attack chain early before we even reach `attackby()`
- Removed trait `TRAIT_FOOD_GRILLED` no longer needed as we can re-grill
items as many times needed
 - Converts some constant values into `SECONDS` for accuracy
 - Autodoc for vars & procs

**4. Refactor**
- Grills now process manualy upon placing food or fuel into it & not
round start
   

## Changelog
🆑
qol: adds examines & screentips for grill (the machine for grilling
food), converts some chats to balloon alerts
qol: foods that can be re-grilled any number of times 
qol: grill (the machine for grilling food) can now be made in the
crafting menu. Cargo pack cost for purchasing grill has now been halved.
qol: monkey fuel & other reagents(see examines) can be added from any
container & not just from glass bottles to the grill (the machine for
grilling food)
fix: grills (the machine for grilling food) now don't burn foods into a
mouldy mess unlike the girdle
fix: correctly computes grill times of items that were previously
grilled
fix: grills now have an upper fixed fuel limit
code: autodoc procs & vars for the grill (the machine for grilling food)
refactor: grills (the machine for grilling food) has been refactored.
report bugs on github, also they only start processing after putting
food/fuel into them.
/🆑
2024-03-11 02:57:23 +00:00

32 lines
1.1 KiB
Plaintext

/datum/component/sizzle
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
///The sizzling appearance to put on top of the food item
var/mutable_appearance/sizzling
///The amount of time the food item has been sizzling for
var/grilled_time = 0
/datum/component/sizzle/Initialize(grilled_time)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
var/atom/food = parent
var/icon/grill_marks = icon(food.icon, food.icon_state)
grill_marks.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent)
grill_marks.Blend(icon('icons/obj/machines/kitchen.dmi', "grillmarks"), ICON_MULTIPLY) //adds grill marks and the remaining white areas become transparent
sizzling = new(grill_marks)
food.add_overlay(sizzling)
src.grilled_time = grilled_time
/datum/component/sizzle/InheritComponent(datum/component/C, i_am_original, grilled_time)
var/atom/food = parent
sizzling.alpha += 5
food.cut_overlay(sizzling)
food.add_overlay(sizzling)
src.grilled_time = grilled_time
///Returns how long the food item has been sizzling for
/datum/component/sizzle/proc/time_elapsed()
return src.grilled_time