typed-factorio
Version:
Featureful typescript definitions for the Factorio modding api.
1,116 lines (1,113 loc) • 622 kB
TypeScript
// This is an auto-generated file. Do not edit directly!
/** @noSelfInFile */
import type { CustomInputName } from "factorio:common"
/**
* @noResolution
*/
declare module "factorio:prototype" {
/**
* Entity with energy source with specialised animation for charging/discharging. Used for the {@linkplain https://wiki.factorio.com/Accumulator accumulator} entity.
* @example
* {
* type = "accumulator",
* name = "accumulator",
* icon = "__base__/graphics/icons/accumulator.png",
* icon_size = 32,
* flags = {"placeable-neutral", "player-creation"},
* minable = {mining_time = 0.1, result = "accumulator"},
* max_health = 150,
* corpse = "accumulator-remnants",
* collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
* selection_box = {{-1, -1}, {1, 1}},
* drawing_box = {{-1, -1.5}, {1, 1}},
* energy_source =
* {
* type = "electric",
* buffer_capacity = "5MJ",
* usage_priority = "tertiary",
* input_flow_limit = "300kW",
* output_flow_limit = "300kW"
* },
* picture = accumulator_picture(),
* charge_animation = accumulator_charge(),
*
* charge_cooldown = 30,
* charge_light = {intensity = 0.3, size = 7, color = {r = 1.0, g = 1.0, b = 1.0}},
* discharge_animation = accumulator_discharge(),
* discharge_cooldown = 60,
* discharge_light = {intensity = 0.7, size = 7, color = {r = 1.0, g = 1.0, b = 1.0}},
* vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
* working_sound =
* {
* sound =
* {
* filename = "__base__/sound/accumulator-working.ogg",
* volume = 1
* },
* idle_sound =
* {
* filename = "__base__/sound/accumulator-idle.ogg",
* volume = 0.4
* },
* max_sounds_per_type = 5
* },
*
* circuit_wire_connection_point = circuit_connector_definitions["accumulator"].points,
* circuit_connector_sprites = circuit_connector_definitions["accumulator"].sprites,
* circuit_wire_max_distance = default_circuit_wire_max_distance,
*
* default_output_signal = {type = "virtual", name = "signal-A"}
* }
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html Online documentation}
*/
export interface AccumulatorPrototype extends EntityWithOwnerPrototype {
type: "accumulator"
/**
* The capacity of the energy source buffer specifies the capacity of the accumulator.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#energy_source Online documentation}
*/
energy_source: ElectricEnergySource
picture?: Sprite
/**
* Count of ticks to preserve the animation even when the charging ends. Used to prevent rapid blinking of the accumulator with unstable need to use it.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#charge_cooldown Online documentation}
*/
charge_cooldown: uint16
/**
* How long (in ticks) the animation will last after discharge has been initialized.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#discharge_cooldown Online documentation}
*/
discharge_cooldown: uint16
charge_animation?: Animation
/**
* Only loaded if `charge_animation` is defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#charge_light Online documentation}
*/
charge_light?: LightDefinition
discharge_animation?: Animation
/**
* Only loaded if `discharge_animation` is defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#discharge_light Online documentation}
*/
discharge_light?: LightDefinition
/**
* Defines how wires visually connect to this accumulator.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#circuit_wire_connection_point Online documentation}
*/
circuit_wire_connection_point?: WireConnectionPoint
/**
* **Default:** `0`
*
* The maximum circuit wire distance for this entity.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#circuit_wire_max_distance Online documentation}
*/
circuit_wire_max_distance?: double
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#draw_copper_wires Online documentation}
*/
draw_copper_wires?: bool
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#draw_circuit_wires Online documentation}
*/
draw_circuit_wires?: bool
/**
* The pictures displayed for circuit connections to this accumulator.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#circuit_connector_sprites Online documentation}
*/
circuit_connector_sprites?: CircuitConnectorSprites
/**
* The name of the signal that is the default for when an accumulator is connected to the circuit network.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AccumulatorPrototype.html#default_output_signal Online documentation}
*/
default_output_signal?: SignalIDConnector
}
/**
* This prototype definition is used for the in-game achievements.
* @example
* {
* type = "achievement",
* name = "so-long-and-thanks-for-all-the-fish",
* order = "g[secret]-a[so-long-and-thanks-for-all-the-fish]",
* icon = "__base__/graphics/achievement/so-long-and-thanks-for-all-the-fish.png",
* icon_size = 128
* }
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html Online documentation}
*/
export interface AchievementPrototype extends PrototypeBase {
type:
| "achievement"
| "build-entity-achievement"
| "combat-robot-count"
| "construct-with-robots-achievement"
| "deconstruct-with-robots-achievement"
| "deliver-by-robots-achievement"
| "dont-build-entity-achievement"
| "dont-craft-manually-achievement"
| "dont-use-entity-in-energy-production-achievement"
| "finish-the-game-achievement"
| "group-attack-achievement"
| "kill-achievement"
| "player-damaged-achievement"
| "produce-achievement"
| "produce-per-hour-achievement"
| "research-achievement"
| "train-path-achievement"
/**
* Can't be an empty array.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#icons Online documentation}
*/
icons?: readonly IconData[]
/**
* Path to the icon file.
*
* Mandatory if `icons` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#icon Online documentation}
*/
icon?: FileName
/**
* The size of the square icon, in pixels. E.g. `32` for a 32px by 32px icon.
*
* Mandatory if `icons` is not defined, or if `icon_size` is not specified for all instances of `icons`.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#icon_size Online documentation}
*/
icon_size?: SpriteSizeType
/**
* **Default:** `0`
*
* Icons of reduced size will be used at decreased scale.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#icon_mipmaps Online documentation}
*/
icon_mipmaps?: IconMipMapType
/**
* **Default:** `""`
*
* Unusable by mods, as this refers to unlocking the achievement through Steam.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#steam_stats_name Online documentation}
*/
steam_stats_name?: string
/**
* **Default:** `true`
*
* If this is set to `false`, it is not possible to complete the achievement on the peaceful difficulty setting or when the enemy base generation settings have been changed.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#allowed_without_fight Online documentation}
*/
allowed_without_fight?: bool
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AchievementPrototype.html#hidden Online documentation}
*/
hidden?: bool
}
/**
* Used by {@linkplain https://wiki.factorio.com/Discharge_defense discharge defense} and {@linkplain https://wiki.factorio.com/Personal_laser_defense personal laser defense}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ActiveDefenseEquipmentPrototype.html Online documentation}
*/
export interface ActiveDefenseEquipmentPrototype extends EquipmentPrototype {
type: "active-defense-equipment"
automatic: bool
attack_parameters: AttackParameters
}
/**
* This prototype is used to make sound while playing the game. This includes the game's {@linkplain https://store.steampowered.com/app/436090/Factorio__Soundtrack/ music}, composed by Daniel James Taylor.
* @example
* {
* type = "ambient-sound",
* name = "world-ambience-4",
* track_type = "interlude",
* sound =
* {
* filename = "__base__/sound/ambient/world-ambience-4.ogg",
* volume = 1.2
* }
* }
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmbientSound.html Online documentation}
*/
export interface AmbientSound {
/**
* Specification of the type of the prototype.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmbientSound.html#type Online documentation}
*/
readonly type: "ambient-sound"
/**
* Unique textual identification of the prototype.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmbientSound.html#name Online documentation}
*/
name: string
/**
* The sound file and volume.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmbientSound.html#sound Online documentation}
*/
sound: Sound
/**
* Lets the game know in what instances the audio file is played.
*
* ## Union members
* - `"menu-track"`: This track is only played in the main menu.
* - `"main-track"`: This track is played interleaved (alternating) with `"interlude"` tracks.
* - `"early-game"`: This track is considered a main track, with no functional difference to `"main-track"`.
* - `"late-game"`: This track is considered a main track, with no functional difference to `"main-track"`.
* - `"interlude"`: This track is played in between the main tracks.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmbientSound.html#track_type Online documentation}
*/
track_type: "menu-track" | "main-track" | "early-game" | "late-game" | "interlude"
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmbientSound.html#weight Online documentation}
*/
weight?: double
}
/**
* An ammo category. Each weapon has an ammo category, and can use any ammo with the same ammo category. Ammo categories can also be upgraded by technologies.
*
* _Prototype limited to **255** total instances_
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoCategory.html Online documentation}
*/
export interface AmmoCategory extends PrototypeBase {
type: "ammo-category"
/**
* **Default:** `""`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoCategory.html#bonus_gui_order Online documentation}
*/
bonus_gui_order?: Order
}
/**
* Ammo used for a gun.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoItemPrototype.html Online documentation}
*/
export interface AmmoItemPrototype extends ItemPrototype {
type: "ammo"
/**
* When using a plain {@link AmmoType} (no array), the ammo type applies to everything (`"default"`).
*
* When using an array of AmmoTypes, they have the additional {@link AmmoType#source_type AmmoType::source_type} property.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoItemPrototype.html#ammo_type Online documentation}
*/
ammo_type: AmmoType | readonly AmmoType[]
/**
* **Default:** `1`
*
* Number of shots before ammo item is consumed. Must be >= `1`.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoItemPrototype.html#magazine_size Online documentation}
*/
magazine_size?: float
/**
* **Default:** `0`
*
* Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine. Must be >= `0`.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoItemPrototype.html#reload_time Online documentation}
*/
reload_time?: float
}
/**
* A turret that consumes {@link AmmoItemPrototype ammo items}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoTurretPrototype.html Online documentation}
*/
export interface AmmoTurretPrototype extends TurretPrototype {
type: "ammo-turret"
inventory_size: ItemStackIndex
automated_ammo_count: ItemCountType
/**
* Shift of the "alt-mode icon" relative to the turret's position.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AmmoTurretPrototype.html#entity_info_icon_shift Online documentation}
*/
entity_info_icon_shift?: Vector
}
/**
* Specifies an animation that can be used with {@link import("factorio:runtime").LuaRendering#draw_animation LuaRendering::draw_animation} at runtime.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html Online documentation}
*/
export interface AnimationPrototype {
readonly type: "animation"
/**
* Name of the animation. Can be used with {@link import("factorio:runtime").LuaRendering#draw_animation LuaRendering::draw_animation} at runtime.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#name Online documentation}
*/
name: string
/**
* If this property is present, all Animation definitions have to be placed as entries in the array, and they will all be loaded from there. `layers` may not be an empty table. Each definition in the array may also have the `layers` property.
*
* `animation_speed` and `max_advance` of the first layer are used for all layers. All layers will run at the same speed.
*
* If this property is present, all other properties besides `name` and `type` are ignored.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#layers Online documentation}
*/
layers?: readonly Animation[]
/**
* Only loaded if `layers` is not defined. Mandatory if `stripes` is not defined.
*
* The path to the sprite file to use.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#filename Online documentation}
*/
filename?: FileName
/**
* Only loaded if `layers` is not defined.
*
* If this property exists and high resolution sprites are turned on, this is used to load the Animation.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#hr_version Online documentation}
*/
hr_version?: Animation
/**
* **Default:** `"medium"`
*
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#priority Online documentation}
*/
priority?: SpritePriority
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#flags Online documentation}
*/
flags?: SpriteFlags
/**
* Only loaded if `layers` is not defined.
*
* The width and height of one frame. If this is a tuple, the first member of the tuple is the width and the second is the height. Otherwise the size is both width and height. Width and height may only be in the range of 0-8192.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#size Online documentation}
*/
size?: SpriteSizeType | readonly [SpriteSizeType, SpriteSizeType]
/**
* Only loaded if `layers` is not defined. Mandatory if `size` is not defined.
*
* Width of one frame in pixels, from 0-8192.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#width Online documentation}
*/
width?: SpriteSizeType
/**
* Only loaded if `layers` is not defined. Mandatory if `size` is not defined.
*
* Height of one frame in pixels, from 0-8192.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#height Online documentation}
*/
height?: SpriteSizeType
/**
* **Default:** `0`
*
* Only loaded if `layers` is not defined.
*
* Horizontal position of the animation in the source file in pixels.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#x Online documentation}
*/
x?: SpriteSizeType
/**
* **Default:** `0`
*
* Only loaded if `layers` is not defined.
*
* Vertical position of the animation in the source file in pixels.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#y Online documentation}
*/
y?: SpriteSizeType
/**
* Only loaded if `layers` is not defined.
*
* Loaded only when `x` and `y` are both `0`. The first member of the tuple is `x` and the second is `y`.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#position Online documentation}
*/
position?: readonly [SpriteSizeType, SpriteSizeType]
/**
* **Default:** ``{0, 0}``
*
* Only loaded if `layers` is not defined.
*
* The shift in tiles. `util.by_pixel()` can be used to divide the shift by 32 which is the usual pixel height/width of 1 tile in normal resolution. Note that 32 pixel tile height/width is not enforced anywhere - any other tile height or width is also possible.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#shift Online documentation}
*/
shift?: Vector
/**
* **Default:** `1`
*
* Only loaded if `layers` is not defined.
*
* Values other than `1` specify the scale of the sprite on default zoom. A scale of `2` means that the picture will be two times bigger on screen (and thus more pixelated).
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#scale Online documentation}
*/
scale?: double
/**
* **Default:** `false`
*
* Only loaded if `layers` is not defined.
*
* Only one of `draw_as_shadow`, `draw_as_glow` and `draw_as_light` can be true. This takes precedence over `draw_as_glow` and `draw_as_light`.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#draw_as_shadow Online documentation}
*/
draw_as_shadow?: bool
/**
* **Default:** `false`
*
* Only loaded if `layers` is not defined.
*
* Only one of `draw_as_shadow`, `draw_as_glow` and `draw_as_light` can be true. This takes precedence over `draw_as_light`.
*
* Draws first as a normal sprite, then again as a light layer. See {@linkplain https://forums.factorio.com/91682}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#draw_as_glow Online documentation}
*/
draw_as_glow?: bool
/**
* **Default:** `false`
*
* Only loaded if `layers` is not defined.
*
* Only one of `draw_as_shadow`, `draw_as_glow` and `draw_as_light` can be true.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#draw_as_light Online documentation}
*/
draw_as_light?: bool
/**
* **Default:** `0`
*
* Only loaded if `layers` is not defined.
*
* Only loaded if this is an icon, that is it has the flag `"group=icon"` or `"group=gui"`.
*
* Note that `mipmap_count` doesn't make sense in an animation, as it is not possible to layout mipmaps in a way that would load both the animation and the mipmaps correctly (besides animations with just one frame). See {@linkplain https://forums.factorio.com/viewtopic.php?p=549058#p549058 here}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#mipmap_count Online documentation}
*/
mipmap_count?: uint8
/**
* **Default:** `false`
*
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#apply_runtime_tint Online documentation}
*/
apply_runtime_tint?: bool
/**
* **Default:** ``{r=1, g=1, b=1, a=1}``
*
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#tint Online documentation}
*/
tint?: Color
/**
* **Default:** `"normal"`
*
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#blend_mode Online documentation}
*/
blend_mode?: BlendMode
/**
* **Default:** `false`
*
* Only loaded if `layers` is not defined.
*
* Minimal mode is entered when mod loading fails. You are in it when you see the gray box after (part of) the loading screen that tells you a mod error ({@linkplain https://cdn.discordapp.com/attachments/340530709712076801/532315796626472972/unknown.png Example}). Modders can ignore this property.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#load_in_minimal_mode Online documentation}
*/
load_in_minimal_mode?: bool
/**
* **Default:** `true`
*
* Only loaded if `layers` is not defined.
*
* Whether alpha should be pre-multiplied.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#premul_alpha Online documentation}
*/
premul_alpha?: bool
/**
* **Default:** `false`
*
* Only loaded if `layers` is not defined.
*
* Unused.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#generate_sdf Online documentation}
*/
generate_sdf?: bool
/**
* **Default:** `"forward"`
*
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#run_mode Online documentation}
*/
run_mode?: "forward" | "backward" | "forward-then-backward"
/**
* **Default:** `1`
*
* Only loaded if `layers` is not defined.
*
* Can't be `0`.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#frame_count Online documentation}
*/
frame_count?: uint32
/**
* **Default:** `0`
*
* Only loaded if `layers` is not defined.
*
* Once the specified number of pictures is loaded, other pictures are loaded on other line. This is to allow having longer animations in matrix, to input files with too high width. The game engine limits the width of any input files to 8192px, so it is compatible with most graphics cards. `0` means that all the pictures are in one horizontal line.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#line_length Online documentation}
*/
line_length?: uint32
/**
* **Default:** `1`
*
* Only loaded if `layers` is not defined.
*
* Modifier of the animation playing speed, the default of `1` means one animation frame per tick (60 fps). The speed of playing can often vary depending on the usage (output of steam engine for example). Has to be greater than `0`.
*
* If `layers` are used, the `animation_speed` only has to be defined in one layer. All layers will run at the same speed.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#animation_speed Online documentation}
*/
animation_speed?: float
/**
* **Default:** `MAX_FLOAT`
*
* Only loaded if `layers` is not defined.
*
* If `layers` are used, `max_advance` of the first layer is used for all layers.
*
* Maximum amount of frames the animation can move forward in one update.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#max_advance Online documentation}
*/
max_advance?: float
/**
* **Default:** `1`
*
* Only loaded if `layers` is not defined.
*
* How many times to repeat the animation to complete an animation cycle. E.g. if one layer is 10 frames, a second layer of 1 frame would need `repeat_count = 10` to match the complete cycle.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#repeat_count Online documentation}
*/
repeat_count?: uint8
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#dice Online documentation}
*/
dice?: uint8
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#dice_x Online documentation}
*/
dice_x?: uint8
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#dice_y Online documentation}
*/
dice_y?: uint8
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#frame_sequence Online documentation}
*/
frame_sequence?: AnimationFrameSequence
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AnimationPrototype.html#stripes Online documentation}
*/
stripes?: readonly Stripe[]
}
/**
* An {@linkplain https://wiki.factorio.com/Arithmetic_combinator arithmetic combinator}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArithmeticCombinatorPrototype.html Online documentation}
*/
export interface ArithmeticCombinatorPrototype extends CombinatorPrototype {
type: "arithmetic-combinator"
plus_symbol_sprites?: Sprite4Way
minus_symbol_sprites?: Sprite4Way
multiply_symbol_sprites?: Sprite4Way
divide_symbol_sprites?: Sprite4Way
modulo_symbol_sprites?: Sprite4Way
power_symbol_sprites?: Sprite4Way
left_shift_symbol_sprites?: Sprite4Way
right_shift_symbol_sprites?: Sprite4Way
and_symbol_sprites?: Sprite4Way
or_symbol_sprites?: Sprite4Way
xor_symbol_sprites?: Sprite4Way
}
/**
* Armor to wear on your in-game {@link CharacterPrototype character} for defense and buffs.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArmorPrototype.html Online documentation}
*/
export interface ArmorPrototype extends ToolPrototype {
type: "armor"
/**
* Name of the {@link EquipmentGridPrototype} that this armor has.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArmorPrototype.html#equipment_grid Online documentation}
*/
equipment_grid?: EquipmentGridID
/**
* What amount of damage the armor takes on what type of damage is incoming.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArmorPrototype.html#resistances Online documentation}
*/
resistances?: readonly Resistance[]
/**
* By how many slots the inventory of the player is expanded when the armor is worn.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArmorPrototype.html#inventory_size_bonus Online documentation}
*/
inventory_size_bonus?: ItemStackIndex
}
/**
* The arrows used for example in the campaign, they are literally just arrows.
* @example
* {
* type = "arrow",
* name = "orange-arrow-with-circle",
* flags = { "placeable-off-grid", "not-on-map" },
* blinking = true,
* arrow_picture =
* {
* filename = "__core__/graphics/arrows/gui-arrow-medium.png",
* priority = "low",
* width = 58,
* height = 62
* },
* circle_picture =
* {
* filename = "__core__/graphics/arrows/gui-arrow-circle.png",
* priority = "low",
* width = 50,
* height = 50
* }
* }
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArrowPrototype.html Online documentation}
*/
export interface ArrowPrototype extends EntityPrototype {
type: "arrow"
arrow_picture: Sprite
circle_picture?: Sprite
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArrowPrototype.html#blinking Online documentation}
*/
blinking?: bool
/**
* **Default:** `no masks`
*
* Two entities can collide only if they share a layer from the collision mask.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArrowPrototype.html#collision_mask Online documentation}
*/
collision_mask?: CollisionMask
}
/**
* The entity spawned by the {@linkplain https://wiki.factorio.com/Artillery_targeting_remote artillery targeting remote}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html Online documentation}
*/
export interface ArtilleryFlarePrototype extends EntityPrototype {
type: "artillery-flare"
/**
* Picture variation count and individual frame count must be equal to shadow variation count.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#pictures Online documentation}
*/
pictures: AnimationVariations
life_time: uint16
/**
* Shadow variation variation count and individual frame count must be equal to picture variation count.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#shadows Online documentation}
*/
shadows?: AnimationVariations
/**
* **Default:** `"object"`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#render_layer Online documentation}
*/
render_layer?: RenderLayer
/**
* **Default:** `"lower-object"`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#render_layer_when_on_ground Online documentation}
*/
render_layer_when_on_ground?: RenderLayer
regular_trigger_effect?: TriggerEffect
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#regular_trigger_effect_frequency Online documentation}
*/
regular_trigger_effect_frequency?: uint32
ended_in_water_trigger_effect?: TriggerEffect
/**
* **Default:** `0.8`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#movement_modifier_when_on_ground Online documentation}
*/
movement_modifier_when_on_ground?: double
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#movement_modifier Online documentation}
*/
movement_modifier?: double
creation_shift?: Vector
initial_speed?: Vector
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#initial_height Online documentation}
*/
initial_height?: float
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#initial_vertical_speed Online documentation}
*/
initial_vertical_speed?: float
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#initial_frame_speed Online documentation}
*/
initial_frame_speed?: float
/**
* **Default:** `1`
*
* How many artillery shots should be fired at the position of this flare.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#shots_per_flare Online documentation}
*/
shots_per_flare?: uint32
/**
* **Default:** `180`
*
* How long this flare stays alive after `shots_per_flare` amount of shots have been shot at it.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#early_death_ticks Online documentation}
*/
early_death_ticks?: uint32
shot_category?: AmmoCategoryID
map_color: Color
/**
* **Default:** `48`
*
* The entity with the higher number is selectable before the entity with the lower number. When two entities have the same selection priority, the one with the highest {@link CollisionMask} (as determined by the order on that page) is selected.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#selection_priority Online documentation}
*/
selection_priority?: uint8
/**
* **Default:** `no masks`
*
* Two entities can collide only if they share a layer from the collision mask.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryFlarePrototype.html#collision_mask Online documentation}
*/
collision_mask?: CollisionMask
}
/**
* The projectile shot by {@linkplain https://wiki.factorio.com/Artillery artillery}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryProjectilePrototype.html Online documentation}
*/
export interface ArtilleryProjectilePrototype extends EntityPrototype {
type: "artillery-projectile"
reveal_map: bool
picture?: Sprite
shadow?: Sprite
chart_picture?: Sprite
action?: Trigger
final_action?: Trigger
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryProjectilePrototype.html#height_from_ground Online documentation}
*/
height_from_ground?: float
/**
* **Default:** `true`
*
* Whether the picture of the projectile is rotated to match the direction of travel.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryProjectilePrototype.html#rotatable Online documentation}
*/
rotatable?: bool
map_color: Color
/**
* **Default:** `no masks`
*
* Two entities can collide only if they share a layer from the collision mask.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryProjectilePrototype.html#collision_mask Online documentation}
*/
collision_mask?: CollisionMask
/**
* **Default:** `Empty = `{{0, 0}, {0, 0}}``
*
* Must have a collision box size of zero.
* @example
* collision_box = {{0, 0}, {0, 0}}
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryProjectilePrototype.html#collision_box Online documentation}
*/
collision_box?: BoundingBox
}
/**
* An {@linkplain https://wiki.factorio.com/Artillery_turret artillery turret}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html Online documentation}
*/
export interface ArtilleryTurretPrototype extends EntityWithOwnerPrototype {
type: "artillery-turret"
/**
* Name of a {@link GunPrototype}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#gun Online documentation}
*/
gun: ItemID
/**
* Must be > 0.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#inventory_size Online documentation}
*/
inventory_size: ItemStackIndex
/**
* Must be > 0.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#ammo_stack_limit Online documentation}
*/
ammo_stack_limit: ItemCountType
automated_ammo_count: ItemCountType
turret_rotation_speed: double
/**
* Must be positive.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#manual_range_modifier Online documentation}
*/
manual_range_modifier: double
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#alert_when_attacking Online documentation}
*/
alert_when_attacking?: bool
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#disable_automatic_firing Online documentation}
*/
disable_automatic_firing?: bool
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#base_picture_secondary_draw_order Online documentation}
*/
base_picture_secondary_draw_order?: uint8
/**
* **Default:** `"lower-object"`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#base_picture_render_layer Online documentation}
*/
base_picture_render_layer?: RenderLayer
base_shift?: Vector
base_picture?: Animation4Way
cannon_base_pictures?: RotatedSprite
cannon_barrel_pictures?: RotatedSprite
rotating_sound?: InterruptibleSound
rotating_stopped_sound?: Sound
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#turn_after_shooting_cooldown Online documentation}
*/
turn_after_shooting_cooldown?: uint16
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#cannon_parking_frame_count Online documentation}
*/
cannon_parking_frame_count?: uint16
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#cannon_parking_speed Online documentation}
*/
cannon_parking_speed?: float
cannon_barrel_recoil_shiftings?: readonly Vector3D[]
/**
* Only loaded if `cannon_barrel_recoil_shiftings` is loaded.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#cannon_barrel_recoil_shiftings_load_correction_matrix Online documentation}
*/
cannon_barrel_recoil_shiftings_load_correction_matrix?: readonly Vector3D[]
/**
* Only loaded if `cannon_barrel_recoil_shiftings` is loaded.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#cannon_barrel_light_direction Online documentation}
*/
cannon_barrel_light_direction?: Vector3D
/**
* **Default:** `true`
*
* Whether this prototype should be a high priority target for enemy forces. See {@linkplain https://wiki.factorio.com/Military_units_and_structures Military units and structures}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryTurretPrototype.html#is_military_target Online documentation}
*/
is_military_target?: bool
}
/**
* An {@linkplain https://wiki.factorio.com/Artillery_wagon artillery wagon}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html Online documentation}
*/
export interface ArtilleryWagonPrototype extends RollingStockPrototype {
type: "artillery-wagon"
/**
* Name of a {@link GunPrototype}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#gun Online documentation}
*/
gun: ItemID
/**
* Must be > 0.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#inventory_size Online documentation}
*/
inventory_size: ItemStackIndex
/**
* Must be > 0.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#ammo_stack_limit Online documentation}
*/
ammo_stack_limit: ItemCountType
turret_rotation_speed: double
/**
* Must be > 0.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#manual_range_modifier Online documentation}
*/
manual_range_modifier: double
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#disable_automatic_firing Online documentation}
*/
disable_automatic_firing?: bool
cannon_base_pictures?: RotatedSprite
cannon_barrel_pictures?: RotatedSprite
rotating_sound?: InterruptibleSound
rotating_stopped_sound?: Sound
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#turn_after_shooting_cooldown Online documentation}
*/
turn_after_shooting_cooldown?: uint16
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#cannon_parking_frame_count Online documentation}
*/
cannon_parking_frame_count?: uint16
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#cannon_parking_speed Online documentation}
*/
cannon_parking_speed?: float
/**
* Must match `cannon_base_pictures` frame count.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#cannon_base_shiftings Online documentation}
*/
cannon_base_shiftings?: readonly Vector[]
cannon_barrel_recoil_shiftings?: readonly Vector3D[]
/**
* Only loaded if `cannon_barrel_recoil_shiftings` is loaded.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#cannon_barrel_recoil_shiftings_load_correction_matrix Online documentation}
*/
cannon_barrel_recoil_shiftings_load_correction_matrix?: readonly Vector3D[]
/**
* Only loaded if `cannon_barrel_recoil_shiftings` is loaded.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/ArtilleryWagonPrototype.html#cannon_barrel_light_direction Online documentation}
*/
cannon_barrel_light_direction?: Vector3D
}
/**
* An assembling machine - like the assembling machines 1/2/3 in the game, but you can use your own recipe categories.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AssemblingMachinePrototype.html Online documentation}
*/
export interface AssemblingMachinePrototype extends CraftingMachinePrototype {
type: "assembling-machine" | "rocket-silo"
/**
* **Default:** `""`
*
* The preset recipe of this machine. This machine does not show a recipe selection if this is set. The base game uses this for the {@linkplain https://wiki.factorio.com/Rocket_silo rocket silo}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AssemblingMachinePrototype.html#fixed_recipe Online documentation}
*/
fixed_recipe?: RecipeID
/**
* **Default:** `""`
*
* The locale key of the title of the GUI that is shown when the player opens the assembling machine. May not be longer than 200 characters.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AssemblingMachinePrototype.html#gui_title_key Online documentation}
*/
gui_title_key?: string
/**
* **Default:** `255`
*
* Sets the maximum number of ingredients this machine can craft with. Any recipe with more ingredients than this will be unavailable in this machine.
*
* This only counts item ingredients, not fluid ingredients! This means if ingredient count is 2, and the recipe has 2 item ingredients and 1 fluid ingredient, it can still be crafted in the machine.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AssemblingMachinePrototype.html#ingredient_count Online documentation}
*/
ingredient_count?: uint8
/**
* **Default:** ``{0, -0.3}``
*
* Shift of the "alt-mode icon" relative to the machine's center.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AssemblingMachinePrototype.html#entity_info_icon_shift Online documentation}
*/
entity_info_icon_shift?: Vector
}
/**
* A setting in the map creation GUI. Used by the {@link AutoplaceSpecification#control autoplace system}.
*
* _Prototype limited to **255** total instances_
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AutoplaceControl.html Online documentation}
*/
export interface AutoplaceControl extends PrototypeBase {
type: "autoplace-control"
/**
* Controls in what tab the autoplace is shown in the map generator GUI.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AutoplaceControl.html#category Online documentation}
*/
category: "resource" | "terrain" | "enemy"
/**
* **Default:** `false`
*
* Sets whether this control's richness can be changed. The map generator GUI will only show the richness slider when the `category` is `"resource"`.
*
* If the autoplace control is used to generate ores, you probably want this to be true.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AutoplaceControl.html#richness Online documentation}
*/
richness?: bool
/**
* **Default:** `true`
*
* Whether there is an "enable" checkbox for the autoplace control in the map generator GUI. If this is false, the autoplace control cannot be disabled from the GUI.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/AutoplaceControl.html#can_be_disabled Online documentation}
*/
can_be_disabled?: bool
}
/**
* Used by {@linkplain https://wiki.factorio.com/Personal_battery personal battery}.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BatteryEquipmentPrototype.html Online documentation}
*/
export interface BatteryEquipmentPrototype extends EquipmentPrototype {
type: "battery-equipment"
}
/**
* Entity with the ability to transfer {@link ModulePrototype module} effects to its neighboring entities.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html Online documentation}
*/
export interface BeaconPrototype extends EntityWithOwnerPrototype {
type: "beacon"
/**
* The constant power usage of this beacon.
* @example
* energy_usage = "480kW"
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#energy_usage Online documentation}
*/
energy_usage: Energy
energy_source: ElectricEnergySource | VoidEnergySource
/**
* The maximum distance that this beacon can supply its neighbors with its module's effects. Max distance is 64.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#supply_area_distance Online documentation}
*/
supply_area_distance: double
/**
* The multiplier of the module's effects, when shared between neighbors.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#distribution_effectivity Online documentation}
*/
distribution_effectivity: double
/**
* The number of module slots in this beacon and their icon positions.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#module_specification Online documentation}
*/
module_specification: ModuleSpecification
/**
* The graphics for the beacon.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#graphics_set Online documentation}
*/
graphics_set?: BeaconGraphicsSet
/**
* Only loaded if `graphics_set` is not defined.
*
* The animation for the beacon, when in use.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#animation Online documentation}
*/
animation?: Animation
/**
* Only loaded if `graphics_set` is not defined.
*
* The picture of the beacon when it is not on.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#base_picture Online documentation}
*/
base_picture?: Animation
radius_visualisation_picture?: Sprite
/**
* **Default:** `No effects are allowed`
*
* The types of {@link ModulePrototype modules} that a player can place inside of the beacon.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeaconPrototype.html#allowed_effects Online documentation}
*/
allowed_effects?: EffectTypeLimitation
}
/**
* Used as a laser beam.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeamPrototype.html Online documentation}
*/
export interface BeamPrototype extends EntityPrototype {
type: "beam"
width: double
/**
* Damage interval can't be 0. A value of 1 will cause the attack to be applied each tick.
* @see {@link https://lua-api.factorio.com/1.1.110/prototypes/BeamPrototype.html#damage_interval Online documentation}
*/
damage_interval: uint32
/**
* Head segm