diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 832aef11bd4..42f30f6fb42 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -2177,4 +2177,28 @@ All custom items with worn sprites must follow the contained sprite system: http icon = 'icons/obj/custom_items/godard_cape.dmi' icon_state = "godard_cape" item_state = "godard_cape" - contained_sprite = TRUE \ No newline at end of file + contained_sprite = TRUE + +/obj/item/organ/internal/augment/fluff/kath_legbrace // Leg Support Augment - Kathira El-Hashem - TheGreyWolf + name = "leg support augment" + desc = "A leg augment to aid in the mobility of an otherwise disabled leg." + icon = 'icons/obj/custom_items/kathira_legbrace.dmi' + on_mob_icon = 'icons/obj/custom_items/kathira_legbrace.dmi' + icon_state = "kathira_legbrace" + item_state = "kathira_legbrace_onmob" + parent_organ = BP_R_LEG + supports_limb = TRUE + min_broken_damage = 15 + var/last_drop = 0 + +/obj/item/organ/internal/augment/fluff/kath_legbrace/process() + if(QDELETED(src) || !owner) + return + if(last_drop + 6 SECONDS > world.time) + return + if(is_bruised() && prob(20)) + owner.Weaken(2) + last_drop = world.time + else if(is_broken() && prob(40)) + owner.Weaken(3) + last_drop = world.time \ No newline at end of file diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 9d67cc5fcb1..183edecdfe5 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -249,7 +249,7 @@ /proc/equip_custom_item_to_mob(var/datum/custom_item/citem, var/mob/living/carbon/human/M) // Check for required job title. - if(citem.req_titles && length(citem.req_titles) > 0) + if(length(citem.req_titles)) var/has_title var/current_title = M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role for(var/title in citem.req_titles) @@ -260,6 +260,15 @@ to_chat(M, "A custom item could not be equipped as you have joined with the wrong role.") return FALSE + if(ispath(citem.item_path, /obj/item/organ/internal/augment/fluff)) + var/obj/item/organ/internal/augment/fluff/aug = citem.spawn_item(M) + var/obj/item/organ/external/affected = M.get_organ(aug.parent_organ) + aug.replaced(M, affected) + M.update_body() + M.updatehealth() + M.UpdateDamageIcon() + return + // ID cards and MCs are applied directly to the existing object rather than spawned fresh. var/obj/item/existing_item if(citem.item_path == /obj/item/card/id) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 76de29e484e..d5e4db07f1c 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -544,7 +544,18 @@ This function completely restores a damaged organ to perfect condition. //external organs handle brokenness a bit differently when it comes to damage. Instead brute_dam is checked inside process() //this also ensures that an external organ cannot be "broken" without broken_description being set. /obj/item/organ/external/is_broken() - return ((status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED))) + if(status & ORGAN_CUT_AWAY) + return TRUE + if((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)) + for(var/obj/item/organ/internal/augment/aug in internal_organs) + if(aug.supports_limb) + if(aug.is_broken()) + continue + if(aug.is_bruised() && prob(60)) + continue + return FALSE + return TRUE + return FALSE //Determines if we even need to process this organ. /obj/item/organ/external/proc/need_process() diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 6d3b784b191..c63e6f3cf89 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -138,11 +138,11 @@ /obj/item/organ/external/proc/get_internal_organs_overlay() for(var/obj/item/organ/internal/O in internal_organs) if(O.on_mob_icon) - var/cache_key = "[O.on_mob_icon]-[O.icon_state]" + var/cache_key = "[O.on_mob_icon]-[O.item_state || O.icon_state]" var/icon/organ_icon = SSicon_cache.internal_organ_cache[cache_key] if (!organ_icon) - organ_icon = new /icon(O.on_mob_icon, O.icon_state) + organ_icon = new /icon(O.on_mob_icon, O.item_state || O.icon_state) SSicon_cache.internal_organ_cache[cache_key] = organ_icon add_overlay(organ_icon) @@ -264,7 +264,7 @@ for(var/obj/item/organ/internal/O in internal_organs) if(O.on_mob_icon) - keyparts += "[O.on_mob_icon]-[O.icon_state]" + keyparts += "[O.on_mob_icon]-[O.item_state || O.icon_state]" . = keyparts.Join("_") diff --git a/code/modules/organs/subtypes/augment.dm b/code/modules/organs/subtypes/augment.dm index bddfaf66b8b..0cbc79a23a2 100644 --- a/code/modules/organs/subtypes/augment.dm +++ b/code/modules/organs/subtypes/augment.dm @@ -15,6 +15,7 @@ var/action_button_icon = "augment" var/activable = FALSE var/bypass_implant = FALSE + var/supports_limb = FALSE // if true, will make parent limb not count as broken, as long as it's not bruised (40%) and not broken (0%) /obj/item/organ/internal/augment/Initialize() robotize() diff --git a/icons/obj/custom_items/kathira_legbrace.dmi b/icons/obj/custom_items/kathira_legbrace.dmi new file mode 100644 index 00000000000..519cf879a3c Binary files /dev/null and b/icons/obj/custom_items/kathira_legbrace.dmi differ