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
impl LuaItemPrototype
Sourcepub fn custom_tooltip_fields(&self) -> Vec<CustomTooltipField>
pub fn custom_tooltip_fields(&self) -> Vec<CustomTooltipField>
Extra description items in the tooltip and Factoriopedia.
Sourcepub fn factoriopedia_description(&self) -> &str
pub fn factoriopedia_description(&self) -> &str
Provides additional description used in factoriopedia.
pub fn localised_description(&self) -> &str
pub fn localised_name(&self) -> &str
Sourcepub fn order(&self) -> &str
pub fn order(&self) -> &str
The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
pub fn parameter(&self) -> bool
Sourcepub fn always_include_tiles(&self) -> bool
pub fn always_include_tiles(&self) -> bool
If tiles area always included when doing selection with this selection tool prototype.
pub fn ammo_category(&self) -> LuaAmmoCategoryPrototype
Sourcepub fn attack_parameters(&self) -> AttackParameters
pub fn attack_parameters(&self) -> AttackParameters
The gun attack parameters.
pub fn beacon_tint(&self) -> Vec<Color>
Sourcepub fn burnt_result(&self) -> LuaItemPrototype
pub fn burnt_result(&self) -> LuaItemPrototype
The result of burning this item as fuel, if any.
Sourcepub fn can_be_mod_opened(&self) -> bool
pub fn can_be_mod_opened(&self) -> bool
If this item can be mod-opened.
Sourcepub fn capsule_action(&self) -> CapsuleAction
pub fn capsule_action(&self) -> CapsuleAction
The capsule action for this capsule item prototype.
Sourcepub fn category(&self) -> &str
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.
Sourcepub fn collision_box(&self) -> BoundingBox
pub fn collision_box(&self) -> BoundingBox
The collision box used by character entities when wearing this armor.
pub fn color_hint(&self) -> ColorHintSpecification
pub fn consumption_quality_multiplier(&self) -> f32
pub fn create_electric_network(&self) -> bool
pub fn cuts(&self) -> bool
pub fn default_import_location(&self) -> LuaSpaceLocationPrototype
Sourcepub fn default_label_color(&self) -> Color
pub fn default_label_color(&self) -> Color
The default label color used for this item with label, if any.
pub fn destroyed_by_dropping_trigger(&self) -> Vec<TriggerItem>
Sourcepub fn draw_label_for_cursor_render(&self) -> bool
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.
Sourcepub fn drawing_box(&self) -> BoundingBox
pub fn drawing_box(&self) -> BoundingBox
The drawing box used by character entities when wearing this armor.
Sourcepub fn durability_description_key(&self) -> &str
pub fn durability_description_key(&self) -> &str
The durability message key used when displaying the durability of this tool.
Sourcepub fn durability_description_value(&self) -> &str
pub fn durability_description_value(&self) -> &str
The durability message value used when displaying the durability of this tool.
Sourcepub fn equipment_grid(&self) -> LuaEquipmentGridPrototype
pub fn equipment_grid(&self) -> LuaEquipmentGridPrototype
The prototype of this armor’s equipment grid, if any.
Sourcepub fn factoriopedia_alternative(&self) -> LuaItemPrototype
pub fn factoriopedia_alternative(&self) -> LuaItemPrototype
An alternative prototype that will be used to display info about this prototype in Factoriopedia.
Sourcepub fn factoriopedia_durability_description_key(&self) -> &str
pub fn factoriopedia_durability_description_key(&self) -> &str
The durability message key used when displaying the durability of this tool in Factoriopedia.
Sourcepub fn filter_mode(&self) -> PrototypeFilterMode
pub fn filter_mode(&self) -> PrototypeFilterMode
The filter mode used by this item with inventory.
Sourcepub fn fuel_acceleration_multiplier(&self) -> f64
pub fn fuel_acceleration_multiplier(&self) -> f64
The acceleration multiplier when this item is used as fuel in a vehicle.
Sourcepub fn fuel_acceleration_multiplier_quality_bonus(&self) -> f64
pub fn fuel_acceleration_multiplier_quality_bonus(&self) -> f64
Additional fuel acceleration multiplier per quality level.
Sourcepub fn fuel_category(&self) -> &str
pub fn fuel_category(&self) -> &str
The fuel category, if any.
Sourcepub fn fuel_emissions_multiplier(&self) -> f64
pub fn fuel_emissions_multiplier(&self) -> f64
The emissions multiplier if this is used as fuel.
pub fn fuel_glow_color(&self) -> Color
Sourcepub fn fuel_top_speed_multiplier(&self) -> f64
pub fn fuel_top_speed_multiplier(&self) -> f64
The fuel top speed multiplier when this item is used as fuel in a vehicle.
Sourcepub fn fuel_top_speed_multiplier_quality_bonus(&self) -> f64
pub fn fuel_top_speed_multiplier_quality_bonus(&self) -> f64
Additional fuel top speed multiplier per quality level.
Sourcepub fn fuel_value(&self) -> f32
pub fn fuel_value(&self) -> f32
Fuel value when burned.
pub fn ingredient_to_weight_coefficient(&self) -> f64
pub fn initial_items(&self) -> Vec<ItemProduct>
pub fn item_filters(&self) -> Vec<LuaItemPrototype>
pub fn item_group_filters(&self) -> Vec<LuaGroup>
pub fn item_subgroup_filters(&self) -> Vec<LuaGroup>
pub fn lab_ignores_spoil_percent(&self) -> bool
Sourcepub fn localised_filter_message(&self) -> &str
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.
Sourcepub fn magazine_size(&self) -> f32
pub fn magazine_size(&self) -> f32
Size of full magazine.
pub fn manual_length_limit(&self) -> f64
Sourcepub fn module_effects(&self) -> ModuleEffects
pub fn module_effects(&self) -> ModuleEffects
Effects of this module.
pub fn moved_to_hub_when_building(&self) -> bool
Sourcepub fn object_name(&self) -> &str
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.
Sourcepub fn place_as_equipment_result(&self) -> LuaEquipmentPrototype
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.
Sourcepub fn place_as_tile_result(&self) -> PlaceAsTileResult
pub fn place_as_tile_result(&self) -> PlaceAsTileResult
The place-as-tile result if one is defined, if any.
Sourcepub fn place_result(&self) -> LuaEntityPrototype
pub fn place_result(&self) -> LuaEntityPrototype
Prototype of the entity that will be created by placing this item, if any.
Sourcepub fn plant_result(&self) -> LuaEntityPrototype
pub fn plant_result(&self) -> LuaEntityPrototype
The result entity when planting this item as a seed.
pub fn pollution_quality_multiplier(&self) -> f32
pub fn productivity_quality_multiplier(&self) -> f32
Sourcepub fn provides_flight(&self) -> bool
pub fn provides_flight(&self) -> bool
If this armor provides flight to character entities when worm.
pub fn quality_affects_inventory_size(&self) -> bool
pub fn quality_quality_multiplier(&self) -> f32
pub fn radius_color(&self) -> Color
Sourcepub fn rails(&self) -> Vec<LuaEntityPrototype>
pub fn rails(&self) -> Vec<LuaEntityPrototype>
Prototypes of all rails possible to be used by this rail planner prototype.
Sourcepub fn reload_time(&self) -> f32
pub fn reload_time(&self) -> f32
Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine.
pub fn requires_beacon_alt_mode(&self) -> bool
Sourcepub fn resistances(&self) -> HashMap<String, Resistance>
pub fn resistances(&self) -> HashMap<String, Resistance>
Resistances of this armor item, if any, indexed by damage type name.
Sourcepub fn rocket_launch_products(&self) -> Vec<LuaAny>
pub fn rocket_launch_products(&self) -> Vec<LuaAny>
The results of launching this item in a rocket.
Sourcepub fn send_to_orbit_mode(&self) -> LuaItemPrototypeSendToOrbitMode
pub fn send_to_orbit_mode(&self) -> LuaItemPrototypeSendToOrbitMode
How this item interacts when being sent to orbit.
pub fn shoot_protected(&self) -> bool
Sourcepub fn skip_fog_of_war(&self) -> bool
pub fn skip_fog_of_war(&self) -> bool
If this selection tool skips things covered by fog of war.
pub fn space_platform_request_priority(&self) -> bool
pub fn speed_quality_multiplier(&self) -> f32
pub fn spoil_level(&self) -> u8
pub fn spoil_quality_change(&self) -> i8
pub fn spoil_quality_max(&self) -> LuaQualityPrototype
pub fn spoil_quality_min(&self) -> LuaQualityPrototype
Sourcepub fn spoil_result(&self) -> LuaItemPrototype
pub fn spoil_result(&self) -> LuaItemPrototype
The spoil result of this item, if any
pub fn spoil_to_trigger_result(&self) -> SpoilToTriggerResult
Sourcepub fn stack_size(&self) -> u32
pub fn stack_size(&self) -> u32
Maximum stack size of the item specified by this prototype.
Sourcepub fn support(&self) -> LuaEntityPrototype
pub fn support(&self) -> LuaEntityPrototype
The rail support used by this rail planner.
pub fn surface(&self) -> LuaSurfacePrototype
Sourcepub fn tier(&self) -> u32
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.
pub fn tiles(&self) -> Vec<SpacePlatformTileDefinition>
pub fn trigger(&self) -> TriggerItem
Sourcepub fn used_by_labs(&self) -> bool
pub fn used_by_labs(&self) -> bool
Whether this item is referenced by any lab input.
Sourcepub fn valid(&self) -> bool
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.
Sourcepub fn weight(&self) -> LuaAny
pub fn weight(&self) -> LuaAny
Weight of this item. More information on how item weight is determined can be found on its auxiliary page.
Sourcepub fn get_ammo_type(
&self,
ammo_source_type: Option<LuaItemPrototypeAmmoSourceType>,
) -> Option<AmmoType>
pub fn get_ammo_type( &self, ammo_source_type: Option<LuaItemPrototypeAmmoSourceType>, ) -> Option<AmmoType>
The type of this ammo prototype.
pub fn get_cursor_box_type( &self, selection_mode: &str, ) -> Option<CursorBoxRenderType>
Sourcepub fn get_durability(&self, quality: Option<LuaAny>) -> Option<f64>
pub fn get_durability(&self, quality: Option<LuaAny>) -> Option<f64>
The durability of this tool item prototype.
Sourcepub fn get_entity_filter_mode(
&self,
selection_mode: &str,
) -> Option<PrototypeFilterMode>
pub fn get_entity_filter_mode( &self, selection_mode: &str, ) -> Option<PrototypeFilterMode>
The entity filter mode used by this selection tool.
Sourcepub fn get_entity_filters(
&self,
selection_mode: &str,
) -> Option<Vec<LuaEntityPrototype>>
pub fn get_entity_filters( &self, selection_mode: &str, ) -> Option<Vec<LuaEntityPrototype>>
The entity filters used by this selection tool.
Sourcepub fn get_entity_type_filters(
&self,
selection_mode: &str,
) -> Option<HashMap<String, bool>>
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.
Sourcepub fn get_inventory_size(&self, quality: Option<LuaAny>) -> Option<u32>
pub fn get_inventory_size(&self, quality: Option<LuaAny>) -> Option<u32>
The main inventory size for item-with-inventory-prototype.
Sourcepub fn get_inventory_size_bonus(&self, quality: Option<LuaAny>) -> Option<u32>
pub fn get_inventory_size_bonus(&self, quality: Option<LuaAny>) -> Option<u32>
The inventory size bonus for this armor prototype.
Sourcepub fn get_module_effects(
&self,
quality: Option<LuaAny>,
) -> Option<ModuleEffects>
pub fn get_module_effects( &self, quality: Option<LuaAny>, ) -> Option<ModuleEffects>
Effects of this module at the specified quality.
Sourcepub fn get_selection_border_color(&self, selection_mode: &str) -> Option<Color>
pub fn get_selection_border_color(&self, selection_mode: &str) -> Option<Color>
The color used when doing normal selection with this selection tool prototype.
Sourcepub fn get_selection_mode_flags(&self, selection_mode: &str) -> Option<LuaAny>
pub fn get_selection_mode_flags(&self, selection_mode: &str) -> Option<LuaAny>
Flags that affect which entities will be selected.
Sourcepub fn get_spoil_ticks(&self, quality: Option<LuaAny>) -> u32
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.
Sourcepub fn get_tile_filter_mode(
&self,
selection_mode: &str,
) -> Option<PrototypeFilterMode>
pub fn get_tile_filter_mode( &self, selection_mode: &str, ) -> Option<PrototypeFilterMode>
The tile filter mode used by this selection tool.
Sourcepub fn get_tile_filters(
&self,
selection_mode: &str,
) -> Option<Vec<LuaTilePrototype>>
pub fn get_tile_filters( &self, selection_mode: &str, ) -> Option<Vec<LuaTilePrototype>>
The tile filters used by this selection tool.
Sourcepub fn has_flag(&self, flag: ItemPrototypeFlag) -> bool
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
impl Clone for LuaItemPrototype
Source§fn clone(&self) -> LuaItemPrototype
fn clone(&self) -> LuaItemPrototype
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more