item
Vars | |
attack_speed | Amount of time to check for from a mob's last attack, checked before an attack happens. Lower = faster attacks |
---|---|
attack_unwieldlyness | Amount of time to hard-stagger (no clicking at all) the mob when attacking. Lower = better |
block_chance | The 0% to 100% chance for the default implementation of random block rolls. |
block_priority | Block priority, higher means we check this higher in the "chain". |
clickdelay_from_next_action | This item checks clickdelay from a user's delayed next action variable rather than the last time they attacked. |
clickdelay_ignores_next_action | This item ignores next action delays. |
clickdelay_mod_bypass | This item bypasses any click delay mods |
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 |
equip_sound | Sound used when equipping the item into a valid slot |
force_string | string form of an item's force. Edit this var only to set a custom force string |
hitsound | Sound played when you hit something with the item |
item_flags | Item flags for the item |
item_state | icon state name for inhand overlays |
lefthand_file | Icon file for left hand inhand overlays |
mob_overlay_icon | Icon file for mob worn overlays. no var for state because it should always be the same as icon_state |
mob_throw_hit_sound | Used when yate into a mob |
pickup_sound | Sound uses when picking the item up (into your hands) |
righthand_file | Icon file for right inhand overlays |
sharpness | All items with sharpness of SHARP_EDGED or higher will automatically get the butchering component. |
stagger_force | How long, in deciseconds, this staggers for, if null it will autocalculate from w_class and force. Unlike total mass this supports 0 and negatives. |
stealthy_audio | Whether or not we use stealthy audio levels for this item's attack sounds |
throw_verb | Used if we want to have a custom verb text for throwing. "John Spaceman flicks the ciggerate" for example. |
thrownby | A weakref to the mob who threw the item |
total_mass | The amount of stamina it takes to swing an item in a normal melee attack do not lie to me and say it's for realism because it ain't. If null it will autocalculate from w_class. |
undyeable | Whether the item is unaffected by standard dying. |
used_skills | Skills vars |
usesound | Played when the item is used, for example tools |
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. |
Procs | |
ApplyAttackCooldown | Called after a successful attack to set a mob's clickdelay. |
CheckAttackCooldown | Checks if a user's clickdelay is met for a standard attack, this is called before an attack happens. |
GetEstimatedAttackSpeed | Get estimated time that a user has to not attack for to use us |
UseStaminaBufferStandard | Uses the amount of stamina required for a standard hit |
active_block_calculate_final_damage | Calculates FINAL ATTACK DAMAGE after mitigation |
active_block_do_stamina_damage | Apply the stamina damage to our user, notice how damage argument is stamina_amount. |
active_block_stamina_cost | Amount of stamina from damage blocked. Note that the damage argument is damage_blocked. |
active_parry_reflex_counter | Called when an attack is parried and block_parra_data indicates to use a proc to handle counterattack. |
add_item_context | Creates a "Type-A" contextual screentip interaction.
When a user hovers over something with this item in hand, this proc will be called in order
to provide context for contextual screentips.
You must call register_item_context() in order for this to be registered.
A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm)
that map to the action as text.
If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET.
source can, in all cases, be replaced with src , and only exists because this proc directly connects to a signal. |
afterattack | Called after attacking something if the melee attack chain isn't interrupted before. Also called when clicking on something with an item without being in melee range |
attack | Called when someone uses us to attack a mob in melee combat. |
blockable_directions | Gets the block direction bitflags of what we can block. |
can_active_block | Returns if we can actively block. |
can_active_parry | Determines if we can actively parry. |
can_block_direction | Checks if we can block from a specific direction from our direction. |
can_block_directions_multiple | can_block_direction but for "compound" directions to check all of them and return the number of directions that were blocked. |
check_block | Returns block information using list/block_return. Used for check_block() on mobs. |
cyborg_unequip | Parent proc - triggers when an item/module is unequipped from a cyborg. |
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. |
dropped | Called when a mob drops an item. |
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_block_parry_data | Gets this item's datum/block_parry_data |
get_w_volume | Get an item's volume that it uses when being stored. |
getweight | How much stamina this takes to swing this is not for realism purposes hecc off. |
isEmbedHarmless | Does the current embedding var meet the criteria for being harmless? Namely, does it explicitly define the pain multiplier and jostle pain mult to be 0? If so, return true. |
melee_attack_chain | This is the proc that handles the order of an item_attack. The order of procs called is: tool_act on the target. If it returns TRUE, the chain will be stopped. pre_attack() on src. If this returns TRUE, the chain will be stopped. attackby on the target. If it returns TRUE, the chain will be stopped. and lastly afterattack. The return value does not matter. |
melee_stagger_duration | How long this staggers for. 0 and negatives supported. |
on_active_parry | Called when an attack is parried using this, whether or not the parry was successful. |
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_outfit_equip | Special stuff you want to do when an outfit equips this 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. |
pick_painting_tool_color | Common proc used by painting tools like spraycans and palettes that can access the entire 24 bits color space. |
ranged_attack_chain | Like melee_attack_chain but for ranged. |
register_item_context | Create a "Type-A" contextual screentip interaction, registering to add_item_context() .
This will run add_item_context() when the item hovers over another object for context.
add_item_context() will not be called unless this is run.
This is not necessary for Type-A interactions, as you can just apply the flag and register to the signal yourself. |
run_block | Runs block and returns flag for do_run_block to process. |
set_slowdown | Sets our slowdown and updates equipment slowdown of any mob we're equipped on. |
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. |
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. |
update_action_buttons | Updates all action buttons associated with this item |
Var Details
attack_speed
Amount of time to check for from a mob's last attack, checked before an attack happens. Lower = faster attacks
attack_unwieldlyness
Amount of time to hard-stagger (no clicking at all) the mob when attacking. Lower = better
block_chance
The 0% to 100% chance for the default implementation of random block rolls.
block_priority
Block priority, higher means we check this higher in the "chain".
clickdelay_from_next_action
This item checks clickdelay from a user's delayed next action variable rather than the last time they attacked.
clickdelay_ignores_next_action
This item ignores next action delays.
clickdelay_mod_bypass
This item bypasses any click delay mods
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
equip_sound
Sound used when equipping the item into a valid slot
force_string
string form of an item's force. Edit this var only to set a custom force string
hitsound
Sound played when you hit something with the item
item_flags
Item flags for the item
item_state
icon state name for inhand overlays
lefthand_file
Icon file for left hand inhand overlays
mob_overlay_icon
Icon file for mob worn overlays. no var for state because it should always be the same as icon_state
mob_throw_hit_sound
Used when yate into a mob
pickup_sound
Sound uses when picking the item up (into your hands)
righthand_file
Icon file for right inhand overlays
sharpness
All items with sharpness of SHARP_EDGED or higher will automatically get the butchering component.
stagger_force
How long, in deciseconds, this staggers for, if null it will autocalculate from w_class and force. Unlike total mass this supports 0 and negatives.
stealthy_audio
Whether or not we use stealthy audio levels for this item's attack sounds
throw_verb
Used if we want to have a custom verb text for throwing. "John Spaceman flicks the ciggerate" for example.
thrownby
A weakref to the mob who threw the item
total_mass
The amount of stamina it takes to swing an item in a normal melee attack do not lie to me and say it's for realism because it ain't. If null it will autocalculate from w_class.
undyeable
Whether the item is unaffected by standard dying.
used_skills
Skills vars
usesound
Played when the item is used, for example tools
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.
Proc Details
ApplyAttackCooldown
Called after a successful attack to set a mob's clickdelay.
CheckAttackCooldown
Checks if a user's clickdelay is met for a standard attack, this is called before an attack happens.
GetEstimatedAttackSpeed
Get estimated time that a user has to not attack for to use us
UseStaminaBufferStandard
Uses the amount of stamina required for a standard hit
active_block_calculate_final_damage
Calculates FINAL ATTACK DAMAGE after mitigation
active_block_do_stamina_damage
Apply the stamina damage to our user, notice how damage argument is stamina_amount.
active_block_stamina_cost
Amount of stamina from damage blocked. Note that the damage argument is damage_blocked.
active_parry_reflex_counter
Called when an attack is parried and block_parra_data indicates to use a proc to handle counterattack.
add_item_context
Creates a "Type-A" contextual screentip interaction.
When a user hovers over something with this item in hand, this proc will be called in order
to provide context for contextual screentips.
You must call register_item_context()
in order for this to be registered.
A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm)
that map to the action as text.
If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET.
source
can, in all cases, be replaced with src
, and only exists because this proc directly connects to a signal.
afterattack
Called after attacking something if the melee attack chain isn't interrupted before. Also called when clicking on something with an item without being in melee range
WARNING: This does not automatically check clickdelay if not in a melee attack! Be sure to account for this!
@params
- target - The thing we clicked
- user - mob of person clicking
- proximity_flag - are we in melee range/doing it in a melee attack
- click_parameters - mouse control parameters, check BYOND ref.
attack
Called when someone uses us to attack a mob in melee combat.
This proc respects CheckAttackCooldown() default clickdelay handling.
@params
- mob/living/M - target
- mob/living/user - attacker
- attackchain_Flags - see code/__DEFINES/_flags/return_values.dm
- damage_multiplier - what to multiply the damage by
blockable_directions
Gets the block direction bitflags of what we can block.
can_active_block
Returns if we can actively block.
can_active_parry
Determines if we can actively parry.
can_block_direction
Checks if we can block from a specific direction from our direction.
@params
- our_dir - our direction.
- their_dir - their direction. Must be a single direction, or NONE for an attack from the same tile. This is incoming direction.
can_block_directions_multiple
can_block_direction but for "compound" directions to check all of them and return the number of directions that were blocked.
@params
- our_dir - our direction.
- their_dirs - list of their directions as we cannot use bitfields here.
check_block
Returns block information using list/block_return. Used for check_block() on mobs.
cyborg_unequip
Parent proc - triggers when an item/module is unequipped from a cyborg.
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.
dropped
Called when a mob drops an item.
equipped
Called after an item is placed in an equipment slot.
Note that hands count as slots.
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_block_parry_data
Gets this item's datum/block_parry_data
get_w_volume
Get an item's volume that it uses when being stored.
getweight
How much stamina this takes to swing this is not for realism purposes hecc off.
isEmbedHarmless
Does the current embedding var meet the criteria for being harmless? Namely, does it explicitly define the pain multiplier and jostle pain mult to be 0? If so, return true.
melee_attack_chain
This is the proc that handles the order of an item_attack. The order of procs called is: tool_act on the target. If it returns TRUE, the chain will be stopped. pre_attack() on src. If this returns TRUE, the chain will be stopped. attackby on the target. If it returns TRUE, the chain will be stopped. and lastly afterattack. The return value does not matter.
melee_stagger_duration
How long this staggers for. 0 and negatives supported.
on_active_parry
Called when an attack is parried using this, whether or not the parry was successful.
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_outfit_equip
Special stuff you want to do when an outfit equips this 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.
pick_painting_tool_color
Common proc used by painting tools like spraycans and palettes that can access the entire 24 bits color space.
ranged_attack_chain
Like melee_attack_chain but for ranged.
register_item_context
Create a "Type-A" contextual screentip interaction, registering to add_item_context()
.
This will run add_item_context()
when the item hovers over another object for context.
add_item_context()
will not be called unless this is run.
This is not necessary for Type-A interactions, as you can just apply the flag and register to the signal yourself.
run_block
Runs block and returns flag for do_run_block to process.
set_slowdown
Sets our slowdown and updates equipment slowdown of any mob we're equipped on.
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%?
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.
update_action_buttons
Updates all action buttons associated with this item
Arguments:
- status_only - Update only current availability status of the buttons to show if they are ready or not to use
- force - Force buttons update even if the given button icon state has not changed