From 6a36f8d5dbc14d52b5957e29fdf2346d0ae08a00 Mon Sep 17 00:00:00 2001 From: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Date: Fri, 1 Sep 2023 07:41:40 -0400 Subject: [PATCH] Un-hardcodes camouflage (#4295) # About the pull request Why was it like this # Explain why it's good for the game But why actually why # Testing Photographs and Procedure
Screenshots & Videos I didn't test it
# Changelog :cl: code: changed camouflage from map definitions to JSON /:cl: --- code/game/objects/items.dm | 14 +++++-- .../sprite_accessories/undershirt.dm | 13 ++++--- .../sprite_accessories/underwear.dm | 12 +++--- code/modules/projectiles/gun_attachables.dm | 37 ++++++++++++------- 4 files changed, 49 insertions(+), 27 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 453c2ef1d9d7..cf1678aaeeff 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -237,16 +237,22 @@ cases. Override_icon_state should be a list.*/ new_icon_state = override_icon_state[SSmapping.configs[GROUND_MAP].map_name] if(override_protection && override_protection.len) new_protection = override_protection[SSmapping.configs[GROUND_MAP].map_name] - switch(SSmapping.configs[GROUND_MAP].map_name) // maploader TODO: json - if(MAP_ICE_COLONY, MAP_ICE_COLONY_V3, MAP_CORSAT, MAP_SOROKYNE_STRATA) + switch(SSmapping.configs[GROUND_MAP].camouflage_type) + if("snow") icon_state = new_icon_state ? new_icon_state : "s_" + icon_state item_state = new_item_state ? new_item_state : "s_" + item_state - if(MAP_WHISKEY_OUTPOST, MAP_DESERT_DAM, MAP_BIG_RED, MAP_KUTJEVO) + if("desert") icon_state = new_icon_state ? new_icon_state : "d_" + icon_state item_state = new_item_state ? new_item_state : "d_" + item_state - if(MAP_PRISON_STATION, MAP_PRISON_STATION_V3, MAP_LV522_CHANCES_CLAIM) + if("classic") icon_state = new_icon_state ? new_icon_state : "c_" + icon_state item_state = new_item_state ? new_item_state : "c_" + item_state + if("jungle") + icon_state = new_icon_state ? new_icon_state : "j_" + icon_state + item_state = new_item_state ? new_item_state : "j_" + item_state + if("urban") + icon_state = new_icon_state ? new_icon_state : "u_" + icon_state + item_state = new_item_state ? new_item_state : "u_" + item_state if(new_protection) min_cold_protection_temperature = new_protection else return diff --git a/code/modules/mob/new_player/sprite_accessories/undershirt.dm b/code/modules/mob/new_player/sprite_accessories/undershirt.dm index cc2281f5e848..6f35cef2b645 100644 --- a/code/modules/mob/new_player/sprite_accessories/undershirt.dm +++ b/code/modules/mob/new_player/sprite_accessories/undershirt.dm @@ -32,15 +32,18 @@ GLOBAL_LIST_INIT_TYPED(undershirt_f, /datum/sprite_accessory/undershirt, setup_u /datum/sprite_accessory/undershirt/proc/get_image(mob_gender) var/selected_icon_state = icon_state if(camo_conforming) - switch(SSmapping.configs[GROUND_MAP].map_name) // maploader TODO: json - if(MAP_PRISON_STATION, MAP_PRISON_STATION_V3, MAP_LV522_CHANCES_CLAIM) + switch(SSmapping.configs[GROUND_MAP].camouflage_type) + if("classic") selected_icon_state = "c_" + selected_icon_state - if(MAP_LV_624, MAP_RUNTIME, MAP_NEW_VARADERO) + if("jungle") selected_icon_state = "j_" + selected_icon_state - if(MAP_WHISKEY_OUTPOST, MAP_DESERT_DAM, MAP_BIG_RED, MAP_KUTJEVO) + if("desert") selected_icon_state = "d_" + selected_icon_state - if(MAP_CORSAT, MAP_SOROKYNE_STRATA, MAP_ICE_COLONY, MAP_ICE_COLONY_V3) + if("snow") selected_icon_state = "s_" + selected_icon_state + if("urban") + selected_icon_state = "u_" + selected_icon_state + if(gender == PLURAL) selected_icon_state += mob_gender == MALE ? "_m" : "_f" return image(icon, selected_icon_state) diff --git a/code/modules/mob/new_player/sprite_accessories/underwear.dm b/code/modules/mob/new_player/sprite_accessories/underwear.dm index a558b9459d25..27916a2ff201 100644 --- a/code/modules/mob/new_player/sprite_accessories/underwear.dm +++ b/code/modules/mob/new_player/sprite_accessories/underwear.dm @@ -32,15 +32,17 @@ GLOBAL_LIST_INIT_TYPED(underwear_f, /datum/sprite_accessory/underwear, setup_und /datum/sprite_accessory/underwear/proc/get_image(mob_gender) var/selected_icon_state = icon_state if(camo_conforming) - switch(SSmapping.configs[GROUND_MAP].map_name) // maploader TODO: json - if(MAP_PRISON_STATION, MAP_PRISON_STATION_V3, MAP_LV522_CHANCES_CLAIM) + switch(SSmapping.configs[GROUND_MAP].camouflage_type) + if("classic") selected_icon_state = "c_" + selected_icon_state - if(MAP_LV_624, MAP_RUNTIME, MAP_NEW_VARADERO) + if("jungle") selected_icon_state = "j_" + selected_icon_state - if(MAP_WHISKEY_OUTPOST, MAP_DESERT_DAM, MAP_BIG_RED, MAP_KUTJEVO) + if("desert") selected_icon_state = "d_" + selected_icon_state - if(MAP_CORSAT, MAP_SOROKYNE_STRATA, MAP_ICE_COLONY, MAP_ICE_COLONY_V3) + if("snow") selected_icon_state = "s_" + selected_icon_state + if("urban") + selected_icon_state = "u_" + selected_icon_state if(gender == PLURAL) selected_icon_state += mob_gender == MALE ? "_m" : "_f" return image(icon, selected_icon_state) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index c7b88ef0c1ae..f316aa0b824b 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -830,13 +830,17 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/magnetic_harness/lever_sling/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection) . = ..() var/new_attach_icon - switch(SSmapping.configs[GROUND_MAP].map_name) // maploader TODO: json - if(MAP_ICE_COLONY, MAP_ICE_COLONY_V3, MAP_CORSAT, MAP_SOROKYNE_STRATA) + switch(SSmapping.configs[GROUND_MAP].camouflage_type) + if("snow") attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon - if(MAP_WHISKEY_OUTPOST, MAP_DESERT_DAM, MAP_BIG_RED, MAP_KUTJEVO) + if("desert") attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon - if(MAP_PRISON_STATION, MAP_PRISON_STATION_V3, MAP_LV522_CHANCES_CLAIM) + if("classic") attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon + if("jungle") + attach_icon = new_attach_icon ? new_attach_icon : "j_" + attach_icon + if("urban") + attach_icon = new_attach_icon ? new_attach_icon : "u_" + attach_icon /obj/item/attachable/scope name = "S8 4x telescopic scope" @@ -1663,14 +1667,17 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/m4ra_barrel/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection) . = ..() var/new_attach_icon - switch(SSmapping.configs[GROUND_MAP].map_name) // maploader TODO: json - if(MAP_ICE_COLONY, MAP_ICE_COLONY_V3, MAP_CORSAT, MAP_SOROKYNE_STRATA) + switch(SSmapping.configs[GROUND_MAP].camouflage_type) + if("snow") attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon - if(MAP_WHISKEY_OUTPOST, MAP_DESERT_DAM, MAP_BIG_RED, MAP_KUTJEVO) + if("desert") attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon - if(MAP_PRISON_STATION, MAP_PRISON_STATION_V3, MAP_LV522_CHANCES_CLAIM) + if("classic") attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon - + if("jungle") + attach_icon = new_attach_icon ? new_attach_icon : "j_" + attach_icon + if("urban") + attach_icon = new_attach_icon ? new_attach_icon : "u_" + attach_icon /obj/item/attachable/m4ra_barrel_custom name = "custom M4RA barrel" @@ -1690,13 +1697,17 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/m4ra_barrel_custom/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection) . = ..() var/new_attach_icon - switch(SSmapping.configs[GROUND_MAP].map_name) // maploader TODO: json - if(MAP_ICE_COLONY, MAP_ICE_COLONY_V3, MAP_CORSAT, MAP_SOROKYNE_STRATA) + switch(SSmapping.configs[GROUND_MAP].camouflage_type) + if("snow") attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon - if(MAP_WHISKEY_OUTPOST, MAP_DESERT_DAM, MAP_BIG_RED, MAP_KUTJEVO) + if("desert") attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon - if(MAP_PRISON_STATION, MAP_PRISON_STATION_V3, MAP_LV522_CHANCES_CLAIM) + if("classic") attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon + if("jungle") + attach_icon = new_attach_icon ? new_attach_icon : "j_" + attach_icon + if("urban") + attach_icon = new_attach_icon ? new_attach_icon : "u_" + attach_icon /obj/item/attachable/upp_rpg_breech name = "HJRA-12 Breech"