Files
Bubberstation/code/datums/components/sizzle.dm
SkyratBot 2f552919c1 [MIRROR] Icons folder cleaning wave two [MDB IGNORE] (#22454)
* Icons folder cleaning wave two

* Merge conflict resolution

* Modular path hell

* hmm

* Update 2022-10.yml

* Another modular thing

---------

Co-authored-by: YesterdaysPromise <122572637+YesterdaysPromise@users.noreply.github.com>
Co-authored-by: Giz <vinylspiders@gmail.com>
2023-07-16 00:41:18 -04:00

27 lines
906 B
Plaintext

/datum/component/sizzle
var/mutable_appearance/sizzling
var/sizzlealpha = 0
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
/datum/component/sizzle/Initialize()
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
setup_sizzle()
/datum/component/sizzle/InheritComponent(datum/component/C, i_am_original)
var/atom/food = parent
sizzlealpha += 5
sizzling.alpha = sizzlealpha
food.cut_overlay(sizzling)
food.add_overlay(sizzling)
/datum/component/sizzle/proc/setup_sizzle()
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)
sizzling.alpha = sizzlealpha
food.add_overlay(sizzling)