organ
![code/modules/surgery/organs/_organ.dm 2](git.png)
Vars | |
blood_dna_info | The cached info about the blood this organ belongs to |
---|---|
bodypart_owner | Reference to the limb we're inside of |
damage | Total damage this organ has sustained. Should only ever be modified by apply_organ_damage! |
failing_desc | String displayed when the organ has decayed. |
failure_time | Time this organ has failed for |
food_reagents | Food reagents if the organ is edible |
healing_factor | Healing factor and decay factor function on % of maxhealth, and do not work by applying a static number per tick |
maxHealth | Maximum damage the organ can take, ever. |
organ_effects | Status Effects that are given to the holder of the organ. |
organ_flags | Random flags that describe this organ |
organ_traits | Traits that are given to the holder of the organ. If you want an effect that changes this, don't add directly to this. Use the add_organ_trait() proc. |
owner | The mob that owns this organ. |
reagent_vol | The size of the reagent container if the organ is edible |
slot | The organ slot this organ is supposed to inhabit. This should be unique by type. (Lungs, Appendix, Stomach, etc) Do NOT add slots with matching names to different zones - it will break the organs_slot list! |
useable | When set to false, this can't be used in surgeries and such - Honestly a terrible variable. |
visual | Do we affect the appearance of our mob. Used to save time in preference code |
zone | The body zone this organ is supposed to inhabit. |
Procs | |
add_organ_status | Add a Status Effect to an organ that it will give its owner. |
add_organ_trait | Add a Trait to an organ that it will give its owner. |
apply_organ_damage | Adjusts an organ's damage by the amount "damage_amount", up to a maximum amount, which is by default max damage. Returns the net change in organ damage. |
before_organ_replacement | Called before organs are replaced in regenerate_organs with new ones |
bodypart_insert | Insert an organ into a limb, assume the limb as always detached and include no owner operations here (except the get_bodypart helper here I guess) Give EITHER a limb OR a limb owner |
bodypart_remove | Called to remove an organ from a limb. Do not put any mob operations here (except the bodypart_getter at the start) Give EITHER a limb OR a limb_owner |
check_damage_thresholds | |
exit_wardrobe | Used as callbacks by object pooling |
forced_removal | In space station videogame, nothing is sacred. If somehow an organ is removed unexpectedly, handle it properly |
get_availability | |
get_status_text | Called by medical scanners to get a simple summary of how healthy the organ is. Returns an empty string if things are fine. |
on_bodypart_insert | Add any limb specific effects you might want here |
on_bodypart_remove | Called on limb removal to remove limb specific limb effects or statusses |
on_mob_insert | Called after the organ is inserted into a mob. Adds Traits, Actions, and Status Effects on the mob in which the organ is impanted. Override this proc to create unique side-effects for inserting your organ. Must be called by overrides. |
on_mob_remove | Called after the organ is removed from a mob. Removes Traits, Actions, and Status Effects on the mob in which the organ was impanted. Override this proc to create unique side-effects for removing your organ. Must be called by overrides. |
on_surgical_insertion | Proc that gets called when the organ is surgically inserted by someone. Seem familiar? |
on_surgical_removal | Proc that gets called when the organ is surgically removed by someone, can be used for special effects |
organ_failure | |
remove_organ_status | Removes a Status Effect from an organ, and by extension, its owner. |
remove_organ_trait | Removes a Trait from an organ, and by extension, its owner. |
replace_into | Tries to replace the existing organ on the passed mob with this one, with special handling for replacing a brain without ghosting target |
set_organ_damage | SETS an organ's damage to the amount "damage_amount", and in doing so clears or sets the failing flag, good for when you have an effect that should fix an organ if broken |
Var Details
blood_dna_info
![code/modules/surgery/organs/_organ.dm 12](git.png)
The cached info about the blood this organ belongs to
bodypart_owner
![code/modules/surgery/organs/_organ.dm 10](git.png)
Reference to the limb we're inside of
damage
![code/modules/surgery/organs/_organ.dm 28](git.png)
Total damage this organ has sustained. Should only ever be modified by apply_organ_damage!
failing_desc
![code/modules/surgery/organs/_organ.dm 65](git.png)
String displayed when the organ has decayed.
failure_time
![code/modules/surgery/organs/_organ.dm 54](git.png)
Time this organ has failed for
food_reagents
![code/modules/surgery/organs/_organ.dm 49](git.png)
Food reagents if the organ is edible
healing_factor
![code/modules/surgery/organs/_organ.dm 30](git.png)
Healing factor and decay factor function on % of maxhealth, and do not work by applying a static number per tick
maxHealth
![code/modules/surgery/organs/_organ.dm 23](git.png)
Maximum damage the organ can take, ever.
organ_effects
![code/modules/surgery/organs/_organ.dm 63](git.png)
Status Effects that are given to the holder of the organ.
organ_flags
![code/modules/surgery/organs/_organ.dm 21](git.png)
Random flags that describe this organ
organ_traits
![code/modules/surgery/organs/_organ.dm 61](git.png)
Traits that are given to the holder of the organ. If you want an effect that changes this, don't add directly to this. Use the add_organ_trait() proc.
owner
![code/modules/surgery/organs/_organ.dm 8](git.png)
The mob that owns this organ.
reagent_vol
![code/modules/surgery/organs/_organ.dm 51](git.png)
The size of the reagent container if the organ is edible
slot
![code/modules/surgery/organs/_organ.dm 19](git.png)
The organ slot this organ is supposed to inhabit. This should be unique by type. (Lungs, Appendix, Stomach, etc) Do NOT add slots with matching names to different zones - it will break the organs_slot list!
useable
![code/modules/surgery/organs/_organ.dm 46](git.png)
When set to false, this can't be used in surgeries and such - Honestly a terrible variable.
visual
![code/modules/surgery/organs/_organ.dm 56](git.png)
Do we affect the appearance of our mob. Used to save time in preference code
zone
![code/modules/surgery/organs/_organ.dm 14](git.png)
The body zone this organ is supposed to inhabit.
Proc Details
add_organ_status
Add a Status Effect to an organ that it will give its owner.
add_organ_trait
Add a Trait to an organ that it will give its owner.
apply_organ_damage
Adjusts an organ's damage by the amount "damage_amount", up to a maximum amount, which is by default max damage. Returns the net change in organ damage.
before_organ_replacement
Called before organs are replaced in regenerate_organs with new ones
bodypart_insert
Insert an organ into a limb, assume the limb as always detached and include no owner operations here (except the get_bodypart helper here I guess) Give EITHER a limb OR a limb owner
bodypart_remove
Called to remove an organ from a limb. Do not put any mob operations here (except the bodypart_getter at the start) Give EITHER a limb OR a limb_owner
check_damage_thresholds
- check_damage_thresholds
- input: mob/organ_owner (a mob, the owner of the organ we call the proc on)
- output: returns a message should get displayed.
- description: By checking our current damage against our previous damage, we can decide whether we've passed an organ threshold.
- If we have, send the corresponding threshold message to the owner, if such a message exists.
exit_wardrobe
Used as callbacks by object pooling
forced_removal
In space station videogame, nothing is sacred. If somehow an organ is removed unexpectedly, handle it properly
get_availability
-
get_availability
-
returns whether the species should innately have this organ.
-
regenerate organs works with generic organs, so we need to get whether it can accept certain organs just by what this returns.
-
This is set to return true or false, depending on if a species has a trait that would nulify the purpose of the organ.
-
For example, lungs won't be given if you have NO_BREATH, stomachs check for NO_HUNGER, and livers check for NO_METABOLISM.
-
If you want a carbon to have a trait that normally blocks an organ but still want the organ. Attach the trait to the organ using the organ_traits var
-
Arguments:
-
owner_species - species, needed to return the mutant slot as true or false. stomach set to null means it shouldn't have one.
-
owner_mob - for more specific checks, like nightmares.
get_status_text
Called by medical scanners to get a simple summary of how healthy the organ is. Returns an empty string if things are fine.
on_bodypart_insert
Add any limb specific effects you might want here
on_bodypart_remove
Called on limb removal to remove limb specific limb effects or statusses
on_mob_insert
Called after the organ is inserted into a mob. Adds Traits, Actions, and Status Effects on the mob in which the organ is impanted. Override this proc to create unique side-effects for inserting your organ. Must be called by overrides.
on_mob_remove
Called after the organ is removed from a mob. Removes Traits, Actions, and Status Effects on the mob in which the organ was impanted. Override this proc to create unique side-effects for removing your organ. Must be called by overrides.
on_surgical_insertion
Proc that gets called when the organ is surgically inserted by someone. Seem familiar?
on_surgical_removal
Proc that gets called when the organ is surgically removed by someone, can be used for special effects
organ_failure
-
organ_failure
-
generic proc for handling dying organs
-
Arguments:
-
seconds_per_tick - seconds since last tick
remove_organ_status
Removes a Status Effect from an organ, and by extension, its owner.
remove_organ_trait
Removes a Trait from an organ, and by extension, its owner.
replace_into
Tries to replace the existing organ on the passed mob with this one, with special handling for replacing a brain without ghosting target
set_organ_damage
SETS an organ's damage to the amount "damage_amount", and in doing so clears or sets the failing flag, good for when you have an effect that should fix an organ if broken