diff --git a/code/game/machinery/vendors/generic_vendors.dm b/code/game/machinery/vendors/generic_vendors.dm index d58688d95eb..6fab8e16d1d 100644 --- a/code/game/machinery/vendors/generic_vendors.dm +++ b/code/game/machinery/vendors/generic_vendors.dm @@ -713,6 +713,7 @@ /obj/item/clothing/mask/face/fox = 1, /obj/item/clothing/mask/face/tribal = 1, /obj/item/clothing/mask/face/rat = 1, + /obj/item/clothing/mask/fake_beard = 1, /obj/item/clothing/suit/apron/overalls = 1, /obj/item/clothing/head/rabbitears =1, /obj/item/clothing/head/sombrero = 1, @@ -851,6 +852,7 @@ /obj/item/clothing/mask/face/fox = 100, /obj/item/clothing/mask/face/tribal = 100, /obj/item/clothing/mask/face/rat = 100, + /obj/item/clothing/mask/fake_beard = 50, /obj/item/clothing/suit/apron/overalls = 75, /obj/item/clothing/head/rabbitears = 75, /obj/item/clothing/head/sombrero = 40, diff --git a/code/modules/client/preference/loadout/loadout_general.dm b/code/modules/client/preference/loadout/loadout_general.dm index cb29fc68949..2f2c0138159 100644 --- a/code/modules/client/preference/loadout/loadout_general.dm +++ b/code/modules/client/preference/loadout/loadout_general.dm @@ -193,6 +193,10 @@ display_name = "Bandana, skull" path = /obj/item/clothing/mask/bandana/skull +/datum/gear/fake_beard + display_name = "Fake beard" + path = /obj/item/clothing/mask/fake_beard + /datum/gear/pai display_name = "Personal Artificial Intelligence" path = /obj/item/paicard diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 25332d90ee4..a6c481ae218 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -375,36 +375,57 @@ var/obj/item/clothing/under/has_under = null /// the attached hats to this hat. var/list/attached_hats = list() + /// the attached masks to this hat + var/list/attached_masks = list() /// if this hat can have hats placed on top of it. var/can_have_hats = FALSE /// if this hat can be a hat of a hat. Hat^2 var/can_be_hat = TRUE + /// if this hat can have masks attached to it. + var/can_have_mask = FALSE /obj/item/clothing/head/AltShiftClick(mob/user) if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user)) return - if(!length(attached_hats)) + + var/list/removable_items = list() + removable_items += attached_hats + removable_items += attached_masks + + if(!length(removable_items)) return - var/obj/item/clothing/head/hat - if(length(attached_hats) > 1) - var/pick = radial_menu_helper(usr, src, attached_hats, custom_check = FALSE, require_near = TRUE) - if(!pick || !istype(pick, /obj/item/clothing/head) || !Adjacent(usr)) + + var/obj/item/picked_item + if(length(removable_items) > 1) + var/pick = radial_menu_helper(usr, src, removable_items, custom_check = FALSE, require_near = TRUE) + if(!pick || !Adjacent(usr)) return - hat = pick + picked_item = pick else - hat = attached_hats[1] - remove_hat(user, hat) + picked_item = removable_items[1] + + // Remove the appropriate item type + if(istype(picked_item, /obj/item/clothing/head)) + remove_hat(user, picked_item) + else if(istype(picked_item, /obj/item/clothing/mask)) + remove_mask(user, picked_item) /obj/item/clothing/head/Destroy() if(is_equipped()) var/mob/M = loc for(var/obj/item/clothing/head/H as anything in attached_hats) H.on_removed(M) + for(var/obj/item/clothing/mask/mask as anything in attached_masks) + detach_mask(mask, null) else for(var/obj/item/clothing/head/H as anything in attached_hats) H.forceMove(get_turf(src)) + for(var/obj/item/clothing/mask/mask as anything in attached_masks) + mask.attached_to_hat = null + mask.forceMove(get_turf(src)) attached_hats = null + attached_masks = null return ..() /obj/item/clothing/head/dropped(mob/user, silent) @@ -420,6 +441,9 @@ . = ..() for(var/obj/item/clothing/head/hat as anything in attached_hats) . += "\A [hat] is placed neatly on top." + for(var/obj/item/clothing/mask/mask as anything in attached_masks) + . += "\A [mask] is attached to it." + if(length(attached_hats) || length(attached_masks)) . += SPAN_NOTICE("Alt-Shift-Click to remove an accessory.") //when user attached a hat to H (another hat) @@ -513,9 +537,69 @@ /obj/item/clothing/head/attackby__legacy__attackchain(obj/item/I, mob/user, params) if(istype(I, /obj/item/clothing/head) && can_have_hats) attach_hat(I, user, TRUE) + else if(istype(I, /obj/item/clothing/mask) && can_have_mask) + var/obj/item/clothing/mask/M = I + if(M.can_attach_to_hat) + attach_mask(M, user, TRUE) return ..() +/obj/item/clothing/head/proc/can_attach_mask(obj/item/clothing/mask/mask) + if(!can_have_mask) + return FALSE + if(!mask.can_attach_to_hat) + return FALSE + if(length(attached_masks) >= 1) + return FALSE + return TRUE + +/obj/item/clothing/head/proc/attach_mask(obj/item/clothing/mask/mask, mob/user, unequip = FALSE) + if(!can_attach_mask(mask)) + to_chat(user, SPAN_NOTICE("You cannot attach [mask] to [src].")) + return FALSE + + if(unequip && !user.drop_item_to_ground(mask)) + return FALSE + + attached_masks += mask + mask.attached_to_hat = src + mask.forceMove(src) + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + H.update_inv_head() + + to_chat(user, SPAN_NOTICE("You attach [mask] to [src].")) + return TRUE + +/obj/item/clothing/head/proc/detach_mask(obj/item/clothing/mask/mask, mob/user) + if(!(mask in attached_masks)) + return FALSE + + attached_masks -= mask + mask.attached_to_hat = null + + if(user) + user.put_in_hands(mask) + else + mask.forceMove(get_turf(src)) + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + H.update_inv_head() + + return TRUE + +/obj/item/clothing/head/proc/remove_mask(mob/user, obj/item/clothing/mask/mask) + if(!isliving(user)) + return + if(user.incapacitated()) + return + if(!Adjacent(user)) + return + if(detach_mask(mask, user)) + to_chat(user, SPAN_NOTICE("You remove [mask] from [src].")) + ////////////////////////////// // MARK: MASK ////////////////////////////// @@ -528,6 +612,10 @@ permeability_coefficient = 0.7 var/adjusted_flags = null + /// If this mask can be attached to a hat + var/can_attach_to_hat = FALSE + /// The head clothing that this mask is attached to + var/obj/item/clothing/head/attached_to_hat = null //Proc that moves gas/breath masks out of the way /obj/item/clothing/mask/proc/adjustmask(mob/user) diff --git a/code/modules/clothing/masks/misc_masks.dm b/code/modules/clothing/masks/misc_masks.dm index 9222a48df66..0a9edf87642 100644 --- a/code/modules/clothing/masks/misc_masks.dm +++ b/code/modules/clothing/masks/misc_masks.dm @@ -320,6 +320,12 @@ desc = "A mask carved out of wood, detailed carefully by hand." icon_state = "bumba" +/obj/item/clothing/mask/fake_beard + name = "fake beard" + desc = "A fake beard. Great for making you look wise, festive, or senile." + icon_state = "fake_beard" + can_attach_to_hat = TRUE + /obj/item/clothing/mask/fawkes name = "Guy Fawkes mask" desc = "A mask designed to help you remember a specific date." diff --git a/code/modules/clothing/suits/wiz_robe.dm b/code/modules/clothing/suits/wiz_robe.dm index 5f96c895271..3cd8f8628f4 100644 --- a/code/modules/clothing/suits/wiz_robe.dm +++ b/code/modules/clothing/suits/wiz_robe.dm @@ -46,13 +46,14 @@ ) /obj/item/clothing/head/wizard/fake - desc = "It has WIZZARD written across it in sequins. Comes with a cool beard." + desc = "It has WIZZARD written across it in sequins. Clip-on beard sold separately." icon_state = "wizard-fake" gas_transfer_coefficient = 1 permeability_coefficient = 1 armor = null magical = FALSE resistance_flags = FLAMMABLE + can_have_mask = TRUE icon_monitor = 'icons/mob/clothing/species/machine/monitor/hood.dmi' sprite_sheets = list("Vox" = 'icons/mob/clothing/species/vox/head.dmi') diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 06894bdb2cc..c9ba69b21fe 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -827,6 +827,11 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) var/hat_worn_icon_state = hat.worn_icon_state || hat.icon_state standing.overlays += image(icon = hat_worn_icon, icon_state = hat_worn_icon_state) + for(var/obj/item/clothing/mask/mask in w_hat.attached_masks) + var/mask_worn_icon = listgetindex(mask.sprite_sheets, dna.species.sprite_sheet_name) || mask.worn_icon || 'icons/mob/clothing/mask.dmi' + var/mask_worn_icon_state = mask.worn_icon_state || mask.icon_state + standing.overlays += image(icon = mask_worn_icon, icon_state = mask_worn_icon_state) + if(head.blood_DNA) var/image/bloodsies = image("icon" = dna.species.blood_mask, "icon_state" = "helmetblood") bloodsies.color = head.blood_color diff --git a/icons/mob/clothing/head.dmi b/icons/mob/clothing/head.dmi index 5b92b696f2a..1425d7b768f 100644 Binary files a/icons/mob/clothing/head.dmi and b/icons/mob/clothing/head.dmi differ diff --git a/icons/mob/clothing/mask.dmi b/icons/mob/clothing/mask.dmi index 1715d9d7b8b..37eb6057244 100644 Binary files a/icons/mob/clothing/mask.dmi and b/icons/mob/clothing/mask.dmi differ diff --git a/icons/obj/clothing/masks.dmi b/icons/obj/clothing/masks.dmi index 629c325615a..4dab0780ed2 100644 Binary files a/icons/obj/clothing/masks.dmi and b/icons/obj/clothing/masks.dmi differ