byond - Modules - TypesVar Details - Proc Details

/datum/surgery_step

Vars

accept_any_itemDoes the surgery step accept any item? If true, ignores tools.
accept_handDoes the surgery step accept an open hand? If true and the surgeon uses their hand, doesn't check for tools. If wanting to make a surgery where a hand can do it but tools are faster, give it a long default time and its tools modifiers above 100.
descDescription of the surgery used for need-different-tool messages, format: (You could/can't )["sever the bone in the patient's limb"]( with \the [tool], or )[next step desc]. Can't refer to outside vars as step datums are global.
failure_soundfailure >:(
preop_soundpreop means "in Progress" sound
repeat_stepWhether this step continuously repeats as long as a criteria is met. If TRUE, consider setting skip_step_criteria() or using a failure() override to return TRUE to allow it to be canceled or skipped.
success_soundSound of success
timeHow long does the step take as a baseline? Modified by the surgeon's skills, the tool used, and, if the parent surgery requires the patient to be lying down, the surface the patient is buckled to or resting on: surgery table, field surgical bed, rollerbed, table, open ground etc.
toolsAssociative list, tools and their step time multiplier. tools_typecache is assigned from from first to last, so if you have a more specific subtype and its parent in the same list, place the subtype last to override the general parent. Some are shared defines, some are set on the tool that uses them.
tools_cacheAssoc. list. This is generated on init and is something like an inverse typecache. All types and subtypes of valid tools are in it, associated to the parent tool type. Example: for an item type /wxy/z, tool_check() returns tools_cache[/wxy/z]. If /wxy is in tools, this will == /wxy; otherwise it == NULL.

Procs

attempt_stepThe proc that actually performs the step.
completeFinishes the surgery and removes it from the target's lists.
extra_checksobj/limb/hand ? does any extra checks that is is SUBTYPED to perform
failureThis is used for failed-step narration and relevant failure changes, often damage etc. If it returns TRUE, the step succeeds anyway. tool_type may be a typepath or simply '1'. Note that a first step done on help-intent doesn't call failure(), it just ends harmlessly.
play_failure_soundPlays the failure sound
play_preop_soundPlays Preop Sounds
play_success_soundPlays the selected success sound
preopThis is used for beginning-step narration. tool_type may be a typepath or simply '1'.
repeat_step_criteriaUsed by repeating steps to determine whether to keep looping. tool_type may be a typepath or simply '1'.
skip_step_criteriaWhether this step is optional and can be skipped if it isn't the last step. There must be a step after it to skip to. As this may be used when initiating a surgery and deciding whether to skip the first step, it must be able to work without reference to the parent surgery's status, affected_limb, or location vars. Also, in that case there may be a wait between passing the check and beginning the step while the user picks a surgery.
successThis is used for end-step narration and relevant success changes - whatever the step is meant to do, if it isn't just flavour. tool_type may be a typepath or simply '1'.
tool_checkChecks the given tool, if any, against the step's tools list, and returns one of three options: the tool list key, TRUE, or FALSE to fail the surgery.

Var Details

accept_any_item

Does the surgery step accept any item? If true, ignores tools.

accept_hand

Does the surgery step accept an open hand? If true and the surgeon uses their hand, doesn't check for tools. If wanting to make a surgery where a hand can do it but tools are faster, give it a long default time and its tools modifiers above 100.

desc

Description of the surgery used for need-different-tool messages, format: (You could/can't )["sever the bone in the patient's limb"]( with \the [tool], or )[next step desc]. Can't refer to outside vars as step datums are global.

failure_sound

failure >:(

preop_sound

preop means "in Progress" sound

repeat_step

Whether this step continuously repeats as long as a criteria is met. If TRUE, consider setting skip_step_criteria() or using a failure() override to return TRUE to allow it to be canceled or skipped.

success_sound

Sound of success

time

How long does the step take as a baseline? Modified by the surgeon's skills, the tool used, and, if the parent surgery requires the patient to be lying down, the surface the patient is buckled to or resting on: surgery table, field surgical bed, rollerbed, table, open ground etc.

tools

Associative list, tools and their step time multiplier. tools_typecache is assigned from from first to last, so if you have a more specific subtype and its parent in the same list, place the subtype last to override the general parent. Some are shared defines, some are set on the tool that uses them.

tools_cache

Assoc. list. This is generated on init and is something like an inverse typecache. All types and subtypes of valid tools are in it, associated to the parent tool type. Example: for an item type /wxy/z, tool_check() returns tools_cache[/wxy/z]. If /wxy is in tools, this will == /wxy; otherwise it == NULL.

Proc Details

attempt_step

The proc that actually performs the step.

complete

Finishes the surgery and removes it from the target's lists.

extra_checks

obj/limb/hand ? does any extra checks that is is SUBTYPED to perform

failure

This is used for failed-step narration and relevant failure changes, often damage etc. If it returns TRUE, the step succeeds anyway. tool_type may be a typepath or simply '1'. Note that a first step done on help-intent doesn't call failure(), it just ends harmlessly.

play_failure_sound

Plays the failure sound

play_preop_sound

Plays Preop Sounds

play_success_sound

Plays the selected success sound

preop

This is used for beginning-step narration. tool_type may be a typepath or simply '1'.

repeat_step_criteria

Used by repeating steps to determine whether to keep looping. tool_type may be a typepath or simply '1'.

skip_step_criteria

Whether this step is optional and can be skipped if it isn't the last step. There must be a step after it to skip to. As this may be used when initiating a surgery and deciding whether to skip the first step, it must be able to work without reference to the parent surgery's status, affected_limb, or location vars. Also, in that case there may be a wait between passing the check and beginning the step while the user picks a surgery.

success

This is used for end-step narration and relevant success changes - whatever the step is meant to do, if it isn't just flavour. tool_type may be a typepath or simply '1'.

tool_check

Checks the given tool, if any, against the step's tools list, and returns one of three options: the tool list key, TRUE, or FALSE to fail the surgery.