Skip to main content

LuaItemPrototype

Struct LuaItemPrototype 

Source
pub struct LuaItemPrototype;
Expand description

Prototype of an item. For example, an item prototype can be obtained from LuaPrototypes::item by its name: prototypes.item["iron-plate"].

Implementations§

Source§

impl LuaItemPrototype

Source

pub fn custom_tooltip_fields(&self) -> Vec<CustomTooltipField>

Extra description items in the tooltip and Factoriopedia.

Source

pub fn factoriopedia_description(&self) -> &str

Provides additional description used in factoriopedia.

Source

pub fn group(&self) -> LuaGroup

Group of this prototype.

Source

pub fn hidden(&self) -> bool

Source

pub fn hidden_in_factoriopedia(&self) -> bool

Source

pub fn localised_description(&self) -> &str

Source

pub fn localised_name(&self) -> &str

Source

pub fn name(&self) -> &str

Name of this prototype.

Source

pub fn order(&self) -> &str

The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.

Source

pub fn parameter(&self) -> bool

Source

pub fn subgroup(&self) -> LuaGroup

Subgroup of this prototype.

Source

pub fn type(&self) -> &str

Type of this prototype.

Source

pub fn always_include_tiles(&self) -> bool

If tiles area always included when doing selection with this selection tool prototype.

Source

pub fn ammo_category(&self) -> LuaAmmoCategoryPrototype

Source

pub fn attack_parameters(&self) -> AttackParameters

The gun attack parameters.

Source

pub fn beacon_tint(&self) -> Vec<Color>

Source

pub fn burnt_result(&self) -> LuaItemPrototype

The result of burning this item as fuel, if any.

Source

pub fn can_be_mod_opened(&self) -> bool

If this item can be mod-opened.

Source

pub fn capsule_action(&self) -> CapsuleAction

The capsule action for this capsule item prototype.

Source

pub fn category(&self) -> &str

The name of a LuaModuleCategoryPrototype. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules of the same category with higher tier modules.

Source

pub fn collision_box(&self) -> BoundingBox

The collision box used by character entities when wearing this armor.

Source

pub fn color_hint(&self) -> ColorHintSpecification

Source

pub fn consumption_quality_multiplier(&self) -> f32

Source

pub fn create_electric_network(&self) -> bool

Source

pub fn cuts(&self) -> bool

Source

pub fn default_import_location(&self) -> LuaSpaceLocationPrototype

Source

pub fn default_label_color(&self) -> Color

The default label color used for this item with label, if any.

Source

pub fn destroyed_by_dropping_trigger(&self) -> Vec<TriggerItem>

Source

pub fn draw_label_for_cursor_render(&self) -> bool

If true, and this item with label has a label it is drawn in place of the normal number when held in the cursor.

Source

pub fn drawing_box(&self) -> BoundingBox

The drawing box used by character entities when wearing this armor.

Source

pub fn durability_description_key(&self) -> &str

The durability message key used when displaying the durability of this tool.

Source

pub fn durability_description_value(&self) -> &str

The durability message value used when displaying the durability of this tool.

Source

pub fn equipment_grid(&self) -> LuaEquipmentGridPrototype

The prototype of this armor’s equipment grid, if any.

Source

pub fn factoriopedia_alternative(&self) -> LuaItemPrototype

An alternative prototype that will be used to display info about this prototype in Factoriopedia.

Source

pub fn factoriopedia_durability_description_key(&self) -> &str

The durability message key used when displaying the durability of this tool in Factoriopedia.

Source

pub fn filter_mode(&self) -> PrototypeFilterMode

The filter mode used by this item with inventory.

Source

pub fn flags(&self) -> LuaAny

The flags for this item prototype.

Source

pub fn fuel_acceleration_multiplier(&self) -> f64

The acceleration multiplier when this item is used as fuel in a vehicle.

Source

pub fn fuel_acceleration_multiplier_quality_bonus(&self) -> f64

Additional fuel acceleration multiplier per quality level.

Source

pub fn fuel_category(&self) -> &str

