fixes modsuit icons (#71998)

## About The Pull Request
#71908 this pr breaks modsuit icons before the first time they seal by
making the icon state be skin-standard-part
this fixes that by making them use base_icon_state instead of initial,
and also puts that in other places to reduce hardcoded stuff

## Why It's Good For The Game
le bug is le fix

## Changelog
🆑
fix: fixes modsuit icons
/🆑
This commit is contained in:
Fikou
2022-12-14 13:51:04 +00:00
committed by GitHub
parent c2626a20cf
commit e79d3bc1c4
4 changed files with 11 additions and 8 deletions
+2 -4
View File
@@ -191,6 +191,7 @@
///Seals or unseals the given part
/obj/item/mod/control/proc/seal_part(obj/item/clothing/part, seal)
if(seal)
part.icon_state = "[skin]-[part.base_icon_state]-sealed"
part.clothing_flags |= part.visor_flags
part.flags_inv |= part.visor_flags_inv
part.flags_cover |= part.visor_flags_cover
@@ -198,6 +199,7 @@
part.cold_protection = initial(part.cold_protection)
part.alternate_worn_layer = null
else
part.icon_state = "[skin]-[part.base_icon_state]"
part.flags_cover &= ~part.visor_flags_cover
part.flags_inv &= ~part.visor_flags_inv
part.clothing_flags &= ~part.visor_flags
@@ -205,17 +207,13 @@
part.cold_protection = NONE
part.alternate_worn_layer = mod_parts[part]
if(part == boots)
boots.icon_state = "[skin]-boots[seal ? "-sealed" : ""]"
wearer.update_worn_shoes()
if(part == gauntlets)
gauntlets.icon_state = "[skin]-gauntlets[seal ? "-sealed" : ""]"
wearer.update_worn_gloves()
if(part == chestplate)
chestplate.icon_state = "[skin]-chestplate[seal ? "-sealed" : ""]"
wearer.update_worn_oversuit()
wearer.update_worn_undersuit()
if(part == helmet)
helmet.icon_state = "[skin]-helmet[seal ? "-sealed" : ""]"
wearer.update_worn_head()
wearer.update_worn_mask()
wearer.update_worn_glasses()
+5 -1
View File
@@ -3,6 +3,7 @@
desc = "A helmet for a MODsuit."
icon = 'icons/obj/clothing/modsuit/mod_clothing.dmi'
icon_state = "standard-helmet"
base_icon_state = "helmet"
worn_icon = 'icons/mob/clothing/modsuit/mod_clothing.dmi'
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0, WOUND = 0)
body_parts_covered = HEAD
@@ -15,13 +16,14 @@
desc = "A chestplate for a MODsuit."
icon = 'icons/obj/clothing/modsuit/mod_clothing.dmi'
icon_state = "standard-chestplate"
base_icon_state = "chestplate"
worn_icon = 'icons/mob/clothing/modsuit/mod_clothing.dmi'
blood_overlay_type = "armor"
allowed = list(
/obj/item/tank/internals,
/obj/item/flashlight,
/obj/item/tank/jetpack/oxygen/captain,
)
)
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0, WOUND = 0)
body_parts_covered = CHEST|GROIN
heat_protection = CHEST|GROIN
@@ -33,6 +35,7 @@
desc = "A pair of gauntlets for a MODsuit."
icon = 'icons/obj/clothing/modsuit/mod_clothing.dmi'
icon_state = "standard-gauntlets"
base_icon_state = "gauntlets"
worn_icon = 'icons/mob/clothing/modsuit/mod_clothing.dmi'
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0, WOUND = 0)
body_parts_covered = HANDS|ARMS
@@ -45,6 +48,7 @@
desc = "A pair of boots for a MODsuit."
icon = 'icons/obj/clothing/modsuit/mod_clothing.dmi'
icon_state = "standard-boots"
base_icon_state = "boots"
worn_icon = 'icons/mob/clothing/modsuit/mod_clothing.dmi'
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0, WOUND = 0)
body_parts_covered = FEET|LEGS
+4 -3
View File
@@ -8,8 +8,9 @@
/obj/item/mod/control
name = "MOD control unit"
desc = "The control unit of a Modular Outerwear Device, a powered suit that protects against various environments."
icon_state = "control"
icon_state = "standard-control"
inhand_icon_state = "mod_control"
base_icon_state = "control"
w_class = WEIGHT_CLASS_BULKY
slot_flags = ITEM_SLOT_BACK
strip_delay = 10 SECONDS
@@ -441,7 +442,7 @@
. += module_icons
/obj/item/mod/control/update_icon_state()
icon_state = "[skin]-control[active ? "-sealed" : ""]"
icon_state = "[skin]-[base_icon_state][active ? "-sealed" : ""]"
return ..()
/obj/item/mod/control/proc/set_wearer(mob/living/carbon/human/user)
@@ -632,7 +633,7 @@
for(var/obj/item/part as anything in skin_updating)
part.icon = used_skin[MOD_ICON_OVERRIDE] || 'icons/obj/clothing/modsuit/mod_clothing.dmi'
part.worn_icon = used_skin[MOD_WORN_ICON_OVERRIDE] || 'icons/mob/clothing/modsuit/mod_clothing.dmi'
part.icon_state = "[skin]-[initial(part.icon_state)]"
part.icon_state = "[skin]-[part.base_icon_state]"
for(var/obj/item/clothing/part as anything in mod_parts)
var/used_category
if(part == helmet)