surgery

Base surgery datum and procs. There is an important distinction between surgery datums and surgery steps. The surgery is a separate instance for each individual operation; the steps are shared globally. datum/surgery and datum/surgery_step are intertwined. The surgery calls the step which modifies the surgery. Defines are in __DEFINES/human.dm and __DEFINES/surgery.dm.
Vars | |
affected_limb | The limb the surgery is being performed on. If designing a surgery for a species without limbs, this var won't be usable. |
---|---|
invasiveness | How deep the incision must be before this operation is a valid option. |
location | The location this instance of the surgery is being performed on. |
lying_required | Does the victim needs to be lying down? Surgeries that can be performed while standing aren't affected by the surface the patient is on. |
pain_reduction_required | How strong a level of anesthesia is needed to avoid risking pain causing a step to fail? |
possible_locs | List of possible locations the surgery can be performed on. This is target zones: DEFENSE_ZONES_LIVING lists all options. ALL_LIMBS doesn't include eyes/mouth. Note also that steps don't check this and it is possible to include a step that can't be performed on a target limb. |
priority | When initiating surgeries, this defines their order when listed in initiation selector or 'you can't use this tool for anything, but could x, y, or z' messages. |
required_surgery_skill | How much training is needed to do this surgery? |
requires_bodypart | TRUE if the surgery requires a non-destroyed limb; FALSE if it requires a destroyed one, or doesn't need a limb. |
requires_bodypart_type | Status flag(s) required on the target limb to perform an operation. NONE for any limb type. (FLAG|FLAG) is an OR check, granular this-but-not-this or this-and-this checks should be in can_start() |
self_operable | Can the surgery be performed on yourself? |
status | The step the surgery is currently on. When status > number of steps, the surgery ends. |
steps | List of steps in the surgery. |
target_mobtypes | What species can this be performed on? |
Procs | |
attempt_next_step | Used on attackby and attackhand; TRUE means it stops the attack there, FALSE means it performs an item/open hand attack. CHECK OPENHAND ATTACK IS BLOCKED PROPERLY |
can_start | Catch-all proc for additional preconditions for starting the surgery. Return FALSE if the surgery can't be done. |
Var Details
affected_limb

The limb the surgery is being performed on. If designing a surgery for a species without limbs, this var won't be usable.
invasiveness

How deep the incision must be before this operation is a valid option.
location

The location this instance of the surgery is being performed on.
lying_required

Does the victim needs to be lying down? Surgeries that can be performed while standing aren't affected by the surface the patient is on.
pain_reduction_required

How strong a level of anesthesia is needed to avoid risking pain causing a step to fail?
possible_locs

List of possible locations the surgery can be performed on. This is target zones: DEFENSE_ZONES_LIVING lists all options. ALL_LIMBS doesn't include eyes/mouth. Note also that steps don't check this and it is possible to include a step that can't be performed on a target limb.
priority

When initiating surgeries, this defines their order when listed in initiation selector or 'you can't use this tool for anything, but could x, y, or z' messages.
required_surgery_skill

How much training is needed to do this surgery?
requires_bodypart

TRUE if the surgery requires a non-destroyed limb; FALSE if it requires a destroyed one, or doesn't need a limb.
requires_bodypart_type

Status flag(s) required on the target limb to perform an operation. NONE for any limb type. (FLAG|FLAG) is an OR check, granular this-but-not-this or this-and-this checks should be in can_start()
self_operable

Can the surgery be performed on yourself?
status

The step the surgery is currently on. When status > number of steps, the surgery ends.
steps

List of steps in the surgery.
target_mobtypes

What species can this be performed on?
Proc Details
attempt_next_step
Used on attackby and attackhand; TRUE means it stops the attack there, FALSE means it performs an item/open hand attack. CHECK OPENHAND ATTACK IS BLOCKED PROPERLY
can_start
Catch-all proc for additional preconditions for starting the surgery. Return FALSE if the surgery can't be done.