item ![code/obj/item.dm 3](git.png)
Base vars & procs
Vars | |
amount | This is for things which are stackable! It means that there are [amount] things here, which could be discretely split or stacked! if you use this to represent something other than a literal stack of items I will break your kneecaps |
---|---|
attack_verbs | Verb used when you attack someone with this, as in [attacker] [attack_verbs] [victim]. Can be a list or single entry |
brew_result | What reagent will it make if it's brewable? |
equip_sfx | Sound for when you equip this from an inventory (ie not a turf) |
hat_offset_x | Used for the hattable component |
hat_offset_y | Used for the hattable component |
health | How long an item takes to burn (or be consumed by other means), based on the weight class if no value is set |
inhand_color | set to a colour to make the inhand image be that colour. if the item is coloured though that takes priority over this variable |
item_state | The in-hand icon state |
leaves_slash_wound | when attacking, this item can leave a slash wound |
master | This var fucking sucks. It's used for prox sensors and other stuff that when triggered trigger an item they're attached to. Why is this on /item i am so sad |
mimic_chance | Chance for this item to be replaced by a mimic disguised as it - note, setting this high here is a really bad idea |
pickup_sfx | Sound for when you pick this up from anywhere. If null, we auto-pick from a list based on w_class |
stored | storage datum holding it |
wear_state | icon state used for worn sprites, icon_state used otherwise |
Procs | |
AfterAttack | Call this proc inplace of afterattack(...) |
AttackSelf | Call this proc inplace of attack_self(...) |
UpdateStackAppearance | Don't override this, override _update_stack_appearance() instead. |
_update_stack_appearance | Call UpdateStackAppearance() instead. |
afterattack | DO NOT CALL THIS PROC - Call AfterAttack(...) Instead! |
attack_self | DO NOT CALL THIS PROC - Call AttackSelf(...) Instead! |
enchant | Enchants an item (minor armor boost for clothing, otherwise increases melee damage) |
force_drop | Force the item to drop from the mob's hands.
If sever is TRUE, items will be severed from item arms |
get_hero | Pick one human trying to cover the object |
material_on_drop | Called when an item is dropped for mat effects |
material_on_pickup | Called when an item is picked up for mat effects |
place_to_turf_by_grid | Move item to turf, and snap its pixel offsets to a grid of the input size. |
setTwoHanded | This is the safe way of changing 2-handed-ness at runtime. Use this please. |
try_specific_equip | attempt unique functionality when item is held in hand and and using the equip hotkey |
Var Details
amount ![code/obj/item.dm 86](git.png)
This is for things which are stackable! It means that there are [amount] things here, which could be discretely split or stacked! if you use this to represent something other than a literal stack of items I will break your kneecaps
attack_verbs ![code/obj/item.dm 65](git.png)
Verb used when you attack someone with this, as in [attacker] [attack_verbs] [victim]. Can be a list or single entry
brew_result ![code/obj/item.dm 147](git.png)
What reagent will it make if it's brewable?
equip_sfx ![code/obj/item.dm 76](git.png)
Sound for when you equip this from an inventory (ie not a turf)
hat_offset_x ![code/obj/item.dm 28](git.png)
Used for the hattable component
hat_offset_y ![code/obj/item.dm 26](git.png)
Used for the hattable component
health ![code/obj/item.dm 36](git.png)
How long an item takes to burn (or be consumed by other means), based on the weight class if no value is set
inhand_color ![code/obj/item.dm 22](git.png)
set to a colour to make the inhand image be that colour. if the item is coloured though that takes priority over this variable
item_state ![code/obj/item.dm 13](git.png)
The in-hand icon state
leaves_slash_wound ![code/obj/item.dm 68](git.png)
when attacking, this item can leave a slash wound
master ![code/obj/item.dm 141](git.png)
This var fucking sucks. It's used for prox sensors and other stuff that when triggered trigger an item they're attached to. Why is this on /item i am so sad
mimic_chance ![code/obj/item.dm 135](git.png)
Chance for this item to be replaced by a mimic disguised as it - note, setting this high here is a really bad idea
pickup_sfx ![code/obj/item.dm 74](git.png)
Sound for when you pick this up from anywhere. If null, we auto-pick from a list based on w_class
stored ![code/obj/item.dm 24](git.png)
storage datum holding it
wear_state ![code/obj/item.dm 15](git.png)
icon state used for worn sprites, icon_state used otherwise
Proc Details
AfterAttack
Call this proc inplace of afterattack(...)
AttackSelf
Call this proc inplace of attack_self(...)
UpdateStackAppearance
Don't override this, override _update_stack_appearance() instead.
_update_stack_appearance
Call UpdateStackAppearance() instead.
afterattack
DO NOT CALL THIS PROC - Call AfterAttack(...) Instead!
Only override this proc!
attack_self
DO NOT CALL THIS PROC - Call AttackSelf(...) Instead!
Only override this proc!
enchant
Enchants an item (minor armor boost for clothing, otherwise increases melee damage)
incr - value to enchant by setTo - when true, sets enchantment to incr, otherwise will add incr to existing enchantment (positive or negative)
force_drop
Force the item to drop from the mob's hands.
If sever
is TRUE, items will be severed from item arms
get_hero
Pick one human trying to cover the object
material_on_drop
Called when an item is dropped for mat effects
material_on_pickup
Called when an item is picked up for mat effects
place_to_turf_by_grid
Move item to turf, and snap its pixel offsets to a grid of the input size.
setTwoHanded
This is the safe way of changing 2-handed-ness at runtime. Use this please.
try_specific_equip
attempt unique functionality when item is held in hand and and using the equip hotkey