item
Vars | |
actions | list of /datum/action's that this item has. |
---|---|
actions_types | list of paths of action datums to give to the item on New(). |
allowed | What objects the suit storage can store |
alternate_worn_layer | Forced mob worn layer instead of the standard preferred ssize. |
armour_penetration | percentage of armour effectiveness to remove |
attack_verb | Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" |
body_parts_covered | What body parts are covered by the clothing when you wear it |
breakouttime | How long it takes to resist out of the item (cuffs and such) |
cold_protection | flags which determine which body parts are protected from cold. [See here][HEAD] |
dog_fashion | Reference to the datum that determines whether dogs can wear the item: Needs to be in /obj/item because corgis can wear a lot of non-clothing items |
drop_sound | Sound uses when dropping the item, or when its thrown. |
dye_color | Used as the dye color source in the washing machine only (at the moment). Can be a hex color or a key corresponding to a registry entry, see washing_machine.dm |
dying_key | What dye registry should be looked at when dying this item; see washing_machine.dm |
embedding | Does it embed and if yes, what kind of embed |
equip_delay_other | In deciseconds, how long an item takes to put on another person |
equip_delay_self | In deciseconds, how long an item takes to equip; counts only for normal clothing slots, not pockets etc. |
equip_sound | Sound used when equipping the item into a valid slot |
flags_cover | for flags such as [GLASSESCOVERSEYES] |
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. |
force_string | string form of an item's force. Edit this var only to set a custom force string |
gas_transfer_coefficient | Literally does nothing right now |
greyscale_colors | Needs to follow this syntax: either a list() with the x and y coordinates of the pixel you want to get the colour from, or a hexcolour. Colour one replaces red, two replaces green, and three replaces blue in the icon state. |
greyscale_icon_state | Needs to be a RGB-greyscale format icon state in all species' clothing icon files. |
grind_results | Grinder var:A reagent list containing the reagents this item produces when ground up in a grinder - this can be an empty list to allow for reagent transferring only |
heat_protection | flags which determine which body parts are protected from heat. [See here][HEAD] |
hitsound | Sound played when you hit something with the item |
inhand_x_dimension | Same as for worn_x_dimension but for inhands, uses the lefthand_ and righthand_ file vars |
inhand_y_dimension | Same as for worn_y_dimension but for inhands, uses the lefthand_ and righthand_ file vars |
interaction_flags_item | flags for what should be done when you click on the item, default is picking it up |
inventory_state | Handled by world_icon element |
item_color | Used in picking icon_states based on the string color here. Also used for cables or something. This could probably do with being deprecated. |
item_flags | Item flags for the item |
item_state | icon state name for inhand overlays |
kepori_override_icon | If set, kepori wearing this use this instead of their clothing file |
lefthand_file | Icon file for left hand inhand overlays |
max_heat_protection_temperature | Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags |
min_cold_protection_temperature | Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags |
mob_overlay_icon | Icon file for mob worn overlays. |
mob_overlay_state | icon state for mob worn overlays, if null the normal icon_state will be used. |
mob_throw_hit_sound | Used when yate into a mob |
mouse_drag_pointer | the icon to indicate this object is being dragged |
permeability_coefficient | How likely a disease or chemical is to get through a piece of clothing |
pickup_sound | Sound uses when picking the item up (into your hands) |
power_use_amount | How much power would this item use? |
reach | In tiles, how far this weapon can reach; 1 for adjacent, which is default |
restricted_bodytypes | A bitfield of bodytypes that the item cannot be worn by. |
righthand_file | Icon file for right inhand overlays |
sharpness | All items with sharpness of IS_SHARP or higher will automatically get the butchering component. |
siemens_coefficient | for electrical admittance/conductance (electrocution checks and shit) |
slot_equipment_priority | The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. For default list, see /mob/proc/equip_to_appropriate_slot |
slot_flags | This is used to determine on which slots an item can fit. |
slowdown | How much clothing is slowing you down. Negative values speeds you up |
species_exception | list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item |
stealthy_audio | Whether or not we use stealthy audio levels for this item's attack sounds |
strip_delay | In deciseconds, how long an item takes to remove from another person |
supports_variations | This is a bitfield that defines what variations exist for bodyparts like Digi legs. |
thrownby | A weakref to the mob who threw the item |
tool_behaviour | How a tool acts when you use it on something, such as wirecutters cutting wires while multitools measure power |
toolspeed | How fast does the tool work |
transparent_protection | you can see someone's mask through their transparent visor, but you can't reach it |
trigger_guard | Determines who can shoot this |
undyeable | Whether the item is unaffected by standard dying. |
usesound | Played when the item is used, for example tools |
vox_override_icon | If set, vox wearing this use this instead of their clothing file |
w_class | Weight class for how much storage capacity it uses and how big it physically is meaning storages can't hold it if their maximum weight class isn't as high as it. |
w_volume | Volume override for the item, otherwise automatically calculated from w_class. |
wall_decon_damage | how much damage does this item do when tearing down walls during deconstruction steps? |
world_file | If set it will add a world icon using item_state |
world_state | Handled by world_icon element |
worn_x_dimension | Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly |
worn_y_dimension | Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly |
worn_y_offset | Worn overlay will be shifted by this along y axis |
Procs | |
IsReflect | This proc determines if and at what an object will reflect energy projectiles if it's in l_hand,r_hand or wear_suit |
add_item_action | Adds an item action to our list of item actions. Item actions are actions linked to our item, that are granted to mobs who equip us. This also ensures that the actions are properly tracked in the actions list and removed if they're deleted. Can be be passed a typepath of an action or an instance of an action. |
afterattack | Last proc in the /obj/item/proc/melee_attack_chain |
attack | Called from [/mob/living/attackby] |
attack_obj | The equivalent of the standard version of /obj/item/proc/attack but for object targets. |
attack_qdeleted | Called if the target gets deleted by our attack |
attack_self | Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. |
attackby_storage_insert | Whether or not this item can be put into a storage item through attackby |
disableEmbedding | For when you want to disable an item's embedding capabilities (like transforming weapons and such), this proc will detach any active embed elements from it. |
equipped | called after an item is placed in an equipment slot |
failedEmbed | In case we want to do something special (like self delete) upon failing to embed in something, return true |
get_part_rating | Returns a numeric value for sorting items used as parts in machines, so they can be replaced by the rped |
get_sharpness | Returns the sharpness of src. If you want to get the sharpness of an item use this. |
get_temperature | Returns the temperature of src. If you want to know if an item is hot use this proc. |
get_w_volume | Get an item's volume that it uses when being stored. |
get_writing_implement_details | Returns null if this object cannot be used to interact with physical writing mediums such as paper. Returns a list of key attributes for this object interacting with paper otherwise. |
give_item_action | Gives one of our item actions to a mob, when equipped to a certain slot |
grant_action_to_bearer | Grant the action to anyone who has this item equipped to an appropriate slot |
interact | Research prospects, including boostable nodes and point values. Deliver to a console to know whether the boosts have already been used. Separator between the items on the list Nodes that can be boosted |
isEmbedHarmless | Does the current embedding var meet the criteria for being harmless? Namely, does it have a pain multiplier and jostle pain mult of 0? If so, return true. |
item_action_slot_check | Sometimes we only want to grant the item's action if it's equipped in a specific slot. |
item_use_power | Use the power of an attached component that posesses power handling, will return the signal bitflag. |
melee_attack_chain | This is the proc that handles the order of an item_attack. |
mob_can_equip | the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. if this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. Arguments: |
on_action_deleted | Called when an action associated with our item is deleted |
on_found | called when "found" in pockets and storage items. Returns 1 if the search should end. |
on_grind | Called BEFORE the object is ground up - use this to change grind results based on conditions. Use "return -1" to prevent the grinding from occurring |
on_offer_taken | An interrupt for someone trying to accept an offered item, called mainly from /mob/living/carbon/proc/take, in case you want to run your own take behavior instead. |
on_offered | An interrupt for offering an item to other people, called mainly from /mob/living/carbon/proc/give, in case you want to run your own offer behavior instead. |
on_thrown | Called by the carbon throw_item() proc. Returns null if the item negates the throw, or a reference to the thing to suffer the throw else. |
pickup | called just as an item is picked up (loc is not yet changed) |
play_tool_sound | Plays item's usesound, if any. |
pre_attack | Called on the item before it hits something |
remove_item_action | Removes an instance of an action from our list of item actions. |
tool_check_callback | Used in a callback that is passed by use_tool into do_after call. Do not override, do not call manually. |
tool_start_check | Called before obj/item/proc/use_tool if there is a delay, or by obj/item/proc/use_tool if there isn't. Only ever used by welding tools and stacks, so it's not added on any other obj/item/proc/use_tool checks. |
tool_use_check | A check called by /obj/item/proc/tool_start_check once, and by use_tool on every tick of delay. |
tryEmbed | tryEmbed() is for when you want to try embedding something without dealing with the damage + hit messages of calling hitby() on the item while targetting the target. |
ui_action_click | This proc is executed when someone clicks the on-screen UI button. The default action is attack_self(). Checks before we get to here are: mob is alive, mob is not restrained, stunned, asleep, resting, laying, item is on the mob. |
unique_action | Intended for interactions with guns, like racking |
updateEmbedding | For when you want to add/update the embedding on an item. Uses the vars in /obj/item/embedding, and defaults to config values for values that aren't set. Will automatically detach previous embed elements on this item. |
use | Generic use proc. Depending on the item, it uses up fuel, charges, sheets, etc. Returns TRUE on success, FALSE on failure. |
use_tool | Called when a mob tries to use the item as a tool.Handles most checks. |
visual_equipped | To be overwritten to only perform visual tasks;
this is directly called instead of equipped on visual-only features like human dummies equipping outfits. |
Var Details
actions
list of /datum/action's that this item has.
actions_types
list of paths of action datums to give to the item on New().
allowed
What objects the suit storage can store
alternate_worn_layer
Forced mob worn layer instead of the standard preferred ssize.
armour_penetration
percentage of armour effectiveness to remove
attack_verb
Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
body_parts_covered
What body parts are covered by the clothing when you wear it
breakouttime
How long it takes to resist out of the item (cuffs and such)
cold_protection
flags which determine which body parts are protected from cold. [See here][HEAD]
dog_fashion
Reference to the datum that determines whether dogs can wear the item: Needs to be in /obj/item because corgis can wear a lot of non-clothing items
drop_sound
Sound uses when dropping the item, or when its thrown.
dye_color
Used as the dye color source in the washing machine only (at the moment). Can be a hex color or a key corresponding to a registry entry, see washing_machine.dm
dying_key
What dye registry should be looked at when dying this item; see washing_machine.dm
embedding
Does it embed and if yes, what kind of embed
equip_delay_other
In deciseconds, how long an item takes to put on another person
equip_delay_self
In deciseconds, how long an item takes to equip; counts only for normal clothing slots, not pockets etc.
equip_sound
Sound used when equipping the item into a valid slot
flags_cover
for flags such as [GLASSESCOVERSEYES]
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.
force_string
string form of an item's force. Edit this var only to set a custom force string
gas_transfer_coefficient
Literally does nothing right now
greyscale_colors
Needs to follow this syntax: either a list() with the x and y coordinates of the pixel you want to get the colour from, or a hexcolour. Colour one replaces red, two replaces green, and three replaces blue in the icon state.
greyscale_icon_state
Needs to be a RGB-greyscale format icon state in all species' clothing icon files.
grind_results
Grinder var:A reagent list containing the reagents this item produces when ground up in a grinder - this can be an empty list to allow for reagent transferring only
heat_protection
flags which determine which body parts are protected from heat. [See here][HEAD]
hitsound
Sound played when you hit something with the item
inhand_x_dimension
Same as for worn_x_dimension but for inhands, uses the lefthand_ and righthand_ file vars
inhand_y_dimension
Same as for worn_y_dimension but for inhands, uses the lefthand_ and righthand_ file vars
interaction_flags_item
flags for what should be done when you click on the item, default is picking it up
inventory_state
Handled by world_icon element
item_color
Used in picking icon_states based on the string color here. Also used for cables or something. This could probably do with being deprecated.
item_flags
Item flags for the item
item_state
icon state name for inhand overlays
kepori_override_icon
If set, kepori wearing this use this instead of their clothing file
lefthand_file
Icon file for left hand inhand overlays
max_heat_protection_temperature
Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags
min_cold_protection_temperature
Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags
mob_overlay_icon
Icon file for mob worn overlays.
mob_overlay_state
icon state for mob worn overlays, if null the normal icon_state will be used.
mob_throw_hit_sound
Used when yate into a mob
mouse_drag_pointer
the icon to indicate this object is being dragged
permeability_coefficient
How likely a disease or chemical is to get through a piece of clothing
pickup_sound
Sound uses when picking the item up (into your hands)
power_use_amount
How much power would this item use?
reach
In tiles, how far this weapon can reach; 1 for adjacent, which is default
restricted_bodytypes
A bitfield of bodytypes that the item cannot be worn by.
righthand_file
Icon file for right inhand overlays
sharpness
All items with sharpness of IS_SHARP or higher will automatically get the butchering component.
siemens_coefficient
for electrical admittance/conductance (electrocution checks and shit)
slot_equipment_priority
The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. For default list, see /mob/proc/equip_to_appropriate_slot
slot_flags
This is used to determine on which slots an item can fit.
slowdown
How much clothing is slowing you down. Negative values speeds you up
species_exception
list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item
stealthy_audio
Whether or not we use stealthy audio levels for this item's attack sounds
strip_delay
In deciseconds, how long an item takes to remove from another person
supports_variations
This is a bitfield that defines what variations exist for bodyparts like Digi legs.
thrownby
A weakref to the mob who threw the item
tool_behaviour
How a tool acts when you use it on something, such as wirecutters cutting wires while multitools measure power
toolspeed
How fast does the tool work
transparent_protection
you can see someone's mask through their transparent visor, but you can't reach it
trigger_guard
Determines who can shoot this
undyeable
Whether the item is unaffected by standard dying.
usesound
Played when the item is used, for example tools
vox_override_icon
If set, vox wearing this use this instead of their clothing file
w_class
Weight class for how much storage capacity it uses and how big it physically is meaning storages can't hold it if their maximum weight class isn't as high as it.
w_volume
Volume override for the item, otherwise automatically calculated from w_class.
wall_decon_damage
how much damage does this item do when tearing down walls during deconstruction steps?
world_file
If set it will add a world icon using item_state
world_state
Handled by world_icon element
worn_x_dimension
Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly
worn_y_dimension
Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly
worn_y_offset
Worn overlay will be shifted by this along y axis
Proc Details
IsReflect
This proc determines if and at what an object will reflect energy projectiles if it's in l_hand,r_hand or wear_suit
add_item_action
Adds an item action to our list of item actions. Item actions are actions linked to our item, that are granted to mobs who equip us. This also ensures that the actions are properly tracked in the actions list and removed if they're deleted. Can be be passed a typepath of an action or an instance of an action.
afterattack
Last proc in the /obj/item/proc/melee_attack_chain
Arguments:
- atom/target - The thing that was hit
- mob/user - The mob doing the hitting
- proximity_flag - is 1 if this afterattack was called on something adjacent, in your square, or on your person.
- click_parameters - is the params string from byond /atom/proc/Click code, see that documentation.
attack
Called from [/mob/living/attackby]
Arguments:
- mob/living/M - The mob being hit by this item
- mob/living/user - The mob hitting with this item
attack_obj
The equivalent of the standard version of /obj/item/proc/attack but for object targets.
attack_qdeleted
Called if the target gets deleted by our attack
attack_self
Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
attackby_storage_insert
Whether or not this item can be put into a storage item through attackby
disableEmbedding
For when you want to disable an item's embedding capabilities (like transforming weapons and such), this proc will detach any active embed elements from it.
equipped
called after an item is placed in an equipment slot
Arguments:
- user is mob that equipped it
- slot uses the slot_X defines found in setup.dm for items that can be placed in multiple slots
- Initial is used to indicate whether or not this is the initial equipment (job datums etc) or just a player doing it
failedEmbed
In case we want to do something special (like self delete) upon failing to embed in something, return true
get_part_rating
Returns a numeric value for sorting items used as parts in machines, so they can be replaced by the rped
get_sharpness
Returns the sharpness of src. If you want to get the sharpness of an item use this.
get_temperature
Returns the temperature of src. If you want to know if an item is hot use this proc.
get_w_volume
Get an item's volume that it uses when being stored.
get_writing_implement_details
Returns null if this object cannot be used to interact with physical writing mediums such as paper. Returns a list of key attributes for this object interacting with paper otherwise.
give_item_action
Gives one of our item actions to a mob, when equipped to a certain slot
grant_action_to_bearer
Grant the action to anyone who has this item equipped to an appropriate slot
interact
Research prospects, including boostable nodes and point values. Deliver to a console to know whether the boosts have already been used. Separator between the items on the list Nodes that can be boosted
isEmbedHarmless
Does the current embedding var meet the criteria for being harmless? Namely, does it have a pain multiplier and jostle pain mult of 0? If so, return true.
item_action_slot_check
Sometimes we only want to grant the item's action if it's equipped in a specific slot.
item_use_power
Use the power of an attached component that posesses power handling, will return the signal bitflag.
melee_attack_chain
This is the proc that handles the order of an item_attack.
The order of procs called is:
- /atom/proc/tool_act on the target. If it returns TRUE, the chain will be stopped.
- /obj/item/proc/pre_attack on src. If this returns TRUE, the chain will be stopped.
- /atom/proc/attackby on the target. If it returns TRUE, the chain will be stopped.
- /obj/item/proc/afterattack. The return value does not matter.
mob_can_equip
the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. if this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. Arguments:
- disable_warning to TRUE if you wish it to not give you text outputs.
- slot is the slot we are trying to equip to
- equipper is the mob trying to equip the item
- bypass_equip_delay_self for whether we want to bypass the equip delay
on_action_deleted
Called when an action associated with our item is deleted
on_found
called when "found" in pockets and storage items. Returns 1 if the search should end.
on_grind
Called BEFORE the object is ground up - use this to change grind results based on conditions. Use "return -1" to prevent the grinding from occurring
on_offer_taken
An interrupt for someone trying to accept an offered item, called mainly from /mob/living/carbon/proc/take, in case you want to run your own take behavior instead.
Return TRUE if you want to interrupt the taking.
Arguments: offerer - the person offering the item taker - the person trying to accept the offer
on_offered
An interrupt for offering an item to other people, called mainly from /mob/living/carbon/proc/give, in case you want to run your own offer behavior instead.
Return TRUE if you want to interrupt the offer.
Arguments: offerer - the person offering the item
on_thrown
Called by the carbon throw_item() proc. Returns null if the item negates the throw, or a reference to the thing to suffer the throw else.
pickup
called just as an item is picked up (loc is not yet changed)
play_tool_sound
Plays item's usesound, if any.
pre_attack
Called on the item before it hits something
Arguments:
- atom/A - The atom about to be hit
- mob/living/user - The mob doing the htting
- params - click params such as alt/shift etc
See: /obj/item/proc/melee_attack_chain
remove_item_action
Removes an instance of an action from our list of item actions.
tool_check_callback
Used in a callback that is passed by use_tool into do_after call. Do not override, do not call manually.
tool_start_check
Called before obj/item/proc/use_tool if there is a delay, or by obj/item/proc/use_tool if there isn't. Only ever used by welding tools and stacks, so it's not added on any other obj/item/proc/use_tool checks.
tool_use_check
A check called by /obj/item/proc/tool_start_check once, and by use_tool on every tick of delay.
tryEmbed
tryEmbed() is for when you want to try embedding something without dealing with the damage + hit messages of calling hitby() on the item while targetting the target.
Really, this is used mostly with projectiles with shrapnel payloads, from /datum/element/embed/proc/checkEmbedProjectile, and called on said shrapnel. Mostly acts as an intermediate between different embed elements.
Arguments:
- target- Either a body part, a carbon, or a closed turf. What are we hitting?
- forced- Do we want this to go through 100%?
ui_action_click
This proc is executed when someone clicks the on-screen UI button. The default action is attack_self(). Checks before we get to here are: mob is alive, mob is not restrained, stunned, asleep, resting, laying, item is on the mob.
unique_action
Intended for interactions with guns, like racking
updateEmbedding
For when you want to add/update the embedding on an item. Uses the vars in /obj/item/embedding, and defaults to config values for values that aren't set. Will automatically detach previous embed elements on this item.
use
Generic use proc. Depending on the item, it uses up fuel, charges, sheets, etc. Returns TRUE on success, FALSE on failure.
use_tool
Called when a mob tries to use the item as a tool.Handles most checks.
visual_equipped
To be overwritten to only perform visual tasks;
this is directly called instead of equipped
on visual-only features like human dummies equipping outfits.
This separation exists to prevent things like the monkey sentience helmet from polling ghosts while it's just being equipped as a visual preview for a dummy.