Skip to content

Commit

Permalink
Fixes the Vaurca autoinhaler (Aurorastation#20008)
Browse files Browse the repository at this point in the history
This fixes the sprite of the special Vaurca phoron inhaler so it appears
properly. It doesn't seem like the current code was written with the
inhaler overlays in mind, so ingame it currently appears as a
phoron-coloured overlay without the intended sprite. Implements general
support for inhalers without overlays.

---------

Signed-off-by: hazelrat <[email protected]>
Co-authored-by: Geeves <[email protected]>
  • Loading branch information
hazelrat and Geevies authored Oct 8, 2024
1 parent 8e00916 commit 414173b
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 11 deletions.
25 changes: 14 additions & 11 deletions code/modules/reagents/reagent_containers/inhaler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
slot_flags = SLOT_BELT
var/name_label
var/spent = FALSE
/// Define to false if overlays aren't wanted, such as if the sprite isn't designed for them.
var/has_overlays = TRUE
matter = list(MATERIAL_GLASS = 400, DEFAULT_WALL_MATERIAL = 200)

/obj/item/reagent_containers/inhaler/Initialize()
Expand Down Expand Up @@ -138,18 +140,19 @@
. = ..()

/obj/item/reagent_containers/inhaler/update_icon()
ClearOverlays()
if(!is_open_container())
var/mutable_appearance/backing_overlay = mutable_appearance(icon, "autoinhaler_secured")
AddOverlays(backing_overlay)

icon_state = "[initial(icon_state)][spent]"
item_state = "[initial(item_state)][spent]"

if(reagents.total_volume)
var/mutable_appearance/reagent_overlay = mutable_appearance(icon, "autoinhaler_reagents")
reagent_overlay.color = reagents.get_color()
AddOverlays(reagent_overlay)
if(has_overlays)
ClearOverlays()
if(!is_open_container())
var/mutable_appearance/backing_overlay = mutable_appearance(icon, "autoinhaler_secured")
AddOverlays(backing_overlay)
if(reagents.total_volume)
var/mutable_appearance/reagent_overlay = mutable_appearance(icon, "autoinhaler_reagents")
reagent_overlay.color = reagents.get_color()
AddOverlays(reagent_overlay)

update_held_icon()

/obj/item/reagent_containers/inhaler/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
Expand Down Expand Up @@ -217,10 +220,10 @@
/obj/item/reagent_containers/inhaler/phoron_special
name = "vaurca autoinhaler (phoron)"
desc = "A strange device that contains some sort of heavy-duty bag and mouthpiece combo."
icon_state = "anthaler1"
icon_state = "anthaler"
atom_flags = 0
volume = 10
var/empty_state = "anthaler0"
has_overlays = FALSE

/obj/item/reagent_containers/inhaler/phoron_special/Initialize()
. =..()
Expand Down
58 changes: 58 additions & 0 deletions html/changelogs/hazelmouse-inhalersprites.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: hazelmouse

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Fixed the broken sprite of the Vaurca phoron autoinhaler."
Binary file modified icons/obj/item/reagent_containers/syringe.dmi
Binary file not shown.

0 comments on commit 414173b

Please sign in to comment.