diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 84990f9660..c743f26363 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -247,6 +247,30 @@ /obj/item/clothing/mask/bandana/attack_self(mob/user) adjustmask(user) +/obj/item/clothing/mask/bandana/AltClick(mob/user) + . = ..() + if(iscarbon(user)) + var/mob/living/carbon/C = user + if((C.get_item_by_slot(SLOT_HEAD == src)) || (C.get_item_by_slot(SLOT_WEAR_MASK) == src)) + to_chat(user, "You can't tie [src] while wearing it!") + return + if(slot_flags & ITEM_SLOT_HEAD) + to_chat(user, "You must undo [src] before you can tie it into a neckerchief!") + else + if(user.is_holding(src)) + var/obj/item/clothing/neck/neckerchief/nk = new(src) + nk.name = "[name] neckerchief" + nk.desc = "[desc] It's tied up like a neckerchief." + nk.icon_state = icon_state + nk.sourceBandanaType = src.type + var/currentHandIndex = user.get_held_index_of_item(src) + user.transferItemToLoc(src, null) + user.put_in_hand(nk, currentHandIndex) + user.visible_message("You tie [src] up like a neckerchief.", "[user] ties [src] up like a neckerchief.") + qdel(src) + else + to_chat(user, "You must be holding [src] in order to tie it!") + /obj/item/clothing/mask/bandana/red name = "red bandana" desc = "A fine red bandana with nanotech lining." diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index 2b43460257..530af7777d 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -291,3 +291,36 @@ icon = 'icons/obj/clothing/neck.dmi' icon_state = "bling" item_color = "bling" + +////////////////////////////////// +//VERY SUPER BADASS NECKERCHIEFS// +////////////////////////////////// + +obj/item/clothing/neck/neckerchief + icon = 'icons/obj/clothing/masks.dmi' //In order to reuse the bandana sprite + w_class = WEIGHT_CLASS_TINY + var/sourceBandanaType + +/obj/item/clothing/neck/neckerchief/worn_overlays(isinhands) + . = ..() + if(!isinhands) + var/mutable_appearance/realOverlay = mutable_appearance('icons/mob/mask.dmi', icon_state) + realOverlay.pixel_y = -3 + . += realOverlay + +/obj/item/clothing/neck/neckerchief/AltClick(mob/user) + . = ..() + if(iscarbon(user)) + var/mob/living/carbon/C = user + if(C.get_item_by_slot(SLOT_NECK) == src) + to_chat(user, "You can't untie [src] while wearing it!") + return + if(user.is_holding(src)) + var/obj/item/clothing/mask/bandana/newBand = new sourceBandanaType(user) + var/currentHandIndex = user.get_held_index_of_item(src) + var/oldName = src.name + qdel(src) + user.put_in_hand(newBand, currentHandIndex) + user.visible_message("You untie [oldName] back into a [newBand.name]", "[user] unties [oldName] back into a [newBand.name]") + else + to_chat(user, "You must be holding [src] in order to untie it!")