Skip to content

Commit

Permalink
Un-hardcodes camouflage (#4295)
Browse files Browse the repository at this point in the history
# 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
<details>
<summary>Screenshots & Videos</summary>

I didn't test it

</details>


# Changelog

:cl:
code: changed camouflage from map definitions to JSON
/:cl:
  • Loading branch information
BeagleGaming1 committed Sep 1, 2023
1 parent 704423d commit 6a36f8d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 27 deletions.
14 changes: 10 additions & 4 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions code/modules/mob/new_player/sprite_accessories/undershirt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 7 additions & 5 deletions code/modules/mob/new_player/sprite_accessories/underwear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
37 changes: 24 additions & 13 deletions code/modules/projectiles/gun_attachables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 6a36f8d

Please sign in to comment.