From 4a5827662c77ab1a9612615006e603d433215f15 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sat, 13 Mar 2021 22:29:05 +0100 Subject: [PATCH] you now get to change your mask at any time not just once --- code/modules/clothing/masks/miscellaneous.dm | 34 +++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index baff7ad662..dad327cb5a 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -84,11 +84,35 @@ clothing_flags = ALLOWINTERNALS armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100) mutantrace_variation = STYLE_MUZZLE - unique_reskin = list("Joy" = "joy", - "Flushed" = "flushed", - "Pensive" = "pensive", - "Angry" = "angry" - ) + actions_types = list(/datum/action/item_action/adjust) + var/list/joymask_designs = list() + + +/obj/item/clothing/mask/joy/Initialize(mapload) + . = ..() + joymask_designs = list( + "Joy" = image(icon = src.icon, icon_state = "joy"), + "Flushed" = image(icon = src.icon, icon_state = "flushed"), + "Pensive" = image(icon = src.icon, icon_state = "pensive"), + "Angry" = image(icon = src.icon, icon_state = "angry"), + ) + +/obj/item/clothing/mask/joy/ui_action_click(mob/user) + if(!istype(user) || user.incapacitated()) + return + + var/static/list/options = list("Joy" = "joy", "Flushed" = "flushed", "Pensive" = "pensive","Angry" ="angry") + + var/choice = show_radial_menu(user, src, joymask_designs, custom_check = FALSE, radius = 36, require_near = TRUE) + + if(src && choice && !user.incapacitated() && in_range(user,src)) + icon_state = options[choice] + user.update_inv_wear_mask() + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + to_chat(user, "Your Joy mask now has a [choice] Emotion!") + return 1 /obj/item/clothing/mask/pig name = "pig mask"