Skip to content

Commit

Permalink
Fixes some dyed items retaining their original appearance and adds pl…
Browse files Browse the repository at this point in the history
…asmamen helmet dyeing (#27256)

* Fixes dying not changing the color or description of the dyed item, making it appear unchanged when worn.

* adds plasmaman helmet dyeing
  • Loading branch information
Migratingcocofruit authored Nov 29, 2024
1 parent 8ad28af commit 3be13c3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/dye_keys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define DYE_REGISTRY_BEANIE "beanie"
#define DYE_REGISTRY_BEDSHEET "bedsheet"
#define DYE_REGISTRY_PLASMAMEN "plasmamen"
#define DYE_REGISTRY_PLASMAMEN_HELMET "plasmamen_helmet"
#define DYE_REGISTRY_SYNDICATE_SUIT "syndicate_suit"
#define DYE_REGISTRY_SYNDICATE_HELMET "syndicate_helmet"
#define DYE_REGISTRY_VOID_SUIT "void_suit"
Expand Down
20 changes: 20 additions & 0 deletions code/_globalvars/lists/dye_registry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,26 @@ GLOBAL_LIST_INIT(dye_registry, list(
DYE_RD = /obj/item/clothing/under/plasmaman/rd,
DYE_CMO = /obj/item/clothing/under/plasmaman/cmo,
),
DYE_REGISTRY_PLASMAMEN_HELMET = list(
DYE_RED = /obj/item/clothing/head/helmet/space/plasmaman/security,
DYE_ORANGE = /obj/item/clothing/head/helmet/space/plasmaman,
DYE_YELLOW = /obj/item/clothing/head/helmet/space/plasmaman/engineering,
DYE_GREEN = /obj/item/clothing/head/helmet/space/plasmaman/botany,
DYE_BLUE = /obj/item/clothing/head/helmet/space/plasmaman/atmospherics,
DYE_PURPLE = /obj/item/clothing/head/helmet/space/plasmaman/janitor,
DYE_BLACK = /obj/item/clothing/head/helmet/space/plasmaman/robotics,
DYE_WHITE = /obj/item/clothing/head/helmet/space/plasmaman/chef,
DYE_MIME = /obj/item/clothing/head/helmet/space/plasmaman/mime,
DYE_CLOWN = /obj/item/clothing/head/helmet/space/plasmaman/clown,
DYE_QM = /obj/item/clothing/head/helmet/space/plasmaman/cargo,
DYE_LAW = /obj/item/clothing/head/helmet/space/plasmaman/security/warden,
DYE_CAPTAIN = /obj/item/clothing/head/helmet/space/plasmaman/captain,
DYE_HOP = /obj/item/clothing/head/helmet/space/plasmaman/hop,
DYE_HOS =/obj/item/clothing/head/helmet/space/plasmaman/security/hos,
DYE_CE = /obj/item/clothing/head/helmet/space/plasmaman/engineering/ce,
DYE_RD = /obj/item/clothing/head/helmet/space/plasmaman/rd,
DYE_CMO = /obj/item/clothing/head/helmet/space/plasmaman/cmo,
),
DYE_REGISTRY_VOID_SUIT = list(
DYE_RED = /obj/item/clothing/suit/space/nasavoid,
DYE_GREEN = /obj/item/clothing/suit/space/nasavoid/green,
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items/dyeing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
icon_state = initial(target_obj.icon_state)
item_state = initial(target_obj.item_state)
sprite_sheets = target_obj.sprite_sheets
item_color = target_obj.item_color
desc = target_obj.desc
base_icon_state = target_obj.base_icon_state

// update inhand sprites
lefthand_file = initial(target_obj.lefthand_file)
Expand Down
9 changes: 7 additions & 2 deletions code/modules/clothing/spacesuits/plasmamen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
desc = "A special containment helmet that allows plasma-based lifeforms to exist safely in an oxygenated environment. It is space-worthy, and may be worn in tandem with other EVA gear."
icon_state = "plasmaman-helm"
item_state = "plasmaman-helm"
base_icon_state = "plasmaman-helm"
strip_delay = 80
flash_protect = FLASH_PROTECTION_WELDER
tint = FLASH_PROTECTION_WELDER
Expand All @@ -15,6 +16,9 @@
var/smile_color = "#FF0000"
var/visor_icon = "envisor"
var/smile_state = "envirohelm_smile"

dyeable = TRUE
dyeing_key = DYE_REGISTRY_PLASMAMEN_HELMET
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_welding_screen/plasmaman)
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
Expand All @@ -28,6 +32,7 @@

/obj/item/clothing/head/helmet/space/plasmaman/Initialize(mapload)
. = ..()
base_icon_state = icon_state
visor_toggling()
update_icon()

Expand All @@ -51,9 +56,9 @@

/obj/item/clothing/head/helmet/space/plasmaman/update_icon_state()
if(!up)
icon_state = initial(icon_state)
icon_state = base_icon_state
else
icon_state = "[initial(icon_state)][on ? "-light":""]"
icon_state = "[base_icon_state][on ? "-light":""]"
item_state = icon_state

/obj/item/clothing/head/helmet/space/plasmaman/update_overlays()
Expand Down

0 comments on commit 3be13c3

Please sign in to comment.