Adds Orange and Purple Bandanas, Adds Bandana Colouring, Tweaks Taj/Una Bandana Sprites, Refactors Bandana Adjusting

Also refactors bandana adjustment. I made the change because now it won't revert back to a black bandana after you adjust it twice after colouring it with a crayon in the washing machine.

Tested in the following ways:
Multiple washes, multiple recolourings: Description stayed 'The colours are a bit dodgy' and the name was appropriate for the colour. No sprite issues.
Spammed the adjustment, changing from the head to the face slot at random intervals: Same as above, no sprite issues, description was as intended, name of the item was as intended.

The tweak I made to the East and West directions of the Tajara and Unathi bandana sprites were just to make it fit the muzzle better and make it look like the cloth was pulled taut over the mouth as was the case with the Vulpkanin bandana (and the Vox) to a degree. Slightly less ghetto looking.

Enhanced Bandana Adjusting Functionality

Fixes a bug where adjusting a bandana kept it in the same slot
regardless of whether it was meant to be worn as a hat or a mask.
Fixes a bug where adjusting a bandana didn't change whether or not it
obscured your identity, even when you were wearing it as a hat.
This commit is contained in:
KasparoVy
2016-02-09 00:22:22 -05:00
parent f759003b55
commit 79af19d559
9 changed files with 77 additions and 20 deletions
+34 -2
View File
@@ -285,16 +285,32 @@ BLIND // can't see anything
//Proc that moves gas/breath masks out of the way
/obj/item/clothing/mask/proc/adjustmask(var/mob/user)
var/mob/living/carbon/human/H = usr //Used to check if the mask is on the head, to check if the hands are full, and to turn off internals if they were on when the mask was pushed out of the way.
if(!ignore_maskadjust)
if(!user.canmove || user.stat || user.restrained())
return
if(src.mask_adjusted == 1)
src.icon_state = initial(icon_state)
src.icon_state = copytext(src.icon_state, 1, findtext(src.icon_state, "_up")) //Trims the '_up' off the end of the icon state, thus reverting to the most recent previous state
gas_transfer_coefficient = initial(gas_transfer_coefficient)
permeability_coefficient = initial(permeability_coefficient)
user << "You push \the [src] back into place."
src.mask_adjusted = 0
slot_flags = initial(slot_flags)
if(flags_inv != initial(flags_inv)) //If the mask is one that hides the face and can be adjusted yet lost that trait when it was adjusted, make it hide the face again.
flags_inv += HIDEFACE
if(H.head == src)
if(src.flags_inv == HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
user.unEquip(src)
else
src.loc = user
H.head = null
if(!(H.l_hand) && H.r_hand) //If only the left hand is free, put the bandana there instead.
user.put_in_l_hand(src)
else if(!(H.r_hand) && H.l_hand) //Otherwise if only the right hand is free, put the bandana there instead.
user.put_in_r_hand(src)
else if(!(H.l_hand && H.r_hand)) //Otherwise if both hands are free, pick the active one to put the bandana into.
user.put_in_active_hand(src)
else
src.icon_state += "_up"
user << "You push \the [src] out of the way."
@@ -304,12 +320,28 @@ BLIND // can't see anything
if(adjusted_flags)
slot_flags = adjusted_flags
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.internal)
if(H.internals)
H.internals.icon_state = "internal0"
H.internal = null
if(user.wear_mask == src)
if(src.flags_inv == HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
user.unEquip(src)
else
src.loc = user
user.wear_mask = null
if(!(H.l_hand) && H.r_hand) //If only the left hand is free, put the bandana there instead.
user.put_in_l_hand(src)
else if(!(H.r_hand) && H.l_hand) //Otherwise if only the right hand is free, put the bandana there instead.
user.put_in_r_hand(src)
else if(!(H.l_hand && H.r_hand)) //Otherwise if both hands are free, pick the active one to put the bandana into.
user.put_in_active_hand(src)
flags_inv -= HIDEFACE /*Done after the above to avoid having to do a check for initial(src.flags_inv == HIDEFACE).
This reveals the user's face since the bandana will now be going on their head.*/
usr.update_inv_wear_mask()
usr.update_inv_head()
//Shoes
/obj/item/clothing/shoes
+23 -2
View File
@@ -197,18 +197,38 @@
obj/item/clothing/mask/bandana/red
name = "red bandana"
icon_state = "bandred"
item_color = "red"
desc = "It's a red bandana."
obj/item/clothing/mask/bandana/blue
name = "blue bandana"
icon_state = "bandblue"
item_color = "blue"
desc = "It's a blue bandana."
obj/item/clothing/mask/bandana/gold
name = "gold bandana"
icon_state = "bandgold"
item_color = "yellow"
desc = "It's a gold bandana."
obj/item/clothing/mask/bandana/green
name = "green bandana"
icon_state = "bandgreen"
item_color = "green"
desc = "It's a green bandana."
obj/item/clothing/mask/bandana/orange
name = "orange bandana"
icon_state = "bandorange"
item_color = "orange"
desc = "It's an orange bandana."
obj/item/clothing/mask/bandana/purple
name = "purple bandana"
icon_state = "bandpurple"
item_color = "purple"
desc = "It's a purple bandana."
/obj/item/clothing/mask/bandana/botany
name = "botany bandana"
@@ -222,5 +242,6 @@ obj/item/clothing/mask/bandana/green
/obj/item/clothing/mask/bandana/black
name = "black bandana"
desc = "It's a black bandana."
icon_state = "bandblack"
icon_state = "bandblack"
item_color = "black"
desc = "It's a black bandana."