mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-29 18:40:42 +00:00
* Refactors Regenerate Organs, and a few organ helpers * MERGE CONFLICTS * GETORGANSLOT > GET_ORGAN_SLOT * GETORGAN > get_organ_by_type * lint repairs * more lint * Update tgstation.dme * Update surgery_step.dm --------- Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
45 lines
1.1 KiB
Plaintext
45 lines
1.1 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/get_organ_by_type(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/get_organs_for_zone(zone)
|
|
return
|
|
|
|
/**
|
|
* Returns a list of all organs in specified slot
|
|
*
|
|
* Arguments:
|
|
* * slot Slot to get the organs from
|
|
*/
|
|
/mob/proc/get_organ_slot(slot)
|
|
return
|
|
|
|
/mob/living/carbon/get_organ_by_type(typepath)
|
|
return (locate(typepath) in organs)
|
|
|
|
/mob/living/carbon/get_organs_for_zone(zone, include_children = FALSE)
|
|
var/valid_organs = list()
|
|
for(var/obj/item/organ/organ as anything in organs)
|
|
if(zone == organ.zone)
|
|
valid_organs += organ
|
|
else if(include_children && zone == deprecise_zone(organ.zone))
|
|
valid_organs += organ
|
|
return valid_organs
|
|
|
|
/mob/living/carbon/get_organ_slot(slot)
|
|
. = organs_slot[slot]
|
|
|