diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 45b9a00d241..e757db1be20 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -53,7 +53,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb var/inhand_x_dimension = 32 ///Same as for [worn_y_dimension][/obj/item/var/worn_y_dimension] but for inhands, uses the lefthand_ and righthand_ file vars var/inhand_y_dimension = 32 - + /// Worn overlay will be shifted by this along y axis + var/worn_y_offset = 0 max_integrity = 200 diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index 5bbeea004e7..63088d442cd 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -104,13 +104,10 @@ name = "cage" desc = "A cage that restrains the will of the self, allowing one to see the profane world for what it is." flags_inv = NONE - worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi' icon_state = "cage" inhand_icon_state = "cage" - worn_x_dimension = 64 - worn_y_dimension = 64 - clothing_flags = LARGE_WORN_ICON dynamic_hair_suffix = "" + worn_y_offset = 7 /obj/item/storage/box/holy/sentinel name = "Stone Sentinel Kit" diff --git a/code/game/objects/items/religion.dm b/code/game/objects/items/religion.dm index 603fb3f0697..6bb5f159404 100644 --- a/code/game/objects/items/religion.dm +++ b/code/game/objects/items/religion.dm @@ -299,13 +299,10 @@ /obj/item/clothing/head/helmet/plate/crusader/prophet name = "Prophet's Hat" desc = "A religious-looking hat." - worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi' icon_state = null flags_1 = 0 armor = list(MELEE = 60, BULLET = 60, LASER = 60, ENERGY = 60, BOMB = 70, BIO = 50, RAD = 50, FIRE = 60, ACID = 60) //religion protects you from disease and radiation, honk. - worn_x_dimension = 64 - worn_y_dimension = 64 - clothing_flags = LARGE_WORN_ICON + worn_y_offset = 6 /obj/item/clothing/head/helmet/plate/crusader/prophet/red icon_state = "prophet-red" diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 7f0fb194691..72670f75109 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -202,13 +202,10 @@ /obj/item/clothing/head/helmet/constable name = "constable helmet" desc = "A british looking helmet." - worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi' icon_state = "constable" inhand_icon_state = "constable" - worn_x_dimension = 64 - worn_y_dimension = 64 - clothing_flags = LARGE_WORN_ICON custom_price = PAYCHECK_HARD * 1.5 + worn_y_offset = 4 /obj/item/clothing/head/helmet/swat/nanotrasen name = "\improper SWAT helmet" diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm index 1b73f8db688..25a4c29b8cb 100644 --- a/code/modules/clothing/head/misc.dm +++ b/code/modules/clothing/head/misc.dm @@ -491,13 +491,10 @@ name = "shrine maiden's wig" desc = "Purify in style!" flags_inv = HIDEHAIR //bald - worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi' icon_state = "shrine_wig" inhand_icon_state = "shrine_wig" - worn_x_dimension = 64 - worn_y_dimension = 64 - clothing_flags = LARGE_WORN_ICON dynamic_hair_suffix = "" + worn_y_offset = 1 /obj/item/clothing/head/intern name = "\improper CentCom Head Intern beancap" diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index d516d6abc5f..1cfb24aea6e 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -528,27 +528,29 @@ generate/load female uniform sprites matching all previously decided variables standing = center_image(standing, isinhands ? inhand_x_dimension : worn_x_dimension, isinhands ? inhand_y_dimension : worn_y_dimension) - //Handle held offsets - var/mob/M = loc - if(istype(M)) - var/list/L = get_held_offsets() - if(L) - standing.pixel_x += L["x"] //+= because of center()ing - standing.pixel_y += L["y"] + //Worn offsets + var/list/offsets = get_worn_offsets(isinhands) + standing.pixel_x += offsets[1] + standing.pixel_y += offsets[2] standing.alpha = alpha standing.color = color return standing - -/obj/item/proc/get_held_offsets() - var/list/L - if(ismob(loc)) - var/mob/M = loc - L = M.get_item_offsets_for_index(M.get_held_index_of_item(src)) - return L - +/// Returns offsets used for equipped item overlays in list(px_offset,py_offset) form. +/obj/item/proc/get_worn_offsets(isinhands) + . = list(0,0) //(px,py) + if(isinhands) + //Handle held offsets + var/mob/holder = loc + if(istype(holder)) + var/list/offsets = holder.get_item_offsets_for_index(holder.get_held_index_of_item(src)) + if(offsets) + .[1] = offsets["x"] + .[2] = offsets["y"] + else + .[2] = worn_y_offset //Can't think of a better way to do this, sadly /mob/proc/get_item_offsets_for_index(i) diff --git a/icons/mob/clothing/head.dmi b/icons/mob/clothing/head.dmi index 3857717c67a..3a169db4bd6 100644 Binary files a/icons/mob/clothing/head.dmi and b/icons/mob/clothing/head.dmi differ diff --git a/icons/mob/large-worn-icons/64x64/head.dmi b/icons/mob/large-worn-icons/64x64/head.dmi deleted file mode 100644 index d9b5024efc4..00000000000 Binary files a/icons/mob/large-worn-icons/64x64/head.dmi and /dev/null differ