The fuel category, if any.

Source

pub fn fuel_emissions_multiplier(&self) -> f64

The emissions multiplier if this is used as fuel.

Source

pub fn fuel_glow_color(&self) -> Color

Source

pub fn fuel_top_speed_multiplier(&self) -> f64

The fuel top speed multiplier when this item is used as fuel in a vehicle.

Source

pub fn fuel_top_speed_multiplier_quality_bonus(&self) -> f64

Additional fuel top speed multiplier per quality level.

Source

pub fn fuel_value(&self) -> f32

Fuel value when burned.

Source

pub fn infinite(&self) -> bool

If this tool item has infinite durability.

Source

pub fn ingredient_to_weight_coefficient(&self) -> f64

Source

pub fn initial_items(&self) -> Vec<ItemProduct>

Source

pub fn item_filters(&self) -> Vec<LuaItemPrototype>

Source

pub fn item_group_filters(&self) -> Vec<LuaGroup>

Source

pub fn item_subgroup_filters(&self) -> Vec<LuaGroup>

Source

pub fn lab_ignores_spoil_percent(&self) -> bool

Source

pub fn localised_filter_message(&self) -> &str

The localised string used when the player attempts to put items into this item with inventory that aren’t allowed.

Source

pub fn magazine_size(&self) -> f32

Size of full magazine.

Source

pub fn manual_length_limit(&self) -> f64

Source

pub fn module_effects(&self) -> ModuleEffects

Effects of this module.

Source

pub fn moved_to_hub_when_building(&self) -> bool

Source

pub fn object_name(&self) -> &str

The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.

Source

pub fn place_as_equipment_result(&self) -> LuaEquipmentPrototype

Prototype of the equipment that will be created by placing this item in an equipment grid, if any.

Source

pub fn place_as_tile_result(&self) -> PlaceAsTileResult

The place-as-tile result if one is defined, if any.

Source

pub fn place_result(&self) -> LuaEntityPrototype

Prototype of the entity that will be created by placing this item, if any.

Source

pub fn plant_result(&self) -> LuaEntityPrototype

The result entity when planting this item as a seed.

Source

pub fn pollution_quality_multiplier(&self) -> f32

Source

pub fn productivity_quality_multiplier(&self) -> f32

Source

pub fn provides_flight(&self) -> bool

If this armor provides flight to character entities when worm.

Source

pub fn quality_affects_inventory_size(&self) -> bool

Source

pub fn quality_quality_multiplier(&self) -> f32

Source

pub fn radius_color(&self) -> Color

Source

pub fn rails(&self) -> Vec<LuaEntityPrototype>

Prototypes of all rails possible to be used by this rail planner prototype.

Source

pub fn reload_time(&self) -> f32

Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine.

Source

pub fn requires_beacon_alt_mode(&self) -> bool

Source

pub fn resistances(&self) -> HashMap<String, Resistance>

Resistances of this armor item, if any, indexed by damage type name.

Source

pub fn rocket_launch_products(&self) -> Vec<LuaAny>

The results of launching this item in a rocket.

Source

pub fn send_to_orbit_mode(&self) -> LuaItemPrototypeSendToOrbitMode

How this item interacts when being sent to orbit.

Source

pub fn shoot_protected(&self) -> bool

Source

pub fn skip_fog_of_war(&self) -> bool

If this selection tool skips things covered by fog of war.

Source

pub fn space_platform_request_priority(&self) -> bool

Source

pub fn speed(&self) -> f32

The repairing speed if this is a repairing tool.

Source

pub fn speed_quality_multiplier(&self) -> f32

Source

pub fn spoil_level(&self) -> u8

Source

pub fn spoil_quality_change(&self) -> i8

Source

pub fn spoil_quality_max(&self) -> LuaQualityPrototype

Source

pub fn spoil_quality_min(&self) -> LuaQualityPrototype

Source

pub fn spoil_result(&self) -> LuaItemPrototype

The spoil result of this item, if any

Source

