mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 08:27:13 +01:00
Kathira El-Hashem Custom Item (#11897)
This commit is contained in:
@@ -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
|
||||
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
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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("_")
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 465 B |
Reference in New Issue
Block a user