diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 5a78b702d04..6e1cc86633c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -49,18 +49,11 @@ var/list/sprite_sheets = null var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc. - /* Species-specific sprite sheets for object and inhand sprites + /* Species-specific sprite sheets for inventory sprites Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called. */ var/list/sprite_sheets_obj = null - //Inhand is not as big a deal as the object sprites, so I'm not sure if these are worth the extra vars. - //Maybe in the future: - //var/list/sprite_sheets_inhand_l = null - //var/list/sprite_sheets_inhand_r = null - //var/icon_l_hand = 'icons/mob/items_lefthand.dmi' - //var/icon_r_hand = 'icons/mob/items_righthand.dmi' - /obj/item/device icon = 'icons/obj/device.dmi' diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index fa519d6f0be..fd04046e254 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,6 +1,14 @@ /obj/item/clothing name = "clothing" var/list/species_restricted = null //Only these species can wear this kit. + + /* + Sprites used when the clothing item is refit. This is done by setting icon_override. + For best results, if this is set then sprite_sheets should be null and vice versa, but that is by no means necessary. + Ideally, sprite_sheets_refit should be used for "hard" clothing items that can't change shape very well to fit the wearer (e.g. helmets, hardsuits), + while sprite_sheets should be used for "flexible" clothing items that do not need to be refitted (e.g. vox wearing jumpsuits). + */ + var/list/sprite_sheets_refit = null //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) @@ -41,6 +49,11 @@ species_restricted = list(target_species) //Set icon + if (sprite_sheets_refit && (target_species in sprite_sheets_refit)) + icon_override = sprite_sheets_refit[target_species] + else + icon_override = initial(icon_override) + if (sprite_sheets_obj && (target_species in sprite_sheets_obj)) icon = sprite_sheets_obj[target_species] else @@ -57,12 +70,16 @@ species_restricted = list(target_species) //Set icon + if (sprite_sheets_refit && (target_species in sprite_sheets_refit)) + icon_override = sprite_sheets_refit[target_species] + else + icon_override = initial(icon_override) + if (sprite_sheets_obj && (target_species in sprite_sheets_obj)) icon = sprite_sheets_obj[target_species] else icon = initial(icon) - //Ears: headsets, earmuffs and tiny objects /obj/item/clothing/ears name = "ears" diff --git a/code/modules/clothing/spacesuits/rig.dm b/code/modules/clothing/spacesuits/rig.dm index 2b4674c09f7..a8017a95da0 100644 --- a/code/modules/clothing/spacesuits/rig.dm +++ b/code/modules/clothing/spacesuits/rig.dm @@ -15,13 +15,15 @@ //Species-specific stuff. species_restricted = list("exclude","Unathi","Tajaran","Skrell","Diona","Vox") - sprite_sheets = list( + sprite_sheets_refit = list( "Unathi" = 'icons/mob/species/unathi/helmet.dmi', "Tajaran" = 'icons/mob/species/tajaran/helmet.dmi', + "Skrell" = 'icons/mob/species/skrell/helmet.dmi', ) sprite_sheets_obj = list( "Unathi" = 'icons/obj/clothing/species/unathi/hats.dmi', "Tajaran" = 'icons/obj/clothing/species/tajaran/hats.dmi', + "Skrell" = 'icons/obj/clothing/species/skrell/hats.dmi', ) attack_self(mob/user) @@ -63,13 +65,15 @@ max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox") - sprite_sheets = list( + sprite_sheets_refit = list( "Unathi" = 'icons/mob/species/unathi/suit.dmi', "Tajaran" = 'icons/mob/species/tajaran/suit.dmi', + "Skrell" = 'icons/mob/species/skrell/suit.dmi', ) sprite_sheets_obj = list( "Unathi" = 'icons/obj/clothing/species/unathi/suits.dmi', "Tajaran" = 'icons/obj/clothing/species/tajaran/suits.dmi', + "Skrell" = 'icons/obj/clothing/species/skrell/suits.dmi', ) //Breach thresholds, should ideally be inherited by most (if not all) hardsuits. @@ -322,14 +326,16 @@ icon_state = "rig0-white" item_state = "ce_helm" item_color = "white" - sprite_sheets = null + sprite_sheets_refit = null + sprite_sheets_obj = null /obj/item/clothing/suit/space/rig/engineering/chief icon_state = "rig-white" name = "advanced hardsuit" desc = "An advanced suit that protects against hazardous, low pressure environments. Shines with a high polish." item_state = "ce_hardsuit" - sprite_sheets = null + sprite_sheets_refit = null + sprite_sheets_obj = null //Mining rig /obj/item/clothing/head/helmet/space/rig/mining @@ -359,16 +365,6 @@ siemens_coefficient = 0.6 var/obj/machinery/camera/camera species_restricted = list("exclude","Unathi","Tajaran","Skrell","Vox") - sprite_sheets = list( - "Tajaran" = 'icons/mob/species/tajaran/helmet.dmi', - "Unathi" = 'icons/mob/species/unathi/helmet.dmi', - "Skrell" = 'icons/mob/species/skrell/helmet.dmi', - ) - sprite_sheets_obj = list( - "Tajaran" = 'icons/obj/clothing/species/tajaran/hats.dmi', - "Unathi" = 'icons/obj/clothing/species/unathi/hats.dmi', - "Skrell" = 'icons/obj/clothing/species/skrell/hats.dmi', - ) /obj/item/clothing/head/helmet/space/rig/syndi/attack_self(mob/user) @@ -397,16 +393,6 @@ allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword,/obj/item/weapon/handcuffs) siemens_coefficient = 0.6 species_restricted = list("exclude","Unathi","Tajaran","Skrell","Vox") - sprite_sheets = list( - "Unathi" = 'icons/mob/species/unathi/suit.dmi', - "Tajaran" = 'icons/mob/species/tajaran/suit.dmi', - "Skrell" = 'icons/mob/species/skrell/suit.dmi' - ) - sprite_sheets_obj = list( - "Tajaran" = 'icons/obj/clothing/species/tajaran/suits.dmi', - "Unathi" = 'icons/obj/clothing/species/unathi/suits.dmi', - "Skrell" = 'icons/obj/clothing/species/skrell/suits.dmi', - ) //Wizard Rig @@ -419,7 +405,7 @@ unacidable = 1 //No longer shall our kind be foiled by lone chemists with spray bottles! armor = list(melee = 40, bullet = 20, laser = 20,energy = 20, bomb = 35, bio = 100, rad = 60) siemens_coefficient = 0.7 - sprite_sheets = null + sprite_sheets_refit = null sprite_sheets_obj = null /obj/item/clothing/suit/space/rig/wizard @@ -432,7 +418,7 @@ unacidable = 1 armor = list(melee = 40, bullet = 20, laser = 20,energy = 20, bomb = 35, bio = 100, rad = 60) siemens_coefficient = 0.7 - sprite_sheets = null + sprite_sheets_refit = null sprite_sheets_obj = null //Medical Rig