typed-factorio
Version:
Featureful typescript definitions for the Factorio modding api.
1,172 lines (1,170 loc) • 584 kB
TypeScript
// This is an auto-generated file. Do not edit directly!
/** @noSelfInFile */
/**
* @noResolution
*/
declare module "factorio:prototype" {
export interface ActivateEquipmentCapsuleAction {
readonly type: "equipment-remote"
/**
* Activation is only implemented for {@link ActiveDefenseEquipmentPrototype}.
* @see {@link https://lua-api.factorio.com/1.1.110/types/ActivateEquipmentCapsuleAction.html#equipment Online documentation}
*/
equipment: EquipmentID
}
export interface ActivityBarStyleSpecification extends BaseStyleSpecification {
readonly type: "activity_bar_style"
speed?: float
bar_width?: uint32
color?: Color
bar_background?: Sprite
bar?: Sprite
bar_size_ratio?: float
}
/**
* @see MapGenPreset.advanced_settings
* @see {@link https://lua-api.factorio.com/1.1.110/types/MapGenPreset.html#advanced_settings Online documentation}
*/
export interface AdvancedMapGenSettings {
pollution?: MapGenPresetPollutionSettings
enemy_evolution?: MapGenPresetEnemyEvolutionSettings
enemy_expansion?: MapGenPresetEnemyExpansionSettings
difficulty_settings?: MapGenPresetDifficultySettings
}
export interface AggregationSpecification {
max_count: uint32
/**
* **Default:** `1`
*
* If `count_already_playing` is `true`, this will determine maximum progress when instance is counted toward playing sounds.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AggregationSpecification.html#progress_threshold Online documentation}
*/
progress_threshold?: float
remove: bool
/**
* **Default:** `false`
*
* If `true`, already playing sounds are taken into account when checking `max_count`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AggregationSpecification.html#count_already_playing Online documentation}
*/
count_already_playing?: bool
}
/**
* The name of an {@link AmmoCategory}.
* @example
* "bullet"
* @example
* "melee"
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoCategoryID.html Online documentation}
*/
export type AmmoCategoryID = string
export interface AmmoDamageModifier extends BaseModifier {
readonly type: "ammo-damage"
/**
* **Default:** `true`
*
* If set to `false`, use the icon from {@link UtilitySprites} for this technology effect icon.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoDamageModifier.html#infer_icon Online documentation}
*/
infer_icon?: bool
/**
* **Default:** `true`
*
* If `false`, do not draw the small "constant" icon over the technology effect icon.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoDamageModifier.html#use_icon_overlay_constant Online documentation}
*/
use_icon_overlay_constant?: bool
/**
* Name of the {@link AmmoCategory} that is affected.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoDamageModifier.html#ammo_category Online documentation}
*/
ammo_category: AmmoCategoryID
/**
* Modification value, which will be added to the current ammo damage modifier upon researching.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoDamageModifier.html#modifier Online documentation}
*/
modifier: double
}
/**
* Used to allow specifying different ammo effects depending on which kind of entity the ammo is used in.
*
* If ammo is used in an entity that isn't covered by the defined source_types, e.g. only `"player"` and `"vehicle"` are defined and the ammo is used by a turret, the first defined AmmoType in the {@link AmmoItemPrototype#ammo_type AmmoItemPrototype::ammo_type} array is used.
*
* ## Union members
* - `"default"`
* - `"player"`
* - `"turret"`
* - `"vehicle"`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoSourceType.html Online documentation}
*/
export type AmmoSourceType = "default" | "player" | "turret" | "vehicle"
/**
* Definition of actual parameters used in attack.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html Online documentation}
*/
export interface AmmoType {
/**
* Name of a {@link AmmoCategory}. Defines whether the attack will be affected by upgrades.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#category Online documentation}
*/
category: AmmoCategoryID
/**
* Describes actions taken upon attack happening.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#action Online documentation}
*/
action?: Trigger
/**
* **Default:** `false`
*
* When true, the gun will be able to shoot even when the target is out of range. Only applies when `target_type` equals `"position"`. The gun will fire at the maximum range in the direction of the target position.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#clamp_position Online documentation}
*/
clamp_position?: bool
/**
* Energy consumption of a single shot, if applicable.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#energy_consumption Online documentation}
*/
energy_consumption?: Energy
/**
* **Default:** `1`
*
* Affects the `range` value of the shooting gun prototype's {@link BaseAttackParameters} to give a modified maximum range. The `min_range` value of the gun is unaffected.
*
* This has no effect on artillery turrets and wagons even though the bonus appears in the GUI. {@linkplain https://forums.factorio.com/103658 Forum thread}.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#range_modifier Online documentation}
*/
range_modifier?: double
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#cooldown_modifier Online documentation}
*/
cooldown_modifier?: double
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#consumption_modifier Online documentation}
*/
consumption_modifier?: float
/**
* **Default:** `"entity"`
*
* `"entity"` fires at an entity, `"position"` fires directly at a position, `"direction"` fires in a direction.
*
* If this is `"entity"`, `clamp_position` is forced to be `false`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#target_type Online documentation}
*/
target_type?: "entity" | "position" | "direction"
/**
* Only exists (and is then mandatory) if the {@link AmmoItemPrototype#ammo_type AmmoItemPrototype::ammo_type} this AmmoType is defined on has multiple ammo types.
*
* Defines for which kind of entity this ammo type applies. Each entity kind can only be used once per array.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AmmoType.html#source_type Online documentation}
*/
source_type?: AmmoSourceType
}
export interface AndTipTrigger {
readonly type: "and"
/**
* If all of the triggers are fulfilled, this trigger is considered fulfilled.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AndTipTrigger.html#triggers Online documentation}
*/
triggers: readonly TipTrigger[]
}
export interface AnimatedVector {
/**
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimatedVector.html#rotations Online documentation}
*/
rotations: readonly VectorRotation[]
/**
* Default render layer for the rotations.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimatedVector.html#render_layer Online documentation}
*/
render_layer?: RenderLayer
/**
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimatedVector.html#direction_shift Online documentation}
*/
direction_shift?: DirectionShift
}
/**
* Specifies an animation that can be used in the game.
*
* Note that if any frame of the animation is specified from the same source as any other {@link Sprite} or frame of other animation, it will be shared.
* @example
* -- simple animation
* horizontal_animation =
* {
* filename = "__base__/graphics/entity/steam-engine/steam-engine-H.png",
* width = 176,
* height = 128,
* frame_count = 32,
* line_length = 8,
* shift = {0.03125, -0.15625}
* }
* @example
* -- animation with hr version
* horizontal_animation =
* {
* filename = "__base__/graphics/entity/steam-engine/steam-engine-H.png",
* width = 176,
* height = 128,
* frame_count = 32,
* line_length = 8,
* shift = {0.03125, -0.15625},
* hr_version =
* {
* filename = "__base__/graphics/entity/steam-engine/hr-steam-engine-H.png",
* width = 352,
* height = 257,
* frame_count = 32,
* line_length = 8,
* shift = {0.03125, -0.1484375},
* scale = 0.5
* }
* }
* @example
* -- animation with layers
* horizontal_animation =
* {
* layers =
* {
* {
* filename = "__base__/graphics/entity/steam-engine/steam-engine-H.png",
* width = 176,
* height = 128,
* frame_count = 32,
* line_length = 8,
* shift = {0.03125, -0.15625}
* },
* {
* filename = "__base__/graphics/entity/steam-engine/steam-engine-H-shadow.png",
* width = 254,
* height = 80,
* frame_count = 32,
* line_length = 8,
* draw_as_shadow = true,
* shift = {1.5, 0.75}
* }
* }
* }
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation.html Online documentation}
*/
export interface Animation extends Omit<AnimationParameters, "filename"> {
/**
* 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, including those inherited from AnimationParameters, are ignored.
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation.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/types/Animation.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/types/Animation.html#hr_version Online documentation}
*/
hr_version?: Animation
/**
* Only loaded if `layers` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation.html#stripes Online documentation}
*/
stripes?: readonly Stripe[]
}
/**
* If this is loaded as a single Animation, it applies to all directions.
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation4Way.html Online documentation}
*/
export type Animation4Way =
| {
north: Animation
/**
* Defaults to the north animation.
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation4Way.html#east Online documentation}
*/
east?: Animation
/**
* Defaults to the north animation.
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation4Way.html#south Online documentation}
*/
south?: Animation
/**
* Defaults to the east animation.
* @see {@link https://lua-api.factorio.com/1.1.110/types/Animation4Way.html#west Online documentation}
*/
west?: Animation
}
| Animation
export interface AnimationElement {
/**
* **Default:** `"object"`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationElement.html#render_layer Online documentation}
*/
render_layer?: RenderLayer
/**
* Used to determine render order for sprites with the same `render_layer` in the same position. Sprites with a higher `secondary_draw_order` are drawn on top.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationElement.html#secondary_draw_order Online documentation}
*/
secondary_draw_order?: int8
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationElement.html#draw_as_sprite Online documentation}
*/
draw_as_sprite?: bool
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationElement.html#draw_as_light Online documentation}
*/
draw_as_light?: bool
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationElement.html#apply_tint Online documentation}
*/
apply_tint?: bool
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationElement.html#always_draw Online documentation}
*/
always_draw?: bool
animation?: Animation
}
/**
* This is a list of 1-based frame indices into the spritesheet. The actual length of the animation will then be the length of the frame_sequence (times `repeat_count`, times two if `run_mode` is `"forward-then-backward"`). There is a limit for (actual) animation length of 255 frames.
*
* Indices can be used in any order, repeated or not used at all. Unused frames are not loaded into VRAM at all, frames referenced multiple times are loaded just once, see {@linkplain https://forums.factorio.com/53202 here}.
* @example
* -- Trivial example - frame_sequence defines same sequence in which the animation would load by default,
* -- so it is useless in this case:
* frame_count = 4,
* frame_sequence = { 1, 2, 3, 4 }
* @example
* -- Usage example - first five times repeat frame 2, then alternate between 4 and 3 two times. Frame 1 is not used:
* frame_count = 4,
* frame_sequence = { 2, 2, 2, 2, 2, 4, 3, 4, 3 }
* @example
* -- Complex example - animation contains different layers with different frame counts:
* local custom_frame_sequence = { 2, 2, 2, 2, 2, 4, 3, 4, 3 }
* layers = {
* {
* -- Animation with custom frame sequence
* frame_count = 4,
* frame_sequence = custom_frame_sequence,
* },
* {
* -- Single sprite that's repeated
* repeat_count = #custom_frame_sequence,
* },
* {
* -- Other animation with different frame count
* -- Assuming: #custom_frame_sequence < frame_count
* frame_count = #custom_frame_sequence,
* },
* }
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationFrameSequence.html Online documentation}
*/
export type AnimationFrameSequence = readonly uint16[]
export interface AnimationParameters extends SpriteParameters {
/**
* 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/types/AnimationParameters.html#size Online documentation}
*/
size?: SpriteSizeType | readonly [SpriteSizeType, SpriteSizeType]
/**
* 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/types/AnimationParameters.html#width Online documentation}
*/
width?: SpriteSizeType
/**
* 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/types/AnimationParameters.html#height Online documentation}
*/
height?: SpriteSizeType
/**
* **Default:** `"forward"`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#run_mode Online documentation}
*/
run_mode?: "forward" | "backward" | "forward-then-backward"
/**
* **Default:** `1`
*
* Can't be `0`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#frame_count Online documentation}
*/
frame_count?: uint32
/**
* **Default:** `0`
*
* Specifies how many pictures are on each horizontal line in the image file. `0` means that all the pictures are in one horizontal line. Once the specified number of pictures are loaded from a line, the pictures from the next line are loaded. This is to allow having longer animations loaded in to Factorio's graphics matrix than the game engine's width limit of 8192px per input file. The restriction on input files is to be compatible with most graphics cards.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#line_length Online documentation}
*/
line_length?: uint32
/**
* **Default:** `1`
*
* 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`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#animation_speed Online documentation}
*/
animation_speed?: float
/**
* **Default:** `MAX_FLOAT`
*
* Maximum amount of frames the animation can move forward in one update. Useful to cap the animation speed on entities where it is variable, such as car animations.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#max_advance Online documentation}
*/
max_advance?: float
/**
* **Default:** `1`
*
* 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/types/AnimationParameters.html#repeat_count Online documentation}
*/
repeat_count?: uint8
/**
* Number of slices this is sliced into when using the "optimized atlas packing" option. If you are a modder, you can just ignore this property. Example: If this is 4, the sprite will be sliced into a 4×4 grid.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#dice Online documentation}
*/
dice?: uint8
/**
* Same as `dice` above, but this specifies only how many slices there are on the x axis.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#dice_x Online documentation}
*/
dice_x?: uint8
/**
* Same as `dice` above, but this specifies only how many slices there are on the y axis.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#dice_y Online documentation}
*/
dice_y?: uint8
frame_sequence?: AnimationFrameSequence
/**
* **Default:** `0`
*
* 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/types/AnimationParameters.html#mipmap_count Online documentation}
*/
mipmap_count?: uint8
/**
* **Default:** `false`
*
* Unused.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationParameters.html#generate_sdf Online documentation}
*/
generate_sdf?: bool
}
export interface AnimationSheet extends AnimationParameters {
/**
* If this property exists and high resolution sprites are turned on, this is used to load the AnimationSheet.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationSheet.html#hr_version Online documentation}
*/
hr_version?: AnimationSheet
variation_count: uint32
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationSheet.html#frame_count Online documentation}
*/
frame_count?: uint32
/**
* **Default:** `Value of `variation_count``
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationSheet.html#line_length Online documentation}
*/
line_length?: uint32
}
/**
* @example
* -- array of animations
* animations =
* {
* {
* filename = "__base__/graphics/entity/explosion-gunshot/explosion-gunshot.png",
* draw_as_glow = true,
* priority = "extra-high",
* width = 34,
* height = 38,
* frame_count = 2,
* animation_speed = 1.5,
* shift = {0, 0}
* },
* {
* filename = "__base__/graphics/entity/explosion-gunshot/explosion-gunshot.png",
* draw_as_glow = true,
* priority = "extra-high",
* width = 34,
* height = 38,
* x = 34 * 2,
* frame_count = 2,
* animation_speed = 1.5,
* shift = {0, 0}
* },
* -- [...]
* }
* @example
* -- animation sheet using "sheet"
* pictures =
* {
* sheet =
* {
* filename = "__base__/graphics/entity/character/footprints.png",
* line_length = 2,
* frame_count = 2,
* width = 15,
* height = 11,
* shift = util.by_pixel(0.5, 0.5),
* variation_count = 8,
* hr_version =
* {
* filename = "__base__/graphics/entity/character/hr-footprints.png",
* line_length = 2,
* frame_count = 2,
* width = 30,
* height = 22,
* shift = util.by_pixel(0.25, 0.25),
* scale = 0.5,
* variation_count = 8
* }
* }
* }
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationVariations.html Online documentation}
*/
export type AnimationVariations =
| {
/**
* The variations are arranged vertically in the file, one row for each variation.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationVariations.html#sheet Online documentation}
*/
sheet?: AnimationSheet
/**
* Only loaded if `sheet` is not defined.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnimationVariations.html#sheets Online documentation}
*/
sheets?: readonly AnimationSheet[]
}
| Animation
| readonly Animation[]
/**
* A union of all prototypes. A specific prototype is loaded based on the value of the `type` key.
*
* See the {@linkplain https://lua-api.factorio.com/1.1.110/prototypes.html Prototypes page} for more information.
*
* ## Union members
* - {@link AccumulatorPrototype}: `'accumulator'`
* - {@link AchievementPrototype}: `'achievement'`
* - {@link ActiveDefenseEquipmentPrototype}: `'active-defense-equipment'`
* - {@link AmbientSound}: `'ambient-sound'`
* - {@link AmmoCategory}: `'ammo-category'`
* - {@link AmmoItemPrototype}: `'ammo'`
* - {@link AmmoTurretPrototype}: `'ammo-turret'`
* - {@link AnimationPrototype}: `'animation'`
* - {@link ArithmeticCombinatorPrototype}: `'arithmetic-combinator'`
* - {@link ArmorPrototype}: `'armor'`
* - {@link ArrowPrototype}: `'arrow'`
* - {@link ArtilleryFlarePrototype}: `'artillery-flare'`
* - {@link ArtilleryProjectilePrototype}: `'artillery-projectile'`
* - {@link ArtilleryTurretPrototype}: `'artillery-turret'`
* - {@link ArtilleryWagonPrototype}: `'artillery-wagon'`
* - {@link AssemblingMachinePrototype}: `'assembling-machine'`
* - {@link AutoplaceControl}: `'autoplace-control'`
* - {@link BatteryEquipmentPrototype}: `'battery-equipment'`
* - {@link BeaconPrototype}: `'beacon'`
* - {@link BeamPrototype}: `'beam'`
* - {@link BeltImmunityEquipmentPrototype}: `'belt-immunity-equipment'`
* - {@link BlueprintBookPrototype}: `'blueprint-book'`
* - {@link BlueprintItemPrototype}: `'blueprint'`
* - {@link BoilerPrototype}: `'boiler'`
* - {@link BuildEntityAchievementPrototype}: `'build-entity-achievement'`
* - {@link BurnerGeneratorPrototype}: `'burner-generator'`
* - {@link CapsulePrototype}: `'capsule'`
* - {@link CarPrototype}: `'car'`
* - {@link CargoWagonPrototype}: `'cargo-wagon'`
* - {@link CharacterCorpsePrototype}: `'character-corpse'`
* - {@link CharacterPrototype}: `'character'`
* - {@link CliffPrototype}: `'cliff'`
* - {@link CombatRobotCountAchievementPrototype}: `'combat-robot-count'`
* - {@link CombatRobotPrototype}: `'combat-robot'`
* - {@link ConstantCombinatorPrototype}: `'constant-combinator'`
* - {@link ConstructWithRobotsAchievementPrototype}: `'construct-with-robots-achievement'`
* - {@link ConstructionRobotPrototype}: `'construction-robot'`
* - {@link ContainerPrototype}: `'container'`
* - {@link CopyPasteToolPrototype}: `'copy-paste-tool'`
* - {@link CorpsePrototype}: `'corpse'`
* - {@link CurvedRailPrototype}: `'curved-rail'`
* - {@link CustomInputPrototype}: `'custom-input'`
* - {@link DamageType}: `'damage-type'`
* - {@link DeciderCombinatorPrototype}: `'decider-combinator'`
* - {@link DeconstructWithRobotsAchievementPrototype}: `'deconstruct-with-robots-achievement'`
* - {@link DeconstructibleTileProxyPrototype}: `'deconstructible-tile-proxy'`
* - {@link DeconstructionItemPrototype}: `'deconstruction-item'`
* - {@link DecorativePrototype}: `'optimized-decorative'`
* - {@link DeliverByRobotsAchievementPrototype}: `'deliver-by-robots-achievement'`
* - {@link DontBuildEntityAchievementPrototype}: `'dont-build-entity-achievement'`
* - {@link DontCraftManuallyAchievementPrototype}: `'dont-craft-manually-achievement'`
* - {@link DontUseEntityInEnergyProductionAchievementPrototype}: `'dont-use-entity-in-energy-production-achievement'`
* - {@link EditorControllerPrototype}: `'editor-controller'`
* - {@link ElectricEnergyInterfacePrototype}: `'electric-energy-interface'`
* - {@link ElectricPolePrototype}: `'electric-pole'`
* - {@link ElectricTurretPrototype}: `'electric-turret'`
* - {@link EnemySpawnerPrototype}: `'unit-spawner'`
* - {@link EnergyShieldEquipmentPrototype}: `'energy-shield-equipment'`
* - {@link EntityGhostPrototype}: `'entity-ghost'`
* - {@link EntityParticlePrototype}: `'particle'`
* - {@link EquipmentCategory}: `'equipment-category'`
* - {@link EquipmentGridPrototype}: `'equipment-grid'`
* - {@link ExplosionPrototype}: `'explosion'`
* - {@link FinishTheGameAchievementPrototype}: `'finish-the-game-achievement'`
* - {@link FireFlamePrototype}: `'fire'`
* - {@link FishPrototype}: `'fish'`
* - {@link FlameThrowerExplosionPrototype}: `'flame-thrower-explosion'`
* - {@link FluidPrototype}: `'fluid'`
* - {@link FluidStreamPrototype}: `'stream'`
* - {@link FluidTurretPrototype}: `'fluid-turret'`
* - {@link FluidWagonPrototype}: `'fluid-wagon'`
* - {@link FlyingTextPrototype}: `'flying-text'`
* - {@link FontPrototype}: `'font'`
* - {@link FuelCategory}: `'fuel-category'`
* - {@link FurnacePrototype}: `'furnace'`
* - {@link GatePrototype}: `'gate'`
* - {@link GeneratorEquipmentPrototype}: `'generator-equipment'`
* - {@link GeneratorPrototype}: `'generator'`
* - {@link GodControllerPrototype}: `'god-controller'`
* - {@link GroupAttackAchievementPrototype}: `'group-attack-achievement'`
* - {@link GuiStyle}: `'gui-style'`
* - {@link GunPrototype}: `'gun'`
* - {@link HeatInterfacePrototype}: `'heat-interface'`
* - {@link HeatPipePrototype}: `'heat-pipe'`
* - {@link HighlightBoxEntityPrototype}: `'highlight-box'`
* - {@link InfinityContainerPrototype}: `'infinity-container'`
* - {@link InfinityPipePrototype}: `'infinity-pipe'`
* - {@link InserterPrototype}: `'inserter'`
* - {@link ItemEntityPrototype}: `'item-entity'`
* - {@link ItemGroup}: `'item-group'`
* - {@link ItemPrototype}: `'item'`
* - {@link ItemRequestProxyPrototype}: `'item-request-proxy'`
* - {@link ItemSubGroup}: `'item-subgroup'`
* - {@link ItemWithEntityDataPrototype}: `'item-with-entity-data'`
* - {@link ItemWithInventoryPrototype}: `'item-with-inventory'`
* - {@link ItemWithLabelPrototype}: `'item-with-label'`
* - {@link ItemWithTagsPrototype}: `'item-with-tags'`
* - {@link KillAchievementPrototype}: `'kill-achievement'`
* - {@link LabPrototype}: `'lab'`
* - {@link LampPrototype}: `'lamp'`
* - {@link LandMinePrototype}: `'land-mine'`
* - {@link LeafParticlePrototype}: `'leaf-particle'`
* - {@link LinkedBeltPrototype}: `'linked-belt'`
* - {@link LinkedContainerPrototype}: `'linked-container'`
* - {@link Loader1x1Prototype}: `'loader-1x1'`
* - {@link Loader1x2Prototype}: `'loader'`
* - {@link LocomotivePrototype}: `'locomotive'`
* - {@link LogisticContainerPrototype}: `'logistic-container'`
* - {@link LogisticRobotPrototype}: `'logistic-robot'`
* - {@link MapGenPresets}: `'map-gen-presets'`
* - {@link MapSettings}: `'map-settings'`
* - {@link MarketPrototype}: `'market'`
* - {@link MiningDrillPrototype}: `'mining-drill'`
* - {@link MiningToolPrototype}: `'mining-tool'`
* - {@link ModuleCategory}: `'module-category'`
* - {@link ModulePrototype}: `'module'`
* - {@link MouseCursor}: `'mouse-cursor'`
* - {@link MovementBonusEquipmentPrototype}: `'movement-bonus-equipment'`
* - {@link NamedNoiseExpression}: `'noise-expression'`
* - {@link NightVisionEquipmentPrototype}: `'night-vision-equipment'`
* - {@link NoiseLayer}: `'noise-layer'`
* - {@link OffshorePumpPrototype}: `'offshore-pump'`
* - {@link ParticlePrototype}: `'optimized-particle'`
* - {@link ParticleSourcePrototype}: `'particle-source'`
* - {@link PipePrototype}: `'pipe'`
* - {@link PipeToGroundPrototype}: `'pipe-to-ground'`
* - {@link PlayerDamagedAchievementPrototype}: `'player-damaged-achievement'`
* - {@link PlayerPortPrototype}: `'player-port'`
* - {@link PowerSwitchPrototype}: `'power-switch'`
* - {@link ProduceAchievementPrototype}: `'produce-achievement'`
* - {@link ProducePerHourAchievementPrototype}: `'produce-per-hour-achievement'`
* - {@link ProgrammableSpeakerPrototype}: `'programmable-speaker'`
* - {@link ProjectilePrototype}: `'projectile'`
* - {@link PumpPrototype}: `'pump'`
* - {@link RadarPrototype}: `'radar'`
* - {@link RailChainSignalPrototype}: `'rail-chain-signal'`
* - {@link RailPlannerPrototype}: `'rail-planner'`
* - {@link RailRemnantsPrototype}: `'rail-remnants'`
* - {@link RailSignalPrototype}: `'rail-signal'`
* - {@link ReactorPrototype}: `'reactor'`
* - {@link RecipeCategory}: `'recipe-category'`
* - {@link RecipePrototype}: `'recipe'`
* - {@link RepairToolPrototype}: `'repair-tool'`
* - {@link ResearchAchievementPrototype}: `'research-achievement'`
* - {@link ResourceCategory}: `'resource-category'`
* - {@link ResourceEntityPrototype}: `'resource'`
* - {@link RoboportEquipmentPrototype}: `'roboport-equipment'`
* - {@link RoboportPrototype}: `'roboport'`
* - {@link RocketSiloPrototype}: `'rocket-silo'`
* - {@link RocketSiloRocketPrototype}: `'rocket-silo-rocket'`
* - {@link RocketSiloRocketShadowPrototype}: `'rocket-silo-rocket-shadow'`
* - {@link SelectionToolPrototype}: `'selection-tool'`
* - {@link ShortcutPrototype}: `'shortcut'`
* - {@link SimpleEntityPrototype}: `'simple-entity'`
* - {@link SimpleEntityWithForcePrototype}: `'simple-entity-with-force'`
* - {@link SimpleEntityWithOwnerPrototype}: `'simple-entity-with-owner'`
* - {@link SimpleSmokePrototype}: `'smoke'`
* - {@link SmokeWithTriggerPrototype}: `'smoke-with-trigger'`
* - {@link SolarPanelEquipmentPrototype}: `'solar-panel-equipment'`
* - {@link SolarPanelPrototype}: `'solar-panel'`
* - {@link SoundPrototype}: `'sound'`
* - {@link SpectatorControllerPrototype}: `'spectator-controller'`
* - {@link SpeechBubblePrototype}: `'speech-bubble'`
* - {@link SpiderLegPrototype}: `'spider-leg'`
* - {@link SpiderVehiclePrototype}: `'spider-vehicle'`
* - {@link SpidertronRemotePrototype}: `'spidertron-remote'`
* - {@link SplitterPrototype}: `'splitter'`
* - {@link SpritePrototype}: `'sprite'`
* - {@link StickerPrototype}: `'sticker'`
* - {@link StorageTankPrototype}: `'storage-tank'`
* - {@link StraightRailPrototype}: `'straight-rail'`
* - {@link TechnologyPrototype}: `'technology'`
* - {@link TileEffectDefinition}: `'tile-effect'`
* - {@link TileGhostPrototype}: `'tile-ghost'`
* - {@link TilePrototype}: `'tile'`
* - {@link TipsAndTricksItem}: `'tips-and-tricks-item'`
* - {@link TipsAndTricksItemCategory}: `'tips-and-tricks-item-category'`
* - {@link ToolPrototype}: `'tool'`
* - {@link TrainPathAchievementPrototype}: `'train-path-achievement'`
* - {@link TrainStopPrototype}: `'train-stop'`
* - {@link TransportBeltPrototype}: `'transport-belt'`
* - {@link TreePrototype}: `'tree'`
* - {@link TriggerTargetType}: `'trigger-target-type'`
* - {@link TrivialSmokePrototype}: `'trivial-smoke'`
* - {@link TurretPrototype}: `'turret'`
* - {@link TutorialDefinition}: `'tutorial'`
* - {@link UndergroundBeltPrototype}: `'underground-belt'`
* - {@link UnitPrototype}: `'unit'`
* - {@link UpgradeItemPrototype}: `'upgrade-item'`
* - {@link UtilityConstants}: `'utility-constants'`
* - {@link UtilitySounds}: `'utility-sounds'`
* - {@link UtilitySprites}: `'utility-sprites'`
* - {@link VirtualSignalPrototype}: `'virtual-signal'`
* - {@link WallPrototype}: `'wall'`
* - {@link WindSound}: `'wind-sound'`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AnyPrototype.html Online documentation}
*/
export type AnyPrototype =
| AccumulatorPrototype
| AchievementPrototype
| ActiveDefenseEquipmentPrototype
| AmbientSound
| AmmoCategory
| AmmoItemPrototype
| AmmoTurretPrototype
| AnimationPrototype
| ArithmeticCombinatorPrototype
| ArmorPrototype
| ArrowPrototype
| ArtilleryFlarePrototype
| ArtilleryProjectilePrototype
| ArtilleryTurretPrototype
| ArtilleryWagonPrototype
| AssemblingMachinePrototype
| AutoplaceControl
| BatteryEquipmentPrototype
| BeaconPrototype
| BeamPrototype
| BeltImmunityEquipmentPrototype
| BlueprintBookPrototype
| BlueprintItemPrototype
| BoilerPrototype
| BuildEntityAchievementPrototype
| BurnerGeneratorPrototype
| CapsulePrototype
| CarPrototype
| CargoWagonPrototype
| CharacterCorpsePrototype
| CharacterPrototype
| CliffPrototype
| CombatRobotCountAchievementPrototype
| CombatRobotPrototype
| ConstantCombinatorPrototype
| ConstructWithRobotsAchievementPrototype
| ConstructionRobotPrototype
| ContainerPrototype
| CopyPasteToolPrototype
| CorpsePrototype
| CurvedRailPrototype
| CustomInputPrototype
| DamageType
| DeciderCombinatorPrototype
| DeconstructWithRobotsAchievementPrototype
| DeconstructibleTileProxyPrototype
| DeconstructionItemPrototype
| DecorativePrototype
| DeliverByRobotsAchievementPrototype
| DontBuildEntityAchievementPrototype
| DontCraftManuallyAchievementPrototype
| DontUseEntityInEnergyProductionAchievementPrototype
| EditorControllerPrototype
| ElectricEnergyInterfacePrototype
| ElectricPolePrototype
| ElectricTurretPrototype
| EnemySpawnerPrototype
| EnergyShieldEquipmentPrototype
| EntityGhostPrototype
| EntityParticlePrototype
| EquipmentCategory
| EquipmentGridPrototype
| ExplosionPrototype
| FinishTheGameAchievementPrototype
| FireFlamePrototype
| FishPrototype
| FlameThrowerExplosionPrototype
| FluidPrototype
| FluidStreamPrototype
| FluidTurretPrototype
| FluidWagonPrototype
| FlyingTextPrototype
| FontPrototype
| FuelCategory
| FurnacePrototype
| GatePrototype
| GeneratorEquipmentPrototype
| GeneratorPrototype
| GodControllerPrototype
| GroupAttackAchievementPrototype
| GuiStyle
| GunPrototype
| HeatInterfacePrototype
| HeatPipePrototype
| HighlightBoxEntityPrototype
| InfinityContainerPrototype
| InfinityPipePrototype
| InserterPrototype
| ItemEntityPrototype
| ItemGroup
| ItemPrototype
| ItemRequestProxyPrototype
| ItemSubGroup
| ItemWithEntityDataPrototype
| ItemWithInventoryPrototype
| ItemWithLabelPrototype
| ItemWithTagsPrototype
| KillAchievementPrototype
| LabPrototype
| LampPrototype
| LandMinePrototype
| LeafParticlePrototype
| LinkedBeltPrototype
| LinkedContainerPrototype
| Loader1x1Prototype
| Loader1x2Prototype
| LocomotivePrototype
| LogisticContainerPrototype
| LogisticRobotPrototype
| MapGenPresets
| MapSettings
| MarketPrototype
| MiningDrillPrototype
| MiningToolPrototype
| ModuleCategory
| ModulePrototype
| MouseCursor
| MovementBonusEquipmentPrototype
| NamedNoiseExpression
| NightVisionEquipmentPrototype
| NoiseLayer
| OffshorePumpPrototype
| ParticlePrototype
| ParticleSourcePrototype
| PipePrototype
| PipeToGroundPrototype
| PlayerDamagedAchievementPrototype
| PlayerPortPrototype
| PowerSwitchPrototype
| ProduceAchievementPrototype
| ProducePerHourAchievementPrototype
| ProgrammableSpeakerPrototype
| ProjectilePrototype
| PumpPrototype
| RadarPrototype
| RailChainSignalPrototype
| RailPlannerPrototype
| RailRemnantsPrototype
| RailSignalPrototype
| ReactorPrototype
| RecipeCategory
| RecipePrototype
| RepairToolPrototype
| ResearchAchievementPrototype
| ResourceCategory
| ResourceEntityPrototype
| RoboportEquipmentPrototype
| RoboportPrototype
| RocketSiloPrototype
| RocketSiloRocketPrototype
| RocketSiloRocketShadowPrototype
| SelectionToolPrototype
| ShortcutPrototype
| SimpleEntityPrototype
| SimpleEntityWithForcePrototype
| SimpleEntityWithOwnerPrototype
| SimpleSmokePrototype
| SmokeWithTriggerPrototype
| SolarPanelEquipmentPrototype
| SolarPanelPrototype
| SoundPrototype
| SpectatorControllerPrototype
| SpeechBubblePrototype
| SpiderLegPrototype
| SpiderVehiclePrototype
| SpidertronRemotePrototype
| SplitterPrototype
| SpritePrototype
| StickerPrototype
| StorageTankPrototype
| StraightRailPrototype
| TechnologyPrototype
| TileEffectDefinition
| TileGhostPrototype
| TilePrototype
| TipsAndTricksItem
| TipsAndTricksItemCategory
| ToolPrototype
| TrainPathAchievementPrototype
| TrainStopPrototype
| TransportBeltPrototype
| TreePrototype
| TriggerTargetType
| TrivialSmokePrototype
| TurretPrototype
| TutorialDefinition
| UndergroundBeltPrototype
| UnitPrototype
| UpgradeItemPrototype
| UtilityConstants
| UtilitySounds
| UtilitySprites
| VirtualSignalPrototype
| WallPrototype
| WindSound
export interface AreaTriggerItem extends TriggerItem {
readonly type: "area"
radius: double
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AreaTriggerItem.html#trigger_from_target Online documentation}
*/
trigger_from_target?: bool
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AreaTriggerItem.html#target_entities Online documentation}
*/
target_entities?: bool
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AreaTriggerItem.html#show_in_tooltip Online documentation}
*/
show_in_tooltip?: bool
/**
* **Default:** `"distance-from-collision-box"`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AreaTriggerItem.html#collision_mode Online documentation}
*/
collision_mode?: "distance-from-collision-box" | "distance-from-center"
}
export interface ArtilleryRangeModifier extends SimpleModifier {
readonly type: "artillery-range"
/**
* **Default:** `false`
*
* If set to `false`, use the icon from {@link UtilitySprites} for this technology effect icon.
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryRangeModifier.html#infer_icon Online documentation}
*/
infer_icon?: bool
/**
* **Default:** `true`
*
* If `false`, do not draw the small "constant" icon over the technology effect icon.
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryRangeModifier.html#use_icon_overlay_constant Online documentation}
*/
use_icon_overlay_constant?: bool
}
export interface ArtilleryRemoteCapsuleAction {
readonly type: "artillery-remote"
/**
* Name of an {@link ArtilleryFlarePrototype}.
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryRemoteCapsuleAction.html#flare Online documentation}
*/
flare: EntityID
/**
* **Default:** `true`
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryRemoteCapsuleAction.html#play_sound_on_failure Online documentation}
*/
play_sound_on_failure?: bool
}
export interface ArtilleryTriggerDelivery extends TriggerDeliveryItem {
readonly type: "artillery"
/**
* Name of a {@link ArtilleryProjectilePrototype}.
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryTriggerDelivery.html#projectile Online documentation}
*/
projectile: EntityID
starting_speed: float
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryTriggerDelivery.html#starting_speed_deviation Online documentation}
*/
starting_speed_deviation?: float
/**
* **Default:** `0`
*
* Maximum deviation of the projectile from source orientation, in +/- (`x radians / 2`). Example: `3.14 radians -> +/- (180° / 2)`, meaning up to 90° deviation in either direction of rotation.
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryTriggerDelivery.html#direction_deviation Online documentation}
*/
direction_deviation?: float
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryTriggerDelivery.html#range_deviation Online documentation}
*/
range_deviation?: float
/**
* **Default:** `false`
* @see {@link https://lua-api.factorio.com/1.1.110/types/ArtilleryTriggerDelivery.html#trigger_fired_artillery Online documentation}
*/
trigger_fired_artillery?: bool
}
/**
* Loaded as one of the {@link BaseAttackParameters} extensions, based on the value of the `type` key.
*
* ## Union members
* - {@link ProjectileAttackParameters}: Loaded when the `type` is `"projectile"`.
* - {@link BeamAttackParameters}: Loaded when the `type` is `"beam"`.
* - {@link StreamAttackParameters}: Loaded when the `type` is `"stream"`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AttackParameters.html Online documentation}
*/
export type AttackParameters = ProjectileAttackParameters | BeamAttackParameters | StreamAttackParameters
export interface AttackReactionItem {
range: float
action?: Trigger
/**
* **Default:** `0`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AttackReactionItem.html#reaction_modifier Online documentation}
*/
reaction_modifier?: float
damage_type?: DamageTypeID
}
/**
* The name of an {@link AutoplaceControl}.
* @example
* "copper-ore"
* @example
* "trees"
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplaceControlID.html Online documentation}
*/
export type AutoplaceControlID = string
export interface AutoplacePeak {
/**
* **Default:** `1`
*
* Influence multiplier.
*
* Influence is calculated as a sum of influences of peaks. Influence of a peak is obtained by calculating a distance from each of its dimensions and sum of these individual distances is used as a distance from optimal conditions. Based on this distance a peak gets influence between -1 and 1. This is then multiplied by the noise function, if it is specified, and by the `influence` constant (or by `influence` + `richness_influence` if calculating richness). Finally this value is clamped to a range between `min_influence` and `max_influence`.
*
* When {@link AutoplaceSpecification#starting_area_amount AutoplaceSpecification::starting_area_amount} is non-zero a position in starting area is selected and a blob is placed centered on this position. Influence is then a maximum of the default calculated value and a value obtained from this blob.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#influence Online documentation}
*/
influence?: double
/**
* **Default:** `min double`
*
* Minimal influence (after all calculations) of current peak. See `influence`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#min_influence Online documentation}
*/
min_influence?: double
/**
* **Default:** `max double`
*
* Maximal influence (after all calculations) of current peak. See `influence`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#max_influence Online documentation}
*/
max_influence?: double
/**
* **Default:** `0`
*
* Bonus for influence multiplier when calculating richness. See `influence`.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#richness_influence Online documentation}
*/
richness_influence?: double
/**
* **Default:** `""`
*
* Name of {@link NoiseLayer} to use for this peak. If empty, then no noise is added to this peak.
*
* A peak may have a noise multiplied with its influence. Intended use is to have noise layers separate for different types of objects that might appear (trees-12 vs enemy-base).
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#noise_layer Online documentation}
*/
noise_layer?: NoiseLayerID
/**
* **Default:** `0.5`
*
* Must be between 0 and 1. Persistence of the noise.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#noise_persistence Online documentation}
*/
noise_persistence?: double
/**
* **Default:** `0`
*
* Difference between number of octaves of the world and of the noise.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#noise_octaves_difference Online documentation}
*/
noise_octaves_difference?: double
/**
* **Default:** `1`
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#noise_scale Online documentation}
*/
noise_scale?: double
/**
* Optimal value of starting_area_weight. If starting_area_weight is close to this value, peak influence is 1.
*
* starting_area_weight corresponds to the `starting_area_weight` {@link BaseNamedNoiseExpressions noise expression}.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#starting_area_weight_optimal Online documentation}
*/
starting_area_weight_optimal?: double
/**
* **Default:** `0`
*
* Distance from the optimal parameters that is still considered optimal.
*
* Only loaded if `starting_area_weight_optimal` is defined.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#starting_area_weight_range Online documentation}
*/
starting_area_weight_range?: double
/**
* Distance from the optimal parameters that get influence of -1.
*
* Only loaded if `starting_area_weight_optimal` is defined.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#starting_area_weight_max_range Online documentation}
*/
starting_area_weight_max_range?: double
/**
* **Default:** `max double`
*
* Limit distance from the optimum on a single (positive) side. This is pure magic.
*
* Only loaded if `starting_area_weight_optimal` is defined.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#starting_area_weight_top_property_limit Online documentation}
*/
starting_area_weight_top_property_limit?: double
/**
* Optimal value of elevation. If elevation is close to this value, peak influence is 1.
*
* elevation corresponds to the `elevation` {@link BaseNamedNoiseExpressions noise expression}.
* @see {@link https://lua-api.factorio.com/1.1.110/types/AutoplacePeak.html#elevation_optimal Online documentation}
*/
elevation_optimal?: double
/**
* **Default:** `0`
*
* Distance from the optimal parameters that is sti