|is_blueprint_setup() → boolean||Is this blueprint item setup?|
|get_blueprint_entities() → array of blueprint entity||Entities in this blueprint.|
|set_blueprint_entities(entities)||Set new entities to be a part of this blueprint.|
|add_ammo(amount)||Add ammo to this ammo item.|
|drain_ammo(amount)||Remove ammo from this ammo item.|
|can_set_stack(stack) → boolean||Would a call to LuaItemStack::set_stack succeed?|
|set_stack(stack) → boolean||Set this item stack to another item stack.|
|clear()||Clear this item stack.|
|get_blueprint_tiles() → array of blueprint tile||Tiles in this blueprint|
|set_blueprint_tiles(tiles)||Set tiles in this blueprint|
|valid :: boolean [R]||Is this object valid?|
|valid_for_read :: boolean [R]||Is this valid for reading?|
|prototype :: LuaItemPrototype [R]||Prototype of the item held in this stack.|
|name :: string [R]||Prototype name of the item held in this stack.|
|type :: string [R]||Type of the item prototype.|
|count :: uint [RW]||Number of items in this stack.|
|has_grid :: boolean [R]|| |
|grid :: LuaEquipmentGrid [R]||The equipment grid of this item.|
|health :: float [RW]||How much health the item has, as a number in range [0, 1].|
|durability :: uint [RW]||Durability of the contained item.|
|ammo :: uint [RW]||Number of bullets left in the magazine.|
|blueprint_icons :: array of Icon [RW]||Icons of a blueprint item.|
|cost_to_build :: dictionary string → uint [R]||Raw materials required to build this blueprint.|
An item and a count.
Is this blueprint item setup? I.e. is it a non-empty blueprint?
Entities in this blueprint.
Set new entities to be a part of this blueprint.
Add ammo to this ammo item.
Remove ammo from this ammo item.
Clear this item stack.
Set tiles in this blueprint
Is this object valid? This Lua object holds a reference to an object within
the game engine. It is possible that the game-engine object is removed whilst
a mod still holds the corresponding Lua object. If that happens, the object
becomes invalid, i.e. this attribute will be
false. Mods are advised to
check for object validity if any change to the game state might have occurred
between the creation of the Lua object and its access.
Is this valid for reading? Differs from the usual
valid in that
valid will be
true even if
the item stack is blank but the entity that holds it is still valid.
Prototype of the item held in this stack.
Prototype name of the item held in this stack.
Type of the item prototype.
Number of items in this stack.
true if this item has an equipment grid.
The equipment grid of this item.
How much health the item has, as a number in range [0, 1].
Durability of the contained item. Automatically capped at the item's maximum durability.
Number of bullets left in the magazine.