Skip to content

Commit

Permalink
Autoinjector resprite (Adoption of #7100) (#15970)
Browse files Browse the repository at this point in the history
Co-authored-by: BatElite <alexandermeys@hotmail.com>
  • Loading branch information
DisturbHerb and BatElite committed Oct 6, 2023
1 parent a4fc207 commit 0aae259
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions code/modules/chemistry/tools/emergency_injectors.dm
Expand Up @@ -19,22 +19,26 @@
var/label = "orange" // colors available as of the moment: orange, red, blue, green, yellow, purple, black, white, big red
hide_attack = ATTACK_PARTIALLY_HIDDEN

New()
..()
src.item_state = "emerg_inj-[src.label]"
src.fluid_image = image(src.icon, "emerg_inj-fluid")
src.fluid_image.color = src.reagents.get_average_color().to_rgba()
src.vis_contents += src.fluid_image
src.UpdateIcon()

on_reagent_change()
..()
src.UpdateIcon()

update_icon()
src.underlays = null
if (reagents.total_volume)
icon_state = "emerg_inj-[label]"
var/datum/color/average = reagents.get_average_color()
if (!src.fluid_image)
src.fluid_image = image(src.icon, "emerg_inj-fluid", -1)
src.fluid_image.color = average.to_rgba()
src.underlays += src.fluid_image
if (src.reagents.total_volume)
src.icon_state = "emerg_inj-[src.label]"
else
icon_state = "emerg_inj-[label]0"
item_state = "emerg_inj-[label]"
src.icon_state = "emerg_inj-[src.label]0"
src.fluid_image = image(src.fluid_image, "emerg_inj-fluid-flick")
flick("emerg_inj-[src.label]-flick", src)
UpdateOverlays(src.fluid_image, "fluid")

attack(mob/M, mob/user)
if (iscarbon(M) || ismobcritter(M))
Expand Down
Binary file modified icons/obj/chemical.dmi
Binary file not shown.

0 comments on commit 0aae259

Please sign in to comment.