pub fn spoil_to_trigger_result(&self) -> SpoilToTriggerResult

Source

pub fn stack_size(&self) -> u32

Maximum stack size of the item specified by this prototype.

Source

pub fn stackable(&self) -> bool

Is this item allowed to stack at all?

Source

pub fn support(&self) -> LuaEntityPrototype

The rail support used by this rail planner.

Source

pub fn surface(&self) -> LuaSurfacePrototype

Source

pub fn tier(&self) -> u32

Tier of the module inside its category. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules with higher tier modules if they have the same category.

Source

pub fn tiles(&self) -> Vec<SpacePlatformTileDefinition>

Source

pub fn trigger(&self) -> TriggerItem

Source

pub fn used_by_labs(&self) -> bool

Whether this item is referenced by any lab input.

Source

pub fn valid(&self) -> bool

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.

Source

pub fn weight(&self) -> LuaAny

Weight of this item. More information on how item weight is determined can be found on its auxiliary page.

Source

pub fn get_ammo_type( &self, ammo_source_type: Option<LuaItemPrototypeAmmoSourceType>, ) -> Option<AmmoType>

The type of this ammo prototype.

Source

pub fn get_cursor_box_type( &self, selection_mode: &str, ) -> Option<CursorBoxRenderType>

Source

pub fn get_durability(&self, quality: Option<LuaAny>) -> Option<f64>

The durability of this tool item prototype.

Source

pub fn get_entity_filter_mode( &self, selection_mode: &str, ) -> Option<PrototypeFilterMode>

The entity filter mode used by this selection tool.

Source

pub fn get_entity_filters( &self, selection_mode: &str, ) -> Option<Vec<LuaEntityPrototype>>

The entity filters used by this selection tool.

Source

pub fn get_entity_type_filters( &self, selection_mode: &str, ) -> Option<HashMap<String, bool>>

The entity type filters used by this selection tool indexed by entity type.

The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary.

Source

pub fn get_inventory_size(&self, quality: Option<LuaAny>) -> Option<u32>

The main inventory size for item-with-inventory-prototype.

Source

pub fn get_inventory_size_bonus(&self, quality: Option<LuaAny>) -> Option<u32>

The inventory size bonus for this armor prototype.

Source

pub fn get_module_effects( &self, quality: Option<LuaAny>, ) -> Option<ModuleEffects>

Effects of this module at the specified quality.

Source

pub fn get_selection_border_color(&self, selection_mode: &str) -> Option<Color>

The color used when doing normal selection with this selection tool prototype.

Source

pub fn get_selection_mode_flags(&self, selection_mode: &str) -> Option<LuaAny>

Flags that affect which entities will be selected.

Source

pub fn get_spoil_ticks(&self, quality: Option<LuaAny>) -> u32

The number of ticks before this item spoils, or 0 if it does not spoil.

Source

pub fn get_tile_filter_mode( &self, selection_mode: &str, ) -> Option<PrototypeFilterMode>

The tile filter mode used by this selection tool.

Source

pub fn get_tile_filters( &self, selection_mode: &str, ) -> Option<Vec<LuaTilePrototype>>

The tile filters used by this selection tool.

Source

pub fn has_flag(&self, flag: ItemPrototypeFlag) -> bool

Test whether this item prototype has a certain flag set.

Trait Implementations§

Source§

impl Clone for LuaItemPrototype

Source§

fn clone(&self) -> LuaItemPrototype

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LuaItemPrototype

Source§

impl Debug for LuaItemPrototype

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LuaItemPrototype

Source§

fn default() -> LuaItemPrototype

Returns the “default value” for a type. Read more
Source§

impl Eq for LuaItemPrototype

Source§

impl From<LuaItemPrototype> for LuaAny

Source§

fn from(_: LuaItemPrototype) -> Self

Converts to this type from the input type.
Source§

impl LuaObject for LuaItemPrototype

Source§

impl PartialEq for LuaItemPrototype

Source§

fn eq(&self, other: &LuaItemPrototype) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LuaItemPrototype

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.