Merge pull request #11450 from zeroisthebiggay/timefornekerchiefsuwu

ports ([READY] Allows bandannas to be worn as neckerchiefs. #40125) from TG code
This commit is contained in:
kevinz000
2020-03-14 09:12:12 -07:00
committed by GitHub
2 changed files with 57 additions and 0 deletions
@@ -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, "<span class='warning'>You can't tie [src] while wearing it!</span>")
return
if(slot_flags & ITEM_SLOT_HEAD)
to_chat(user, "<span class='warning'>You must undo [src] before you can tie it into a neckerchief!</span>")
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("<span class='notice'>You tie [src] up like a neckerchief.</span>", "<span class='notice'>[user] ties [src] up like a neckerchief.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>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."
+33
View File
@@ -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, "<span class='warning'>You can't untie [src] while wearing it!</span>")
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, "<span class='warning'>You must be holding [src] in order to untie it!")