mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Replaces ugly way of checking for coverage/slots with GinjaNinja32's way.
This commit is contained in:
@@ -91,6 +91,37 @@ var/global/list/endgame_exits = list()
|
|||||||
var/global/list/endgame_safespawns = list()
|
var/global/list/endgame_safespawns = list()
|
||||||
|
|
||||||
var/global/list/syndicate_access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
|
var/global/list/syndicate_access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
|
||||||
|
|
||||||
|
// Strings which corraspond to bodypart covering flags, useful for outputting what something covers.
|
||||||
|
var/global/list/string_part_flags = list(
|
||||||
|
"head" = HEAD,
|
||||||
|
"face" = FACE,
|
||||||
|
"eyes" = EYES,
|
||||||
|
"upper body" = UPPER_TORSO,
|
||||||
|
"lower body" = LOWER_TORSO,
|
||||||
|
"legs" = LEGS,
|
||||||
|
"feet" = FEET,
|
||||||
|
"arms" = ARMS,
|
||||||
|
"hands" = HANDS
|
||||||
|
)
|
||||||
|
|
||||||
|
// Strings which corraspond to slot flags, useful for outputting what slot something is.
|
||||||
|
var/global/list/string_slot_flags = list(
|
||||||
|
"back" = SLOT_BACK,
|
||||||
|
"face" = SLOT_MASK,
|
||||||
|
"waist" = SLOT_BELT,
|
||||||
|
"ID slot" = SLOT_ID,
|
||||||
|
"ears" = SLOT_EARS,
|
||||||
|
"eyes" = SLOT_EYES,
|
||||||
|
"hands" = SLOT_GLOVES,
|
||||||
|
"head" = SLOT_HEAD,
|
||||||
|
"feet" = SLOT_FEET,
|
||||||
|
"exo slot" = SLOT_OCLOTHING,
|
||||||
|
"body" = SLOT_ICLOTHING,
|
||||||
|
"uniform" = SLOT_TIE,
|
||||||
|
"holster" = SLOT_HOLSTER
|
||||||
|
)
|
||||||
|
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
/////Initial Building/////
|
/////Initial Building/////
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|||||||
@@ -58,61 +58,21 @@
|
|||||||
if(min_cold_protection_temperature == SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE)
|
if(min_cold_protection_temperature == SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE)
|
||||||
armor_stats += "It provides very good protection against very cold temperatures. \n"
|
armor_stats += "It provides very good protection against very cold temperatures. \n"
|
||||||
|
|
||||||
var/list/covers_these = list()
|
var/list/covers = list()
|
||||||
|
var/list/slots = list()
|
||||||
|
|
||||||
//This is superugly :(
|
for(var/name in string_part_flags)
|
||||||
if(body_parts_covered & HEAD)
|
if(body_parts_covered & string_part_flags[name])
|
||||||
covers_these.Add("head")
|
covers += name
|
||||||
if(body_parts_covered & FACE)
|
|
||||||
covers_these.Add("face")
|
|
||||||
if(body_parts_covered & EYES)
|
|
||||||
covers_these.Add("eyes")
|
|
||||||
if(body_parts_covered & UPPER_TORSO)
|
|
||||||
covers_these.Add("upper body")
|
|
||||||
if(body_parts_covered & LOWER_TORSO)
|
|
||||||
covers_these.Add("lower body")
|
|
||||||
if(body_parts_covered & LEGS)
|
|
||||||
covers_these.Add("legs")
|
|
||||||
if(body_parts_covered & FEET)
|
|
||||||
covers_these.Add("feet")
|
|
||||||
if(body_parts_covered & ARMS)
|
|
||||||
covers_these.Add("arms")
|
|
||||||
if(body_parts_covered & HANDS)
|
|
||||||
covers_these.Add("hands")
|
|
||||||
|
|
||||||
if(covers_these.len)
|
for(var/name in string_slot_flags)
|
||||||
armor_stats += "It covers the [english_list(covers_these)]. \n"
|
if(slot_flags & string_slot_flags[name])
|
||||||
|
slots += name
|
||||||
|
|
||||||
var/list/goes_on = list()
|
if(covers.len)
|
||||||
|
armor_stats += "It covers the [english_list(covers)]. \n"
|
||||||
|
|
||||||
if(slot_flags & SLOT_BACK)
|
if(slots.len)
|
||||||
goes_on.Add("back")
|
armor_stats += "It can be worn on your [english_list(slots)]. \n"
|
||||||
if(slot_flags & SLOT_MASK)
|
|
||||||
goes_on.Add("face")
|
|
||||||
if(slot_flags & SLOT_BELT)
|
|
||||||
goes_on.Add("waist")
|
|
||||||
if(slot_flags & SLOT_ID)
|
|
||||||
goes_on.Add("uniform's ID slot")
|
|
||||||
if(slot_flags & SLOT_EARS)
|
|
||||||
goes_on.Add("ears")
|
|
||||||
if(slot_flags & SLOT_EYES)
|
|
||||||
goes_on.Add("eyes")
|
|
||||||
if(slot_flags & SLOT_GLOVES)
|
|
||||||
goes_on.Add("hands")
|
|
||||||
if(slot_flags & SLOT_HEAD)
|
|
||||||
goes_on.Add("head")
|
|
||||||
if(slot_flags & SLOT_FEET)
|
|
||||||
goes_on.Add("feet")
|
|
||||||
if(slot_flags & SLOT_OCLOTHING)
|
|
||||||
goes_on.Add("exo slot")
|
|
||||||
if(slot_flags & SLOT_ICLOTHING)
|
|
||||||
goes_on.Add("body")
|
|
||||||
if(slot_flags & SLOT_TIE)
|
|
||||||
goes_on.Add("uniform")
|
|
||||||
if(slot_flags & SLOT_HOLSTER)
|
|
||||||
goes_on.Add("holster")
|
|
||||||
|
|
||||||
if(goes_on.len)
|
|
||||||
armor_stats += "It can be worn on your [english_list(goes_on)]. \n"
|
|
||||||
|
|
||||||
return armor_stats
|
return armor_stats
|
||||||
Reference in New Issue
Block a user