Merge pull request #11416 from KasparoVy/swippity-swappity

Adds Eyewear Adjustment: Wearing Over/Under Masks
This commit is contained in:
variableundefined
2019-05-03 22:40:21 +08:00
committed by GitHub
3 changed files with 59 additions and 29 deletions
+23
View File
@@ -159,6 +159,7 @@
var/list/color_view = null//overrides client.color while worn
var/prescription = 0
var/prescription_upgradable = 0
var/over_mask = FALSE //Whether or not the eyewear is rendered above the mask. Purely cosmetic.
strip_delay = 20 // but seperated to allow items to protect but not impair vision, like space helmets
put_on_delay = 25
burn_state = FIRE_PROOF
@@ -173,6 +174,28 @@ SEE_PIXELS// if an object is located on an unlit area, but some of its pixels ar
BLIND // can't see anything
*/
/obj/item/clothing/glasses/verb/adjust_eyewear() //Adjust eyewear to be worn above or below the mask.
set name = "Adjust Eyewear"
set category = "Object"
set desc = "Adjust your eyewear to be worn over or under a mask."
set src in usr
var/mob/living/carbon/human/user = usr
if(!istype(user))
return
if(user.incapacitated()) //Dead spessmen adjust no glasses. Resting/buckled ones do, though
return
var/action_fluff = "You adjust \the [src]"
if(user.glasses == src)
if(!user.canUnEquip(src))
to_chat(usr, "[src] is stuck to you!")
return
if(attack_hand(user)) //Remove the glasses for this action. Prevents logic-defying instances where glasses phase through your mask as it ascends/descends to another plane of existence.
action_fluff = "You remove \the [src] and adjust it"
over_mask = !over_mask
to_chat(user, "<span class='notice'>[action_fluff] to be worn [over_mask ? "over" : "under"] a mask.</span>")
//Gloves
/obj/item/clothing/gloves
@@ -659,6 +659,7 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_glasses(var/update_icons=1)
remove_overlay(GLASSES_LAYER)
remove_overlay(GLASSES_OVER_LAYER)
remove_overlay(OVER_MASK_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_glasses]
@@ -681,7 +682,12 @@ var/global/list/damage_icon_parts = list()
new_glasses = mutable_appearance('icons/mob/eyes.dmi', "[glasses.icon_state]", layer = -GLASSES_LAYER)
var/datum/sprite_accessory/hair/hair_style = GLOB.hair_styles_full_list[head_organ.h_style]
if(hair_style && hair_style.glasses_over) //Select which layer to use based on the properties of the hair style. Hair styles with hair that don't overhang the arms of the glasses should have glasses_over set to a positive value.
var/obj/item/clothing/glasses/G = glasses
if(istype(G) && G.over_mask) //If the user's used the 'wear over mask' verb on the glasses.
new_glasses.layer = -OVER_MASK_LAYER
overlays_standing[OVER_MASK_LAYER] = new_glasses
apply_overlay(OVER_MASK_LAYER)
else if(hair_style && hair_style.glasses_over) //Select which layer to use based on the properties of the hair style. Hair styles with hair that don't overhang the arms of the glasses should have glasses_over set to a positive value.
new_glasses.layer = -GLASSES_OVER_LAYER
overlays_standing[GLASSES_OVER_LAYER] = new_glasses
apply_overlay(GLASSES_OVER_LAYER)