mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-07 07:22:56 +00:00
48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
/**
|
|
* Get the organ object from the mob matching the passed in typepath
|
|
*
|
|
* Arguments:
|
|
* * typepath The typepath of the organ to get
|
|
*/
|
|
/mob/proc/getorgan(typepath)
|
|
return
|
|
/**
|
|
* Get organ objects by zone
|
|
*
|
|
* This will return a list of all the organs that are relevant to the zone that is passedin
|
|
*
|
|
* Arguments:
|
|
* * zone [a BODY_ZONE_X define](https://github.com/tgstation/tgstation/blob/master/code/__DEFINES/combat.dm#L187-L200)
|
|
*/
|
|
/mob/proc/getorganszone(zone)
|
|
return
|
|
/**
|
|
* Returns a list of all organs in specified slot
|
|
*
|
|
* Arguments:
|
|
* * slot Slot to get the organs from
|
|
*/
|
|
/mob/proc/getorganslot(slot)
|
|
return
|
|
|
|
/mob/living/carbon/getorgan(typepath)
|
|
return (locate(typepath) in internal_organs)
|
|
|
|
/mob/living/carbon/getorganszone(zone, subzones = 0)
|
|
var/list/returnorg = list()
|
|
if(subzones)
|
|
// Include subzones - groin for chest, eyes and mouth for head
|
|
if(zone == BODY_ZONE_HEAD)
|
|
returnorg = getorganszone(BODY_ZONE_PRECISE_EYES) + getorganszone(BODY_ZONE_PRECISE_MOUTH)
|
|
if(zone == BODY_ZONE_CHEST)
|
|
returnorg = getorganszone(BODY_ZONE_PRECISE_GROIN)
|
|
|
|
for(var/X in internal_organs)
|
|
var/obj/item/organ/O = X
|
|
if(zone == O.zone)
|
|
returnorg += O
|
|
return returnorg
|
|
|
|
/mob/living/carbon/getorganslot(slot)
|
|
return internal_organs_slot[slot]
|