diff --git a/code/modules/mining/equipment/goliath_hide.dm b/code/modules/mining/equipment/goliath_hide.dm index e652bc6e94..6b88fff0b3 100644 --- a/code/modules/mining/equipment/goliath_hide.dm +++ b/code/modules/mining/equipment/goliath_hide.dm @@ -1,4 +1,4 @@ - +/**********************Goliath Hide**********************/ /obj/item/stack/sheet/animalhide/goliath_hide name = "goliath hide plates" desc = "Pieces of a goliath's rocky hide, these might be able to make your suit a bit more durable to attack from the local fauna." @@ -10,33 +10,37 @@ flags = NOBLUDGEON w_class = WEIGHT_CLASS_NORMAL layer = MOB_LAYER + var/static/list/goliath_platable_armor_typecache = typecacheof(list( + /obj/item/clothing/head/helmet/space/hardsuit/mining, + /obj/item/clothing/suit/space/hardsuit/mining, + /obj/item/clothing/head/hooded/explorer, + /obj/item/clothing/suit/hooded/explorer)) /obj/item/stack/sheet/animalhide/goliath_hide/afterattack(atom/target, mob/user, proximity_flag) - if(proximity_flag) - if(istype(target, /obj/item/clothing/suit/space/hardsuit/mining) || istype(target, /obj/item/clothing/head/helmet/space/hardsuit/mining) || istype(target, /obj/item/clothing/suit/hooded/explorer) || istype(target, /obj/item/clothing/head/hooded/explorer)) - var/obj/item/clothing/C = target - var/list/current_armor = C.armor - if(current_armor.["melee"] < 60) - current_armor.["melee"] = min(current_armor.["melee"] + 10, 60) - to_chat(user, "You strengthen [target], improving its resistance against melee attacks.") - use(1) + if(!proximity_flag) + return + if(is_type_in_typecache(target, goliath_platable_armor_typecache)) + var/obj/item/clothing/C = target + var/list/current_armor = C.armor + if(current_armor["melee"] < 60) + current_armor["melee"] = min(current_armor["melee"] + 10, 60) + to_chat(user, "You strengthen [target], improving its resistance against melee attacks.") + use(1) + else + to_chat(user, "You can't improve [C] any further!") + else if(istype(target, /obj/mecha/working/ripley)) + var/obj/mecha/working/ripley/D = target + if(D.hides < 3) + D.hides++ + D.armor["melee"] = min(D.armor["melee"] + 10, 70) + D.armor["bullet"] = min(D.armor["bullet"] + 5, 50) + D.armor["laser"] = min(D.armor["laser"] + 5, 50) + to_chat(user, "You strengthen [target], improving its resistance against melee attacks.") + D.update_icon() + if(D.hides == 3) + D.desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - its pilot must be an experienced monster hunter." else - to_chat(user, "You can't improve [C] any further!") - return - if(istype(target, /obj/mecha/working/ripley)) - var/obj/mecha/working/ripley/D = target - if(D.hides < 3) - D.hides++ - D.armor["melee"] = min(D.armor["melee"] + 10, 70) - D.armor["bullet"] = min(D.armor["bullet"] + 5, 50) - D.armor["laser"] = min(D.armor["laser"] + 5, 50) - to_chat(user, "You strengthen [target], improving its resistance against melee attacks.") - D.update_icon() - if(D.hides == 3) - D.desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - its pilot must be an experienced monster hunter." - else - D.desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates." - qdel(src) - else - to_chat(user, "You can't improve [D] any further!") - return + D.desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates." + use(1) + else + to_chat(user, "You can't improve [D] any further!")