diff --git a/code/__DEFINES/mod.dm b/code/__DEFINES/mod.dm index bc82d1b691a..f1be922e66f 100644 --- a/code/__DEFINES/mod.dm +++ b/code/__DEFINES/mod.dm @@ -37,6 +37,9 @@ #define SEALED_COVER "sealed_cover" #define CAN_OVERSLOT "can_overslot" +// Flags for skin modifiers +#define MAKE_SPACEPROOF (1<<0) + //Defines used to override MOD clothing's icon and worn icon files in the skin. #define MOD_ICON_OVERRIDE "mod_icon_override" diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm index efd50f67861..cd8ea0fb7ba 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -702,8 +702,16 @@ overslotting_parts -= part continue overslotting_parts |= part + var/used_skin_modifiers = theme.skin_modifiers[new_skin] + apply_modifiers(used_skin_modifiers) wearer?.regenerate_icons() +/obj/item/mod/control/proc/apply_modifiers(modifiers) + if(modifiers & MAKE_SPACEPROOF) + min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT + for(var/obj/item/clothing/part in mod_parts) + part.min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT + /obj/item/mod/control/proc/on_exit(datum/source, atom/movable/part, direction) SIGNAL_HANDLER diff --git a/code/modules/mod/mod_paint.dm b/code/modules/mod/mod_paint.dm index b48bf8f08a8..09f473faf88 100644 --- a/code/modules/mod/mod_paint.dm +++ b/code/modules/mod/mod_paint.dm @@ -4,7 +4,6 @@ icon = 'icons/obj/clothing/modsuit/mod_construction.dmi' icon_state = "skinapplier" var/skin = "civilian" - var/make_spaceproof = FALSE //Used on the miner asteroid skin to make the suit spaceproof when upgrading. var/compatible_theme = /datum/mod_theme/standard /obj/item/mod/skin_applier/Initialize(mapload) @@ -22,10 +21,6 @@ to_chat(user, "Theme is not compatible!") return TRUE mod.set_mod_skin(skin) - if(make_spaceproof) - mod.min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT - for(var/obj/item/clothing/C in mod.mod_parts) - C.min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT to_chat(user, "You apply the theme to [mod].") qdel(src) return TRUE @@ -34,7 +29,6 @@ skin = "asteroid" compatible_theme = /datum/mod_theme/mining desc = "This one-use skin applier will add a skin to MODsuits of a specific type. This one applies to mining modsuits, and makes them spaceproof. Enjoy the days when you had MODsuits on the asteroid. Wait a minute." - make_spaceproof = TRUE /obj/item/mod/skin_applier/corpsman skin = "corpsman" diff --git a/code/modules/mod/mod_theme.dm b/code/modules/mod/mod_theme.dm index 69c37d19dfa..4d7399bc47f 100644 --- a/code/modules/mod/mod_theme.dm +++ b/code/modules/mod/mod_theme.dm @@ -51,6 +51,8 @@ var/list/inbuilt_modules = list() /// Allowed items in the chestplate's suit storage. var/list/allowed_suit_storage = list() + /// List of modifiers that we apply after applying new skin + var/list/skin_modifiers = list() /// List of skins with their appropriate clothing flags. var/list/skins = list( "standard" = list( @@ -309,6 +311,9 @@ /obj/item/gun/energy/kinetic_accelerator, ) inbuilt_modules = list(/obj/item/mod/module/ash_accretion, /obj/item/mod/module/sphere_transform) + skin_modifiers = list( + "asteroid" = MAKE_SPACEPROOF + ) skins = list( "mining" = list( HELMET_FLAGS = list(