Space Station 13 - Modules - TypesVar Details - Proc Details

surgery_step

Vars

accept_any_itemDoes the surgery step accept any item? If true, ignores implements. Compatible with accept_hand.
accept_handdoes the surgery step require an open hand? If true, ignores implements. Compatible with accept_any_item.
allowed_toolsType path of tools that can be used to complete this step. Format is path = probability of success. If the tool has a specific surgery tooltype, you can use that as a key as well.
blood_levelHow much blood this step can get on surgeon. See SURGERY_BLOODSPREAD_* defines
can_infectWhether this surgery step can cause an infection.
chems_neededList of chems needed in the mob to complete the step. Even on success, this step will have no effect if the required chems aren't in the mob.
failure_soundSound played if the step fails. Single value only
implement_typeThe current type of implement from allowed_tools in use. This has to be stored, as the typepath of the tool might not match the list type (such as if we're using tool behavior)
preop_soundSound played when the step is started. Lists or single value can be used for this var as well as tool defines
repeatableIs this step repeatable by using the same tool again after it's finished? Make sure it isn't the last step, or it's used in a cancellable surgery. Otherwise, you might get stuck in a loop!
require_all_chemsDo we require any of the needed chems, or all of them?
silicons_ignore_probWhether silicons ignore any probabilities (and are therefore "perfect" surgeons)
success_soundSound played if the step succeeded. Single value only
timeduration of the step
times_repeatedHow many times this step has been automatically repeated.

Procs

can_repeatDetermines whether or not this surgery step can repeat if its end/fail steps returned SURGERY_STEP_RETRY.
chem_checkCheck that the target contains the chems we expect them to.
deal_painTry to inflict pain during a surgery, a surgeon's dream come true. This will wake up the user if they're voluntarily sleeping.
end_stepFinish a surgery step, performing anything that runs on the tail-end of a successful surgery. This runs if the surgery step passes the probability check, and therefore is a success.
fail_stepPlay out the failure state of a surgery step. This runs if the surgery step fails the probability check, the right chems weren't present, or if the user deliberately failed the surgery.
get_step_informationGet the action that will be performed during this surgery step, in context of the surgery it is a part of.
initiateInitiate and really perform the surgery itself. This includes the main do-after and the checking of probabilities for successful surgeries. If try_to_fail is TRUE, then this surgery will be deliberately failed out of.
is_valid_toolWhether or not the tool being used is usable for the surgery. Checks both the tool itself as well as any tool behaviors defined in allowed_tools. Arguments:
slowdown_immuneCheck for mobs that would be immune to surgery slowdowns/speedups.
spread_germs_by_incisionSpread germs directly from a tool.
spread_germs_to_organSpread some nasty germs to an organ.
tool_checkGet whether the tool should be usable in its current state. Useful for checks to see if a welder is on, for example.
try_opTry to perform an operation on a user. Arguments:

Var Details

accept_any_item

Does the surgery step accept any item? If true, ignores implements. Compatible with accept_hand.

accept_hand

does the surgery step require an open hand? If true, ignores implements. Compatible with accept_any_item.

allowed_tools

Type path of tools that can be used to complete this step. Format is path = probability of success. If the tool has a specific surgery tooltype, you can use that as a key as well.

blood_level

How much blood this step can get on surgeon. See SURGERY_BLOODSPREAD_* defines

can_infect

Whether this surgery step can cause an infection.

chems_needed

List of chems needed in the mob to complete the step. Even on success, this step will have no effect if the required chems aren't in the mob.

failure_sound

Sound played if the step fails. Single value only

implement_type

The current type of implement from allowed_tools in use. This has to be stored, as the typepath of the tool might not match the list type (such as if we're using tool behavior)

preop_sound

Sound played when the step is started. Lists or single value can be used for this var as well as tool defines

repeatable

Is this step repeatable by using the same tool again after it's finished? Make sure it isn't the last step, or it's used in a cancellable surgery. Otherwise, you might get stuck in a loop!

require_all_chems

Do we require any of the needed chems, or all of them?

silicons_ignore_prob

Whether silicons ignore any probabilities (and are therefore "perfect" surgeons)

success_sound

Sound played if the step succeeded. Single value only

time

duration of the step

times_repeated

How many times this step has been automatically repeated.

Proc Details

can_repeat

Determines whether or not this surgery step can repeat if its end/fail steps returned SURGERY_STEP_RETRY.

Arguments:

If this returns TRUE, the step will automatically retry. If not, the user will have to manually start the step again.

chem_check

Check that the target contains the chems we expect them to.

deal_pain

Try to inflict pain during a surgery, a surgeon's dream come true. This will wake up the user if they're voluntarily sleeping.

Returns the success rate that the user's amount of pain would deal, while also handling extra pain behavior.

end_step

Finish a surgery step, performing anything that runs on the tail-end of a successful surgery. This runs if the surgery step passes the probability check, and therefore is a success.

Should return SURGERY_STEP_CONTINUE to advance the surgery, though may return SURGERY_STEP_INCOMPLETE to keep the surgery step from advancing.

fail_step

Play out the failure state of a surgery step. This runs if the surgery step fails the probability check, the right chems weren't present, or if the user deliberately failed the surgery.

Should return SURGERY_STEP_INCOMPLETE to prevent the surgery step from advancing, though may return SURGERY_STEP_CONTINUE to advance to the next step regardless.

get_step_information

Get the action that will be performed during this surgery step, in context of the surgery it is a part of.

initiate

Initiate and really perform the surgery itself. This includes the main do-after and the checking of probabilities for successful surgeries. If try_to_fail is TRUE, then this surgery will be deliberately failed out of.

Returns TRUE if the surgery should proceed to the next step, or FALSE otherwise.

is_valid_tool

Whether or not the tool being used is usable for the surgery. Checks both the tool itself as well as any tool behaviors defined in allowed_tools. Arguments:

slowdown_immune

Check for mobs that would be immune to surgery slowdowns/speedups.

spread_germs_by_incision

Spread germs directly from a tool.

spread_germs_to_organ

Spread some nasty germs to an organ.

tool_check

Get whether the tool should be usable in its current state. Useful for checks to see if a welder is on, for example.

Arguments:

try_op

Try to perform an operation on a user. Arguments: