Space Station 13 - Modules - TypesVar Details - Proc Details

item

Vars

anomaly_protectionA value denoting how much this item should protect against the effects of anomalies when worn.
attack_verbUsed in use_weapon() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
blood_overlayThis saves our blood splatter overlay, which will be processed not to go over the edges of the sprite
body_parts_coveredSee items_clothing.dm for appropriate bit flags
equip_delayOptional delay for /mob/living/carbon/human/equip_to_slot_if_possible to do_after before succeeding
equip_delay_flagsFlags to use for do_after when equip_delay is set
flags_invThis flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
pluralnameBYOND sometimes doesn't add an 'es' to make a word plural when it should; pluralname is a workaround. Only use if it doesn't work traditionally. For example match becomes matchs without this.
toolspeedUsed to determine how fast an item completes a certain action. Lower values are faster.

Procs

ChameleonFlexibleAppearanceVerbs to handle changing the appearance of atoms that have the chameleon extension.
afterattackCalled when the item is in the active hand and another atom is clicked and resolve_attackby() returns FALSE. This is generally called by ClickOn(). Works on ranged targets, unlike resolve_attackby()
apply_hit_effectCalled when a weapon is used to make a successful melee attack on a mob. Generally called by the target's use_weapon() proc. Overriden to apply special effects like electrical shocks from stun batons/defib paddles.
attack_selfCalled when the item is in the active hand and clicked, or the activate held object verb is used.
can_punctureFor items that can puncture e.g. thick plastic but aren't necessarily sharp.
droppedCalled whenever an item is removed from a slot, container, or anything else.
equip_delay_afterVirtual for behavior to do after successful do_after if equip_delay is set
equip_delay_beforeVirtual for behavior to do before do_after if equip_delay is set
resolve_attackbyCalled when the item is in the active hand and another atom is clicked. This is generally called by ClickOn().
use_afterCalled when the item is in the active hand and another atom is clicked. This is generally called by the target's resolve_attackby() proc. Use it for item-level behavior you don't necessarily want running before use_tool/use_weapon. You will need to use type checks on atom/target on overrides; or else this will be called on anything you click.
use_beforeCalled when a mob is clicked while the item is in the active hand. This is usually called first by the mob's resolve_attackby() proc. Use this to set item-level overrides that you want running first. If you have an override you don't want running before use_tool and use_weapon, put it in use_after(). You will need to use type checks on atom/target on overrides; or else this will be called on anything you click. If returns FALSE, the rest of the resolve_attackby() chain is called.

Var Details

anomaly_protection

A value denoting how much this item should protect against the effects of anomalies when worn.

attack_verb

Used in use_weapon() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"

blood_overlay

This saves our blood splatter overlay, which will be processed not to go over the edges of the sprite

body_parts_covered

See items_clothing.dm for appropriate bit flags

equip_delay

Optional delay for /mob/living/carbon/human/equip_to_slot_if_possible to do_after before succeeding

equip_delay_flags

Flags to use for do_after when equip_delay is set

flags_inv

This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.

It should be used purely for appearance. For gameplay effects caused by items covering body parts, use body_parts_covered.

pluralname

BYOND sometimes doesn't add an 'es' to make a word plural when it should; pluralname is a workaround. Only use if it doesn't work traditionally. For example match becomes matchs without this.

toolspeed

Used to determine how fast an item completes a certain action. Lower values are faster.

Proc Details

ChameleonFlexibleAppearance

Verbs to handle changing the appearance of atoms that have the chameleon extension.

afterattack

Called when the item is in the active hand and another atom is clicked and resolve_attackby() returns FALSE. This is generally called by ClickOn(). Works on ranged targets, unlike resolve_attackby()

Parameters:

Should have no return value.

apply_hit_effect

Called when a weapon is used to make a successful melee attack on a mob. Generally called by the target's use_weapon() proc. Overriden to apply special effects like electrical shocks from stun batons/defib paddles.

Parameters:

Returns boolean to indicate whether or not damage was dealt.

attack_self

Called when the item is in the active hand and clicked, or the activate held object verb is used.

Parameters:

Should have no return value.

can_puncture

For items that can puncture e.g. thick plastic but aren't necessarily sharp.

Returns TRUE if the given item is capable of popping things like balloons, inflatable barriers, or cutting police tape. Also used to determine what items can eyestab.

dropped

Called whenever an item is removed from a slot, container, or anything else.

equip_delay_after

Virtual for behavior to do after successful do_after if equip_delay is set

equip_delay_before

Virtual for behavior to do before do_after if equip_delay is set

resolve_attackby

Called when the item is in the active hand and another atom is clicked. This is generally called by ClickOn().

This passes down to use_before(), use_weapon(), use_tool(), and then use_after() in that order, depending on item flags and user's intent. use_grab() is run in an override of resolve_attackby() processed at the grab's level, and is not part of this chain.

Parameters:

Returns boolean to indicate whether the attack call was handled or not.

use_after

Called when the item is in the active hand and another atom is clicked. This is generally called by the target's resolve_attackby() proc. Use it for item-level behavior you don't necessarily want running before use_tool/use_weapon. You will need to use type checks on atom/target on overrides; or else this will be called on anything you click.

Parameters:

Returns boolean to indicate whether the use call was handled or not.

use_before

Called when a mob is clicked while the item is in the active hand. This is usually called first by the mob's resolve_attackby() proc. Use this to set item-level overrides that you want running first. If you have an override you don't want running before use_tool and use_weapon, put it in use_after(). You will need to use type checks on atom/target on overrides; or else this will be called on anything you click. If returns FALSE, the rest of the resolve_attackby() chain is called.

Parameters: