Minor mask tweaks, adds alt_head mask refitting, adds fitted versions of unathi masks for the new alt head.

The alt_head mask refitting system works like this: If the player has an alt_head that's not "None", the system will look for an icon state in the most relevant mask icon file that has the mask's icon state and alt_head suffix ("[wear_mask.icon_state]_[alternate_head.suffix]") and, if it exists ([(alternate_head && ("[wear_mask.icon_state]_[alternate_head.suffix]" in mask_icon.IconStates())) ? "_[alternate_head.suffix]" : ""]") the mask sprite that will appear on the character will have that icon state. If it doesn't exist, the mask sprite that will appear on the character will have the default icon state for the mask object.
This commit is contained in:
KasparoVy
2016-08-17 08:19:52 -04:00
parent e0bfbd0af6
commit d7b7df692a
8 changed files with 19 additions and 5 deletions
@@ -133,6 +133,8 @@
update_markings()
update_body(1, 1) //Update the body and force limb icon regeneration to update the head with the new icon.
if(wear_mask)
update_inv_wear_mask()
return 1
/mob/living/carbon/human/proc/reset_hair()
@@ -1013,13 +1013,21 @@ var/global/list/damage_icon_parts = list()
if(inv)
inv.update_icon()
if(wear_mask && (istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory)))
var/obj/item/organ/external/head/head_organ = get_organ("head")
var/datum/sprite_accessory/alt_heads/alternate_head
if(head_organ.alt_head && head_organ.alt_head != "None")
alternate_head = alt_heads_list[head_organ.alt_head]
var/image/standing
var/icon/mask_icon = new(wear_mask.icon)
if(wear_mask.icon_override)
standing = image("icon" = wear_mask.icon_override, "icon_state" = "[wear_mask.icon_state]")
mask_icon = new(wear_mask.icon_override)
standing = image("icon" = wear_mask.icon_override, "icon_state" = "[wear_mask.icon_state][(alternate_head && ("[wear_mask.icon_state]_[alternate_head.suffix]" in mask_icon.IconStates())) ? "_[alternate_head.suffix]" : ""]")
else if(wear_mask.sprite_sheets && wear_mask.sprite_sheets[species.name])
standing = image("icon" = wear_mask.sprite_sheets[species.name], "icon_state" = "[wear_mask.icon_state]")
mask_icon = new(wear_mask.sprite_sheets[species.name])
standing = image("icon" = wear_mask.sprite_sheets[species.name], "icon_state" = "[wear_mask.icon_state][(alternate_head && ("[wear_mask.icon_state]_[alternate_head.suffix]" in mask_icon.IconStates())) ? "_[alternate_head.suffix]" : ""]")
else
standing = image("icon" = 'icons/mob/mask.dmi', "icon_state" = "[wear_mask.icon_state]")
standing = image("icon" = 'icons/mob/mask.dmi', "icon_state" = "[wear_mask.icon_state][(alternate_head && ("[wear_mask.icon_state]_[alternate_head.suffix]" in mask_icon.IconStates())) ? "_[alternate_head.suffix]" : ""]")
if(!istype(wear_mask, /obj/item/clothing/mask/cigarette) && wear_mask.blood_DNA)
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "maskblood")
@@ -1292,13 +1300,15 @@ var/global/list/damage_icon_parts = list()
icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty).
if(fexists(icon_path)) //Just ensuring the nonexistance of a file with the above path won't cause a runtime.
var/icon/icon_file = new(icon_path)
standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
if(wear_suit.icon_state in icon_file.IconStates())
standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
else if(wear_suit.sprite_sheets && wear_suit.sprite_sheets[species.name])
var/icon_path = "[wear_suit.sprite_sheets[species.name]]"
icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty).
if(fexists(icon_path)) //Just ensuring the nonexistance of a file with the above path won't cause a runtime.
var/icon/icon_file = new(icon_path)
standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
if(wear_suit.icon_state in icon_file.IconStates())
standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
else
if(wear_suit.icon_state in C.IconStates())
standing = image("icon" = C, "icon_state" = "[wear_suit.icon_state]")
@@ -2349,6 +2349,7 @@
icon = null
icon_state = null
species_allowed = null
var/suffix = null
/datum/sprite_accessory/alt_heads/none
name = "None"
@@ -2360,3 +2361,4 @@
name = "Unathi Sharp Snout"
species_allowed = list("Unathi")
icon_state = "head_sharp"
suffix = "sharp"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB