factorio-types 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,8 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.110
6
- // API version 5
5
+ // Factorio version 2.0.12
6
+ // API version 6
7
7
 
8
8
  declare namespace runtime {
9
9
  interface BaseAchievementPrototypeFilter {
@@ -78,17 +78,13 @@ interface AmmoType {
78
78
  * When `true`, the gun will be able to shoot even when the target is out of range. Only applies when `target_type` is `position`. The gun will fire at the maximum range in the direction of the target position. Defaults to `false`.
79
79
  */
80
80
  clamp_position?: boolean;
81
- /**
82
- * Ammo category of this ammo.
83
- */
84
- category: string;
85
81
  /**
86
82
  * Energy consumption of a single shot, if applicable. Defaults to `0`.
87
83
  */
88
84
  energy_consumption?: double;
89
85
  range_modifier?: double;
90
86
  cooldown_modifier?: double;
91
- consumption_modifier?: double;
87
+ consumption_modifier?: float;
92
88
  }
93
89
  /**
94
90
  * Any basic type (string, number, boolean), table, or LuaObject.
@@ -124,6 +120,42 @@ interface ArithmeticCombinatorParameters {
124
120
  */
125
121
  output_signal?: SignalID;
126
122
  }
123
+ interface AsteroidChunk {
124
+ /**
125
+ * The name of the asteroid chunk prototype.
126
+ */
127
+ name: string;
128
+ position: MapPosition;
129
+ movement: Vector;
130
+ }
131
+ /**
132
+ * An asteroid chunk prototype may be specified in one of two ways.
133
+ */
134
+ type AsteroidChunkID = /**
135
+ * The asteroid chunk prototype.
136
+ */
137
+ LuaAsteroidChunkPrototype | /**
138
+ * The prototype name.
139
+ */
140
+ string;
141
+ interface AsteroidChunkPrototypeFilter {
142
+ /**
143
+ * The condition to filter on.
144
+ */
145
+ filter: 'minable';
146
+ /**
147
+ * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
148
+ */
149
+ mode?: 'or' | 'and';
150
+ /**
151
+ * Inverts the condition. Default is `false`.
152
+ */
153
+ invert?: boolean;
154
+ }
155
+ interface AsteroidMapSettings {
156
+ spawning_rate: double;
157
+ max_ray_portals_expanded_per_tick: uint;
158
+ }
127
159
  interface AttackParameterFluid {
128
160
  /**
129
161
  * Name of the {@link LuaFluidPrototype | runtime:LuaFluidPrototype}.
@@ -150,7 +182,7 @@ interface BaseAttackParameters {
150
182
  /**
151
183
  * Defines how the range is determined.
152
184
  */
153
- range_mode: 'center-to-center' | 'bounding-box-to-bounding-box';
185
+ range_mode: RangeMode;
154
186
  /**
155
187
  * When searching for the nearest enemy to attack, `fire_penalty` is added to the enemy's distance if they are on fire.
156
188
  */
@@ -228,7 +260,7 @@ interface AttackParametersStream extends BaseAttackParameters {
228
260
  }
229
261
  interface AutoplaceControl {
230
262
  /**
231
- * For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number of spots placed per unit area. For continuous features such as forests, frequency is how compressed the probability function is over distance, i.e. the inverse of 'scale' (similar to terrain_segmentation). When the {@link LuaAutoplaceControlPrototype | runtime:LuaAutoplaceControlPrototype} is of the category `"terrain"`, then scale is shown in the map generator GUI instead of frequency.
263
+ * For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number of spots placed per unit area. For continuous features such as forests, frequency is how compressed the probability function is over distance, i.e. the inverse of 'scale'. When the {@link LuaAutoplaceControlPrototype | runtime:LuaAutoplaceControlPrototype} is of the category `"terrain"`, then scale is shown in the map generator GUI instead of frequency.
232
264
  */
233
265
  frequency: MapGenSize;
234
266
  /**
@@ -236,7 +268,7 @@ interface AutoplaceControl {
236
268
  */
237
269
  size: MapGenSize;
238
270
  /**
239
- * Has different effects for different things, but generally affects the 'health' or density of a thing that is placed without affecting where it is placed. For trees, richness affects tree health. For ores, richness multiplies the amount of ore at any given tile in a patch. Metadata about autoplace controls (such as whether or not 'richness' does anything for them) can be found in the {@link LuaAutoplaceControlPrototype | runtime:LuaAutoplaceControlPrototype} by looking up `game.autoplace_control_prototypes[(control prototype name)]`, e.g. `game.autoplace_control_prototypes["enemy-base"].richness` is false, because enemy base autoplacement doesn't use richness.
271
+ * Has different effects for different things, but generally affects the 'health' or density of a thing that is placed without affecting where it is placed. For trees, richness affects tree health. For ores, richness multiplies the amount of ore at any given tile in a patch. Metadata about autoplace controls (such as whether or not 'richness' does anything for them) can be found in the {@link LuaAutoplaceControlPrototype | runtime:LuaAutoplaceControlPrototype} by looking up `prototypes.autoplace_control[(control prototype name)]`, e.g. `prototypes.autoplace_control["enemy-base"].richness` is false, because enemy base autoplacement doesn't use richness.
240
272
  */
241
273
  richness: MapGenSize;
242
274
  }
@@ -251,69 +283,20 @@ interface AutoplaceSettings {
251
283
  settings?: Record<string, AutoplaceControl>;
252
284
  }
253
285
  /**
254
- * Specifies how probability and richness are calculated when placing something on the map. Can be specified either using `probability_expression` and `richness_expression` or by using all the other fields.
286
+ * Specifies how probability and richness are calculated when placing something on the map.
255
287
  */
256
288
  interface AutoplaceSpecification {
257
- probability_expression: NoiseExpression;
258
- richness_expression: NoiseExpression;
259
- coverage: double;
260
- sharpness: double;
261
- max_probability: double;
262
- placement_density: uint;
263
- richness_base: double;
264
- richness_multiplier: double;
265
- richness_multiplier_distance_bonus: double;
266
- starting_area_size: uint;
267
- order: string;
268
- default_enabled: boolean;
269
- peaks?: AutoplaceSpecificationPeak[];
270
289
  /**
271
290
  * Control prototype name.
272
291
  */
273
292
  control?: string;
274
- tile_restriction?: AutoplaceSpecificationRestriction[];
293
+ default_enabled: boolean;
275
294
  force: string;
276
- random_probability_penalty: double;
277
- }
278
- interface AutoplaceSpecificationPeak {
279
- influence: double;
280
- max_influence: double;
281
- min_influence: double;
282
- richness_influence: double;
283
- noisePersistence: double;
284
- /**
285
- * Prototype name of the noise layer.
286
- */
287
- noise_layer?: string;
288
- noise_octaves_difference: double;
289
- water_optimal: double;
290
- water_range: double;
291
- water_max_range: double;
292
- water_top_property_limit: double;
293
- elevation_optimal: double;
294
- elevation_range: double;
295
- elevation_max_range: double;
296
- elevation_top_property_limit: double;
297
- temperature_optimal: double;
298
- temperature_range: double;
299
- temperature_max_range: double;
300
- temperature_top_property_limit: double;
301
- starting_area_weight_optimal: double;
302
- starting_area_weight_range: double;
303
- starting_area_weight_max_range: double;
304
- starting_area_weight_top_property_limit: double;
305
- tier_from_start_optimal: double;
306
- tier_from_start_range: double;
307
- tier_from_start_max_range: double;
308
- tier_from_start_top_property_limit: double;
309
- distance_optimal: double;
310
- distance_range: double;
311
- distance_max_range: double;
312
- distance_top_property_limit: double;
313
- aux_optimal: double;
314
- aux_range: double;
315
- aux_max_range: double;
316
- aux_top_property_limit: double;
295
+ order: string;
296
+ placement_density: uint;
297
+ tile_restriction?: AutoplaceSpecificationRestriction[];
298
+ probability_expression: NoiseExpression;
299
+ richness_expression?: NoiseExpression;
317
300
  }
318
301
  interface AutoplaceSpecificationRestriction {
319
302
  /**
@@ -356,36 +339,128 @@ interface BlueprintEntity {
356
339
  */
357
340
  direction?: defines.direction;
358
341
  /**
359
- * The entity tags of the entity, if there are any. Only relevant for entity ghosts.
342
+ * Whether this entity is mirrored.
360
343
  */
361
- tags?: Tags;
362
- /**
363
- * The items that the entity will request when revived, if there are any. It's a mapping of prototype names to amounts. Only relevant for entity ghosts.
364
- */
365
- items?: Record<string, uint>;
344
+ mirror?: boolean;
366
345
  /**
367
- * The circuit network connections of the entity, if there are any. Only relevant for entities that support circuit connections.
346
+ * The prototype name of the entity's quality.
368
347
  */
369
- connections?: BlueprintCircuitConnection;
348
+ quality?: string;
370
349
  /**
371
350
  * The control behavior of the entity, if it has one. The format of the control behavior depends on the entity's type. Only relevant for entities that support control behaviors.
372
351
  */
373
352
  control_behavior?: BlueprintControlBehavior;
353
+ /**
354
+ * The items that the entity will request when revived, if any.
355
+ */
356
+ items?: BlueprintInsertPlan[];
357
+ /**
358
+ * The entity tags of the entity, if there are any.
359
+ */
360
+ tags?: Tags;
374
361
  /**
375
362
  * The schedule of the entity, if it has one. Only relevant for locomotives.
376
363
  */
377
- schedule?: TrainScheduleRecord[];
364
+ schedule?: BlueprintSchedule;
365
+ /**
366
+ * Wires connected to this entity in the blueprint.
367
+ */
368
+ wires?: BlueprintWire[];
369
+ }
370
+ /**
371
+ * Defines an item type that a blueprint entity will request.
372
+ */
373
+ interface BlueprintInsertPlan {
374
+ /**
375
+ * The prototype name and quality of the item to request.
376
+ */
377
+ id: ItemIDAndQualityIDPair;
378
+ /**
379
+ * Describes the inventories to insert these items into.
380
+ */
381
+ items: ItemInventoryPositions;
382
+ }
383
+ interface BlueprintLogisticFilter {
384
+ index: LogisticFilterIndex;
385
+ /**
386
+ * The type of the logistic filter.
387
+ */
388
+ type?: SignalIDType;
389
+ /**
390
+ * Name of the logistic filter.
391
+ */
392
+ name?: string;
393
+ /**
394
+ * The prototype name of the quality. `nil` for any quality.
395
+ */
396
+ quality?: string;
397
+ /**
398
+ * The comparator for quality. `nil` if any quality.
399
+ */
400
+ comparator?: ComparatorString;
401
+ count: int;
402
+ max_count?: ItemCountType;
403
+ /**
404
+ * Defaults to 0.
405
+ */
406
+ minimum_delivery_count?: ItemCountType;
407
+ import_from?: string;
408
+ }
409
+ interface BlueprintSchedule {
410
+ records?: BlueprintScheduleRecord[];
411
+ group?: string;
412
+ interrupts?: BlueprintScheduleInterrupt[];
413
+ }
414
+ interface BlueprintScheduleInterrupt {
415
+ name?: string;
416
+ conditions?: WaitCondition[];
417
+ targets?: BlueprintScheduleRecord[];
418
+ inside_interrupt: boolean;
419
+ }
420
+ interface BlueprintScheduleRecord {
421
+ /**
422
+ * Name of the station.
423
+ */
424
+ station?: string;
425
+ wait_conditions?: WaitCondition[];
426
+ /**
427
+ * Only present when the station is temporary, the value is then always `true`.
428
+ */
429
+ temporary?: boolean;
430
+ created_by_interrupt?: boolean;
431
+ allows_unloading?: boolean;
378
432
  }
379
433
  interface BlueprintSignalIcon {
380
434
  /**
381
- * The icon to use. It can be any item icon as well as any virtual signal icon.
435
+ * The icon to use.
382
436
  */
383
437
  signal: SignalID;
384
438
  /**
385
- * Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4].
439
+ * Index of the icon in the blueprint icons slots. An integer in the range [1, 4].
386
440
  */
387
441
  index: uint;
388
442
  }
443
+ /**
444
+ * Describes a single wire in the blueprint. The members of the tuple are, in order:
445
+ *
446
+ * - `source_entity_number`
447
+ *
448
+ * - `source_wire_connector_id`
449
+ *
450
+ * - `target_entity_number`
451
+ *
452
+ * - `target_wire_connector_id`
453
+ */
454
+ type BlueprintWire = [
455
+ uint,
456
+ defines.wire_connector_id,
457
+ uint,
458
+ defines.wire_connector_id
459
+ ];
460
+ interface BlueprintWireEnd {
461
+ entity: BlueprintEntity;
462
+ connector: defines.wire_connector_id;
463
+ }
389
464
  /**
390
465
  * Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition | runtime:MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero.
391
466
  * @example ```
@@ -405,6 +480,13 @@ type BoundingBox = {
405
480
  MapPosition,
406
481
  MapPosition
407
482
  ];
483
+ /**
484
+ * The name of a {@link LuaBurnerUsagePrototype | runtime:LuaBurnerUsagePrototype}.
485
+ * @example ```
486
+ "fuel"
487
+ ```
488
+ */
489
+ type BurnerUsageID = string;
408
490
  interface BaseCapsuleAction {
409
491
  type: 'throw' | 'equipment-remote' | 'use-on-self' | 'artillery-remote' | 'destroy-cliffs';
410
492
  }
@@ -507,21 +589,16 @@ interface CircuitCondition {
507
589
  constant?: int;
508
590
  }
509
591
  interface CircuitConditionDefinition {
592
+ /**
593
+ * TODOC CircuitConditionDefinition now extends CircuitCondition, all fields of CircuitCondition should be pasted here directly
594
+ */
510
595
  condition: CircuitCondition;
511
596
  /**
512
597
  * Whether the condition is currently fulfilled
513
598
  */
514
599
  fulfilled?: boolean;
515
600
  }
516
- interface CircuitConnectionDefinition {
517
- /**
518
- * Wire color, either {@link defines.wire_type.red | runtime:defines.wire_type.red} or {@link defines.wire_type.green | runtime:defines.wire_type.green}.
519
- */
520
- wire: defines.wire_type;
521
- target_entity: LuaEntity;
522
- source_circuit_id: defines.circuit_connector_id;
523
- target_circuit_id: defines.circuit_connector_id;
524
- }
601
+ type CircuitNetworkSelection = table;
525
602
  interface CircularParticleCreationSpecification {
526
603
  /**
527
604
  * Name of the {@link LuaEntityPrototype | runtime:LuaEntityPrototype}.
@@ -537,9 +614,6 @@ interface CircularParticleCreationSpecification {
537
614
  height_deviation: float;
538
615
  vertical_speed: float;
539
616
  vertical_speed_deviation: float;
540
- /**
541
- * This vector is a table with `x` and `y` keys instead of an array.
542
- */
543
617
  center: Vector;
544
618
  creation_distance: double;
545
619
  creation_distance_orientation: double;
@@ -555,6 +629,10 @@ interface CliffPlacementSettings {
555
629
  * Name of the cliff prototype.
556
630
  */
557
631
  name: string;
632
+ /**
633
+ * Name of the autoplace control prototype.
634
+ */
635
+ control: string;
558
636
  /**
559
637
  * Elevation at which the first row of cliffs is placed. The default is `10`, and this cannot be set from the map generation GUI.
560
638
  */
@@ -563,34 +641,46 @@ interface CliffPlacementSettings {
563
641
  * Elevation difference between successive rows of cliffs. This is inversely proportional to 'frequency' in the map generation GUI. Specifically, when set from the GUI the value is `40 / frequency`.
564
642
  */
565
643
  cliff_elevation_interval: float;
644
+ /**
645
+ * Smoothing makes cliffs straighter on rough elevation but makes placement inaccurate. 0 is no smoothing, 1 is full smoothing. Values outside of 0-1 are possible for specific effects but not recommended.
646
+ */
647
+ cliff_smoothing: float;
566
648
  /**
567
649
  * Corresponds to 'continuity' in the GUI. This value is not used directly, but is used by the 'cliffiness' noise expression, which in combination with elevation and the two cliff elevation properties drives cliff placement (cliffs are placed when elevation crosses the elevation contours defined by `cliff_elevation_0` and `cliff_elevation_interval` when 'cliffiness' is greater than `0.5`). The default 'cliffiness' expression interprets this value such that larger values result in longer unbroken walls of cliffs, and smaller values (between `0` and `1`) result in larger gaps in cliff walls.
568
650
  */
569
651
  richness: MapGenSize;
570
652
  }
571
653
  /**
572
- * A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all.
573
- */
574
- type CollisionMask = Record<CollisionMaskLayer, true>;
575
- /**
576
- * A {@link string | runtime:string} specifying a collision mask layer.
577
- *
578
- * In addition to the listed layers, there is `"layer-13"` through `"layer-55"`. These layers are currently unused by the game but may change. If a mod is going to use one of the unused layers it's recommended to start at the higher layers because the base game will take from the lower ones.
654
+ * The name of a {@link LuaCollisionLayerPrototype | runtime:LuaCollisionLayerPrototype}.
655
+ * @example ```
656
+ "is_lower_object"
657
+ ```
579
658
  */
580
- type CollisionMaskLayer = 'ground-tile' | 'water-tile' | 'resource-layer' | 'doodad-layer' | 'floor-layer' | 'item-layer' | 'ghost-layer' | 'object-layer' | 'player-layer' | 'train-layer' | 'rail-layer' | 'transport-belt-layer' | 'not-setup' | 'layer-13' | 'layer-14' | 'layer-15' | 'layer-16' | 'layer-17' | 'layer-18' | 'layer-19' | 'layer-20' | 'layer-21' | 'layer-22' | 'layer-23' | 'layer-24' | 'layer-25' | 'layer-26' | 'layer-27' | 'layer-28' | 'layer-29' | 'layer-30' | 'layer-31' | 'layer-32' | 'layer-33' | 'layer-34' | 'layer-35' | 'layer-36' | 'layer-37' | 'layer-38' | 'layer-39' | 'layer-40' | 'layer-41' | 'layer-42' | 'layer-43' | 'layer-44' | 'layer-45' | 'layer-46' | 'layer-47' | 'layer-48' | 'layer-49' | 'layer-50' | 'layer-51' | 'layer-52' | 'layer-53' | 'layer-54' | 'layer-55';
659
+ type CollisionLayerID = string;
581
660
  /**
582
- * A {@link CollisionMask | runtime:CollisionMask} which also includes any flags this mask has.
583
- */
584
- type CollisionMaskWithFlags = Record<CollisionMaskLayer | /**
585
- * Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. Other collision mask options are not included in the identical layer list check. This does mean that two different prototypes with the same collision mask layers and this option enabled will not collide.
586
- */
587
- 'not-colliding-with-itself' | /**
588
- * Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. Allows the prototype to overlap colliding tiles up until its center point. This is only respected for character movement and cars driven by players.
589
- */
590
- 'consider-tile-transitions' | /**
591
- * Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile.
661
+ * @example ```
662
+ -- Most common collision mask of buildings:
663
+ collision_mask = {layers = {item = true, meltable = true, object = true, player = true, water_tile = true, is_object = true, is_lower_object = true}}
664
+ ```
592
665
  */
593
- 'colliding-with-tiles-only', true>;
666
+ interface CollisionMask {
667
+ /**
668
+ * Every key in the dictionary is the name of one {@link layer | runtime:LuaCollisionLayerPrototype} the object collides with. The value is meaningless and always `true`. An empty table means that no layers are set.
669
+ */
670
+ layers: Record<string, true>;
671
+ /**
672
+ * Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. Other collision mask options are not included in the identical layer list check. This does mean that two different prototypes with the same collision mask layers and this option enabled will not collide. Defaults to `false`.
673
+ */
674
+ not_colliding_with_itself?: boolean;
675
+ /**
676
+ * Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. Allows the prototype to overlap colliding tiles up until its center point. This is only respected for character movement and cars driven by players. Defaults to `false`.
677
+ */
678
+ consider_tile_transitions?: boolean;
679
+ /**
680
+ * Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile. Defaults to `false`.
681
+ */
682
+ colliding_with_tiles_only?: boolean;
683
+ }
594
684
  /**
595
685
  * Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. All values here are optional. Color channels default to `0`, the alpha channel defaults to `1`.
596
686
  *
@@ -781,7 +871,7 @@ interface CommandGroup extends BaseCommand {
781
871
  /**
782
872
  * The group whose command to follow.
783
873
  */
784
- 'group': LuaUnitGroup;
874
+ 'group': LuaCommandable;
785
875
  /**
786
876
  * Whether the unit will use the group distraction or the commands distraction. Defaults to true.
787
877
  */
@@ -864,6 +954,31 @@ type ComparatorString = /**
864
954
  * "not equal to"
865
955
  */
866
956
  '!=';
957
+ interface CompiledLogisticFilter {
958
+ index: LogisticFilterIndex;
959
+ /**
960
+ * The type of the logistic filter.
961
+ */
962
+ type?: SignalIDType;
963
+ /**
964
+ * Name of the logistic filter.
965
+ */
966
+ name?: string;
967
+ /**
968
+ * The prototype name of the quality. `nil` for any quality.
969
+ */
970
+ quality?: string;
971
+ /**
972
+ * The comparator for quality. `nil` if any quality.
973
+ */
974
+ comparator?: ComparatorString;
975
+ count: int;
976
+ max_count?: ItemCountType;
977
+ /**
978
+ * Defaults to 0.
979
+ */
980
+ minimum_delivery_count?: ItemCountType;
981
+ }
867
982
  interface ConfigurationChangedData {
868
983
  /**
869
984
  * Old version of the map. Present only when loading map version other than the current version.
@@ -886,25 +1001,6 @@ interface ConfigurationChangedData {
886
1001
  */
887
1002
  migration_applied: boolean;
888
1003
  }
889
- interface ConstantCombinatorParameters {
890
- /**
891
- * Signal to emit.
892
- */
893
- signal: SignalID;
894
- /**
895
- * Value of the signal to emit.
896
- */
897
- count: int;
898
- /**
899
- * Index of the constant combinator's slot to set this signal to.
900
- */
901
- index: uint;
902
- }
903
- interface CopperConnectionDefinition {
904
- source_wire_connector: defines.wire_connection_id;
905
- target_entity: LuaEntity;
906
- target_wire_connector: defines.wire_connection_id;
907
- }
908
1004
  interface CraftingQueueItem {
909
1005
  /**
910
1006
  * The index of the item in the crafting queue.
@@ -923,13 +1019,13 @@ interface CraftingQueueItem {
923
1019
  */
924
1020
  prerequisite: boolean;
925
1021
  }
926
- /**
927
- * One of the following values:
928
- */
929
1022
  type CursorBoxRenderType = /**
930
1023
  * The normal entity selection box. Yellow by default.
931
1024
  */
932
1025
  'entity' | /**
1026
+ * The multiplayer entity selection box which gets tinted using {@link LuaPlayer::chat_color | runtime:LuaPlayer::chat_color}. White by default.
1027
+ */
1028
+ 'multiplayer-entity' | /**
933
1029
  * The selection box used to specify electric poles an entity is connected to. Light blue by default.
934
1030
  */
935
1031
  'electricity' | /**
@@ -950,7 +1046,7 @@ type CursorBoxRenderType = /**
950
1046
  'train-visualization' | /**
951
1047
  * Green by default.
952
1048
  */
953
- 'blueprint-snap-rectangle';
1049
+ 'blueprint-snap-rectangle' | 'spidertron-remote-selected' | 'spidertron-remote-to-be-selected';
954
1050
  interface CustomCommandData {
955
1051
  /**
956
1052
  * The name of the command.
@@ -969,6 +1065,10 @@ interface CustomCommandData {
969
1065
  */
970
1066
  parameter?: string;
971
1067
  }
1068
+ interface CustomEntityStatus {
1069
+ diode: defines.entity_status_diode;
1070
+ label: LocalisedString;
1071
+ }
972
1072
  interface CutsceneWaypoint {
973
1073
  /**
974
1074
  * Position to pan the camera to.
@@ -977,7 +1077,7 @@ interface CutsceneWaypoint {
977
1077
  /**
978
1078
  * Entity or unit group to pan the camera to.
979
1079
  */
980
- target?: LuaEntity | LuaUnitGroup;
1080
+ target?: LuaEntity | LuaCommandable;
981
1081
  /**
982
1082
  * How many ticks it will take to reach this waypoint from the previous one.
983
1083
  */
@@ -1001,31 +1101,27 @@ interface DamageTypeFilters {
1001
1101
  */
1002
1102
  types: Record<string, true>;
1003
1103
  }
1104
+ /**
1105
+ * A damage type prototype may be specified in one of two ways.
1106
+ */
1107
+ type DamageTypeID = /**
1108
+ * The damage type prototype.
1109
+ */
1110
+ LuaDamagePrototype | /**
1111
+ * The prototype name.
1112
+ */
1113
+ string;
1114
+ type DeciderCombinatorCondition = table;
1115
+ type DeciderCombinatorOutput = table;
1004
1116
  interface DeciderCombinatorParameters {
1005
1117
  /**
1006
- * Defaults to blank.
1118
+ * List of conditions.
1007
1119
  */
1008
- first_signal?: SignalID;
1009
- /**
1010
- * Second signal to use in an operation, if any. If this is not specified, the second argument to a decider combinator's operation is assumed to be the value of `constant`.
1011
- */
1012
- second_signal?: SignalID;
1013
- /**
1014
- * Constant to use as the second argument of operation. Defaults to `0`.
1015
- */
1016
- constant?: uint;
1017
- /**
1018
- * Specifies how the inputs should be compared. If not specified, defaults to `"<"`.
1019
- */
1020
- comparator?: ComparatorString;
1021
- /**
1022
- * Defaults to blank.
1023
- */
1024
- output_signal?: SignalID;
1120
+ conditions: DeciderCombinatorCondition[];
1025
1121
  /**
1026
- * Defaults to `true`. When `false`, will output a value of `1` for the given `output_signal`.
1122
+ * List of outputs.
1027
1123
  */
1028
- copy_count_from_input?: boolean;
1124
+ outputs: DeciderCombinatorOutput[];
1029
1125
  }
1030
1126
  interface Decorative {
1031
1127
  /**
@@ -1035,6 +1131,16 @@ interface Decorative {
1035
1131
  position: TilePosition;
1036
1132
  amount: uint8;
1037
1133
  }
1134
+ /**
1135
+ * A decorative prototype may be specified in one of two ways.
1136
+ */
1137
+ type DecorativeID = /**
1138
+ * The decorative prototype.
1139
+ */
1140
+ LuaDecorativePrototype | /**
1141
+ * The prototype name.
1142
+ */
1143
+ string;
1038
1144
  interface BaseDecorativePrototypeFilter {
1039
1145
  /**
1040
1146
  * The condition to filter on.
@@ -1059,7 +1165,10 @@ interface DecorativePrototypeFilterCollisionMask extends BaseDecorativePrototype
1059
1165
  * The condition to filter on.
1060
1166
  */
1061
1167
  'filter': 'collision-mask';
1062
- 'mask': CollisionMask | CollisionMaskWithFlags;
1168
+ /**
1169
+ * Name of one {@link layer | runtime:LuaCollisionLayerPrototype} or a full collision mask.
1170
+ */
1171
+ 'mask': CollisionLayerID | CollisionMask;
1063
1172
  /**
1064
1173
  * How to filter.
1065
1174
  */
@@ -1070,21 +1179,44 @@ interface DecorativeResult {
1070
1179
  decorative: LuaDecorativePrototype;
1071
1180
  amount: uint;
1072
1181
  }
1182
+ interface DetailedItemOnLine {
1183
+ stack: LuaItemStack;
1184
+ /**
1185
+ * Linear position of this stack on this line.
1186
+ */
1187
+ position: float;
1188
+ /**
1189
+ * Unique identifier of this item while it is on transport lines.
1190
+ */
1191
+ unique_id: uint;
1192
+ }
1073
1193
  /**
1074
- * Technology and recipe difficulty settings. Updating any of the attributes will immediately take effect in the game engine.
1194
+ * Technology difficulty settings. Updating any of the attributes will immediately take effect in the game engine.
1075
1195
  */
1076
1196
  interface DifficultySettings {
1077
- recipe_difficulty: defines.difficulty_settings.recipe_difficulty;
1078
1197
  /**
1079
- * Changing this to `"always"` or `"after-victory"` does not automatically unlock the research queue. See {@link LuaForce::research_queue_enabled | runtime:LuaForce::research_queue_enabled} for that.
1198
+ * A value in range [0.01, 100].
1080
1199
  */
1081
- research_queue_setting: 'after-victory' | 'always' | 'never';
1082
- technology_difficulty: defines.difficulty_settings.technology_difficulty;
1200
+ spoil_time_modifier: double;
1083
1201
  /**
1084
1202
  * A value in range [0.001, 1000].
1085
1203
  */
1086
1204
  technology_price_multiplier: double;
1087
1205
  }
1206
+ interface DisplayPanelMessageDefinition {
1207
+ /**
1208
+ * The message to show.
1209
+ */
1210
+ text: string;
1211
+ /**
1212
+ * The icon to show alongside the message.
1213
+ */
1214
+ icon: SignalID;
1215
+ /**
1216
+ * The circuit condition under which to show the message.
1217
+ */
1218
+ condition: CircuitConditionDefinition;
1219
+ }
1088
1220
  interface DisplayResolution {
1089
1221
  width: uint;
1090
1222
  height: uint;
@@ -1092,13 +1224,15 @@ interface DisplayResolution {
1092
1224
  interface DragTarget {
1093
1225
  target_entity: LuaEntity;
1094
1226
  /**
1095
- * If the wire being dragged is a circuit wire this is the connector id.
1096
- */
1097
- target_circuit_id?: defines.circuit_connector_id;
1098
- /**
1099
- * If the wire being dragged is copper wire this is the wire id.
1227
+ * Identifier of the wire connector from which the wire is being dragged.
1100
1228
  */
1101
- target_wire_id?: defines.wire_connection_id;
1229
+ wire_connector_id: defines.wire_connector_id;
1230
+ }
1231
+ interface EffectReceiver {
1232
+ base_effect: ModuleEffects;
1233
+ uses_module_effects: boolean;
1234
+ uses_beacon_effects: boolean;
1235
+ uses_surface_effects: boolean;
1102
1236
  }
1103
1237
  interface ElemID {
1104
1238
  type: ElemType;
@@ -1106,11 +1240,15 @@ interface ElemID {
1106
1240
  * Name of a prototype as defined by `type`.
1107
1241
  */
1108
1242
  name: string;
1243
+ /**
1244
+ * Name of a quality prototype if `type` use quality.
1245
+ */
1246
+ quality?: string;
1109
1247
  }
1110
1248
  /**
1111
1249
  * A {@link string | runtime:string} specifying a type for {@link choose elem buttons | runtime:LuaGuiElement::elem_type}. It's also used by {@link ElemID | runtime:ElemID} for {@link LuaGuiElement::elem_tooltip | runtime:LuaGuiElement::elem_tooltip}.
1112
1250
  */
1113
- type ElemType = 'achievement' | 'decorative' | 'entity' | 'equipment' | 'fluid' | 'item' | 'item-group' | 'recipe' | 'signal' | 'technology' | 'tile';
1251
+ type ElemType = 'achievement' | 'decorative' | 'entity' | 'equipment' | 'fluid' | 'item' | 'item-group' | 'recipe' | 'signal' | 'technology' | 'tile' | 'asteroid-chunk' | 'space-location' | 'item-with-quality' | 'entity-with-quality' | 'recipe-with-quality' | 'equipment-with-quality';
1114
1252
  /**
1115
1253
  * These values represent a percentual increase in evolution. This means a value of `0.1` would increase evolution by 10%.
1116
1254
  */
@@ -1136,6 +1274,7 @@ interface EnemyEvolutionMapSettings {
1136
1274
  * Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into account various settings noted below. The iteration is over a square region centered around the chunk for which the calculation is done, and includes the central chunk as well. Distances are calculated as {@link Manhattan distance | https://en.wikipedia.org/wiki/Taxicab_geometry}.
1137
1275
  *
1138
1276
  * The pseudocode algorithm to determine a chunk's score is as follows:
1277
+ *
1139
1278
  * ```
1140
1279
  * player = 0
1141
1280
  * for neighbour in all chunks within enemy_building_influence_radius from chunk:
@@ -1204,11 +1343,51 @@ interface EnemyExpansionMapSettings {
1204
1343
  */
1205
1344
  max_expansion_cooldown: uint;
1206
1345
  }
1346
+ /**
1347
+ * An entity prototype may be specified in one of three ways.
1348
+ */
1349
+ type EntityID = /**
1350
+ * The entity prototype.
1351
+ */
1352
+ LuaEntityPrototype | /**
1353
+ * The entity.
1354
+ */
1355
+ LuaEntity | /**
1356
+ * The prototype name.
1357
+ */
1358
+ string;
1359
+ /**
1360
+ * An entity prototype with optional quality specification.
1361
+ */
1362
+ interface EntityIDAndQualityIDPair {
1363
+ /**
1364
+ * Entity prototype.
1365
+ */
1366
+ name: EntityID;
1367
+ /**
1368
+ * Quality prototype. Normal quality will be used if not specified.
1369
+ */
1370
+ quality?: QualityID;
1371
+ }
1372
+ interface EntityIDFilter {
1373
+ /**
1374
+ * The entity name.
1375
+ */
1376
+ name: string;
1377
+ /**
1378
+ * The name of the quality.
1379
+ */
1380
+ quality?: string;
1381
+ /**
1382
+ * The quality comparison type.
1383
+ */
1384
+ comparator?: ComparatorString;
1385
+ }
1207
1386
  interface BaseEntityPrototypeFilter {
1208
1387
  /**
1209
1388
  * The condition to filter on.
1210
1389
  */
1211
- filter: 'flying-robot' | 'robot-with-logistics-interface' | 'rail' | 'ghost' | 'explosion' | 'vehicle' | 'crafting-machine' | 'rolling-stock' | 'turret' | 'transport-belt-connectable' | 'wall-connectable' | 'buildable' | 'placable-in-editor' | 'clonable' | 'selectable' | 'hidden' | 'entity-with-health' | 'building' | 'fast-replaceable' | 'uses-direction' | 'minable' | 'circuit-connectable' | 'autoplace' | 'blueprintable' | 'item-to-place' | 'name' | 'type' | 'collision-mask' | 'flag' | 'build-base-evolution-requirement' | 'selection-priority' | 'emissions' | 'crafting-category';
1390
+ filter: 'flying-robot' | 'robot-with-logistics-interface' | 'rail' | 'ghost' | 'explosion' | 'vehicle' | 'crafting-machine' | 'rolling-stock' | 'turret' | 'transport-belt-connectable' | 'wall-connectable' | 'buildable' | 'placable-in-editor' | 'clonable' | 'selectable' | 'hidden' | 'entity-with-health' | 'building' | 'fast-replaceable' | 'uses-direction' | 'minable' | 'circuit-connectable' | 'autoplace' | 'blueprintable' | 'item-to-place' | 'name' | 'type' | 'collision-mask' | 'flag' | 'build-base-evolution-requirement' | 'selection-priority' | 'emissions-per-second' | 'crafting-category';
1212
1391
  /**
1213
1392
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
1214
1393
  */
@@ -1218,7 +1397,7 @@ interface BaseEntityPrototypeFilter {
1218
1397
  */
1219
1398
  invert?: boolean;
1220
1399
  }
1221
- type EntityPrototypeFilter = BaseEntityPrototypeFilter | EntityPrototypeFilterBuildBaseEvolutionRequirement | EntityPrototypeFilterCollisionMask | EntityPrototypeFilterCraftingCategory | EntityPrototypeFilterEmissions | EntityPrototypeFilterFlag | EntityPrototypeFilterName | EntityPrototypeFilterSelectionPriority | EntityPrototypeFilterType;
1400
+ type EntityPrototypeFilter = BaseEntityPrototypeFilter | EntityPrototypeFilterBuildBaseEvolutionRequirement | EntityPrototypeFilterCollisionMask | EntityPrototypeFilterCraftingCategory | EntityPrototypeFilterEmissionsPerSecond | EntityPrototypeFilterFlag | EntityPrototypeFilterName | EntityPrototypeFilterSelectionPriority | EntityPrototypeFilterType;
1222
1401
  /**
1223
1402
  *
1224
1403
  * Applies to variant case `build-base-evolution-requirement`
@@ -1238,7 +1417,7 @@ interface EntityPrototypeFilterBuildBaseEvolutionRequirement extends BaseEntityP
1238
1417
  * Usage example:
1239
1418
  *
1240
1419
  * ```
1241
- * game.get_filtered_entity_prototypes({{filter = "collision-mask", mask = "player-layer", mask_mode = "collides"}})
1420
+ * prototypes.get_entity_filtered({{filter = "collision-mask", mask = "player", mask_mode = "collides"}})
1242
1421
  * ```
1243
1422
  * Applies to variant case `collision-mask`
1244
1423
  */
@@ -1247,7 +1426,10 @@ interface EntityPrototypeFilterCollisionMask extends BaseEntityPrototypeFilter {
1247
1426
  * The condition to filter on.
1248
1427
  */
1249
1428
  'filter': 'collision-mask';
1250
- 'mask': CollisionMask | CollisionMaskWithFlags;
1429
+ /**
1430
+ * Name of one {@link layer | runtime:LuaCollisionLayerPrototype} or a full collision mask.
1431
+ */
1432
+ 'mask': CollisionLayerID | CollisionMask;
1251
1433
  'mask_mode': 'collides' | 'layers-equals' | 'contains-any' | 'contains-all';
1252
1434
  }
1253
1435
  /**
@@ -1266,14 +1448,18 @@ interface EntityPrototypeFilterCraftingCategory extends BaseEntityPrototypeFilte
1266
1448
  }
1267
1449
  /**
1268
1450
  *
1269
- * Applies to variant case `emissions`
1451
+ * Applies to variant case `emissions-per-second`
1270
1452
  */
1271
- interface EntityPrototypeFilterEmissions extends BaseEntityPrototypeFilter {
1453
+ interface EntityPrototypeFilterEmissionsPerSecond extends BaseEntityPrototypeFilter {
1272
1454
  /**
1273
1455
  * The condition to filter on.
1274
1456
  */
1275
- 'filter': 'emissions';
1457
+ 'filter': 'emissions-per-second';
1276
1458
  'comparison': ComparatorString;
1459
+ /**
1460
+ * The name of a pollutant type to check.
1461
+ */
1462
+ 'pollutant': string;
1277
1463
  /**
1278
1464
  * The value to compare against.
1279
1465
  */
@@ -1283,7 +1469,7 @@ interface EntityPrototypeFilterEmissions extends BaseEntityPrototypeFilter {
1283
1469
  * Usage example:
1284
1470
  *
1285
1471
  * ```
1286
- * game.get_filtered_entity_prototypes({{filter = "flag", flag = "placeable-player"}, {filter = "flag", flag = "placeable-enemy", mode = "and"}})
1472
+ * prototypes.get_entity_filtered({{filter = "flag", flag = "placeable-player"}, {filter = "flag", flag = "placeable-enemy", mode = "and"}})
1287
1473
  * ```
1288
1474
  * Applies to variant case `flag`
1289
1475
  */
@@ -1328,7 +1514,7 @@ interface EntityPrototypeFilterSelectionPriority extends BaseEntityPrototypeFilt
1328
1514
  /**
1329
1515
  * Usage example:
1330
1516
  * ```
1331
- * game.get_filtered_entity_prototypes({{filter = "type", type = "unit"}})
1517
+ * prototypes.get_entity_filtered({{filter = "type", type = "unit"}})
1332
1518
  * ```
1333
1519
  * Applies to variant case `type`
1334
1520
  */
@@ -1370,9 +1556,9 @@ type EntityPrototypeFlag = /**
1370
1556
  * Used to automatically detect the proper direction of the entity if possible. Used by the pump, train stop, and train signal by default.
1371
1557
  */
1372
1558
  'filter-directions' | /**
1373
- * Fast replace will not apply when building while moving.
1559
+ * When set, entity will be possible to obtain by using {@link LuaGameScript::get_entity_by_unit_number | runtime:LuaGameScript::get_entity_by_unit_number}. It also changes input actions sent by a player to be selecting entity by unit number instead of a position which may help players in latency to select moving entities.
1374
1560
  */
1375
- 'fast-replaceable-no-build-while-moving' | /**
1561
+ 'get-by-unit-number' | /**
1376
1562
  * Used to specify that the entity breathes air, and is thus affected by poison.
1377
1563
  */
1378
1564
  'breaths-air' | /**
@@ -1388,15 +1574,9 @@ type EntityPrototypeFlag = /**
1388
1574
  * Prevents the entity from being part of a blueprint.
1389
1575
  */
1390
1576
  'not-blueprintable' | /**
1391
- * Hides the entity from the bonus GUI and from the "made in"-property of recipe tooltips.
1392
- */
1393
- 'hidden' | /**
1394
1577
  * Hides the alt-info of this entity when in alt-mode.
1395
1578
  */
1396
- 'hide-alt-info' | /**
1397
- * Does not fast replace this entity over other entity types when building while moving.
1398
- */
1399
- 'fast-replaceable-no-cross-type-while-moving' | 'no-gap-fill-while-building' | /**
1579
+ 'hide-alt-info' | 'no-gap-fill-while-building' | /**
1400
1580
  * Does not apply fire stickers to the entity.
1401
1581
  */
1402
1582
  'not-flammable' | /**
@@ -1417,27 +1597,98 @@ type EntityPrototypeFlag = /**
1417
1597
  'not-upgradable' | /**
1418
1598
  * Prevents the entity from being shown in the kill statistics.
1419
1599
  */
1420
- 'not-in-kill-statistics' | /**
1600
+ 'not-in-kill-statistics' | 'building-direction-16-way' | 'snap-to-rail-support-spot' | /**
1421
1601
  * Prevents the entity from being shown in the "made in" list in recipe tooltips.
1422
1602
  */
1423
1603
  'not-in-made-in';
1424
1604
  /**
1425
- * A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all. By default, none of these flags are set.
1605
+ * A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all.
1606
+ *
1607
+ * By default, none of these flags are set.
1426
1608
  */
1427
1609
  type EntityPrototypeFlags = Record<EntityPrototypeFlag, true>;
1610
+ interface EntitySearchFilters {
1611
+ area?: BoundingBox;
1612
+ /**
1613
+ * Has precedence over area field.
1614
+ */
1615
+ position?: MapPosition;
1616
+ /**
1617
+ * If given with position, will return all entities within the radius of the position.
1618
+ */
1619
+ radius?: double;
1620
+ /**
1621
+ * An empty array means nothing matches the name filter.
1622
+ */
1623
+ name?: EntityID | EntityID[];
1624
+ /**
1625
+ * An empty array means nothing matches the type filter.
1626
+ */
1627
+ type?: string | string[];
1628
+ /**
1629
+ * An empty array means nothing matches the ghost_name filter.
1630
+ */
1631
+ ghost_name?: EntityID | EntityID[];
1632
+ /**
1633
+ * An empty array means nothing matches the ghost_type filter.
1634
+ */
1635
+ ghost_type?: string | string[];
1636
+ direction?: defines.direction | defines.direction[];
1637
+ collision_mask?: CollisionLayerID | CollisionLayerID[] | Record<CollisionLayerID, true>;
1638
+ force?: ForceSet;
1639
+ to_be_deconstructed?: boolean;
1640
+ to_be_upgraded?: boolean;
1641
+ limit?: uint;
1642
+ is_military_target?: boolean;
1643
+ has_item_inside?: ItemWithQualityID;
1644
+ quality?: QualityCondition;
1645
+ /**
1646
+ * Whether the filters should be inverted.
1647
+ */
1648
+ invert?: boolean;
1649
+ }
1428
1650
  /**
1429
- * An entity prototype may be specified in one of three ways.
1651
+ * An entity prototype with optional quality specification. Can be specified in one of four ways.
1430
1652
  */
1431
- type EntityPrototypeIdentification = /**
1432
- * The entity.
1653
+ type EntityWithQualityID = /**
1654
+ * The entity. Both prototype and quality of the entity will be used.
1433
1655
  */
1434
1656
  LuaEntity | /**
1435
- * The entity prototype.
1657
+ * The entity prototype. Normal quality will be used.
1436
1658
  */
1437
1659
  LuaEntityPrototype | /**
1438
- * The prototype name.
1660
+ * The prototype name. Normal quality will be used.
1661
+ */
1662
+ string | /**
1663
+ * A table of entity prototype and quality.
1664
+ */
1665
+ EntityIDAndQualityIDPair;
1666
+ /**
1667
+ * An equipment prototype may be specified in one of three ways.
1668
+ */
1669
+ type EquipmentID = /**
1670
+ * The equipment prototype.
1671
+ */
1672
+ LuaEquipmentPrototype | /**
1673
+ * The equipment.
1674
+ */
1675
+ LuaEquipment | /**
1676
+ * The prototype name.
1439
1677
  */
1440
1678
  string;
1679
+ /**
1680
+ * An equipment prototype with optional quality specification.
1681
+ */
1682
+ interface EquipmentIDAndQualityIDPair {
1683
+ /**
1684
+ * Equipment prototype.
1685
+ */
1686
+ name: EquipmentID;
1687
+ /**
1688
+ * Quality prototype. Normal quality will be used if not specified.
1689
+ */
1690
+ quality?: QualityID;
1691
+ }
1441
1692
  /**
1442
1693
  * A table used to define a manual shape for a piece of equipment.
1443
1694
  */
@@ -1493,6 +1744,22 @@ interface EquipmentPrototypeFilterType extends BaseEquipmentPrototypeFilter {
1493
1744
  */
1494
1745
  'type': string | string[];
1495
1746
  }
1747
+ /**
1748
+ * An equipment prototype with optional quality specification.
1749
+ */
1750
+ type EquipmentWithQualityID = /**
1751
+ * The equipment prototype. Normal quality will be used.
1752
+ */
1753
+ LuaEquipmentPrototype | /**
1754
+ * The equipment. Both prototype and quality of the provided equipment will be used.
1755
+ */
1756
+ LuaEquipment | /**
1757
+ * The prototype name. Normal quality will be used.
1758
+ */
1759
+ string | /**
1760
+ * A table of equipment prototype and quality.
1761
+ */
1762
+ EquipmentIDAndQualityIDPair;
1496
1763
  /**
1497
1764
  * Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@link the list of Factorio events | runtime:events} for more information on these.
1498
1765
  */
@@ -1515,7 +1782,7 @@ interface EventData {
1515
1782
  *
1516
1783
  * Filters are always used as an array of filters of a specific type. Every filter can only be used with its corresponding event, and different types of event filters can not be mixed.
1517
1784
  */
1518
- type EventFilter = (LuaScriptRaisedDestroyEventFilter | LuaScriptRaisedReviveEventFilter | LuaScriptRaisedBuiltEventFilter | LuaPostEntityDiedEventFilter | LuaEntityDiedEventFilter | LuaPlayerBuiltEntityEventFilter | LuaEntityMarkedForDeconstructionEventFilter | LuaRobotMinedEntityEventFilter | LuaPreGhostDeconstructedEventFilter | LuaEntityMarkedForUpgradeEventFilter | LuaUpgradeCancelledEventFilter | LuaSectorScannedEventFilter | LuaPreGhostUpgradedEventFilter | LuaPreRobotMinedEntityEventFilter | LuaEntityDeconstructionCancelledEventFilter | LuaEntityDamagedEventFilter | LuaScriptRaisedTeleportedEventFilter | LuaEntityClonedEventFilter | LuaPlayerRepairedEntityEventFilter | LuaRobotBuiltEntityEventFilter | LuaPlayerMinedEntityEventFilter | LuaPrePlayerMinedEntityEventFilter)[];
1785
+ type EventFilter = (LuaPrePlatformMinedEntityEventFilter | LuaRobotMinedEntityEventFilter | LuaEntityMarkedForUpgradeEventFilter | LuaPreGhostUpgradedEventFilter | LuaPlatformMinedEntityEventFilter | LuaScriptRaisedDestroyEventFilter | LuaPlayerBuiltEntityEventFilter | LuaPlatformBuiltEntityEventFilter | LuaPreGhostDeconstructedEventFilter | LuaEntityClonedEventFilter | LuaScriptRaisedTeleportedEventFilter | LuaEntityDeconstructionCancelledEventFilter | LuaRobotBuiltEntityEventFilter | LuaScriptRaisedBuiltEventFilter | LuaPrePlayerMinedEntityEventFilter | LuaPlayerRepairedEntityEventFilter | LuaUpgradeCancelledEventFilter | LuaSectorScannedEventFilter | LuaPostEntityDiedEventFilter | LuaEntityMarkedForDeconstructionEventFilter | LuaPlayerMinedEntityEventFilter | LuaEntityDamagedEventFilter | LuaScriptRaisedReviveEventFilter | LuaEntityDiedEventFilter | LuaPreRobotMinedEntityEventFilter)[];
1519
1786
  interface Fluid {
1520
1787
  /**
1521
1788
  * Fluid prototype name of the fluid.
@@ -1528,21 +1795,12 @@ interface Fluid {
1528
1795
  /**
1529
1796
  * The temperature. When reading from {@link LuaFluidBox | runtime:LuaFluidBox}, this field will always be present. It is not necessary to specify it when writing, however. When not specified, the fluid will be set to the fluid's default temperature as specified in the fluid's prototype.
1530
1797
  */
1531
- temperature?: double;
1798
+ temperature?: float;
1532
1799
  }
1533
- /**
1534
- * A definition of a fluidbox connection point.
1535
- */
1536
- interface FluidBoxConnection {
1537
- type: 'input' | 'output' | 'input-output';
1538
- /**
1539
- * The 4 cardinal direction connection points for this pipe. This vector is a table with `x` and `y` keys instead of an array.
1540
- */
1541
- positions: Vector[];
1542
- /**
1543
- * The maximum tile distance this underground connection can connect at if this is an underground pipe.
1544
- */
1545
- max_underground_distance?: uint;
1800
+ interface FluidBoxConnectionRecord {
1801
+ this_linked_connection_id: uint;
1802
+ other_entity: LuaEntity;
1803
+ other_linked_connection_id: uint;
1546
1804
  }
1547
1805
  interface FluidBoxFilter {
1548
1806
  /**
@@ -1552,11 +1810,11 @@ interface FluidBoxFilter {
1552
1810
  /**
1553
1811
  * The minimum temperature allowed into the fluidbox.
1554
1812
  */
1555
- minimum_temperature: double;
1813
+ minimum_temperature: float;
1556
1814
  /**
1557
1815
  * The maximum temperature allowed into the fluidbox.
1558
1816
  */
1559
- maximum_temperature: double;
1817
+ maximum_temperature: float;
1560
1818
  }
1561
1819
  interface FluidBoxFilterSpec {
1562
1820
  /**
@@ -1566,11 +1824,11 @@ interface FluidBoxFilterSpec {
1566
1824
  /**
1567
1825
  * The minimum temperature allowed into the fluidbox.
1568
1826
  */
1569
- minimum_temperature?: double;
1827
+ minimum_temperature?: float;
1570
1828
  /**
1571
1829
  * The maximum temperature allowed into the fluidbox.
1572
1830
  */
1573
- maximum_temperature?: double;
1831
+ maximum_temperature?: float;
1574
1832
  /**
1575
1833
  * Force the filter to be set, regardless of current fluid content.
1576
1834
  */
@@ -1579,7 +1837,7 @@ interface FluidBoxFilterSpec {
1579
1837
  /**
1580
1838
  * A fluid may be specified in one of three ways.
1581
1839
  */
1582
- type FluidIdentification = /**
1840
+ type FluidID = /**
1583
1841
  * The fluid name.
1584
1842
  */
1585
1843
  string | /**
@@ -1589,6 +1847,50 @@ LuaFluidPrototype | /**
1589
1847
  * The fluid.
1590
1848
  */
1591
1849
  Fluid;
1850
+ /**
1851
+ * @example ```
1852
+ -- Products of the "advanced-oil-processing" recipe
1853
+ {{type="fluid", name="heavy-oil", amount=1},
1854
+ {type="fluid", name="light-oil", amount=4.5},
1855
+ {type="fluid", name="petroleum-gas", amount=5.5}}
1856
+ ```
1857
+ */
1858
+ interface FluidProduct {
1859
+ type: 'fluid';
1860
+ /**
1861
+ * Prototype name of the result.
1862
+ */
1863
+ name: string;
1864
+ /**
1865
+ * Amount of the fluid to give. If not returned, `amount_min` and `amount_max` will be present instead.
1866
+ */
1867
+ amount?: double;
1868
+ /**
1869
+ * Minimal amount of the fluid to give. Not returned if `amount` is returned.
1870
+ */
1871
+ amount_min?: double;
1872
+ /**
1873
+ * Maximum amount of the fluid to give. Not returned if `amount` is returned.
1874
+ */
1875
+ amount_max?: double;
1876
+ /**
1877
+ * A value in range `[0, 1]`. Fluid is only given with this probability; otherwise no product is produced.
1878
+ */
1879
+ probability: double;
1880
+ /**
1881
+ * How much of this product is ignored by statistics.
1882
+ */
1883
+ ignored_by_stats?: double;
1884
+ /**
1885
+ * How much of this product is ignored by productivity.
1886
+ */
1887
+ ignored_by_productivity?: double;
1888
+ /**
1889
+ * The fluid temperature of this product.
1890
+ */
1891
+ temperature?: float;
1892
+ fluidbox_index?: uint;
1893
+ }
1592
1894
  interface BaseFluidPrototypeFilter {
1593
1895
  /**
1594
1896
  * The condition to filter on.
@@ -1749,16 +2051,26 @@ type ForceCondition = /**
1749
2051
  /**
1750
2052
  * A force may be specified in one of three ways.
1751
2053
  */
1752
- type ForceIdentification = /**
1753
- * The force index.
1754
- */
1755
- uint8 | /**
1756
- * The force name.
2054
+ type ForceID = /**
2055
+ * Name of the force, same as {@link LuaForce::name | runtime:LuaForce::name}.
1757
2056
  */
1758
2057
  string | /**
2058
+ * Index of the force, same as {@link LuaForce::index | runtime:LuaForce::index}.
2059
+ */
2060
+ uint8 | /**
1759
2061
  * A reference to {@link LuaForce | runtime:LuaForce} may be passed directly.
1760
2062
  */
1761
2063
  LuaForce;
2064
+ /**
2065
+ * Set of forces. Can be specified in one of two ways.
2066
+ */
2067
+ type ForceSet = /**
2068
+ * Array of many forces.
2069
+ */
2070
+ ForceID[] | /**
2071
+ * A single force.
2072
+ */
2073
+ ForceID;
1762
2074
  /**
1763
2075
  * Parameters that affect the look and control of the game. Updating any of the member attributes here will immediately take effect in the game engine.
1764
2076
  */
@@ -1784,7 +2096,7 @@ interface GameViewSettings {
1784
2096
  */
1785
2097
  show_entity_tooltip: boolean;
1786
2098
  /**
1787
- * Shows or hides the mouse and keyboard/controller button hints in the bottom left corner if they are enabled in the interface settings.
2099
+ * hows or hides the mouse and keyboard/controller button hints in the bottom left corner if they are enabled in the interface settings.
1788
2100
  */
1789
2101
  show_hotkey_suggestions: boolean;
1790
2102
  /**
@@ -1896,7 +2208,7 @@ interface GuiArrowSpecificationItemStack extends BaseGuiArrowSpecification {
1896
2208
  * Which stack to point to.
1897
2209
  */
1898
2210
  'item_stack_index': uint;
1899
- 'source': 'player' | 'target' | 'player-quickbar' | 'player-equipment-bar';
2211
+ 'source': 'player' | 'target' | 'player-quickbar';
1900
2212
  }
1901
2213
  /**
1902
2214
  *
@@ -2088,9 +2400,9 @@ interface BaseIngredient {
2088
2400
  */
2089
2401
  amount: double;
2090
2402
  /**
2091
- * How much of this ingredient is a catalyst.
2403
+ * How much of this ingredient is ignored by statistics.
2092
2404
  */
2093
- catalyst_amount?: uint | double;
2405
+ ignored_by_stats?: uint | double;
2094
2406
  }
2095
2407
  type Ingredient = BaseIngredient | IngredientFluid;
2096
2408
  /**
@@ -2102,11 +2414,11 @@ interface IngredientFluid extends BaseIngredient {
2102
2414
  /**
2103
2415
  * The maximum fluid temperature allowed.
2104
2416
  */
2105
- 'maximum_temperature'?: double;
2417
+ 'maximum_temperature'?: float;
2106
2418
  /**
2107
2419
  * The minimum fluid temperature required.
2108
2420
  */
2109
- 'minimum_temperature'?: double;
2421
+ 'minimum_temperature'?: float;
2110
2422
  }
2111
2423
  interface InserterCircuitConditions {
2112
2424
  circuit?: CircuitCondition;
@@ -2122,11 +2434,165 @@ interface InventoryFilter {
2122
2434
  */
2123
2435
  name: string;
2124
2436
  }
2437
+ type InventoryIndex = uint8;
2438
+ interface InventoryPosition {
2439
+ /**
2440
+ * The ID of the inventory to insert into.
2441
+ */
2442
+ inventory: defines.inventory;
2443
+ /**
2444
+ * The stack index of the inventory to insert into.
2445
+ */
2446
+ stack: ItemStackIndex;
2447
+ /**
2448
+ * How many items to insert. Defaults to `1`.
2449
+ */
2450
+ count?: ItemCountType;
2451
+ }
2452
+ type ItemCountType = uint;
2453
+ interface ItemCountWithQuality {
2454
+ /**
2455
+ * The name of the item prototype.
2456
+ */
2457
+ name: string;
2458
+ /**
2459
+ * The number of items.
2460
+ */
2461
+ count: uint;
2462
+ /**
2463
+ * The quality level of the items.
2464
+ */
2465
+ quality: QualityID;
2466
+ }
2467
+ /**
2468
+ * An item filter may be specified in two ways, either as a string which is an item prototype name or as a table.
2469
+ */
2470
+ type ItemFilter = {
2471
+ /**
2472
+ * The item.
2473
+ */
2474
+ name?: ItemID;
2475
+ /**
2476
+ * The quality.
2477
+ */
2478
+ quality?: QualityID;
2479
+ /**
2480
+ * The quality comparison type.
2481
+ */
2482
+ comparator?: ComparatorString;
2483
+ } | string;
2484
+ /**
2485
+ * An item prototype may be specified in one of four ways.
2486
+ */
2487
+ type ItemID = /**
2488
+ * Item prototype.
2489
+ */
2490
+ LuaItemPrototype | /**
2491
+ * Non empty item stack.
2492
+ */
2493
+ LuaItemStack | /**
2494
+ * The item.
2495
+ */
2496
+ LuaItem | /**
2497
+ * The prototype name.
2498
+ */
2499
+ string;
2500
+ /**
2501
+ * An item prototype with optional quality specification.
2502
+ */
2503
+ interface ItemIDAndQualityIDPair {
2504
+ /**
2505
+ * Item prototype. Returns `LuaItemPrototype` when read.
2506
+ */
2507
+ name: ItemID;
2508
+ /**
2509
+ * Quality prototype. Normal quality will be used if not specified. Returns `LuaQualityPrototype` when read.
2510
+ */
2511
+ quality?: QualityID;
2512
+ }
2513
+ interface ItemIDFilter {
2514
+ /**
2515
+ * The item name.
2516
+ */
2517
+ name: string;
2518
+ /**
2519
+ * The name of the quality.
2520
+ */
2521
+ quality?: string;
2522
+ /**
2523
+ * The quality comparison type.
2524
+ */
2525
+ comparator?: ComparatorString;
2526
+ }
2527
+ interface ItemInventoryPositions {
2528
+ /**
2529
+ * A list of stacks into which items should be inserted.
2530
+ */
2531
+ in_inventory?: InventoryPosition[];
2532
+ /**
2533
+ * Defaults to `0`. Number of items to request for the equipment grid. When the items arrive they will be used to revive the first matching ghost equipment.
2534
+ */
2535
+ grid_count?: ItemCountType;
2536
+ }
2537
+ interface ItemLocationData {
2538
+ surface: LuaSurface;
2539
+ entity?: LuaEntity;
2540
+ player?: LuaPlayer;
2541
+ position: MapPosition;
2542
+ force: LuaForce;
2543
+ }
2544
+ /**
2545
+ * @example ```
2546
+ -- Products of the "steel-chest" recipe (an array of Product)
2547
+ {{type="item", name="steel-chest", amount=1}}
2548
+ ```
2549
+ * @example ```
2550
+ -- What a custom recipe would look like that had a probability of 0.5 to return a
2551
+ -- minimum amount of 1 and a maximum amount of 5
2552
+ {{type="item", name="custom-item", probability=0.5, amount_min=1, amount_max=5}}
2553
+ ```
2554
+ */
2555
+ interface ItemProduct {
2556
+ type: 'item';
2557
+ /**
2558
+ * Prototype name of the result.
2559
+ */
2560
+ name: string;
2561
+ /**
2562
+ * Amount of the item to give. If not returned, `amount_min` and `amount_max` will be present instead.
2563
+ */
2564
+ amount?: uint16;
2565
+ /**
2566
+ * Minimal amount of the item to give. Not returned if `amount` is returned.
2567
+ */
2568
+ amount_min?: uint16;
2569
+ /**
2570
+ * Maximum amount of the item to give. Not returned if `amount` is returned.
2571
+ */
2572
+ amount_max?: uint16;
2573
+ /**
2574
+ * A value in range `[0, 1]`. Item is only given with this probability; otherwise no product is produced.
2575
+ */
2576
+ probability: double;
2577
+ /**
2578
+ * How much of this product is ignored by statistics.
2579
+ */
2580
+ ignored_by_stats?: uint16;
2581
+ /**
2582
+ * How much of this product is ignored by productivity.
2583
+ */
2584
+ ignored_by_productivity?: uint16;
2585
+ /**
2586
+ * Probability that a craft will yield one additional product. Also applies to bonus crafts caused by productivity.
2587
+ */
2588
+ extra_count_fraction?: float;
2589
+ percent_spoiled?: float;
2590
+ }
2125
2591
  interface BaseItemPrototypeFilter {
2126
2592
  /**
2127
2593
  * The condition to filter on.
2128
2594
  */
2129
- filter: 'tool' | 'mergeable' | 'item-with-inventory' | 'selection-tool' | 'item-with-label' | 'has-rocket-launch-products' | 'fuel' | 'place-result' | 'burnt-result' | 'place-as-tile' | 'placed-as-equipment-result' | 'name' | 'type' | 'flag' | 'subgroup' | 'fuel-category' | 'stack-size' | 'default-request-amount' | 'wire-count' | 'fuel-value' | 'fuel-acceleration-multiplier' | 'fuel-top-speed-multiplier' | 'fuel-emissions-multiplier';
2595
+ filter: 'tool' | 'mergeable' | 'hidden' | 'hidden-in-factoriopedia' | 'is-parameter' | 'item-with-inventory' | 'selection-tool' | 'item-with-label' | 'has-rocket-launch-products' | 'fuel' | 'place-result' | 'burnt-result' | 'place-as-tile' | 'placed-as-equipment-result' | 'name' | 'type' | 'flag' | 'subgroup' | 'fuel-category' | 'stack-size' | 'fuel-value' | 'fuel-acceleration-multiplier' | 'fuel-top-speed-multiplier' | 'fuel-emissions-multiplier';
2130
2596
  /**
2131
2597
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2132
2598
  */
@@ -2136,7 +2602,7 @@ interface BaseItemPrototypeFilter {
2136
2602
  */
2137
2603
  invert?: boolean;
2138
2604
  }
2139
- type ItemPrototypeFilter = BaseItemPrototypeFilter | ItemPrototypeFilterBurntResult | ItemPrototypeFilterDefaultRequestAmount | ItemPrototypeFilterFlag | ItemPrototypeFilterFuelAccelerationMultiplier | ItemPrototypeFilterFuelCategory | ItemPrototypeFilterFuelEmissionsMultiplier | ItemPrototypeFilterFuelTopSpeedMultiplier | ItemPrototypeFilterFuelValue | ItemPrototypeFilterName | ItemPrototypeFilterPlaceAsTile | ItemPrototypeFilterPlaceResult | ItemPrototypeFilterPlacedAsEquipmentResult | ItemPrototypeFilterStackSize | ItemPrototypeFilterSubgroup | ItemPrototypeFilterType | ItemPrototypeFilterWireCount;
2605
+ type ItemPrototypeFilter = BaseItemPrototypeFilter | ItemPrototypeFilterBurntResult | ItemPrototypeFilterFlag | ItemPrototypeFilterFuelAccelerationMultiplier | ItemPrototypeFilterFuelCategory | ItemPrototypeFilterFuelEmissionsMultiplier | ItemPrototypeFilterFuelTopSpeedMultiplier | ItemPrototypeFilterFuelValue | ItemPrototypeFilterName | ItemPrototypeFilterPlaceAsTile | ItemPrototypeFilterPlaceResult | ItemPrototypeFilterPlacedAsEquipmentResult | ItemPrototypeFilterStackSize | ItemPrototypeFilterSubgroup | ItemPrototypeFilterType;
2140
2606
  /**
2141
2607
  *
2142
2608
  * Applies to variant case `burnt-result`
@@ -2151,21 +2617,6 @@ interface ItemPrototypeFilterBurntResult extends BaseItemPrototypeFilter {
2151
2617
  */
2152
2618
  'elem_filters'?: ItemPrototypeFilter[];
2153
2619
  }
2154
- /**
2155
- *
2156
- * Applies to variant case `default-request-amount`
2157
- */
2158
- interface ItemPrototypeFilterDefaultRequestAmount extends BaseItemPrototypeFilter {
2159
- /**
2160
- * The condition to filter on.
2161
- */
2162
- 'filter': 'default-request-amount';
2163
- 'comparison': ComparatorString;
2164
- /**
2165
- * The value to compare against.
2166
- */
2167
- 'value': uint;
2168
- }
2169
2620
  /**
2170
2621
  *
2171
2622
  * Applies to variant case `flag`
@@ -2313,7 +2764,7 @@ interface ItemPrototypeFilterPlacedAsEquipmentResult extends BaseItemPrototypeFi
2313
2764
  * Usage example:
2314
2765
  *
2315
2766
  * ```
2316
- * game.get_filtered_item_prototypes({{filter = "stack-size", comparison = ">", value = 20}, {filter = "stack-size", comparison = "<", value = 100, mode = "and"}})
2767
+ * prototypes.get_item_filtered({{filter = "stack-size", comparison = ">", value = 20}, {filter = "stack-size", comparison = "<", value = 100, mode = "and"}})
2317
2768
  * ```
2318
2769
  * Applies to variant case `stack-size`
2319
2770
  */
@@ -2345,7 +2796,7 @@ interface ItemPrototypeFilterSubgroup extends BaseItemPrototypeFilter {
2345
2796
  /**
2346
2797
  * Usage example:
2347
2798
  * ```
2348
- * game.get_filtered_item_prototypes({{filter = "type", type = "armor"}})
2799
+ * prototypes.get_item_filtered({{filter = "type", type = "armor"}})
2349
2800
  * ```
2350
2801
  * Applies to variant case `type`
2351
2802
  */
@@ -2359,21 +2810,6 @@ interface ItemPrototypeFilterType extends BaseItemPrototypeFilter {
2359
2810
  */
2360
2811
  'type': string | string[];
2361
2812
  }
2362
- /**
2363
- *
2364
- * Applies to variant case `wire-count`
2365
- */
2366
- interface ItemPrototypeFilterWireCount extends BaseItemPrototypeFilter {
2367
- /**
2368
- * The condition to filter on.
2369
- */
2370
- 'filter': 'wire-count';
2371
- 'comparison': ComparatorString;
2372
- /**
2373
- * The value to compare against.
2374
- */
2375
- 'value': uint;
2376
- }
2377
2813
  /**
2378
2814
  * A {@link string | runtime:string} specifying an item prototype flag.
2379
2815
  */
@@ -2381,9 +2817,9 @@ type ItemPrototypeFlag = /**
2381
2817
  * Determines whether the logistics areas of roboports should be drawn when holding this item. Used by the deconstruction planner by default.
2382
2818
  */
2383
2819
  'draw-logistic-overlay' | /**
2384
- * Hides the item in the logistic requests and filters GUIs (among others).
2820
+ * If this item is skipped by the trash-unrequested logic.
2385
2821
  */
2386
- 'hidden' | /**
2822
+ 'excluded-from-trash-unrequested' | /**
2387
2823
  * Always shows the item in the logistic requests and filters GUIs (among others) even when the recipe for that item is locked.
2388
2824
  */
2389
2825
  'always-show' | /**
@@ -2396,9 +2832,6 @@ type ItemPrototypeFlag = /**
2396
2832
  * Prevents the item from being stacked. It also prevents the item from stacking in assembling machine input slots, which can otherwise exceed the item stack size if required by the recipe. Additionally, the item does not show an item count when in the cursor.
2397
2833
  */
2398
2834
  'not-stackable' | /**
2399
- * Makes the item act as an extension to the inventory that it is placed in. Only has an effect for items with inventory.
2400
- */
2401
- 'can-extend-inventory' | /**
2402
2835
  * Makes construction bots prefer this item when building the entity specified by its `place_result`.
2403
2836
  */
2404
2837
  'primary-place-result' | /**
@@ -2410,33 +2843,29 @@ type ItemPrototypeFlag = /**
2410
2843
  'only-in-cursor' | /**
2411
2844
  * Allows the item to be spawned by a quickbar shortcut or custom input.
2412
2845
  */
2413
- 'spawnable';
2414
- /**
2415
- * A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all. By default, none of these flags are set.
2846
+ 'spawnable' | 'spoil-result' | /**
2847
+ * Controls whether the spoil time ignores the spoil time modifier in the {@link DifficultySettings | runtime:DifficultySettings}.
2416
2848
  */
2417
- type ItemPrototypeFlags = Record<ItemPrototypeFlag, true>;
2849
+ 'ignore-spoil-time-modifier';
2418
2850
  /**
2419
- * An item prototype may be specified in one of three ways.
2420
- */
2421
- type ItemPrototypeIdentification = /**
2422
- * The item.
2423
- */
2424
- LuaItemStack | /**
2425
- * The item prototype.
2426
- */
2427
- LuaItemPrototype | /**
2428
- * The prototype name.
2851
+ * A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all.
2852
+ *
2853
+ * By default, none of these flags are set.
2429
2854
  */
2430
- string;
2855
+ type ItemPrototypeFlags = Record<ItemPrototypeFlag, true>;
2431
2856
  interface ItemStackDefinition {
2432
2857
  /**
2433
2858
  * Prototype name of the item the stack holds.
2434
2859
  */
2435
2860
  name: string;
2436
2861
  /**
2437
- * Number of items the stack holds. If not specified, defaults to `1`.
2862
+ * Number of items the stack holds. Defaults to `1`.
2438
2863
  */
2439
- count?: uint;
2864
+ count?: ItemCountType;
2865
+ /**
2866
+ * Quality of the item the stack holds. Defaults to `"normal"`.
2867
+ */
2868
+ quality?: string;
2440
2869
  /**
2441
2870
  * Health of the items in the stack. Defaults to `1.0`.
2442
2871
  */
@@ -2448,20 +2877,49 @@ interface ItemStackDefinition {
2448
2877
  /**
2449
2878
  * Amount of ammo in the ammo items in the stack.
2450
2879
  */
2451
- ammo?: double;
2880
+ ammo?: float;
2452
2881
  /**
2453
2882
  * Tags of the items with tags in the stack.
2454
2883
  */
2455
2884
  tags?: string[];
2885
+ /**
2886
+ * Description of the items with tags in the stack.
2887
+ */
2888
+ custom_description?: LocalisedString;
2889
+ /**
2890
+ * The spoil percent for this item if the item can spoil. Defaults to `0`.
2891
+ */
2892
+ spoil_percent?: double;
2456
2893
  }
2457
2894
  /**
2458
2895
  * An item may be specified in one of two ways.
2459
2896
  */
2460
2897
  type ItemStackIdentification = SimpleItemStack | LuaItemStack;
2898
+ type ItemStackIndex = uint16;
2461
2899
  interface ItemStackLocation {
2462
2900
  inventory: defines.inventory;
2463
2901
  slot: uint;
2464
2902
  }
2903
+ /**
2904
+ * An item prototype with optional quality specification. Can be specified in one of four ways.
2905
+ */
2906
+ type ItemWithQualityID = /**
2907
+ * The item stack. Both prototype and quality of the item stack will be used.
2908
+ */
2909
+ LuaItemStack | /**
2910
+ * The item prototype. Normal quality will be used.
2911
+ */
2912
+ LuaItemPrototype | /**
2913
+ * The prototype name. Normal quality will be used.
2914
+ */
2915
+ string | /**
2916
+ * A table of entity prototype and quality.
2917
+ */
2918
+ ItemIDAndQualityIDPair;
2919
+ /**
2920
+ * The internal name of a game control (key binding).
2921
+ */
2922
+ type LinkedGameControl = 'move-up' | 'move-down' | 'move-left' | 'move-right' | 'open-character-gui' | 'open-gui' | 'confirm-gui' | 'toggle-free-cursor' | 'mine' | 'build' | 'build-ghost' | 'super-forced-build' | 'clear-cursor' | 'pipette' | 'rotate' | 'reverse-rotate' | 'flip-horizontal' | 'flip-vertical' | 'pick-items' | 'drop-cursor' | 'show-info' | 'shoot-enemy' | 'shoot-selected' | 'next-weapon' | 'toggle-driving' | 'zoom-in' | 'zoom-out' | 'use-item' | 'alternative-use-item' | 'toggle-console' | 'copy-entity-settings' | 'paste-entity-settings' | 'controller-gui-logistics-tab' | 'controller-gui-character-tab' | 'controller-gui-crafting-tab' | 'toggle-rail-layer' | 'select-for-blueprint' | 'select-for-cancel-deconstruct' | 'select-for-super-forced-deconstruct' | 'reverse-select' | 'alt-reverse-select' | 'deselect' | 'cycle-blueprint-forwards' | 'cycle-blueprint-backwards' | 'focus-search' | 'larger-terrain-building-area' | 'smaller-terrain-building-area' | 'remove-pole-cables' | 'build-with-obstacle-avoidance' | 'add-station' | 'add-temporary-station' | 'rename-all' | 'fast-wait-condition' | 'drag-map' | 'move-tag' | 'place-in-chat' | 'place-ping' | 'pin' | 'activate-tooltip' | 'next-surface' | 'previous-surface' | 'cycle-quality-up' | 'cycle-quality-down' | 'craft' | 'craft-5' | 'craft-all' | 'cancel-craft' | 'cancel-craft-5' | 'cancel-craft-all' | 'pick-item' | 'stack-transfer' | 'inventory-transfer' | 'fast-entity-transfer' | 'cursor-split' | 'stack-split' | 'inventory-split' | 'fast-entity-split' | 'toggle-filter' | 'open-item' | 'copy-inventory-filter' | 'paste-inventory-filter' | 'show-quick-panel' | 'next-quick-panel-page' | 'previous-quick-panel-page' | 'next-quick-panel-tab' | 'previous-quick-panel-tab' | 'rotate-active-quick-bars' | 'next-active-quick-bar' | 'previous-active-quick-bar' | 'quick-bar-button-1' | 'quick-bar-button-2' | 'quick-bar-button-3' | 'quick-bar-button-4' | 'quick-bar-button-5' | 'quick-bar-button-6' | 'quick-bar-button-7' | 'quick-bar-button-8' | 'quick-bar-button-9' | 'quick-bar-button-10' | 'quick-bar-button-1-secondary' | 'quick-bar-button-2-secondary' | 'quick-bar-button-3-secondary' | 'quick-bar-button-4-secondary' | 'quick-bar-button-5-secondary' | 'quick-bar-button-6-secondary' | 'quick-bar-button-7-secondary' | 'quick-bar-button-8-secondary' | 'quick-bar-button-9-secondary' | 'quick-bar-button-10-secondary' | 'action-bar-select-page-1' | 'action-bar-select-page-2' | 'action-bar-select-page-3' | 'action-bar-select-page-4' | 'action-bar-select-page-5' | 'action-bar-select-page-6' | 'action-bar-select-page-7' | 'action-bar-select-page-8' | 'action-bar-select-page-9' | 'action-bar-select-page-10' | 'copy' | 'cut' | 'paste' | 'cycle-clipboard-forwards' | 'cycle-clipboard-backwards' | 'undo' | 'redo' | 'toggle-menu' | 'toggle-map' | 'close-menu' | 'open-technology-gui' | 'production-statistics' | 'logistic-networks' | 'toggle-blueprint-library' | 'open-trains-gui' | 'open-factoriopedia' | 'back' | 'forward' | 'pause-game' | 'confirm-message' | 'previous-technology' | 'previous-mod' | 'connect-train' | 'disconnect-train' | 'submit-feedback' | 'editor-next-variation' | 'editor-previous-variation' | 'editor-clone-item' | 'editor-delete-item' | 'editor-toggle-pause' | 'editor-tick-once' | 'editor-speed-up' | 'editor-speed-down' | 'editor-reset-speed' | 'editor-set-clone-brush-source' | 'editor-set-clone-brush-destination' | 'editor-switch-to-surface' | 'editor-remove-scripting-object' | 'debug-toggle-atlas-gui' | 'debug-toggle-gui-visibility' | 'debug-toggle-debug-settings' | 'debug-toggle-basic' | 'debug-reset-zoom' | 'debug-reset-zoom-2x' | 'toggle-gui-debug' | 'toggle-gui-style-view' | 'toggle-gui-shadows' | 'toggle-gui-glows' | 'open-prototypes-gui' | 'open-prototype-explorer-gui' | 'increase-ui-scale' | 'decrease-ui-scale' | 'reset-ui-scale' | 'slash-editor' | 'toggle-entity' | 'next-player-in-replay' | 'move-blueprint-absolute-grid-up' | 'move-blueprint-absolute-grid-down' | 'move-blueprint-absolute-grid-left' | 'move-blueprint-absolute-grid-right' | 'move-blueprint-entities-up' | 'move-blueprint-entities-down' | 'move-blueprint-entities-left' | 'move-blueprint-entities-right' | 'play-next-track' | 'play-previous-track' | 'pause-resume-music';
2465
2923
  /**
2466
2924
  * Localised strings are a way to support translation of in-game text. It is an array where the first element is the key and the remaining elements are parameters that will be substituted for placeholders in the template designated by the key.
2467
2925
  *
@@ -2500,31 +2958,46 @@ game.print({"", {"item-name.iron-plate"}, ": ", 60})
2500
2958
  type LocalisedString = string | number | boolean | LuaObject | nil | LocalisedString[];
2501
2959
  interface LogisticFilter {
2502
2960
  /**
2503
- * The index this filter applies to.
2961
+ * The item filter to put into the slot.
2504
2962
  */
2505
- index: uint;
2963
+ value?: SignalFilter;
2506
2964
  /**
2507
- * The item name for this filter.
2965
+ * The minimum amount to satisfy.
2508
2966
  */
2509
- name: string;
2967
+ min?: int;
2510
2968
  /**
2511
- * The count for this filter.
2969
+ * The maximum amount to keep in inventory. `nil` for infinite.
2512
2970
  */
2513
- count: uint;
2971
+ max?: ItemCountType;
2972
+ /**
2973
+ * The minimum count that will be delivered to a space platform. `nil` if unchanged from the default.
2974
+ */
2975
+ minimum_delivery_count?: ItemCountType;
2976
+ /**
2977
+ * The space location to import from.
2978
+ */
2979
+ import_from?: SpaceLocationID;
2514
2980
  }
2515
- interface LogisticParameters {
2981
+ type LogisticFilterIndex = uint16;
2982
+ interface LogisticSection {
2983
+ index: uint8;
2984
+ filters?: BlueprintLogisticFilter[];
2985
+ group?: string;
2516
2986
  /**
2517
- * The item. `nil` clears the filter.
2987
+ * Defaults to 1.
2518
2988
  */
2519
- name?: string;
2989
+ multiplier?: float;
2520
2990
  /**
2521
- * Defaults to `0`.
2991
+ * Defaults to true.
2522
2992
  */
2523
- min?: uint;
2993
+ active?: float;
2994
+ }
2995
+ interface LogisticSections {
2996
+ sections?: LogisticSection[];
2524
2997
  /**
2525
- * Defaults to max uint.
2998
+ * Defaults to false.
2526
2999
  */
2527
- max?: uint;
3000
+ trash_not_requested?: boolean;
2528
3001
  }
2529
3002
  interface LogisticsNetworkSupplyCounts {
2530
3003
  /**
@@ -2572,7 +3045,7 @@ interface BaseLuaEntityClonedEventFilter {
2572
3045
  /**
2573
3046
  * The condition to filter on.
2574
3047
  */
2575
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3048
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
2576
3049
  /**
2577
3050
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2578
3051
  */
@@ -2643,7 +3116,7 @@ interface BaseLuaEntityDamagedEventFilter {
2643
3116
  /**
2644
3117
  * The condition to filter on.
2645
3118
  */
2646
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'original-damage-amount' | 'final-damage-amount' | 'damage-type' | 'final-health';
3119
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'original-damage-amount' | 'final-damage-amount' | 'damage-type' | 'final-health';
2647
3120
  /**
2648
3121
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2649
3122
  */
@@ -2773,7 +3246,7 @@ interface BaseLuaEntityDeconstructionCancelledEventFilter {
2773
3246
  /**
2774
3247
  * The condition to filter on.
2775
3248
  */
2776
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3249
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
2777
3250
  /**
2778
3251
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2779
3252
  */
@@ -2844,7 +3317,7 @@ interface BaseLuaEntityDiedEventFilter {
2844
3317
  /**
2845
3318
  * The condition to filter on.
2846
3319
  */
2847
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3320
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
2848
3321
  /**
2849
3322
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2850
3323
  */
@@ -2915,7 +3388,7 @@ interface BaseLuaEntityMarkedForDeconstructionEventFilter {
2915
3388
  /**
2916
3389
  * The condition to filter on.
2917
3390
  */
2918
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3391
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
2919
3392
  /**
2920
3393
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2921
3394
  */
@@ -2986,7 +3459,7 @@ interface BaseLuaEntityMarkedForUpgradeEventFilter {
2986
3459
  /**
2987
3460
  * The condition to filter on.
2988
3461
  */
2989
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3462
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
2990
3463
  /**
2991
3464
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
2992
3465
  */
@@ -3057,11 +3530,11 @@ interface LuaEntityMarkedForUpgradeEventFilterType extends BaseLuaEntityMarkedFo
3057
3530
  * Any LuaObject listed on the {@link Classes | runtime:classes} page.
3058
3531
  */
3059
3532
  type LuaObject = object;
3060
- interface BaseLuaPlayerBuiltEntityEventFilter {
3533
+ interface BaseLuaPlatformBuiltEntityEventFilter {
3061
3534
  /**
3062
3535
  * The condition to filter on.
3063
3536
  */
3064
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'force';
3537
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'force';
3065
3538
  /**
3066
3539
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3067
3540
  */
@@ -3071,12 +3544,12 @@ interface BaseLuaPlayerBuiltEntityEventFilter {
3071
3544
  */
3072
3545
  invert?: boolean;
3073
3546
  }
3074
- type LuaPlayerBuiltEntityEventFilter = BaseLuaPlayerBuiltEntityEventFilter | LuaPlayerBuiltEntityEventFilterForce | LuaPlayerBuiltEntityEventFilterGhostName | LuaPlayerBuiltEntityEventFilterGhostType | LuaPlayerBuiltEntityEventFilterName | LuaPlayerBuiltEntityEventFilterType;
3547
+ type LuaPlatformBuiltEntityEventFilter = BaseLuaPlatformBuiltEntityEventFilter | LuaPlatformBuiltEntityEventFilterForce | LuaPlatformBuiltEntityEventFilterGhostName | LuaPlatformBuiltEntityEventFilterGhostType | LuaPlatformBuiltEntityEventFilterName | LuaPlatformBuiltEntityEventFilterType;
3075
3548
  /**
3076
3549
  *
3077
3550
  * Applies to variant case `force`
3078
3551
  */
3079
- interface LuaPlayerBuiltEntityEventFilterForce extends BaseLuaPlayerBuiltEntityEventFilter {
3552
+ interface LuaPlatformBuiltEntityEventFilterForce extends BaseLuaPlatformBuiltEntityEventFilter {
3080
3553
  /**
3081
3554
  * The condition to filter on.
3082
3555
  */
@@ -3090,7 +3563,7 @@ interface LuaPlayerBuiltEntityEventFilterForce extends BaseLuaPlayerBuiltEntityE
3090
3563
  *
3091
3564
  * Applies to variant case `ghost_name`
3092
3565
  */
3093
- interface LuaPlayerBuiltEntityEventFilterGhostName extends BaseLuaPlayerBuiltEntityEventFilter {
3566
+ interface LuaPlatformBuiltEntityEventFilterGhostName extends BaseLuaPlatformBuiltEntityEventFilter {
3094
3567
  /**
3095
3568
  * The condition to filter on.
3096
3569
  */
@@ -3104,7 +3577,7 @@ interface LuaPlayerBuiltEntityEventFilterGhostName extends BaseLuaPlayerBuiltEnt
3104
3577
  *
3105
3578
  * Applies to variant case `ghost_type`
3106
3579
  */
3107
- interface LuaPlayerBuiltEntityEventFilterGhostType extends BaseLuaPlayerBuiltEntityEventFilter {
3580
+ interface LuaPlatformBuiltEntityEventFilterGhostType extends BaseLuaPlatformBuiltEntityEventFilter {
3108
3581
  /**
3109
3582
  * The condition to filter on.
3110
3583
  */
@@ -3118,7 +3591,7 @@ interface LuaPlayerBuiltEntityEventFilterGhostType extends BaseLuaPlayerBuiltEnt
3118
3591
  *
3119
3592
  * Applies to variant case `name`
3120
3593
  */
3121
- interface LuaPlayerBuiltEntityEventFilterName extends BaseLuaPlayerBuiltEntityEventFilter {
3594
+ interface LuaPlatformBuiltEntityEventFilterName extends BaseLuaPlatformBuiltEntityEventFilter {
3122
3595
  /**
3123
3596
  * The condition to filter on.
3124
3597
  */
@@ -3132,7 +3605,7 @@ interface LuaPlayerBuiltEntityEventFilterName extends BaseLuaPlayerBuiltEntityEv
3132
3605
  *
3133
3606
  * Applies to variant case `type`
3134
3607
  */
3135
- interface LuaPlayerBuiltEntityEventFilterType extends BaseLuaPlayerBuiltEntityEventFilter {
3608
+ interface LuaPlatformBuiltEntityEventFilterType extends BaseLuaPlatformBuiltEntityEventFilter {
3136
3609
  /**
3137
3610
  * The condition to filter on.
3138
3611
  */
@@ -3142,11 +3615,11 @@ interface LuaPlayerBuiltEntityEventFilterType extends BaseLuaPlayerBuiltEntityEv
3142
3615
  */
3143
3616
  'type': string;
3144
3617
  }
3145
- interface BaseLuaPlayerMinedEntityEventFilter {
3618
+ interface BaseLuaPlatformMinedEntityEventFilter {
3146
3619
  /**
3147
3620
  * The condition to filter on.
3148
3621
  */
3149
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3622
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3150
3623
  /**
3151
3624
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3152
3625
  */
@@ -3156,12 +3629,12 @@ interface BaseLuaPlayerMinedEntityEventFilter {
3156
3629
  */
3157
3630
  invert?: boolean;
3158
3631
  }
3159
- type LuaPlayerMinedEntityEventFilter = BaseLuaPlayerMinedEntityEventFilter | LuaPlayerMinedEntityEventFilterGhostName | LuaPlayerMinedEntityEventFilterGhostType | LuaPlayerMinedEntityEventFilterName | LuaPlayerMinedEntityEventFilterType;
3632
+ type LuaPlatformMinedEntityEventFilter = BaseLuaPlatformMinedEntityEventFilter | LuaPlatformMinedEntityEventFilterGhostName | LuaPlatformMinedEntityEventFilterGhostType | LuaPlatformMinedEntityEventFilterName | LuaPlatformMinedEntityEventFilterType;
3160
3633
  /**
3161
3634
  *
3162
3635
  * Applies to variant case `ghost_name`
3163
3636
  */
3164
- interface LuaPlayerMinedEntityEventFilterGhostName extends BaseLuaPlayerMinedEntityEventFilter {
3637
+ interface LuaPlatformMinedEntityEventFilterGhostName extends BaseLuaPlatformMinedEntityEventFilter {
3165
3638
  /**
3166
3639
  * The condition to filter on.
3167
3640
  */
@@ -3175,7 +3648,7 @@ interface LuaPlayerMinedEntityEventFilterGhostName extends BaseLuaPlayerMinedEnt
3175
3648
  *
3176
3649
  * Applies to variant case `ghost_type`
3177
3650
  */
3178
- interface LuaPlayerMinedEntityEventFilterGhostType extends BaseLuaPlayerMinedEntityEventFilter {
3651
+ interface LuaPlatformMinedEntityEventFilterGhostType extends BaseLuaPlatformMinedEntityEventFilter {
3179
3652
  /**
3180
3653
  * The condition to filter on.
3181
3654
  */
@@ -3189,7 +3662,7 @@ interface LuaPlayerMinedEntityEventFilterGhostType extends BaseLuaPlayerMinedEnt
3189
3662
  *
3190
3663
  * Applies to variant case `name`
3191
3664
  */
3192
- interface LuaPlayerMinedEntityEventFilterName extends BaseLuaPlayerMinedEntityEventFilter {
3665
+ interface LuaPlatformMinedEntityEventFilterName extends BaseLuaPlatformMinedEntityEventFilter {
3193
3666
  /**
3194
3667
  * The condition to filter on.
3195
3668
  */
@@ -3203,7 +3676,7 @@ interface LuaPlayerMinedEntityEventFilterName extends BaseLuaPlayerMinedEntityEv
3203
3676
  *
3204
3677
  * Applies to variant case `type`
3205
3678
  */
3206
- interface LuaPlayerMinedEntityEventFilterType extends BaseLuaPlayerMinedEntityEventFilter {
3679
+ interface LuaPlatformMinedEntityEventFilterType extends BaseLuaPlatformMinedEntityEventFilter {
3207
3680
  /**
3208
3681
  * The condition to filter on.
3209
3682
  */
@@ -3213,11 +3686,11 @@ interface LuaPlayerMinedEntityEventFilterType extends BaseLuaPlayerMinedEntityEv
3213
3686
  */
3214
3687
  'type': string;
3215
3688
  }
3216
- interface BaseLuaPlayerRepairedEntityEventFilter {
3689
+ interface BaseLuaPlayerBuiltEntityEventFilter {
3217
3690
  /**
3218
3691
  * The condition to filter on.
3219
3692
  */
3220
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3693
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'force';
3221
3694
  /**
3222
3695
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3223
3696
  */
@@ -3227,30 +3700,44 @@ interface BaseLuaPlayerRepairedEntityEventFilter {
3227
3700
  */
3228
3701
  invert?: boolean;
3229
3702
  }
3230
- type LuaPlayerRepairedEntityEventFilter = BaseLuaPlayerRepairedEntityEventFilter | LuaPlayerRepairedEntityEventFilterGhostName | LuaPlayerRepairedEntityEventFilterGhostType | LuaPlayerRepairedEntityEventFilterName | LuaPlayerRepairedEntityEventFilterType;
3703
+ type LuaPlayerBuiltEntityEventFilter = BaseLuaPlayerBuiltEntityEventFilter | LuaPlayerBuiltEntityEventFilterForce | LuaPlayerBuiltEntityEventFilterGhostName | LuaPlayerBuiltEntityEventFilterGhostType | LuaPlayerBuiltEntityEventFilterName | LuaPlayerBuiltEntityEventFilterType;
3231
3704
  /**
3232
3705
  *
3233
- * Applies to variant case `ghost_name`
3706
+ * Applies to variant case `force`
3234
3707
  */
3235
- interface LuaPlayerRepairedEntityEventFilterGhostName extends BaseLuaPlayerRepairedEntityEventFilter {
3708
+ interface LuaPlayerBuiltEntityEventFilterForce extends BaseLuaPlayerBuiltEntityEventFilter {
3236
3709
  /**
3237
3710
  * The condition to filter on.
3238
3711
  */
3239
- 'filter': 'ghost_name';
3712
+ 'filter': 'force';
3240
3713
  /**
3241
- * The ghost prototype name.
3714
+ * The entity force
3242
3715
  */
3243
- 'name': string;
3716
+ 'force': string;
3244
3717
  }
3245
3718
  /**
3246
3719
  *
3247
- * Applies to variant case `ghost_type`
3720
+ * Applies to variant case `ghost_name`
3248
3721
  */
3249
- interface LuaPlayerRepairedEntityEventFilterGhostType extends BaseLuaPlayerRepairedEntityEventFilter {
3722
+ interface LuaPlayerBuiltEntityEventFilterGhostName extends BaseLuaPlayerBuiltEntityEventFilter {
3250
3723
  /**
3251
3724
  * The condition to filter on.
3252
3725
  */
3253
- 'filter': 'ghost_type';
3726
+ 'filter': 'ghost_name';
3727
+ /**
3728
+ * The ghost prototype name.
3729
+ */
3730
+ 'name': string;
3731
+ }
3732
+ /**
3733
+ *
3734
+ * Applies to variant case `ghost_type`
3735
+ */
3736
+ interface LuaPlayerBuiltEntityEventFilterGhostType extends BaseLuaPlayerBuiltEntityEventFilter {
3737
+ /**
3738
+ * The condition to filter on.
3739
+ */
3740
+ 'filter': 'ghost_type';
3254
3741
  /**
3255
3742
  * The ghost prototype type.
3256
3743
  */
@@ -3260,7 +3747,7 @@ interface LuaPlayerRepairedEntityEventFilterGhostType extends BaseLuaPlayerRepai
3260
3747
  *
3261
3748
  * Applies to variant case `name`
3262
3749
  */
3263
- interface LuaPlayerRepairedEntityEventFilterName extends BaseLuaPlayerRepairedEntityEventFilter {
3750
+ interface LuaPlayerBuiltEntityEventFilterName extends BaseLuaPlayerBuiltEntityEventFilter {
3264
3751
  /**
3265
3752
  * The condition to filter on.
3266
3753
  */
@@ -3274,7 +3761,78 @@ interface LuaPlayerRepairedEntityEventFilterName extends BaseLuaPlayerRepairedEn
3274
3761
  *
3275
3762
  * Applies to variant case `type`
3276
3763
  */
3277
- interface LuaPlayerRepairedEntityEventFilterType extends BaseLuaPlayerRepairedEntityEventFilter {
3764
+ interface LuaPlayerBuiltEntityEventFilterType extends BaseLuaPlayerBuiltEntityEventFilter {
3765
+ /**
3766
+ * The condition to filter on.
3767
+ */
3768
+ 'filter': 'type';
3769
+ /**
3770
+ * The prototype type.
3771
+ */
3772
+ 'type': string;
3773
+ }
3774
+ interface BaseLuaPlayerMinedEntityEventFilter {
3775
+ /**
3776
+ * The condition to filter on.
3777
+ */
3778
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3779
+ /**
3780
+ * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3781
+ */
3782
+ mode?: 'or' | 'and';
3783
+ /**
3784
+ * Inverts the condition. Default is `false`.
3785
+ */
3786
+ invert?: boolean;
3787
+ }
3788
+ type LuaPlayerMinedEntityEventFilter = BaseLuaPlayerMinedEntityEventFilter | LuaPlayerMinedEntityEventFilterGhostName | LuaPlayerMinedEntityEventFilterGhostType | LuaPlayerMinedEntityEventFilterName | LuaPlayerMinedEntityEventFilterType;
3789
+ /**
3790
+ *
3791
+ * Applies to variant case `ghost_name`
3792
+ */
3793
+ interface LuaPlayerMinedEntityEventFilterGhostName extends BaseLuaPlayerMinedEntityEventFilter {
3794
+ /**
3795
+ * The condition to filter on.
3796
+ */
3797
+ 'filter': 'ghost_name';
3798
+ /**
3799
+ * The ghost prototype name.
3800
+ */
3801
+ 'name': string;
3802
+ }
3803
+ /**
3804
+ *
3805
+ * Applies to variant case `ghost_type`
3806
+ */
3807
+ interface LuaPlayerMinedEntityEventFilterGhostType extends BaseLuaPlayerMinedEntityEventFilter {
3808
+ /**
3809
+ * The condition to filter on.
3810
+ */
3811
+ 'filter': 'ghost_type';
3812
+ /**
3813
+ * The ghost prototype type.
3814
+ */
3815
+ 'type': string;
3816
+ }
3817
+ /**
3818
+ *
3819
+ * Applies to variant case `name`
3820
+ */
3821
+ interface LuaPlayerMinedEntityEventFilterName extends BaseLuaPlayerMinedEntityEventFilter {
3822
+ /**
3823
+ * The condition to filter on.
3824
+ */
3825
+ 'filter': 'name';
3826
+ /**
3827
+ * The prototype name.
3828
+ */
3829
+ 'name': string;
3830
+ }
3831
+ /**
3832
+ *
3833
+ * Applies to variant case `type`
3834
+ */
3835
+ interface LuaPlayerMinedEntityEventFilterType extends BaseLuaPlayerMinedEntityEventFilter {
3278
3836
  /**
3279
3837
  * The condition to filter on.
3280
3838
  */
@@ -3284,11 +3842,11 @@ interface LuaPlayerRepairedEntityEventFilterType extends BaseLuaPlayerRepairedEn
3284
3842
  */
3285
3843
  'type': string;
3286
3844
  }
3287
- interface BaseLuaPostEntityDiedEventFilter {
3845
+ interface BaseLuaPlayerRepairedEntityEventFilter {
3288
3846
  /**
3289
3847
  * The condition to filter on.
3290
3848
  */
3291
- filter: 'type';
3849
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3292
3850
  /**
3293
3851
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3294
3852
  */
@@ -3298,12 +3856,54 @@ interface BaseLuaPostEntityDiedEventFilter {
3298
3856
  */
3299
3857
  invert?: boolean;
3300
3858
  }
3301
- type LuaPostEntityDiedEventFilter = BaseLuaPostEntityDiedEventFilter | LuaPostEntityDiedEventFilterType;
3859
+ type LuaPlayerRepairedEntityEventFilter = BaseLuaPlayerRepairedEntityEventFilter | LuaPlayerRepairedEntityEventFilterGhostName | LuaPlayerRepairedEntityEventFilterGhostType | LuaPlayerRepairedEntityEventFilterName | LuaPlayerRepairedEntityEventFilterType;
3860
+ /**
3861
+ *
3862
+ * Applies to variant case `ghost_name`
3863
+ */
3864
+ interface LuaPlayerRepairedEntityEventFilterGhostName extends BaseLuaPlayerRepairedEntityEventFilter {
3865
+ /**
3866
+ * The condition to filter on.
3867
+ */
3868
+ 'filter': 'ghost_name';
3869
+ /**
3870
+ * The ghost prototype name.
3871
+ */
3872
+ 'name': string;
3873
+ }
3874
+ /**
3875
+ *
3876
+ * Applies to variant case `ghost_type`
3877
+ */
3878
+ interface LuaPlayerRepairedEntityEventFilterGhostType extends BaseLuaPlayerRepairedEntityEventFilter {
3879
+ /**
3880
+ * The condition to filter on.
3881
+ */
3882
+ 'filter': 'ghost_type';
3883
+ /**
3884
+ * The ghost prototype type.
3885
+ */
3886
+ 'type': string;
3887
+ }
3888
+ /**
3889
+ *
3890
+ * Applies to variant case `name`
3891
+ */
3892
+ interface LuaPlayerRepairedEntityEventFilterName extends BaseLuaPlayerRepairedEntityEventFilter {
3893
+ /**
3894
+ * The condition to filter on.
3895
+ */
3896
+ 'filter': 'name';
3897
+ /**
3898
+ * The prototype name.
3899
+ */
3900
+ 'name': string;
3901
+ }
3302
3902
  /**
3303
3903
  *
3304
3904
  * Applies to variant case `type`
3305
3905
  */
3306
- interface LuaPostEntityDiedEventFilterType extends BaseLuaPostEntityDiedEventFilter {
3906
+ interface LuaPlayerRepairedEntityEventFilterType extends BaseLuaPlayerRepairedEntityEventFilter {
3307
3907
  /**
3308
3908
  * The condition to filter on.
3309
3909
  */
@@ -3313,11 +3913,25 @@ interface LuaPostEntityDiedEventFilterType extends BaseLuaPostEntityDiedEventFil
3313
3913
  */
3314
3914
  'type': string;
3315
3915
  }
3916
+ interface LuaPostEntityDiedEventFilter {
3917
+ /**
3918
+ * The condition to filter on.
3919
+ */
3920
+ filter: 'ghost';
3921
+ /**
3922
+ * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3923
+ */
3924
+ mode?: 'or' | 'and';
3925
+ /**
3926
+ * Inverts the condition. Default is `false`.
3927
+ */
3928
+ invert?: boolean;
3929
+ }
3316
3930
  interface BaseLuaPreGhostDeconstructedEventFilter {
3317
3931
  /**
3318
3932
  * The condition to filter on.
3319
3933
  */
3320
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
3934
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3321
3935
  /**
3322
3936
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3323
3937
  */
@@ -3388,7 +4002,7 @@ interface BaseLuaPreGhostUpgradedEventFilter {
3388
4002
  /**
3389
4003
  * The condition to filter on.
3390
4004
  */
3391
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4005
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3392
4006
  /**
3393
4007
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3394
4008
  */
@@ -3455,11 +4069,82 @@ interface LuaPreGhostUpgradedEventFilterType extends BaseLuaPreGhostUpgradedEven
3455
4069
  */
3456
4070
  'type': string;
3457
4071
  }
4072
+ interface BaseLuaPrePlatformMinedEntityEventFilter {
4073
+ /**
4074
+ * The condition to filter on.
4075
+ */
4076
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
4077
+ /**
4078
+ * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
4079
+ */
4080
+ mode?: 'or' | 'and';
4081
+ /**
4082
+ * Inverts the condition. Default is `false`.
4083
+ */
4084
+ invert?: boolean;
4085
+ }
4086
+ type LuaPrePlatformMinedEntityEventFilter = BaseLuaPrePlatformMinedEntityEventFilter | LuaPrePlatformMinedEntityEventFilterGhostName | LuaPrePlatformMinedEntityEventFilterGhostType | LuaPrePlatformMinedEntityEventFilterName | LuaPrePlatformMinedEntityEventFilterType;
4087
+ /**
4088
+ *
4089
+ * Applies to variant case `ghost_name`
4090
+ */
4091
+ interface LuaPrePlatformMinedEntityEventFilterGhostName extends BaseLuaPrePlatformMinedEntityEventFilter {
4092
+ /**
4093
+ * The condition to filter on.
4094
+ */
4095
+ 'filter': 'ghost_name';
4096
+ /**
4097
+ * The ghost prototype name.
4098
+ */
4099
+ 'name': string;
4100
+ }
4101
+ /**
4102
+ *
4103
+ * Applies to variant case `ghost_type`
4104
+ */
4105
+ interface LuaPrePlatformMinedEntityEventFilterGhostType extends BaseLuaPrePlatformMinedEntityEventFilter {
4106
+ /**
4107
+ * The condition to filter on.
4108
+ */
4109
+ 'filter': 'ghost_type';
4110
+ /**
4111
+ * The ghost prototype type.
4112
+ */
4113
+ 'type': string;
4114
+ }
4115
+ /**
4116
+ *
4117
+ * Applies to variant case `name`
4118
+ */
4119
+ interface LuaPrePlatformMinedEntityEventFilterName extends BaseLuaPrePlatformMinedEntityEventFilter {
4120
+ /**
4121
+ * The condition to filter on.
4122
+ */
4123
+ 'filter': 'name';
4124
+ /**
4125
+ * The prototype name.
4126
+ */
4127
+ 'name': string;
4128
+ }
4129
+ /**
4130
+ *
4131
+ * Applies to variant case `type`
4132
+ */
4133
+ interface LuaPrePlatformMinedEntityEventFilterType extends BaseLuaPrePlatformMinedEntityEventFilter {
4134
+ /**
4135
+ * The condition to filter on.
4136
+ */
4137
+ 'filter': 'type';
4138
+ /**
4139
+ * The prototype type.
4140
+ */
4141
+ 'type': string;
4142
+ }
3458
4143
  interface BaseLuaPrePlayerMinedEntityEventFilter {
3459
4144
  /**
3460
4145
  * The condition to filter on.
3461
4146
  */
3462
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4147
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3463
4148
  /**
3464
4149
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3465
4150
  */
@@ -3530,7 +4215,7 @@ interface BaseLuaPreRobotMinedEntityEventFilter {
3530
4215
  /**
3531
4216
  * The condition to filter on.
3532
4217
  */
3533
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4218
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3534
4219
  /**
3535
4220
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3536
4221
  */
@@ -3601,7 +4286,7 @@ interface BaseLuaRobotBuiltEntityEventFilter {
3601
4286
  /**
3602
4287
  * The condition to filter on.
3603
4288
  */
3604
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'force';
4289
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'force';
3605
4290
  /**
3606
4291
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3607
4292
  */
@@ -3686,7 +4371,7 @@ interface BaseLuaRobotMinedEntityEventFilter {
3686
4371
  /**
3687
4372
  * The condition to filter on.
3688
4373
  */
3689
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4374
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3690
4375
  /**
3691
4376
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3692
4377
  */
@@ -3757,7 +4442,7 @@ interface BaseLuaScriptRaisedBuiltEventFilter {
3757
4442
  /**
3758
4443
  * The condition to filter on.
3759
4444
  */
3760
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4445
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3761
4446
  /**
3762
4447
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3763
4448
  */
@@ -3828,7 +4513,7 @@ interface BaseLuaScriptRaisedDestroyEventFilter {
3828
4513
  /**
3829
4514
  * The condition to filter on.
3830
4515
  */
3831
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4516
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3832
4517
  /**
3833
4518
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3834
4519
  */
@@ -3899,7 +4584,7 @@ interface BaseLuaScriptRaisedReviveEventFilter {
3899
4584
  /**
3900
4585
  * The condition to filter on.
3901
4586
  */
3902
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4587
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3903
4588
  /**
3904
4589
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3905
4590
  */
@@ -3970,7 +4655,7 @@ interface BaseLuaScriptRaisedTeleportedEventFilter {
3970
4655
  /**
3971
4656
  * The condition to filter on.
3972
4657
  */
3973
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4658
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
3974
4659
  /**
3975
4660
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
3976
4661
  */
@@ -4041,7 +4726,7 @@ interface BaseLuaSectorScannedEventFilter {
4041
4726
  /**
4042
4727
  * The condition to filter on.
4043
4728
  */
4044
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4729
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
4045
4730
  /**
4046
4731
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
4047
4732
  */
@@ -4112,7 +4797,7 @@ interface BaseLuaUpgradeCancelledEventFilter {
4112
4797
  /**
4113
4798
  * The condition to filter on.
4114
4799
  */
4115
- filter: 'type' | 'name' | 'ghost_type' | 'ghost_name' | 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable';
4800
+ filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable' | 'type' | 'name' | 'ghost_type' | 'ghost_name';
4116
4801
  /**
4117
4802
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
4118
4803
  */
@@ -4189,6 +4874,7 @@ interface MapAndDifficultySettings {
4189
4874
  unit_group: UnitGroupMapSettings;
4190
4875
  steering: SteeringMapSettings;
4191
4876
  path_finder: PathFinderMapSettings;
4877
+ asteroids: AsteroidMapSettings;
4192
4878
  /**
4193
4879
  * If a behavior fails this many times, the enemy (or enemy group) is destroyed. This solves biters getting stuck within their own base.
4194
4880
  */
@@ -4196,16 +4882,14 @@ interface MapAndDifficultySettings {
4196
4882
  difficulty_settings: MapDifficultySettings;
4197
4883
  }
4198
4884
  interface MapDifficultySettings {
4199
- recipe_difficulty: defines.difficulty_settings.recipe_difficulty;
4200
- technology_difficulty: defines.difficulty_settings.technology_difficulty;
4201
4885
  /**
4202
4886
  * A value in range [0.001, 1000].
4203
4887
  */
4204
4888
  technology_price_multiplier: double;
4205
4889
  /**
4206
- * Changing this to `"always"` or `"after-victory"` does not automatically unlock the research queue. See {@link LuaForce::research_queue_enabled | runtime:LuaForce::research_queue_enabled} for that.
4890
+ * A value in range [0.01, 100].
4207
4891
  */
4208
- research_queue_setting: 'after-victory' | 'always' | 'never';
4892
+ spoil_time_modifier: double;
4209
4893
  }
4210
4894
  /**
4211
4895
  * The data that can be extracted from a map exchange string, as a plain table.
@@ -4227,7 +4911,6 @@ interface MapGenPreset {
4227
4911
  advanced_settings?: AdvancedMapGenSettings;
4228
4912
  }
4229
4913
  /**
4230
- * The 'map type' dropdown in the map generation GUI is actually a selector for elevation generator. The base game sets `property_expression_names.elevation` to `"0_16-elevation"` to reproduce terrain from 0.16 or to `"0_17-island"` for the island preset. If generators are available for other properties, the 'map type' dropdown in the GUI will be renamed to 'elevation' and shown along with selectors for the other selectable properties.
4231
4914
  * @example ```
4232
4915
  -- Assuming a NamedNoiseExpression with the name "my-alternate-grass1-probability" is defined...
4233
4916
  local surface = game.player.surface
@@ -4247,14 +4930,6 @@ surface.map_gen_settings = mgs
4247
4930
  ```
4248
4931
  */
4249
4932
  interface MapGenSettings {
4250
- /**
4251
- * The inverse of 'water scale' in the map generator GUI. Lower `terrain_segmentation` increases the scale of elevation features (lakes, continents, etc). This behavior can be overridden with alternate elevation generators (see `property_expression_names`, below).
4252
- */
4253
- terrain_segmentation: MapGenSize;
4254
- /**
4255
- * The equivalent to 'water coverage' in the map generator GUI. Specifically, when this value is non-zero, `water_level = 10 * log2` (the value of this field), and the elevation generator subtracts water level from elevation before adding starting lakes. If water is set to 'none', elevation is clamped to a small positive value before adding starting lakes. This behavior can be overridden with alternate elevation generators (see `property_expression_names`, below).
4256
- */
4257
- water: MapGenSize;
4258
4933
  /**
4259
4934
  * Indexed by autoplace control prototype name.
4260
4935
  */
@@ -4267,10 +4942,6 @@ interface MapGenSettings {
4267
4942
  * Each setting in this dictionary maps the string type to the settings for that type.
4268
4943
  */
4269
4944
  autoplace_settings: Record<'entity' | 'tile' | 'decorative', AutoplaceSettings>;
4270
- /**
4271
- * Map generation settings for entities of the type "cliff".
4272
- */
4273
- cliff_settings: CliffPlacementSettings;
4274
4945
  /**
4275
4946
  * The random seed used to generated this map.
4276
4947
  */
@@ -4292,18 +4963,27 @@ interface MapGenSettings {
4292
4963
  */
4293
4964
  starting_points: MapPosition[];
4294
4965
  /**
4295
- * Whether peaceful mode is enabled for this map.
4966
+ * Whether enemy creatures will not attack unless the player first attacks them.
4296
4967
  */
4297
4968
  peaceful_mode: boolean;
4969
+ /**
4970
+ * Whether enemy creatures will not naturally spawn from spawners, map gen, or trigger effects.
4971
+ */
4972
+ no_enemies_mode: boolean;
4298
4973
  /**
4299
4974
  * Overrides for tile property value generators.
4300
4975
  */
4301
4976
  property_expression_names: PropertyExpressionNames;
4977
+ /**
4978
+ * Map generation settings for entities of the type "cliff".
4979
+ */
4980
+ cliff_settings: CliffPlacementSettings;
4981
+ territory_settings: TerritorySettings;
4302
4982
  }
4303
4983
  /**
4304
4984
  * A floating point number specifying an amount.
4305
4985
  *
4306
- * For backwards compatibility, MapGenSizes can also be specified as one of the following strings, which will be converted to a number (when queried, a number will always be returned):
4986
+ * For backwards compatibility, MapGenSizes can also be specified as a string, which will be converted to a number (when queried, a number will always be returned).
4307
4987
  *
4308
4988
  * The map generation algorithm officially supports the range of values the in-game map generation screen shows (specifically `0` and values from `1/6` to `6`). Values outside this range are not guaranteed to work as expected.
4309
4989
  */
@@ -4383,11 +5063,12 @@ type MapPosition = {
4383
5063
  /**
4384
5064
  * Various game-related settings. Updating any of the attributes will immediately take effect in the game engine.
4385
5065
  * @example ```
4386
- -- Increase the number of short paths the pathfinder can cache
5066
+ -- Increase the number of short paths the pathfinder can cache.
4387
5067
  game.map_settings.path_finder.short_cache_size = 15
4388
5068
  ```
4389
5069
  */
4390
5070
  interface MapSettings {
5071
+ asteroids: AsteroidMapSettings;
4391
5072
  enemy_evolution: EnemyEvolutionMapSettings;
4392
5073
  enemy_expansion: EnemyExpansionMapSettings;
4393
5074
  /**
@@ -4399,6 +5080,10 @@ interface MapSettings {
4399
5080
  steering: SteeringMapSetting;
4400
5081
  unit_group: UnitGroupMapSettings;
4401
5082
  }
5083
+ /**
5084
+ * `math.huge` represents the maximum possible tick.
5085
+ */
5086
+ type MapTick = uint64;
4402
5087
  /**
4403
5088
  * What is shown in the map view. If a field is not given, that setting will not be changed.
4404
5089
  */
@@ -4414,46 +5099,125 @@ interface MapViewSettings {
4414
5099
  'show-worker-robots'?: boolean;
4415
5100
  'show-rail-signal-states'?: boolean;
4416
5101
  'show-recipe-icons'?: boolean;
5102
+ 'show-pipelines'?: boolean;
4417
5103
  'show-non-standard-map-info'?: boolean;
4418
5104
  }
4419
- interface ModChangeData {
4420
- /**
4421
- * Old version of the mod. May be `nil` if the mod wasn't previously present (i.e. it was just added).
4422
- */
4423
- old_version: string;
4424
- /**
4425
- * New version of the mod. May be `nil` if the mod is no longer present (i.e. it was just removed).
4426
- */
4427
- new_version: string;
4428
- }
4429
- interface ModSetting {
4430
- /**
4431
- * The value of the mod setting. The type depends on the kind of setting.
4432
- */
4433
- value: int | double | boolean | string | Color;
4434
- }
4435
- interface BaseModSettingPrototypeFilter {
5105
+ interface MarketIngredient {
4436
5106
  /**
4437
- * The condition to filter on.
5107
+ * Prototype name of the required item.
4438
5108
  */
4439
- filter: 'type' | 'mod' | 'setting-type';
5109
+ name: string;
4440
5110
  /**
4441
- * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
5111
+ * Normal quality will be used if not specified.
4442
5112
  */
4443
- mode?: 'or' | 'and';
5113
+ quality?: string;
4444
5114
  /**
4445
- * Inverts the condition. Default is `false`.
5115
+ * Count of the item. Cannot be 0.
4446
5116
  */
4447
- invert?: boolean;
5117
+ count: ItemCountType;
4448
5118
  }
4449
- type ModSettingPrototypeFilter = BaseModSettingPrototypeFilter | ModSettingPrototypeFilterMod | ModSettingPrototypeFilterSettingType | ModSettingPrototypeFilterType;
4450
5119
  /**
5120
+ * A string that represents a math expression. The expression parser recognizes four basic token types (with their regex):
4451
5121
  *
4452
- * Applies to variant case `mod`
4453
- */
4454
- interface ModSettingPrototypeFilterMod extends BaseModSettingPrototypeFilter {
4455
- /**
4456
- * The condition to filter on.
5122
+ * - Whitespace: `[ \n\r\t]*`
5123
+ *
5124
+ * - Number: `(0x[0-9a-f]+|([0-9]+\.?[0-9]*|\.[0-9]+)(e-?[0-9]+)?)` (e.g. `3.2`, `100`, `.6`, `4.2e-5`, `0x2a5f`). Supports hexadecimal input and scientific notation for decimal numbers.
5125
+ *
5126
+ * - Operator: `+`, `-`, `*`, `/`, `^`, and `()` for brackets, which may be nested.
5127
+ *
5128
+ * - Identifier: The functions listed below and any variables listed where the expression is used.
5129
+ *
5130
+ * Identifiers are used to name functions and variables, which result in or represent numbers. The following functions are always available:
5131
+ *
5132
+ * - `abs(value)`: Returns absolute value of the given argument; i.e. if the argument is negative, it is inverted.
5133
+ *
5134
+ * - `log2(value)`: Returns a binary logarithm of the given value.
5135
+ *
5136
+ * - `sign(value)`: Returns `-1` for negative numbers, `0` for zero (regardless of sign), `1` for positive numbers
5137
+ *
5138
+ * - `max(value1, value2, ...)`: Returns the greater of the given values. Supports between 2 and 255 arguments.
5139
+ *
5140
+ * - `min(value1, value2, ...)`: Returns the smaller of the given values. Supports between 2 and 255 arguments.
5141
+ *
5142
+ * The property where the expression is used may provide variables. For example in {@link TechnologyUnit::count_formula | prototype:TechnologyUnit::count_formula} `L` and `l` may be used for the technology level.
5143
+ *
5144
+ * The formula is executed following the {@link BODMAS | https://en.wikipedia.org/wiki/Order_of_operations#Conventional_order} order (also known as PEMDAS).
5145
+ * @example ```
5146
+ "2500 * (L - 3)"
5147
+ ```
5148
+ * @example ```
5149
+ "(4e5 * (abs(speed) + 10.5)) / weight"
5150
+ ```
5151
+ */
5152
+ type MathExpression = string;
5153
+ interface MineableProperties {
5154
+ /**
5155
+ * Is this entity mineable at all?
5156
+ */
5157
+ minable: boolean;
5158
+ /**
5159
+ * Energy required to mine an entity.
5160
+ */
5161
+ mining_time: double;
5162
+ /**
5163
+ * Prototype name of the particle produced when mining this entity. Will only be present if this entity produces any particle during mining.
5164
+ */
5165
+ mining_particle?: string;
5166
+ /**
5167
+ * Products obtained by mining this entity.
5168
+ */
5169
+ products?: Product[];
5170
+ /**
5171
+ * The required fluid amount if any.
5172
+ */
5173
+ fluid_amount?: double;
5174
+ /**
5175
+ * The prototype name of the required fluid if any.
5176
+ */
5177
+ required_fluid?: string;
5178
+ /**
5179
+ * The mining trigger if any.
5180
+ */
5181
+ mining_trigger?: TriggerItem[];
5182
+ }
5183
+ interface ModChangeData {
5184
+ /**
5185
+ * Old version of the mod. May be `nil` if the mod wasn't previously present (i.e. it was just added).
5186
+ */
5187
+ old_version: string;
5188
+ /**
5189
+ * New version of the mod. May be `nil` if the mod is no longer present (i.e. it was just removed).
5190
+ */
5191
+ new_version: string;
5192
+ }
5193
+ interface ModSetting {
5194
+ /**
5195
+ * The value of the mod setting. The type depends on the kind of setting.
5196
+ */
5197
+ value: int | double | boolean | string | Color;
5198
+ }
5199
+ interface BaseModSettingPrototypeFilter {
5200
+ /**
5201
+ * The condition to filter on.
5202
+ */
5203
+ filter: 'type' | 'mod' | 'setting-type';
5204
+ /**
5205
+ * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
5206
+ */
5207
+ mode?: 'or' | 'and';
5208
+ /**
5209
+ * Inverts the condition. Default is `false`.
5210
+ */
5211
+ invert?: boolean;
5212
+ }
5213
+ type ModSettingPrototypeFilter = BaseModSettingPrototypeFilter | ModSettingPrototypeFilterMod | ModSettingPrototypeFilterSettingType | ModSettingPrototypeFilterType;
5214
+ /**
5215
+ *
5216
+ * Applies to variant case `mod`
5217
+ */
5218
+ interface ModSettingPrototypeFilterMod extends BaseModSettingPrototypeFilter {
5219
+ /**
5220
+ * The condition to filter on.
4457
5221
  */
4458
5222
  'filter': 'mod';
4459
5223
  /**
@@ -4492,20 +5256,18 @@ interface ModSettingPrototypeFilterType extends BaseModSettingPrototypeFilter {
4492
5256
  /**
4493
5257
  * Used by {@link TechnologyModifier | runtime:TechnologyModifier}.
4494
5258
  */
4495
- type ModifierType = 'inserter-stack-size-bonus' | 'stack-inserter-capacity-bonus' | 'laboratory-speed' | 'character-logistic-trash-slots' | 'maximum-following-robots-count' | 'worker-robot-speed' | 'worker-robot-storage' | 'ghost-time-to-live' | 'turret-attack' | 'ammo-damage' | 'give-item' | 'gun-speed' | 'unlock-recipe' | 'character-crafting-speed' | 'character-mining-speed' | 'character-running-speed' | 'character-build-distance' | 'character-item-drop-distance' | 'character-reach-distance' | 'character-resource-reach-distance' | 'character-item-pickup-distance' | 'character-loot-pickup-distance' | 'character-inventory-slots-bonus' | 'deconstruction-time-to-live' | 'max-failed-attempts-per-tick-per-construction-queue' | 'max-successful-attempts-per-tick-per-construction-queue' | 'character-health-bonus' | 'mining-drill-productivity-bonus' | 'train-braking-force-bonus' | 'zoom-to-world-enabled' | 'zoom-to-world-ghost-building-enabled' | 'zoom-to-world-blueprint-enabled' | 'zoom-to-world-deconstruction-planner-enabled' | 'zoom-to-world-upgrade-planner-enabled' | 'zoom-to-world-selection-tool-enabled' | 'worker-robot-battery' | 'laboratory-productivity' | 'follower-robot-lifetime' | 'artillery-range' | 'nothing' | 'character-logistic-requests';
4496
- interface ModuleEffectValue {
4497
- /**
4498
- * The percentual increase of the attribute. A value of `0.6` means a 60% increase.
4499
- */
4500
- bonus: float;
4501
- }
5259
+ type ModifierType = 'inserter-stack-size-bonus' | 'bulk-inserter-capacity-bonus' | 'laboratory-speed' | 'character-logistic-trash-slots' | 'maximum-following-robots-count' | 'worker-robot-speed' | 'worker-robot-storage' | 'turret-attack' | 'ammo-damage' | 'give-item' | 'gun-speed' | 'unlock-recipe' | 'character-crafting-speed' | 'character-mining-speed' | 'character-running-speed' | 'character-build-distance' | 'character-item-drop-distance' | 'character-reach-distance' | 'character-resource-reach-distance' | 'character-item-pickup-distance' | 'character-loot-pickup-distance' | 'character-inventory-slots-bonus' | 'deconstruction-time-to-live' | 'max-failed-attempts-per-tick-per-construction-queue' | 'max-successful-attempts-per-tick-per-construction-queue' | 'character-health-bonus' | 'mining-drill-productivity-bonus' | 'train-braking-force-bonus' | 'worker-robot-battery' | 'laboratory-productivity' | 'follower-robot-lifetime' | 'artillery-range' | 'nothing' | 'character-logistic-requests' | 'unlock-space-location' | 'unlock-quality' | 'unlock-space-platforms' | 'unlock-circuit-network' | 'cargo-landing-pad-count' | 'change-recipe-productivity' | 'cliff-deconstruction-enabled' | 'mining-with-fluid' | 'rail-support-on-deep-oil-ocean' | 'rail-planner-allow-elevated-rails' | 'beacon-distribution' | 'create-ghost-on-entity-death' | 'belt-stack-size-bonus' | 'vehicle-logistics';
5260
+ /**
5261
+ * The percentual increase of the attribute. A value of `0.6` means a 60% increase.
5262
+ */
5263
+ type ModuleEffectValue = float;
4502
5264
  /**
4503
5265
  * @example ```
4504
5266
  -- These are the effects of the vanilla Productivity Module 3 (up to floating point imprecisions)
4505
- {consumption={bonus=0.6},
4506
- speed={bonus=-0.15},
4507
- productivity={bonus=0.06},
4508
- pollution={bonus=0.075}}
5267
+ {consumption=0.6,
5268
+ speed=-0.15,
5269
+ productivity=0.06,
5270
+ pollution=0.075}
4509
5271
  ```
4510
5272
  */
4511
5273
  interface ModuleEffects {
@@ -4513,6 +5275,7 @@ interface ModuleEffects {
4513
5275
  speed?: ModuleEffectValue;
4514
5276
  productivity?: ModuleEffectValue;
4515
5277
  pollution?: ModuleEffectValue;
5278
+ quality?: ModuleEffectValue;
4516
5279
  }
4517
5280
  /**
4518
5281
  * A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all.
@@ -4546,7 +5309,7 @@ interface Offer {
4546
5309
  /**
4547
5310
  * List of prices.
4548
5311
  */
4549
- price: Ingredient[];
5312
+ price?: MarketIngredient[];
4550
5313
  /**
4551
5314
  * The action that will take place when a player accepts the offer. Usually a `"give-item"` modifier.
4552
5315
  */
@@ -4556,6 +5319,16 @@ interface OldTileAndPosition {
4556
5319
  old_tile: LuaTilePrototype;
4557
5320
  position: TilePosition;
4558
5321
  }
5322
+ /**
5323
+ * A particle prototype may be specified in one of two ways.
5324
+ */
5325
+ type ParticleID = /**
5326
+ * The particle prototype.
5327
+ */
5328
+ LuaParticlePrototype | /**
5329
+ * The prototype name.
5330
+ */
5331
+ string;
4559
5332
  interface PathFinderMapSettings {
4560
5333
  /**
4561
5334
  * The pathfinder performs a step of the backward search every `fwd2bwd_ratio`'th step. The minimum allowed value is `2`, which means symmetric search. The default value is `5`.
@@ -4565,6 +5338,10 @@ interface PathFinderMapSettings {
4565
5338
  * When looking at which node to check next, their heuristic value is multiplied by this ratio. The higher it is, the more the search is directed straight at the goal. Defaults to `2`.
4566
5339
  */
4567
5340
  goal_pressure_ratio: double;
5341
+ /**
5342
+ * Whether to cache paths at all. Defaults to `true`.
5343
+ */
5344
+ use_path_cache: boolean;
4568
5345
  /**
4569
5346
  * The maximum number of nodes that are expanded per tick. Defaults to `1 000`.
4570
5347
  */
@@ -4573,10 +5350,6 @@ interface PathFinderMapSettings {
4573
5350
  * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8 000`.
4574
5351
  */
4575
5352
  max_work_done_per_tick: uint;
4576
- /**
4577
- * Whether to cache paths at all. Defaults to `true`.
4578
- */
4579
- use_path_cache: boolean;
4580
5353
  /**
4581
5354
  * Number of elements in the short cache. Defaults to `5`.
4582
5355
  */
@@ -4731,7 +5504,7 @@ interface PathfinderWaypoint {
4731
5504
  */
4732
5505
  interface PipeConnection {
4733
5506
  flow_direction: 'input' | 'output' | 'input-output';
4734
- connection_type: 'normal' | 'underground';
5507
+ connection_type: 'normal' | 'underground' | 'linked';
4735
5508
  /**
4736
5509
  * The absolute position of this connection within the entity.
4737
5510
  */
@@ -4753,6 +5526,18 @@ interface PipeConnection {
4753
5526
  */
4754
5527
  target_pipe_connection_index?: uint;
4755
5528
  }
5529
+ interface PipeConnectionDefinition {
5530
+ /**
5531
+ * The 4 cardinal direction connection points for this pipe.
5532
+ */
5533
+ positions: MapPosition[];
5534
+ /**
5535
+ * The maximum tile distance this underground connection can connect.
5536
+ */
5537
+ max_underground_distance?: uint;
5538
+ flow_direction: 'input-output' | 'input' | 'output';
5539
+ direction: defines.direction;
5540
+ }
4756
5541
  interface PlaceAsTileResult {
4757
5542
  /**
4758
5543
  * The tile prototype.
@@ -4761,6 +5546,13 @@ interface PlaceAsTileResult {
4761
5546
  condition_size: uint;
4762
5547
  condition: CollisionMask;
4763
5548
  }
5549
+ interface PlatformSchedule {
5550
+ /**
5551
+ * Index of the currently active record
5552
+ */
5553
+ current: uint;
5554
+ records: ScheduleRecord[];
5555
+ }
4764
5556
  /**
4765
5557
  * A player may be specified in one of three ways.
4766
5558
  */
@@ -4847,13 +5639,14 @@ interface PrintSettings {
4847
5639
  /**
4848
5640
  * The volume of the sound to play. Must be between 0 and 1 inclusive. Defaults to 1.
4849
5641
  */
4850
- volume_modifier?: double;
5642
+ volume_modifier?: float;
4851
5643
  /**
4852
5644
  * If set to false, message will not be part of game state and will disappear from output console after save-load. Defaults to `true`.
4853
5645
  */
4854
5646
  game_state?: boolean;
4855
5647
  }
4856
5648
  /**
5649
+ * Returns one of the subtypes, depending on the value of `type`.
4857
5650
  * @example ```
4858
5651
  -- Products of the "steel-chest" recipe (an array of Product)
4859
5652
  {{type="item", name="steel-chest", amount=1}}
@@ -4866,66 +5659,20 @@ interface PrintSettings {
4866
5659
  ```
4867
5660
  * @example ```
4868
5661
  -- What a custom recipe would look like that had a probability of 0.5 to return a
4869
- -- minimum amount of 1 and amaximum amount of 5
5662
+ -- minimum amount of 1 and a maximum amount of 5
4870
5663
  {{type="item", name="custom-item", probability=0.5, amount_min=1, amount_max=5}}
4871
5664
  ```
4872
5665
  */
4873
- interface BaseProduct {
4874
- type: 'item' | 'fluid';
4875
- /**
4876
- * Prototype name of the result.
4877
- */
4878
- name: string;
4879
- /**
4880
- * Amount of the item or fluid to give. If not specified, `amount_min`, `amount_max` and `probability` must all be specified.
4881
- */
4882
- amount?: double;
4883
- /**
4884
- * Minimal amount of the item or fluid to give. Has no effect when `amount` is specified.
4885
- */
4886
- amount_min?: uint | double;
4887
- /**
4888
- * Maximum amount of the item or fluid to give. Has no effect when `amount` is specified.
4889
- */
4890
- amount_max?: uint | double;
4891
- /**
4892
- * A value in range [0, 1]. Item or fluid is only given with this probability; otherwise no product is produced.
4893
- */
4894
- probability?: double;
4895
- /**
4896
- * How much of this product is a catalyst.
4897
- */
4898
- catalyst_amount?: uint | double;
4899
- }
4900
- /**
4901
- * @example ```
4902
- -- Products of the "steel-chest" recipe (an array of Product)
4903
- {{type="item", name="steel-chest", amount=1}}
4904
- ```
4905
- * @example ```
4906
- -- Products of the "advanced-oil-processing" recipe
4907
- {{type="fluid", name="heavy-oil", amount=1},
4908
- {type="fluid", name="light-oil", amount=4.5},
4909
- {type="fluid", name="petroleum-gas", amount=5.5}}
4910
- ```
4911
- * @example ```
4912
- -- What a custom recipe would look like that had a probability of 0.5 to return a
4913
- -- minimum amount of 1 and amaximum amount of 5
4914
- {{type="item", name="custom-item", probability=0.5, amount_min=1, amount_max=5}}
4915
- ```
5666
+ type Product = /**
5667
+ * Returned when the `type` is `"item"`.
4916
5668
  */
4917
- type Product = BaseProduct | ProductFluid;
4918
- /**
4919
- *
4920
- * Applies to variant case `fluid`
5669
+ ItemProduct | /**
5670
+ * Returned when the `type` is `"fluid"`.
4921
5671
  */
4922
- interface ProductFluid extends BaseProduct {
4923
- 'type': 'fluid';
4924
- /**
4925
- * The fluid temperature of this product.
4926
- */
4927
- 'temperature'?: double;
4928
- }
5672
+ FluidProduct | /**
5673
+ * Returned when the `type` is `"research-progress"`.
5674
+ */
5675
+ ResearchProgressProduct;
4929
5676
  interface ProgrammableSpeakerAlertParameters {
4930
5677
  show_alert: boolean;
4931
5678
  show_on_map: boolean;
@@ -4942,10 +5689,23 @@ interface ProgrammableSpeakerInstrument {
4942
5689
  notes: string[];
4943
5690
  }
4944
5691
  interface ProgrammableSpeakerParameters {
4945
- playback_volume: double;
4946
- playback_globally: boolean;
5692
+ playback_volume: float;
5693
+ playback_mode: ProgrammableSpeakerPlaybackMode;
4947
5694
  allow_polyphony: boolean;
4948
5695
  }
5696
+ /**
5697
+ * Specifies from where the programmable speaker's sound will be heard.
5698
+ */
5699
+ type ProgrammableSpeakerPlaybackMode = /**
5700
+ * The sound can be heard within the audible range around the speaker.
5701
+ */
5702
+ 'local' | /**
5703
+ * The sound can be heard anywhere on the speaker's surface.
5704
+ */
5705
+ 'surface' | /**
5706
+ * The sound can be heard everywhere.
5707
+ */
5708
+ 'global';
4949
5709
  /**
4950
5710
  * All other MapGenSettings feed into named noise expressions, and therefore placement can be overridden by including the name of a property in this dictionary. The probability and richness functions for placing specific tiles, entities, and decoratives can be overridden by including an entry named `{tile|entity|decorative}:(prototype name):{probability|richness}`.
4951
5711
  * Values either name a NamedNoiseExpression or can be literal numbers, stored as strings (e.g. `5`). All other controls can be overridden by a property expression names. Notable properties:
@@ -4960,10 +5720,10 @@ interface ProgrammableSpeakerParameters {
4960
5720
  * - `enemy-base-radius` - a number representing the radius of an enemy base, if one were to be placed on the given tile, by default proportional to a constant plus `enemy-base-intensity`.
4961
5721
  * Climate controls ('Moisture' and 'Terrain type' at the bottom of the Terrain tab in the map generator GUI) don't have their own dedicated structures in MapGenSettings. Instead, their values are stored as property expression overrides with long names:
4962
5722
  *
4963
- * - `control-setting:moisture:frequency:multiplier` - frequency (inverse of scale) multiplier for moisture noise. Default is 1.
4964
- * - `control-setting:moisture:bias` - global bias for moisture (which normally varies between 0 and 1). Default is 0.
4965
- * - `control-setting:aux:frequency:multiplier` - frequency (inverse of scale) multiplier for aux (called 'terrain type' in the GUI) noise. Default is 1.
4966
- * - `control-setting:aux:bias` - global bias for aux/terrain type (which normally varies between 0 and 1). Default is 0.
5723
+ * - `control:moisture:frequency` - frequency (inverse of scale) multiplier for moisture noise. Default is 1.
5724
+ * - `control:moisture:bias` - global bias for moisture (which normally varies between 0 and 1). Default is 0.
5725
+ * - `control:aux:frequency` - frequency (inverse of scale) multiplier for aux (called 'terrain type' in the GUI) noise. Default is 1.
5726
+ * - `control:aux:bias` - global bias for aux/terrain type (which normally varies between 0 and 1). Default is 0.
4967
5727
  */
4968
5728
  type PropertyExpressionNames = Record<string, string>;
4969
5729
  /**
@@ -4971,10 +5731,7 @@ type PropertyExpressionNames = Record<string, string>;
4971
5731
  *
4972
5732
  * Filters are always used as an array of filters of a specific type. Every filter can only be used with its corresponding event, and different types of event filters can not be mixed.
4973
5733
  */
4974
- type PrototypeFilter = (ModSettingPrototypeFilter | DecorativePrototypeFilter | EntityPrototypeFilter | TechnologyPrototypeFilter | RecipePrototypeFilter | EquipmentPrototypeFilter | AchievementPrototypeFilter | FluidPrototypeFilter | ItemPrototypeFilter | TilePrototypeFilter)[];
4975
- /**
4976
- * One of the following values:
4977
- */
5734
+ type PrototypeFilter = (ModSettingPrototypeFilter | TilePrototypeFilter | DecorativePrototypeFilter | RecipePrototypeFilter | AchievementPrototypeFilter | TechnologyPrototypeFilter | AsteroidChunkPrototypeFilter | ItemPrototypeFilter | EquipmentPrototypeFilter | EntityPrototypeFilter | SpaceLocationPrototypeFilter | FluidPrototypeFilter)[];
4978
5735
  type PrototypeFilterMode = 'none' | 'whitelist' | 'blacklist';
4979
5736
  interface PrototypeHistory {
4980
5737
  /**
@@ -4986,22 +5743,122 @@ interface PrototypeHistory {
4986
5743
  */
4987
5744
  changed: string[];
4988
5745
  }
5746
+ /**
5747
+ * An item filter may be specified in two ways, either as a string which is a quality prototype name or as a table.
5748
+ */
5749
+ type QualityCondition = {
5750
+ /**
5751
+ * The prototype name of the quality.
5752
+ */
5753
+ quality?: string;
5754
+ /**
5755
+ * The comparator for quality.
5756
+ */
5757
+ comparator?: ComparatorString;
5758
+ } | string;
5759
+ /**
5760
+ * A quality prototype may be specified in one of two ways.
5761
+ */
5762
+ type QualityID = /**
5763
+ * The quality prototype.
5764
+ */
5765
+ LuaQualityPrototype | /**
5766
+ * The prototype name.
5767
+ */
5768
+ string;
4989
5769
  interface RadiusVisualisationSpecification {
4990
5770
  distance: double;
4991
5771
  offset: Vector;
4992
5772
  draw_in_cursor: boolean;
4993
5773
  draw_on_selection: boolean;
4994
5774
  }
4995
- interface RailEnd {
5775
+ interface RailEndGoal {
5776
+ /**
5777
+ * Rail target.
5778
+ */
5779
+ rail: LuaEntity;
5780
+ direction: defines.rail_direction;
5781
+ /**
5782
+ * Goal priority. If not provided, defaults to 50.
5783
+ */
5784
+ priority?: uint8;
5785
+ }
5786
+ interface RailEndStart {
4996
5787
  rail: LuaEntity;
4997
5788
  direction: defines.rail_direction;
5789
+ /**
5790
+ * Defaults to `true`. Providing false will cause the pathfinder to reject a path that starts here and ends in the same segment as the path would be too short to provide correct alignment with a goal.
5791
+ */
5792
+ allow_path_within_segment?: boolean;
5793
+ /**
5794
+ * Defaults to `false`.
5795
+ */
5796
+ is_front?: boolean;
5797
+ /**
5798
+ * Start priority. Defaults to `50`.
5799
+ */
5800
+ priority?: uint8;
5801
+ }
5802
+ interface RailExtensionData {
5803
+ /**
5804
+ * Name of the entity prototype to be built
5805
+ */
5806
+ name: string;
5807
+ /**
5808
+ * Position of the entity to be built
5809
+ */
5810
+ position: MapPosition;
5811
+ /**
5812
+ * Direction of the entity to be built
5813
+ */
5814
+ direction: defines.direction;
5815
+ /**
5816
+ * Goal where this rail extension will go to
5817
+ */
5818
+ goal: RailLocation;
5819
+ }
5820
+ interface RailLocation {
5821
+ position: MapPosition;
5822
+ direction: defines.direction;
5823
+ rail_layer: defines.rail_layer;
4998
5824
  }
5825
+ /**
5826
+ * A table containing the parameters required to raise a given game event. See the event being raised for what parameters are required.
5827
+ */
5828
+ type RaiseEventParameters = table;
5829
+ type RangeMode = 'center-to-center' | 'bounding-box-to-bounding-box' | 'center-to-bounding-box';
4999
5830
  /**
5000
5831
  * The smooth orientation. It is a {@link float | runtime:float} in the range `[0, 1)` that covers a full circle, starting at the top and going clockwise. This means a value of `0` indicates "north", a value of `0.5` indicates "south".
5001
5832
  *
5002
5833
  * For example then, a value of `0.625` would indicate "south-west", and a value of `0.875` would indicate "north-west".
5003
5834
  */
5004
5835
  type RealOrientation = float;
5836
+ /**
5837
+ * A recipe may be specified in one of three ways.
5838
+ */
5839
+ type RecipeID = /**
5840
+ * By recipe prototype.
5841
+ */
5842
+ LuaRecipePrototype | /**
5843
+ * By instance of recipe.
5844
+ */
5845
+ LuaRecipe | /**
5846
+ * By name of the recipe prototype.
5847
+ */
5848
+ string;
5849
+ /**
5850
+ * A recipe prototype with optional quality specification.
5851
+ */
5852
+ interface RecipeIDAndQualityIDPair {
5853
+ /**
5854
+ * Recipe prototype.
5855
+ */
5856
+ name: RecipeID;
5857
+ /**
5858
+ * Quality prototype.
5859
+ */
5860
+ quality: QualityID;
5861
+ }
5005
5862
  interface BaseRecipePrototypeFilter {
5006
5863
  /**
5007
5864
  * The condition to filter on.
@@ -5102,7 +5959,7 @@ interface RecipePrototypeFilterHasProductFluid extends BaseRecipePrototypeFilter
5102
5959
  */
5103
5960
  'filter': 'has-product-fluid';
5104
5961
  /**
5105
- * Matches if at least 1 product is a fluid that matches these filters.
5962
+ * Matches if at least 1 product is a fluid that matches
5106
5963
  */
5107
5964
  'elem_filters'?: FluidPrototypeFilter[];
5108
5965
  }
@@ -5173,24 +6030,100 @@ interface RecipePrototypeFilterSubgroup extends BaseRecipePrototypeFilter {
5173
6030
  'subgroup': string;
5174
6031
  }
5175
6032
  /**
5176
- * A number between 0 and 255 inclusive, represented by one of the following named strings or the string version of the number. For example `"27"` and `"decals"` are both valid. Higher values are rendered above lower values.
6033
+ * Represents an object that can be {@link registered | runtime:LuaBootstrap::register_on_object_destroyed} for the {@link on_object_destroyed | runtime:on_object_destroyed} event. Each target has an associated {@link defines.target_type | runtime:defines.target_type} and some have a unique identifier.
6034
+ */
6035
+ type RegistrationTarget = /**
6036
+ * Target type {@link entity | runtime:defines.target_type.entity}; `useful_id` {@link LuaEntity::unit_number | runtime:LuaEntity::unit_number}
6037
+ */
6038
+ LuaEntity | /**
6039
+ * Target type {@link equipment | runtime:defines.target_type.equipment}
6040
+ */
6041
+ LuaEquipment | /**
6042
+ * Target type {@link equipment_grid | runtime:defines.target_type.equipment_grid}; `useful_id` {@link LuaEquipmentGrid::unique_id | runtime:LuaEquipmentGrid::unique_id}
6043
+ */
6044
+ LuaEquipmentGrid | /**
6045
+ * Target type {@link item | runtime:defines.target_type.item}; `useful_id` {@link LuaItemCommon::item_number | runtime:LuaItemCommon::item_number}
6046
+ */
6047
+ LuaItem | /**
6048
+ * Target type {@link logistic_cell | runtime:defines.target_type.logistic_cell}
6049
+ */
6050
+ LuaLogisticCell | /**
6051
+ * Target type {@link logistic_network | runtime:defines.target_type.logistic_network}; `useful_id` {@link LuaLogisticNetwork::network_id | runtime:LuaLogisticNetwork::network_id}
6052
+ */
6053
+ LuaLogisticNetwork | /**
6054
+ * Target type {@link logistic_section | runtime:defines.target_type.logistic_section};
6055
+ */
6056
+ LuaLogisticSection | /**
6057
+ * Target type {@link permission_group | runtime:defines.target_type.permission_group}; `useful_id` {@link LuaPermissionGroup::group_id | runtime:LuaPermissionGroup::group_id}
6058
+ */
6059
+ LuaPermissionGroup | /**
6060
+ * Target type {@link planet | runtime:defines.target_type.planet}
6061
+ */
6062
+ LuaPlanet | /**
6063
+ * Target type {@link player | runtime:defines.target_type.player}; `useful_id` {@link LuaPlayer::index | runtime:LuaPlayer::index}
6064
+ */
6065
+ LuaPlayer | /**
6066
+ * Target type {@link rail_path | runtime:defines.target_type.rail_path};
6067
+ */
6068
+ LuaRailPath | /**
6069
+ * Target type {@link render_object | runtime:defines.target_type.render_object}; `useful_id` {@link LuaRenderObject::id | runtime:LuaRenderObject::id}
6070
+ */
6071
+ LuaRenderObject | /**
6072
+ * Target type {@link space_platform | runtime:defines.target_type.space_platform}; `useful_id` {@link LuaSpacePlatform::index | runtime:LuaSpacePlatform::index}
6073
+ */
6074
+ LuaSpacePlatform | /**
6075
+ * Target type {@link surface | runtime:defines.target_type.surface}; `useful_id` {@link LuaSurface::index | runtime:LuaSurface::index}
6076
+ */
6077
+ LuaSurface | /**
6078
+ * Target type {@link train | runtime:defines.target_type.train}; `useful_id` {@link LuaTrain::id | runtime:LuaTrain::id}
6079
+ */
6080
+ LuaTrain | /**
6081
+ * Target type {@link commandable | runtime:defines.target_type.commandable}; `useful_id` {@link LuaCommandable::unique_id | runtime:LuaCommandable::unique_id}
6082
+ */
6083
+ LuaCommandable | /**
6084
+ * Target type {@link custom_chart_tag | runtime:defines.target_type.custom_chart_tag}; `useful_id` {@link LuaCustomChartTag::tag_number | runtime:LuaCustomChartTag::tag_number}
6085
+ */
6086
+ LuaCustomChartTag | /**
6087
+ * Target type {@link gui_element | runtime:defines.target_type.gui_element}; `useful_id` {@link LuaGuiElement::index | runtime:LuaGuiElement::index}
6088
+ */
6089
+ LuaGuiElement;
6090
+ /**
6091
+ * A number between 0 and 255 inclusive, represented by one of the following named strings or the string version of the number. For example `"10"` and `"decals"` are both valid. Higher values are rendered above lower values.
5177
6092
  */
5178
6093
  type RenderLayer = /**
5179
6094
  * A string of a number
5180
6095
  */
5181
6096
  string | /**
5182
- * 15
6097
+ * 0
5183
6098
  */
5184
- 'water-tile' | /**
5185
- * 25
6099
+ 'zero' | /**
6100
+ * 1
5186
6101
  */
5187
- 'ground-tile' | /**
5188
- * 26
6102
+ 'background-transitions' | /**
6103
+ * 2
5189
6104
  */
5190
- 'tile-transition' | /**
5191
- * 27
6105
+ 'under-tiles' | /**
6106
+ * 10
5192
6107
  */
5193
6108
  'decals' | /**
6109
+ * 11
6110
+ */
6111
+ 'above-tiles' | /**
6112
+ * 12
6113
+ */
6114
+ 'ground-layer-1' | /**
6115
+ * 13
6116
+ */
6117
+ 'ground-layer-2' | /**
6118
+ * 14
6119
+ */
6120
+ 'ground-layer-3' | /**
6121
+ * 15
6122
+ */
6123
+ 'ground-layer-4' | /**
6124
+ * 16
6125
+ */
6126
+ 'ground-layer-5' | /**
5194
6127
  * 29
5195
6128
  */
5196
6129
  'lower-radius-visualization' | /**
@@ -5206,6 +6139,15 @@ string | /**
5206
6139
  * 67
5207
6140
  */
5208
6141
  'building-smoke' | /**
6142
+ * 68
6143
+ */
6144
+ 'rail-stone-path-lower' | /**
6145
+ * 76
6146
+ */
6147
+ 'rail-stone-path' | /**
6148
+ * 84
6149
+ */
6150
+ 'rail-tie' | /**
5209
6151
  * 92
5210
6152
  */
5211
6153
  'decorative' | /**
@@ -5218,79 +6160,136 @@ string | /**
5218
6160
  * 95
5219
6161
  */
5220
6162
  'ground-patch-higher2' | /**
5221
- * 112
6163
+ * 96
6164
+ */
6165
+ 'rail-chain-signal-metal' | /**
6166
+ * 97
6167
+ */
6168
+ 'rail-screw' | /**
6169
+ * 100
6170
+ */
6171
+ 'rail-metal' | /**
6172
+ * 102
5222
6173
  */
5223
6174
  'remnants' | /**
5224
- * 113
6175
+ * 103
5225
6176
  */
5226
6177
  'floor' | /**
5227
- * 114
6178
+ * 104
5228
6179
  */
5229
6180
  'transport-belt' | /**
5230
- * 115
6181
+ * 105
5231
6182
  */
5232
6183
  'transport-belt-endings' | /**
5233
- * 120
6184
+ * 106
5234
6185
  */
5235
6186
  'floor-mechanics-under-corpse' | /**
5236
- * 121
6187
+ * 107
5237
6188
  */
5238
6189
  'corpse' | /**
5239
- * 122
6190
+ * 108
5240
6191
  */
5241
6192
  'floor-mechanics' | /**
5242
- * 123
6193
+ * 109
5243
6194
  */
5244
6195
  'item' | /**
5245
- * 124
6196
+ * 117
6197
+ */
6198
+ 'transport-belt-reader' | /**
6199
+ * 118
5246
6200
  */
5247
6201
  'lower-object' | /**
5248
- * 126
6202
+ * 120
5249
6203
  */
5250
6204
  'transport-belt-circuit-connector' | /**
5251
- * 127
6205
+ * 121
5252
6206
  */
5253
6207
  'lower-object-above-shadow' | /**
5254
- * 129
6208
+ * 122
5255
6209
  */
5256
- 'object' | /**
5257
- * 131
6210
+ 'lower-object-overlay' | /**
6211
+ * 123
5258
6212
  */
5259
- 'higher-object-under' | /**
5260
- * 132
6213
+ 'object-under' | /**
6214
+ * 124
6215
+ */
6216
+ 'object' | /**
6217
+ * 125
6218
+ */
6219
+ 'cargo-hatch' | /**
6220
+ * 126
6221
+ */
6222
+ 'higher-object-under' | /**
6223
+ * 127
5261
6224
  */
5262
6225
  'higher-object-above' | /**
5263
- * 134
6226
+ * 128
6227
+ */
6228
+ 'train-stop-top' | /**
6229
+ * 129
5264
6230
  */
5265
6231
  'item-in-inserter-hand' | /**
5266
- * 135
6232
+ * 130
6233
+ */
6234
+ 'above-inserter' | /**
6235
+ * 131
5267
6236
  */
5268
6237
  'wires' | /**
6238
+ * 132
6239
+ */
6240
+ 'under-elevated' | /**
6241
+ * 133
6242
+ */
6243
+ 'elevated-rail-stone-path-lower' | /**
6244
+ * 134
6245
+ */
6246
+ 'elevated-rail-stone-path' | /**
6247
+ * 135
6248
+ */
6249
+ 'elevated-rail-tie' | /**
5269
6250
  * 136
5270
6251
  */
6252
+ 'elevated-rail-screw' | /**
6253
+ * 137
6254
+ */
6255
+ 'elevated-rail-metal' | /**
6256
+ * 141
6257
+ */
6258
+ 'elevated-lower-object' | /**
6259
+ * 142
6260
+ */
6261
+ 'elevated-object' | /**
6262
+ * 143
6263
+ */
6264
+ 'elevated-higher-object' | /**
6265
+ * 149
6266
+ */
6267
+ 'fluid-visualization' | /**
6268
+ * 150
6269
+ */
5271
6270
  'wires-above' | /**
5272
- * 138
6271
+ * 153
5273
6272
  */
5274
6273
  'entity-info-icon' | /**
5275
- * 139
6274
+ * 154
5276
6275
  */
5277
6276
  'entity-info-icon-above' | /**
5278
- * 142
6277
+ * 157
5279
6278
  */
5280
6279
  'explosion' | /**
5281
- * 143
6280
+ * 158
5282
6281
  */
5283
6282
  'projectile' | /**
5284
- * 144
6283
+ * 159
5285
6284
  */
5286
6285
  'smoke' | /**
5287
- * 145
6286
+ * 160
5288
6287
  */
5289
6288
  'air-object' | /**
5290
- * 147
6289
+ * 161
5291
6290
  */
5292
6291
  'air-entity-info-icon' | /**
5293
- * 148
6292
+ * 162
5294
6293
  */
5295
6294
  'light-effect' | /**
5296
6295
  * 187
@@ -5305,9 +6304,81 @@ string | /**
5305
6304
  * 190
5306
6305
  */
5307
6306
  'arrow' | /**
5308
- * 210
6307
+ * 226
5309
6308
  */
5310
6309
  'cursor';
6310
+ interface ResearchIngredient {
6311
+ /**
6312
+ * Prototype name of the required item.
6313
+ */
6314
+ name: string;
6315
+ /**
6316
+ * Amount of items required to research one unit of technology.
6317
+ */
6318
+ amount: uint16;
6319
+ }
6320
+ interface ResearchProgressProduct {
6321
+ type: 'research-progress';
6322
+ /**
6323
+ * Prototype name of the research item.
6324
+ */
6325
+ research_item: string;
6326
+ amount: double;
6327
+ }
6328
+ interface BaseResearchTrigger {
6329
+ type: 'craft-item' | 'mine-entity' | 'craft-fluid' | 'send-item-to-orbit' | 'capture-spawner' | 'build-entity' | 'create-space-platform';
6330
+ }
6331
+ type ResearchTrigger = BaseResearchTrigger | ResearchTriggerBuildEntity | ResearchTriggerCaptureSpawner | ResearchTriggerCraftFluid | ResearchTriggerCraftItem | ResearchTriggerMineEntity | ResearchTriggerSendItemToOrbit;
6332
+ /**
6333
+ *
6334
+ * Applies to variant case `build-entity`
6335
+ */
6336
+ interface ResearchTriggerBuildEntity extends BaseResearchTrigger {
6337
+ 'type': 'build-entity';
6338
+ 'entity': EntityIDFilter;
6339
+ }
6340
+ /**
6341
+ *
6342
+ * Applies to variant case `capture-spawner`
6343
+ */
6344
+ interface ResearchTriggerCaptureSpawner extends BaseResearchTrigger {
6345
+ 'type': 'capture-spawner';
6346
+ 'entity'?: string;
6347
+ }
6348
+ /**
6349
+ *
6350
+ * Applies to variant case `craft-fluid`
6351
+ */
6352
+ interface ResearchTriggerCraftFluid extends BaseResearchTrigger {
6353
+ 'type': 'craft-fluid';
6354
+ 'amount': double;
6355
+ 'fluid': string;
6356
+ }
6357
+ /**
6358
+ *
6359
+ * Applies to variant case `craft-item`
6360
+ */
6361
+ interface ResearchTriggerCraftItem extends BaseResearchTrigger {
6362
+ 'type': 'craft-item';
6363
+ 'item': string;
6364
+ 'item_quality'?: string;
6365
+ }
6366
+ /**
6367
+ *
6368
+ * Applies to variant case `mine-entity`
6369
+ */
6370
+ interface ResearchTriggerMineEntity extends BaseResearchTrigger {
6371
+ 'type': 'mine-entity';
6372
+ 'entity': string;
6373
+ }
6374
+ /**
6375
+ *
6376
+ * Applies to variant case `send-item-to-orbit`
6377
+ */
6378
+ interface ResearchTriggerSendItemToOrbit extends BaseResearchTrigger {
6379
+ 'type': 'send-item-to-orbit';
6380
+ 'item': ItemIDFilter;
6381
+ }
5311
6382
  interface Resistance {
5312
6383
  /**
5313
6384
  * Absolute damage decrease
@@ -5324,7 +6395,28 @@ interface RidingState {
5324
6395
  }
5325
6396
  interface RollingStockDrawData {
5326
6397
  position: MapPosition;
5327
- orientaton: RealOrientation;
6398
+ orientation: RealOrientation;
6399
+ slope: float;
6400
+ height: float;
6401
+ }
6402
+ interface ScheduleRecord {
6403
+ /**
6404
+ * Name of the station.
6405
+ */
6406
+ station?: string;
6407
+ /**
6408
+ * Rail to path to. Ignored if `station` is present.
6409
+ */
6410
+ rail?: LuaEntity;
6411
+ /**
6412
+ * When a train is allowed to reach rail target from any direction it will be `nil`. If rail has to be reached from specific direction, this value allows to choose the direction. This value corresponds to {@link LuaEntity::connected_rail_direction | runtime:LuaEntity::connected_rail_direction} of a TrainStop.
6413
+ */
6414
+ rail_direction?: defines.rail_direction;
6415
+ wait_conditions?: WaitCondition[];
6416
+ /**
6417
+ * Only present when the station is temporary, the value is then always `true`.
6418
+ */
6419
+ temporary?: boolean;
5328
6420
  }
5329
6421
  /**
5330
6422
  * An area defined using the map editor.
@@ -5344,20 +6436,20 @@ interface ScriptPosition {
5344
6436
  color: Color;
5345
6437
  id: uint;
5346
6438
  }
5347
- interface ScriptRenderTarget {
5348
- entity?: LuaEntity;
5349
- entity_offset?: Vector;
5350
- position?: MapPosition;
5351
- }
5352
6439
  /**
5353
- * One vertex of a ScriptRenderPolygon.
6440
+ * When writing it is possible to give LuaEntity or MapPosition directly. However, reading always returns the full ScriptRenderTargetTable.
5354
6441
  */
5355
- interface ScriptRenderVertexTarget {
5356
- target: MapPosition | LuaEntity;
6442
+ type ScriptRenderTarget = LuaEntity | MapPosition | ScriptRenderTargetTable;
6443
+ interface ScriptRenderTargetTable {
6444
+ entity?: LuaEntity;
6445
+ /**
6446
+ * Only used if `entity` was given.
6447
+ */
6448
+ offset?: Vector;
5357
6449
  /**
5358
- * Only used if `target` is a LuaEntity.
6450
+ * Only used, and mandatory if `entity` is not given.
5359
6451
  */
5360
- target_offset?: Vector;
6452
+ position?: MapPosition;
5361
6453
  }
5362
6454
  /**
5363
6455
  * Scroll policy of a {@link scroll pane | runtime:LuaGuiElement}.
@@ -5435,9 +6527,6 @@ type SelectionModeFlags = Record</**
5435
6527
  * Selects entities that are {@link entities with health | runtime:LuaEntity::is_entity_with_health}.
5436
6528
  */
5437
6529
  'entity-with-health' | /**
5438
- * Deprecated. Replaced by `is-military-target`.
5439
- */
5440
- 'entity-with-force' | /**
5441
6530
  * Selects entities that are {@link military targets | runtime:LuaEntity::is_military_target}.
5442
6531
  */
5443
6532
  'is-military-target' | /**
@@ -5446,13 +6535,35 @@ type SelectionModeFlags = Record</**
5446
6535
  'entity-with-owner' | /**
5447
6536
  * Selects entities that are not `rolling-stock`s.
5448
6537
  */
5449
- 'avoid-rolling-stock' | /**
6538
+ 'avoid-rolling-stock' | 'avoid-vehicle' | 'controllable' | 'controllable-add' | 'controllable-remove' | /**
5450
6539
  * Selects entities that are `entity-ghost`s.
5451
6540
  */
5452
6541
  'entity-ghost' | /**
5453
6542
  * Selects entities that are `tile-ghost`s.
5454
6543
  */
5455
6544
  'tile-ghost', true>;
6545
+ interface SelectorCombinatorParameters {
6546
+ /**
6547
+ * The signal to use.
6548
+ */
6549
+ index_signal: SignalID;
6550
+ /**
6551
+ * The signal index to use if not using a specific signal.
6552
+ */
6553
+ index_constant: uint;
6554
+ /**
6555
+ * The signal to emit.
6556
+ */
6557
+ count_signal: SignalID;
6558
+ /**
6559
+ * Must be one of `"select"`, `"count"`, `"random"`. When not specified, defaults to `"select"`.
6560
+ */
6561
+ operation?: string;
6562
+ /**
6563
+ * If the maximum value is used.
6564
+ */
6565
+ select_max: boolean;
6566
+ }
5456
6567
  /**
5457
6568
  * An actual signal transmitted by the network.
5458
6569
  */
@@ -5466,13 +6577,38 @@ interface Signal {
5466
6577
  */
5467
6578
  count: int;
5468
6579
  }
6580
+ /**
6581
+ * A signal filter may be specified in two ways, either as a string which is a virtual signal name or item prototype name or as a table.
6582
+ */
6583
+ type SignalFilter = {
6584
+ /**
6585
+ * The type of the signal filter.
6586
+ */
6587
+ type?: SignalIDType;
6588
+ /**
6589
+ * Name of the signal.
6590
+ */
6591
+ name: string;
6592
+ /**
6593
+ * The prototype name of the signal's quality. `nil` for any quality.
6594
+ */
6595
+ quality?: QualityID;
6596
+ /**
6597
+ * The comparator for quality. `nil` if any quality.
6598
+ */
6599
+ comparator?: ComparatorString;
6600
+ } | string;
5469
6601
  interface SignalID {
5470
- type: 'item' | 'fluid' | 'virtual';
5471
6602
  /**
5472
- * Name of the item, fluid or virtual signal.
6603
+ * The type of the signal. If the type is `"item"`, this will be `nil` when reading.
6604
+ */
6605
+ type?: SignalIDType;
6606
+ /**
6607
+ * Name of the prototype.
5473
6608
  */
5474
6609
  name?: string;
5475
6610
  }
6611
+ type SignalIDType = 'item' | 'fluid' | 'virtual' | 'entity' | 'recipe' | 'space-location' | 'asteroid-chunk' | 'quality';
5476
6612
  /**
5477
6613
  * An item stack may be specified in one of two ways.
5478
6614
  * @example ```
@@ -5497,24 +6633,23 @@ string | /**
5497
6633
  * The detailed definition of an item stack.
5498
6634
  */
5499
6635
  ItemStackDefinition;
5500
- /**
5501
- * The vectors for all 5 position attributes are a table with `x` and `y` keys instead of an array.
5502
- */
6636
+ type SimulationWidgetType = 'signal-id' | 'signal-id-base' | 'signal-or-number' | 'simple-slot' | 'simple-item-slot' | 'recipe-slot' | 'quickbar-slot' | 'logistics-button' | 'logistics-button-space' | 'text-button-localised-substring' | 'text-button' | 'text-button-substring' | 'inventory-limit-slot-button' | 'train-schedule-action-button' | 'choose-button' | 'textfield' | 'item-group-tab' | 'drop-down' | 'check-box' | 'switch' | 'label';
5503
6637
  interface SmokeSource {
5504
6638
  name: string;
5505
- frequency: double;
5506
- offset: double;
6639
+ frequency: float;
6640
+ offset: float;
5507
6641
  position?: Vector;
5508
6642
  north_position?: Vector;
6643
+ north_east_position?: Vector;
5509
6644
  east_position?: Vector;
6645
+ south_east_position?: Vector;
5510
6646
  south_position?: Vector;
6647
+ south_west_position?: Vector;
5511
6648
  west_position?: Vector;
6649
+ north_west_position?: Vector;
5512
6650
  deviation?: MapPosition;
5513
- starting_frame_speed: uint16;
5514
- starting_frame_speed_deviation: double;
5515
6651
  starting_frame: uint16;
5516
- starting_frame_deviation: double;
5517
- slow_down_factor: uint8;
6652
+ starting_frame_deviation: uint16;
5518
6653
  height: float;
5519
6654
  height_deviation: float;
5520
6655
  starting_vertical_speed: float;
@@ -5524,33 +6659,103 @@ interface SmokeSource {
5524
6659
  /**
5525
6660
  * It can be either the name of a {@link SoundPrototype | prototype:SoundPrototype} defined in the data stage, or a path in the form `"type/name"`. The latter option can be sorted into three categories.
5526
6661
  *
5527
- * The validity of a SoundPath can be verified at runtime using {@link LuaGameScript::is_valid_sound_path | runtime:LuaGameScript::is_valid_sound_path}.
5528
- * The utility and ambient types each contain general use sound prototypes defined by the game itself:
6662
+ * The validity of a SoundPath can be verified at runtime using {@link LuaHelpers::is_valid_sound_path | runtime:LuaHelpers::is_valid_sound_path}.
6663
+ * The utility and ambient types each contain general use sound prototypes defined by the game itself.
5529
6664
  *
5530
6665
  * - `"utility"` - Uses {@link UtilitySounds | prototype:UtilitySounds}. Example: `"utility/wire_connect_pole"`
5531
6666
  * - `"ambient"` - Uses {@link AmbientSound | prototype:AmbientSound}. Example: `"ambient/resource-deficiency"`
5532
- * The following types can be combined with any tile name as long as its prototype defines the corresponding sound:
5533
- *
5534
- * - `"tile-walking"` - Uses {@link TilePrototype::walking_sound | prototype:TilePrototype::walking_sound}. Example: `"tile-walking/concrete"`
5535
- * - `"tile-mined"` - Uses {@link TilePrototype::mined_sound | prototype:TilePrototype::mined_sound}
5536
- * - `"tile-build-small"` - Uses {@link TilePrototype::build_sound | prototype:TilePrototype::build_sound}. Example: `"tile-build-small/concrete"`
5537
- * - `"tile-build-medium"` - Uses {@link TilePrototype::build_sound | prototype:TilePrototype::build_sound}
5538
- * - `"tile-build-large"` - Uses {@link TilePrototype::build_sound | prototype:TilePrototype::build_sound}
5539
- * The following types can be combined with any entity name as long as its prototype defines the corresponding sound:
5540
- *
5541
- * - `"entity-build"` - Uses {@link Entity::build_sound | prototype:EntityPrototype::build_sound}. Example: `"entity-build/wooden-chest"`
5542
- * - `"entity-mined"` - Uses {@link Entity::mined_sound | prototype:EntityPrototype::mined_sound}
5543
- * - `"entity-mining"` - Uses {@link Entity::mining_sound | prototype:EntityPrototype::mining_sound}
5544
- * - `"entity-vehicle_impact"` - Uses {@link EntityPrototype::vehicle_impact_sound | prototype:EntityPrototype::vehicle_impact_sound}
5545
- * - `"entity-rotated"` - Uses {@link EntityPrototype::rotated_sound | prototype:EntityPrototype::rotated_sound}
5546
- * - `"entity-open"` - Uses {@link Entity::open_sound | prototype:EntityPrototype::open_sound}
5547
- * - `"entity-close"` - Uses {@link Entity::close_sound | prototype:EntityPrototype::close_sound}
5548
6667
  */
5549
6668
  type SoundPath = string;
5550
6669
  /**
5551
6670
  * Defines which slider in the game's sound settings affects the volume of this sound. Furthermore, some sound types are mixed differently than others, e.g. zoom level effects are applied.
5552
6671
  */
5553
- type SoundType = 'game-effect' | 'gui-effect' | 'ambient' | 'environment' | 'walking' | 'alert' | 'wind';
6672
+ type SoundType = 'game-effect' | 'gui-effect' | 'ambient' | 'environment' | 'walking' | 'alert' | 'wind' | 'world-ambient' | 'weapon' | 'explosion' | 'enemy';
6673
+ interface SpaceConnectionAsteroidSpawnDefinition {
6674
+ /**
6675
+ * `asteroid-chunk` or `entity`
6676
+ */
6677
+ type: string;
6678
+ /**
6679
+ * The asteroid chunk or entity name.
6680
+ */
6681
+ asteroid: string;
6682
+ spawn_points: SpaceConnectionAsteroidSpawnPoint[];
6683
+ }
6684
+ interface SpaceConnectionAsteroidSpawnPoint {
6685
+ probability: double;
6686
+ speed: double;
6687
+ distance: double;
6688
+ }
6689
+ interface SpaceLocationAsteroidSpawnDefinition {
6690
+ /**
6691
+ * `asteroid-chunk` or `entity`
6692
+ */
6693
+ type: string;
6694
+ /**
6695
+ * The asteroid chunk or entity name.
6696
+ */
6697
+ asteroid: string;
6698
+ probability: double;
6699
+ speed: double;
6700
+ }
6701
+ /**
6702
+ * A space location prototype may be specified in one of two ways.
6703
+ */
6704
+ type SpaceLocationID = /**
6705
+ * The space location prototype.
6706
+ */
6707
+ LuaSpaceLocationPrototype | /**
6708
+ * The prototype name.
6709
+ */
6710
+ string;
6711
+ interface BaseSpaceLocationPrototypeFilter {
6712
+ /**
6713
+ * The condition to filter on.
6714
+ */
6715
+ filter: 'fly-condition' | 'type' | 'solar-power-in-space';
6716
+ /**
6717
+ * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
6718
+ */
6719
+ mode?: 'or' | 'and';
6720
+ /**
6721
+ * Inverts the condition. Default is `false`.
6722
+ */
6723
+ invert?: boolean;
6724
+ }
6725
+ type SpaceLocationPrototypeFilter = BaseSpaceLocationPrototypeFilter | SpaceLocationPrototypeFilterSolarPowerInSpace | SpaceLocationPrototypeFilterType;
6726
+ /**
6727
+ *
6728
+ * Applies to variant case `solar-power-in-space`
6729
+ */
6730
+ interface SpaceLocationPrototypeFilterSolarPowerInSpace extends BaseSpaceLocationPrototypeFilter {
6731
+ /**
6732
+ * The condition to filter on.
6733
+ */
6734
+ 'filter': 'solar-power-in-space';
6735
+ 'comparison': ComparatorString;
6736
+ /**
6737
+ * The value to compare against.
6738
+ */
6739
+ 'value': double;
6740
+ }
6741
+ /**
6742
+ *
6743
+ * Applies to variant case `type`
6744
+ */
6745
+ interface SpaceLocationPrototypeFilterType extends BaseSpaceLocationPrototypeFilter {
6746
+ /**
6747
+ * The condition to filter on.
6748
+ */
6749
+ 'filter': 'type';
6750
+ /**
6751
+ * The prototype type, or a list of acceptable types.
6752
+ */
6753
+ 'type': string | string[];
6754
+ }
6755
+ /**
6756
+ * Space platform may be specified in one of one ways.
6757
+ */
6758
+ type SpacePlatformIdentification = LuaSpacePlatform;
5554
6759
  interface SpawnPointDefinition {
5555
6760
  /**
5556
6761
  * Evolution factor for which this weight applies.
@@ -5561,22 +6766,41 @@ interface SpawnPointDefinition {
5561
6766
  */
5562
6767
  weight: double;
5563
6768
  }
6769
+ interface SpoilToTriggerResult {
6770
+ /**
6771
+ * The trigger runs (count-in-stack / items_per_trigger) times; rounded up.
6772
+ */
6773
+ items_per_trigger: uint;
6774
+ /**
6775
+ * The trigger items that are run.
6776
+ */
6777
+ trigger: TriggerItem[];
6778
+ }
5564
6779
  /**
5565
6780
  * It can be either the name of a {@link SpritePrototype | prototype:SpritePrototype} defined in the data stage, or a path in form "type/name" or "type.name".
5566
6781
  *
5567
- * The validity of a SpritePath can be verified at runtime using {@link LuaGameScript::is_valid_sprite_path | runtime:LuaGameScript::is_valid_sprite_path}.
6782
+ * The validity of a SpritePath can be verified at runtime using {@link LuaHelpers::is_valid_sprite_path | runtime:LuaHelpers::is_valid_sprite_path}.
5568
6783
  * The supported types are:
5569
6784
  *
5570
6785
  * - `"item"` - for example "item/iron-plate" is the icon sprite of iron plate
5571
6786
  * - `"entity"` - for example "entity/small-biter" is the icon sprite of the small biter
5572
6787
  * - `"technology"`
5573
6788
  * - `"recipe"`
5574
- * - `"item-group"`
5575
6789
  * - `"fluid"`
5576
6790
  * - `"tile"`
6791
+ * - `"item-group"`
5577
6792
  * - `"virtual-signal"`
6793
+ * - `"shortcut"`
5578
6794
  * - `"achievement"`
5579
6795
  * - `"equipment"`
6796
+ * - `"ammo-category"`
6797
+ * - `"decorative"`
6798
+ * - `"space-connection"`
6799
+ * - `"space-location"`
6800
+ * - `"surface"`
6801
+ * - `"airborne-pollutant"`
6802
+ * - `"asteroid-chunk"`
6803
+ * - `"quality"`
5580
6804
  * - `"file"` - path to an image file located inside the current scenario. This file is not preloaded so it will be slower; for frequently used sprites, it is better to define sprite prototype and use it instead.
5581
6805
  * - `"utility"` - sprite defined in the utility-sprites object, these are the pictures used by the game internally for the UI.
5582
6806
  */
@@ -5597,6 +6821,11 @@ interface SteeringMapSettings {
5597
6821
  default: SteeringMapSetting;
5598
6822
  moving: SteeringMapSetting;
5599
6823
  }
6824
+ interface SurfaceCondition {
6825
+ property: string;
6826
+ min: double;
6827
+ max: double;
6828
+ }
5600
6829
  /**
5601
6830
  * A surface may be specified in one of three ways.
5602
6831
  */
@@ -5610,6 +6839,16 @@ string | /**
5610
6839
  * A reference to {@link LuaSurface | runtime:LuaSurface} may be passed directly.
5611
6840
  */
5612
6841
  LuaSurface;
6842
+ /**
6843
+ * Surface property prototype may be specified in one of two ways.
6844
+ */
6845
+ type SurfacePropertyID = /**
6846
+ * The surface property prototype.
6847
+ */
6848
+ LuaSurfacePropertyPrototype | /**
6849
+ * The prototype name.
6850
+ */
6851
+ string;
5613
6852
  /**
5614
6853
  * State of a GUI {@link switch | runtime:LuaGuiElement::switch_state}.
5615
6854
  */
@@ -5641,18 +6880,18 @@ type TargetType = /**
5641
6880
  */
5642
6881
  'direction';
5643
6882
  /**
5644
- * A technology may be specified in one of three ways.
6883
+ * An technology prototype may be specified in one of three ways.
5645
6884
  */
5646
- type TechnologyIdentification = /**
5647
- * The technology name.
6885
+ type TechnologyID = /**
6886
+ * The technology prototype.
5648
6887
  */
5649
- string | /**
5650
- * A reference to {@link LuaTechnology | runtime:LuaTechnology} may be passed directly.
6888
+ LuaTechnologyPrototype | /**
6889
+ * Instance of the technology.
5651
6890
  */
5652
6891
  LuaTechnology | /**
5653
- * A reference to {@link LuaTechnologyPrototype | runtime:LuaTechnologyPrototype} may be passed directly.
6892
+ * The prototype name.
5654
6893
  */
5655
- LuaTechnologyPrototype;
6894
+ string;
5656
6895
  /**
5657
6896
  * The effect that is applied when a technology is researched. It is a table that contains at least the field `type`.
5658
6897
  */
@@ -5864,6 +7103,12 @@ interface TechnologyPrototypeFilterUnlocksRecipe extends BaseTechnologyPrototype
5864
7103
  */
5865
7104
  'recipe': string;
5866
7105
  }
7106
+ interface TerritorySettings {
7107
+ units: string[];
7108
+ territory_index_expression: string;
7109
+ territory_variation_expression: string;
7110
+ minimum_territory_size: uint;
7111
+ }
5867
7112
  /**
5868
7113
  * The text is aligned so that the target position is at the given side of the text.
5869
7114
  *
@@ -5880,6 +7125,19 @@ interface Tile {
5880
7125
  */
5881
7126
  name: string;
5882
7127
  }
7128
+ /**
7129
+ * A tile may be specified in one of three ways.
7130
+ */
7131
+ type TileID = /**
7132
+ * By tile prototype.
7133
+ */
7134
+ LuaTilePrototype | /**
7135
+ * By instance of tile.
7136
+ */
7137
+ LuaTile | /**
7138
+ * By name of the tile prototype.
7139
+ */
7140
+ string;
5883
7141
  /**
5884
7142
  * Coordinates of a tile on a {@link LuaSurface | runtime:LuaSurface} where each integer `x`/`y` represents a different tile. This uses the same format as {@link MapPosition | runtime:MapPosition}, except it rounds any non-integer `x`/`y` down to whole numbers. It can be specified either with or without explicit keys.
5885
7143
  */
@@ -5894,7 +7152,7 @@ interface BaseTilePrototypeFilter {
5894
7152
  /**
5895
7153
  * The condition to filter on.
5896
7154
  */
5897
- filter: 'minable' | 'autoplace' | 'blueprintable' | 'item-to-place' | 'collision-mask' | 'walking-speed-modifier' | 'vehicle-friction-modifier' | 'decorative-removal-probability' | 'emissions';
7155
+ filter: 'minable' | 'autoplace' | 'blueprintable' | 'item-to-place' | 'collision-mask' | 'walking-speed-modifier' | 'vehicle-friction-modifier' | 'decorative-removal-probability' | 'absorptions-per-second';
5898
7156
  /**
5899
7157
  * How to combine this with the previous filter. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
5900
7158
  */
@@ -5904,51 +7162,58 @@ interface BaseTilePrototypeFilter {
5904
7162
  */
5905
7163
  invert?: boolean;
5906
7164
  }
5907
- type TilePrototypeFilter = BaseTilePrototypeFilter | TilePrototypeFilterCollisionMask | TilePrototypeFilterDecorativeRemovalProbability | TilePrototypeFilterEmissions | TilePrototypeFilterVehicleFrictionModifier | TilePrototypeFilterWalkingSpeedModifier;
7165
+ type TilePrototypeFilter = BaseTilePrototypeFilter | TilePrototypeFilterAbsorptionsPerSecond | TilePrototypeFilterCollisionMask | TilePrototypeFilterDecorativeRemovalProbability | TilePrototypeFilterVehicleFrictionModifier | TilePrototypeFilterWalkingSpeedModifier;
5908
7166
  /**
5909
7167
  *
5910
- * Applies to variant case `collision-mask`
7168
+ * Applies to variant case `absorptions-per-second`
5911
7169
  */
5912
- interface TilePrototypeFilterCollisionMask extends BaseTilePrototypeFilter {
7170
+ interface TilePrototypeFilterAbsorptionsPerSecond extends BaseTilePrototypeFilter {
5913
7171
  /**
5914
7172
  * The condition to filter on.
5915
7173
  */
5916
- 'filter': 'collision-mask';
5917
- 'mask': CollisionMask | CollisionMaskWithFlags;
7174
+ 'filter': 'absorptions-per-second';
7175
+ 'comparison': ComparatorString;
5918
7176
  /**
5919
- * How to filter.
7177
+ * The name of a pollutant type to check.
5920
7178
  */
5921
- 'mask_mode': 'collides' | 'layers-equals' | 'contains-any' | 'contains-all';
7179
+ 'pollutant': string;
7180
+ /**
7181
+ * The value to compare against.
7182
+ */
7183
+ 'value': double;
5922
7184
  }
5923
7185
  /**
5924
7186
  *
5925
- * Applies to variant case `decorative-removal-probability`
7187
+ * Applies to variant case `collision-mask`
5926
7188
  */
5927
- interface TilePrototypeFilterDecorativeRemovalProbability extends BaseTilePrototypeFilter {
7189
+ interface TilePrototypeFilterCollisionMask extends BaseTilePrototypeFilter {
5928
7190
  /**
5929
7191
  * The condition to filter on.
5930
7192
  */
5931
- 'filter': 'decorative-removal-probability';
5932
- 'comparison': ComparatorString;
7193
+ 'filter': 'collision-mask';
5933
7194
  /**
5934
- * The value to compare against.
7195
+ * Name of one {@link layer | runtime:LuaCollisionLayerPrototype} or a full collision mask.
5935
7196
  */
5936
- 'value': float;
7197
+ 'mask': CollisionLayerID | CollisionMask;
7198
+ /**
7199
+ * How to filter.
7200
+ */
7201
+ 'mask_mode': 'collides' | 'layers-equals' | 'contains-any' | 'contains-all';
5937
7202
  }
5938
7203
  /**
5939
7204
  *
5940
- * Applies to variant case `emissions`
7205
+ * Applies to variant case `decorative-removal-probability`
5941
7206
  */
5942
- interface TilePrototypeFilterEmissions extends BaseTilePrototypeFilter {
7207
+ interface TilePrototypeFilterDecorativeRemovalProbability extends BaseTilePrototypeFilter {
5943
7208
  /**
5944
7209
  * The condition to filter on.
5945
7210
  */
5946
- 'filter': 'emissions';
7211
+ 'filter': 'decorative-removal-probability';
5947
7212
  'comparison': ComparatorString;
5948
7213
  /**
5949
7214
  * The value to compare against.
5950
7215
  */
5951
- 'value': double;
7216
+ 'value': float;
5952
7217
  }
5953
7218
  /**
5954
7219
  *
@@ -5980,80 +7245,143 @@ interface TilePrototypeFilterWalkingSpeedModifier extends BaseTilePrototypeFilte
5980
7245
  */
5981
7246
  'value': double;
5982
7247
  }
5983
- interface TrainPathAllGoalsResult {
7248
+ interface TileSearchFilters {
7249
+ area?: BoundingBox;
5984
7250
  /**
5985
- * Amount of goals that are accessible.
7251
+ * Ignored if not given with radius.
5986
7252
  */
5987
- amount_accessible: uint;
7253
+ position?: MapPosition;
5988
7254
  /**
5989
- * Array of the same length as requested goals: each field will tell if related goal is accessible for the train.
7255
+ * If given with position, will return all tiles within the radius of the position.
5990
7256
  */
5991
- accessible: boolean[];
7257
+ radius?: double;
5992
7258
  /**
5993
- * Array of the same length as requested goals. Only present if request type was `"all-goals-penalties"`.
7259
+ * An empty array means nothing matches the name filter.
5994
7260
  */
5995
- penalties?: double[];
7261
+ name?: TileID | TileID[];
7262
+ limit?: uint;
7263
+ has_hidden_tile?: boolean;
5996
7264
  /**
5997
- * Amount of steps pathfinder performed. This is a measure of how expensive this search was.
7265
+ * Can be further filtered by supplying a `force` filter.
5998
7266
  */
5999
- steps_count: uint;
7267
+ has_double_hidden_tile?: boolean;
7268
+ /**
7269
+ * Can be further filtered by supplying a `force` filter.
7270
+ */
7271
+ has_tile_ghost?: boolean;
7272
+ /**
7273
+ * Can be further filtered by supplying a `force` filter.
7274
+ */
7275
+ to_be_deconstructed?: boolean;
7276
+ collision_mask?: CollisionLayerID | CollisionLayerID[] | Record<CollisionLayerID, true>;
7277
+ force?: ForceSet;
7278
+ /**
7279
+ * If the filters should be inverted.
7280
+ */
7281
+ invert?: boolean;
6000
7282
  }
6001
- interface TrainPathAnyGoalResult {
7283
+ interface TrainFilter {
6002
7284
  /**
6003
- * True if any goal was accessible.
7285
+ * Train ID filter
6004
7286
  */
6005
- found_path: boolean;
7287
+ train_id?: uint;
6006
7288
  /**
6007
- * If any goal was accessible, this gives index of the particular goal that was found.
7289
+ * Surface the train must be on in order to pass
6008
7290
  */
6009
- goal_index?: uint;
7291
+ surface?: SurfaceIdentification;
6010
7292
  /**
6011
- * Penalty of the path to goal if a goal was accessible.
7293
+ * Train must contain at least one rolling stock of this force to pass
6012
7294
  */
6013
- penalty?: double;
7295
+ force?: ForceID;
7296
+ /**
7297
+ * Train must contain a rolling stock of any of provided prototype to pass
7298
+ */
7299
+ stock?: EntityID | EntityID[];
7300
+ /**
7301
+ * Train must have at least that many stocks to pass
7302
+ */
7303
+ min_stocks?: uint;
7304
+ /**
7305
+ * Train must have at most that many stocks to pass
7306
+ */
7307
+ max_stocks?: uint;
7308
+ /**
7309
+ * Checks if train is moving (has speed != 0) or not moving.
7310
+ */
7311
+ is_moving?: boolean;
7312
+ /**
7313
+ * Checks if train has a passenger.
7314
+ */
7315
+ has_passenger?: boolean;
7316
+ /**
7317
+ * Checks if train is in manual controller.
7318
+ */
7319
+ is_manual?: boolean;
7320
+ }
7321
+ interface TrainPathAllGoalsResult {
7322
+ /**
7323
+ * Amount of goals that are accessible.
7324
+ */
7325
+ amount_accessible: uint;
7326
+ /**
7327
+ * Array of the same length as requested goals: each field will tell if related goal is accessible for the train.
7328
+ */
7329
+ accessible: boolean[];
7330
+ /**
7331
+ * Array of the same length as requested goals. Only present if request type was `"all-goals-penalties"`.
7332
+ */
7333
+ penalties?: double[];
6014
7334
  /**
6015
7335
  * Amount of steps pathfinder performed. This is a measure of how expensive this search was.
6016
7336
  */
6017
7337
  steps_count: uint;
6018
7338
  }
6019
- interface TrainPathFinderPathResult {
7339
+ type TrainPathFinderGoal = TrainStopGoal | RailEndGoal | LuaRailEnd | /**
7340
+ * Only if it points at train-stop that is connected to a rail.
7341
+ */
7342
+ LuaEntity;
7343
+ interface TrainPathFinderOneGoalResult {
6020
7344
  /**
6021
7345
  * True if found path.
6022
7346
  */
6023
7347
  found_path: boolean;
6024
- /**
6025
- * Only returned if `return_path` was set to true and path was found. Contains all rails in order that are part of the found path.
6026
- */
6027
- path?: LuaEntity[];
6028
7348
  /**
6029
7349
  * If path was found, provides index of the specific goal to which the path goes to.
6030
7350
  */
6031
7351
  goal_index?: uint;
7352
+ /**
7353
+ * If path was found, provides index of the specific start from which the path to target goes from
7354
+ */
7355
+ start_index?: uint;
6032
7356
  /**
6033
7357
  * Penalty of the path to goal if path was found.
6034
7358
  */
6035
7359
  penalty?: double;
6036
7360
  /**
6037
- * If path was found, provides total length of all rails of the path.
7361
+ * If path was found, tells if the path was reached from the train's front end or from {@link RailEndStart | runtime:RailEndStart} with {@link RailEndStart::is_front | runtime:RailEndStart::is_front} set.
7362
+ */
7363
+ is_front?: boolean;
7364
+ /**
7365
+ * If path was found and search was of type `"path"`, provides total length of all rails of the path.
6038
7366
  */
6039
7367
  total_length?: double;
6040
7368
  /**
6041
- * If path was found, tells if the path was reached from the `from_front` or train's front end.
7369
+ * Only if search was of type `"path"`, `return_path` was set to true and path was found. Contains all rails in order that are part of the found path.
6042
7370
  */
6043
- is_front?: boolean;
7371
+ path?: LuaEntity[];
6044
7372
  /**
6045
7373
  * Amount of steps pathfinder performed. This is a measure of how expensive this search was.
6046
7374
  */
6047
7375
  steps_count: uint;
6048
7376
  }
6049
7377
  /**
6050
- * A {@link string | runtime:string} specifying the type of request for {@link LuaGameScript::request_train_path | runtime:LuaGameScript::request_train_path}.
7378
+ * A {@link string | runtime:string} specifying the type of request for {@link LuaTrainManager::request_train_path | runtime:LuaTrainManager::request_train_path}.
6051
7379
  */
6052
7380
  type TrainPathRequestType = /**
6053
- * The method will return {@link TrainPathFinderPathResult | runtime:TrainPathFinderPathResult}.
7381
+ * The method will return {@link TrainPathFinderOneGoalResult | runtime:TrainPathFinderOneGoalResult}.
6054
7382
  */
6055
7383
  'path' | /**
6056
- * The method will return {@link TrainPathAnyGoalResult | runtime:TrainPathAnyGoalResult}.
7384
+ * The method will return {@link TrainPathFinderOneGoalResult | runtime:TrainPathFinderOneGoalResult}.
6057
7385
  */
6058
7386
  'any-goal-accessible' | /**
6059
7387
  * The method will return {@link TrainPathAllGoalsResult | runtime:TrainPathAllGoalsResult}.
@@ -6067,35 +7395,54 @@ interface TrainSchedule {
6067
7395
  * Index of the currently active record
6068
7396
  */
6069
7397
  current: uint;
6070
- records: TrainScheduleRecord[];
7398
+ records: ScheduleRecord[];
6071
7399
  }
6072
- interface TrainScheduleRecord {
7400
+ interface TrainStopFilter {
6073
7401
  /**
6074
- * Name of the station.
7402
+ * Surface the train stop must be on in order to pass
6075
7403
  */
6076
- station?: string;
7404
+ surface?: SurfaceIdentification;
6077
7405
  /**
6078
- * Rail to path to. Ignored if `station` is present.
7406
+ * ForceID the train stop must have to pass
6079
7407
  */
6080
- rail?: LuaEntity;
7408
+ force?: ForceID;
6081
7409
  /**
6082
- * When a train is allowed to reach rail target from any direction it will be `nil`. If rail has to be reached from specific direction, this value allows to choose the direction. This value corresponds to {@link LuaEntity::connected_rail_direction | runtime:LuaEntity::connected_rail_direction} of a TrainStop.
7410
+ * Checks if train stop is full (trains count >= trains limit or disabled) or not full.
6083
7411
  */
6084
- rail_direction?: defines.rail_direction;
6085
- wait_conditions?: WaitCondition[];
7412
+ is_full?: boolean;
6086
7413
  /**
6087
- * Only present when the station is temporary, the value is then always `true`.
7414
+ * Checks if train stop has a rail next to it.
6088
7415
  */
6089
- temporary?: boolean;
7416
+ is_connected_to_rail?: boolean;
7417
+ /**
7418
+ * If given, only train stops of this type will pass
7419
+ */
7420
+ type?: EntityID | EntityID[];
7421
+ /**
7422
+ * Train stop must belong to given station name to pass
7423
+ */
7424
+ station_name?: string | string[];
7425
+ /**
7426
+ * If train stop has limit set by control behavior
7427
+ */
7428
+ limit_set_by_control_behavior?: boolean;
7429
+ /**
7430
+ * If train stop is disabled by a control behavior
7431
+ */
7432
+ is_disabled?: boolean;
6090
7433
  }
6091
7434
  interface TrainStopGoal {
6092
7435
  /**
6093
7436
  * Train stop target. Must be connected to rail ({@link LuaEntity::connected_rail | runtime:LuaEntity::connected_rail} returns valid LuaEntity).
6094
7437
  */
6095
7438
  train_stop: LuaEntity;
7439
+ /**
7440
+ * Goal priority. If not provided, defaults to {@link LuaEntity::train_stop_priority | runtime:LuaEntity::train_stop_priority} of provided train_stop.
7441
+ */
7442
+ priority?: uint8;
6096
7443
  }
6097
7444
  interface TriggerDelivery {
6098
- type: 'instant' | 'projectile' | 'flame-thrower' | 'beam' | 'stream' | 'artillery';
7445
+ type: 'instant' | 'projectile' | 'beam' | 'stream' | 'artillery' | 'chain' | 'delayed';
6099
7446
  source_effects: TriggerEffectItem[];
6100
7447
  target_effects: TriggerEffectItem[];
6101
7448
  }
@@ -6111,7 +7458,7 @@ interface TriggerEffectItem {
6111
7458
  /**
6112
7459
  * Used by {@link TriggerEffectItem | runtime:TriggerEffectItem}.
6113
7460
  */
6114
- type TriggerEffectItemType = 'damage' | 'create-entity' | 'create-explosion' | 'create-fire' | 'create-smoke' | 'create-trivial-smoke' | 'create-particle' | 'create-sticker' | 'create-decorative' | 'nested-result' | 'play-sound' | 'push-back' | 'destroy-cliffs' | 'show-explosion-on-chart' | 'insert-item' | 'script' | 'set-tile' | 'invoke-tile-trigger' | 'destroy-decoratives' | 'camera-effect';
7461
+ type TriggerEffectItemType = 'damage' | 'create-entity' | 'create-explosion' | 'create-fire' | 'create-smoke' | 'create-trivial-smoke' | 'create-asteroid-chunk' | 'create-particle' | 'create-sticker' | 'create-decorative' | 'nested-result' | 'play-sound' | 'push-back' | 'destroy-cliffs' | 'show-explosion-on-chart' | 'insert-item' | 'script' | 'set-tile' | 'invoke-tile-trigger' | 'destroy-decoratives' | 'camera-effect' | 'activate-impact';
6115
7462
  interface TriggerItem {
6116
7463
  type: 'direct' | 'area' | 'line' | 'cluster';
6117
7464
  action_delivery?: TriggerDelivery[];
@@ -6136,6 +7483,210 @@ interface TriggerItem {
6136
7483
  * A set of trigger target masks.
6137
7484
  */
6138
7485
  type TriggerTargetMask = Record<string, true>;
7486
+ /**
7487
+ * A trivial smoke prototype may be specified in one of two ways.
7488
+ */
7489
+ type TrivialSmokeID = /**
7490
+ * The trivial smoke prototype.
7491
+ */
7492
+ LuaTrivialSmokePrototype | /**
7493
+ * The prototype name.
7494
+ */
7495
+ string;
7496
+ interface BaseUndoRedoAction {
7497
+ /**
7498
+ * The type of action that was undone or redone.
7499
+ */
7500
+ type: string;
7501
+ /**
7502
+ * The tags attached to the undo action, if any.
7503
+ */
7504
+ tags?: Tags;
7505
+ }
7506
+ type UndoRedoAction = BaseUndoRedoAction | UndoRedoActionBuiltEntity | UndoRedoActionBuiltTile | UndoRedoActionCopyEntitySettings | UndoRedoActionRemovedEntity | UndoRedoActionRemovedTile | UndoRedoActionRotatedEntity | UndoRedoActionUpgradedEntity | UndoRedoActionUpgradedModules | UndoRedoActionWireAdded | UndoRedoActionWireRemoved;
7507
+ /**
7508
+ *
7509
+ * Applies to variant case `built-entity`
7510
+ */
7511
+ interface UndoRedoActionBuiltEntity extends BaseUndoRedoAction {
7512
+ /**
7513
+ * The type of action that was undone or redone.
7514
+ */
7515
+ 'type': 'built-entity';
7516
+ /**
7517
+ * The specification of the built entity.
7518
+ */
7519
+ 'target': BlueprintEntity;
7520
+ }
7521
+ /**
7522
+ *
7523
+ * Applies to variant case `built-tile`
7524
+ */
7525
+ interface UndoRedoActionBuiltTile extends BaseUndoRedoAction {
7526
+ /**
7527
+ * The type of action that was undone or redone.
7528
+ */
7529
+ 'type': 'built-tile';
7530
+ /**
7531
+ * The prototype name of the newly built tile.
7532
+ */
7533
+ 'new_tile': string;
7534
+ /**
7535
+ * The position of the newly built tile.
7536
+ */
7537
+ 'position': TilePosition;
7538
+ /**
7539
+ * The prototype name of the replaced tile, if any was replaced.
7540
+ */
7541
+ 'previous_tile'?: string;
7542
+ /**
7543
+ * The surface on which the tile was built.
7544
+ */
7545
+ 'surface_index': uint;
7546
+ }
7547
+ /**
7548
+ *
7549
+ * Applies to variant case `copy-entity-settings`
7550
+ */
7551
+ interface UndoRedoActionCopyEntitySettings extends BaseUndoRedoAction {
7552
+ /**
7553
+ * The type of action that was undone or redone.
7554
+ */
7555
+ 'type': 'copy-entity-settings';
7556
+ 'entity_with_previous_settings'?: BlueprintEntity;
7557
+ 'target'?: BlueprintEntity;
7558
+ }
7559
+ /**
7560
+ *
7561
+ * Applies to variant case `removed-entity`
7562
+ */
7563
+ interface UndoRedoActionRemovedEntity extends BaseUndoRedoAction {
7564
+ /**
7565
+ * The type of action that was undone or redone.
7566
+ */
7567
+ 'type': 'removed-entity';
7568
+ /**
7569
+ * The items that the entity will request when revived, if there are any. It's a mapping of prototype names to amounts. Not present for entities the game can't restore, like trees or rocks.
7570
+ */
7571
+ 'insert_plan'?: BlueprintInsertPlan[];
7572
+ /**
7573
+ * The schedule of the entity, if it has one. Only relevant for locomotives. Not present for entities the game can't restore, like trees or rocks.
7574
+ */
7575
+ 'schedule'?: BlueprintSchedule;
7576
+ /**
7577
+ * The surface from which the entity was removed. Not present for entities the game can't restore, like trees or rocks.
7578
+ */
7579
+ 'surface_index'?: uint;
7580
+ /**
7581
+ * The specification of the removed entity.
7582
+ */
7583
+ 'target': BlueprintEntity;
7584
+ }
7585
+ /**
7586
+ *
7587
+ * Applies to variant case `removed-tile`
7588
+ */
7589
+ interface UndoRedoActionRemovedTile extends BaseUndoRedoAction {
7590
+ /**
7591
+ * The type of action that was undone or redone.
7592
+ */
7593
+ 'type': 'removed-tile';
7594
+ /**
7595
+ * The position of the removed tile.
7596
+ */
7597
+ 'position': TilePosition;
7598
+ /**
7599
+ * The prototype name of the removed tile.
7600
+ */
7601
+ 'previous_tile': string;
7602
+ /**
7603
+ * The surface from which the tile was removed.
7604
+ */
7605
+ 'surface_index': uint;
7606
+ }
7607
+ /**
7608
+ *
7609
+ * Applies to variant case `rotated-entity`
7610
+ */
7611
+ interface UndoRedoActionRotatedEntity extends BaseUndoRedoAction {
7612
+ /**
7613
+ * The type of action that was undone or redone.
7614
+ */
7615
+ 'type': 'rotated-entity';
7616
+ /**
7617
+ * The direction of the entity before upgrading.
7618
+ */
7619
+ 'original_direction': defines.direction;
7620
+ 'original_mirroring': boolean;
7621
+ /**
7622
+ * The specification of the rotated entity.
7623
+ */
7624
+ 'target': BlueprintEntity;
7625
+ }
7626
+ /**
7627
+ *
7628
+ * Applies to variant case `upgraded-entity`
7629
+ */
7630
+ interface UndoRedoActionUpgradedEntity extends BaseUndoRedoAction {
7631
+ /**
7632
+ * The type of action that was undone or redone.
7633
+ */
7634
+ 'type': 'upgraded-entity';
7635
+ /**
7636
+ * The prototype name of the upgraded entity.
7637
+ */
7638
+ 'original_name': string;
7639
+ /**
7640
+ * The quality prototype name of the entity before upgrading.
7641
+ */
7642
+ 'original_quality_name': string;
7643
+ /**
7644
+ * The specification of the upgraded entity.
7645
+ */
7646
+ 'target': BlueprintEntity;
7647
+ }
7648
+ /**
7649
+ *
7650
+ * Applies to variant case `upgraded-modules`
7651
+ */
7652
+ interface UndoRedoActionUpgradedModules extends BaseUndoRedoAction {
7653
+ /**
7654
+ * The type of action that was undone or redone.
7655
+ */
7656
+ 'type': 'upgraded-modules';
7657
+ /**
7658
+ * The modules present in the target before the upgrade.
7659
+ */
7660
+ 'modules_before': BlueprintInsertPlan;
7661
+ /**
7662
+ * The specification of the upgraded entity.
7663
+ */
7664
+ 'target': BlueprintEntity;
7665
+ }
7666
+ /**
7667
+ *
7668
+ * Applies to variant case `wire-added`
7669
+ */
7670
+ interface UndoRedoActionWireAdded extends BaseUndoRedoAction {
7671
+ /**
7672
+ * The type of action that was undone or redone.
7673
+ */
7674
+ 'type': 'wire-added';
7675
+ 'a': BlueprintWireEnd;
7676
+ 'b': BlueprintWireEnd;
7677
+ }
7678
+ /**
7679
+ *
7680
+ * Applies to variant case `wire-removed`
7681
+ */
7682
+ interface UndoRedoActionWireRemoved extends BaseUndoRedoAction {
7683
+ /**
7684
+ * The type of action that was undone or redone.
7685
+ */
7686
+ 'type': 'wire-removed';
7687
+ 'a': BlueprintWireEnd;
7688
+ 'b': BlueprintWireEnd;
7689
+ }
6139
7690
  interface UnitGroupMapSettings {
6140
7691
  /**
6141
7692
  * The minimum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `3 600` ticks.
@@ -6197,15 +7748,41 @@ interface UnitSpawnDefinition {
6197
7748
  */
6198
7749
  spawn_points: SpawnPointDefinition[];
6199
7750
  }
6200
- interface UpgradeFilter {
7751
+ interface UpgradeMapperDestination {
7752
+ /**
7753
+ * `"item"`, or `"entity"`.
7754
+ */
7755
+ type: string;
7756
+ /**
7757
+ * Name of the item, or entity.
7758
+ */
7759
+ name?: string;
7760
+ /**
7761
+ * Name of the quality.
7762
+ */
7763
+ quality?: string;
7764
+ /**
7765
+ * when type is `"item"` and the mapper is configured to install modules the limit per machine. If `0` then no limit.
7766
+ */
7767
+ count?: uint;
7768
+ }
7769
+ interface UpgradeMapperSource {
6201
7770
  type: 'item' | 'entity';
6202
7771
  /**
6203
7772
  * Name of the item, or entity.
6204
7773
  */
6205
7774
  name?: string;
7775
+ /**
7776
+ * Name of the quality prototype.
7777
+ */
7778
+ quality?: string;
7779
+ /**
7780
+ * The quality comparison type.
7781
+ */
7782
+ comparator?: ComparatorString;
6206
7783
  }
6207
7784
  /**
6208
- * A vector is a two-element array containing the `x` and `y` components. In some specific cases, the vector is a table with `x` and `y` keys instead, which the documentation will point out.
7785
+ * A vector is a two-element array or dictionary containing the `x` and `y` components. The game will always provide the array format. Positive x goes east, positive y goes south.
6209
7786
  * @example ```
6210
7787
  right = {1.0, 0.0}
6211
7788
  ```
@@ -6217,6 +7794,20 @@ type Vector = {
6217
7794
  float,
6218
7795
  float
6219
7796
  ];
7797
+ /**
7798
+ * Reading this always returns the table with the named keys.
7799
+ *
7800
+ * If this is specified as a three-element array then the array items are x, y and z, in that order.
7801
+ */
7802
+ type Vector3D = {
7803
+ x: float;
7804
+ y: float;
7805
+ z: float;
7806
+ } | [
7807
+ float,
7808
+ float,
7809
+ float
7810
+ ];
6220
7811
  interface VehicleAutomaticTargetingParameters {
6221
7812
  auto_target_without_gunner: boolean;
6222
7813
  auto_target_with_gunner: boolean;
@@ -6227,50 +7818,83 @@ interface VehicleAutomaticTargetingParameters {
6227
7818
  * For example, `"top"` aligned text means the top of the text is at the target position. Or in other words, the target is at the top of the text.
6228
7819
  */
6229
7820
  type VerticalTextAlign = 'top' | 'middle' | 'baseline' | 'bottom';
7821
+ /**
7822
+ * A virtual signal prototype may be specified in one of two ways.
7823
+ */
7824
+ type VirtualSignalID = /**
7825
+ * The virtual signal prototype.
7826
+ */
7827
+ LuaVirtualSignalPrototype | /**
7828
+ * The prototype name.
7829
+ */
7830
+ string;
6230
7831
  interface WaitCondition {
6231
7832
  type: WaitConditionType;
6232
7833
  /**
6233
- * Specifies how this condition is to be compared with the preceding conditions in the corresponding `wait_conditions` array.
7834
+ * Specifies how this condition is to be compared with the preceding conditions in the corresponding `wait_conditions` array. Always present when reading, defaults to `"and"` when writing.
6234
7835
  */
6235
- compare_type: 'and' | 'or';
7836
+ compare_type?: 'and' | 'or';
6236
7837
  /**
6237
7838
  * Number of ticks to wait when `type` is `"time"`, or number of ticks of inactivity when `type` is `"inactivity"`.
6238
7839
  */
6239
7840
  ticks?: uint;
6240
7841
  /**
6241
- * Only present when `type` is `"item_count"`, `"circuit"` or `"fluid_count"`, and a circuit condition is configured.
7842
+ * This is a CircuitCondition and only present when `type` is `"item_count"`, `"circuit"`, `"fluid_count"`, `"fuel_item_count_all"`, or `"fuel_item_count_any"`, and a circuit condition is configured. This is a ItemIDAndQualityIDPair and only present when `type` is `"request_satisfied"` or `"request_not_satisfied"`
6242
7843
  */
6243
- condition?: CircuitCondition;
7844
+ condition?: CircuitCondition | ItemIDAndQualityIDPair;
7845
+ /**
7846
+ * Name of the space location. Only present when `type` is "`any_planet_import_zero`" and a planet is configured.
7847
+ */
7848
+ planet?: string;
7849
+ /**
7850
+ * Name of the station. Only present when `type` is "`specific_destination_full`", "`specific_destination_not_full`", "`at_station`", or "`not_at_station`", and a station is configured.
7851
+ */
7852
+ station?: string;
7853
+ /**
7854
+ * Amount of damage to take when `type` is `"damage_taken"`.
7855
+ */
7856
+ damage?: uint;
6244
7857
  }
6245
7858
  /**
6246
7859
  * Type of a {@link WaitCondition | runtime:WaitCondition}.
6247
7860
  */
6248
- type WaitConditionType = 'time' | 'full' | 'empty' | 'item_count' | 'circuit' | 'inactivity' | 'robots_inactive' | 'fluid_count' | 'passenger_present' | 'passenger_not_present';
6249
- interface WireConnectionDefinition {
7861
+ type WaitConditionType = 'time' | 'full' | 'empty' | 'not_empty' | 'item_count' | 'circuit' | 'inactivity' | 'robots_inactive' | 'fluid_count' | 'passenger_present' | 'passenger_not_present' | 'fuel_item_count_all' | 'fuel_item_count_any' | 'fuel_full' | 'destination_full_or_no_path' | 'request_satisfied' | 'request_not_satisfied' | 'all_requests_satisfied' | 'any_request_not_satisfied' | 'any_request_zero' | 'any_planet_import_zero' | 'specific_destination_full' | 'specific_destination_not_full' | 'at_station' | 'not_at_station' | 'damage_taken';
7862
+ interface WireConnection {
7863
+ target: LuaWireConnector;
6250
7864
  /**
6251
- * The type of wire used.
7865
+ * Defaults to defines.wire_origin.player
6252
7866
  */
6253
- wire: defines.wire_type;
7867
+ origin?: defines.wire_origin;
7868
+ }
7869
+ interface WorkerRobotOrder {
6254
7870
  /**
6255
- * The entity to (dis)connect the source entity with.
7871
+ * The type of the order.
6256
7872
  */
6257
- target_entity: LuaEntity;
7873
+ type: defines.robot_order_type;
7874
+ /**
7875
+ * The target of the order.
7876
+ */
7877
+ target?: LuaEntity;
7878
+ /**
7879
+ * The item to place if relevant.
7880
+ */
7881
+ item_to_place?: SimpleItemStack;
6258
7882
  /**
6259
- * Mandatory if the source entity has more than one circuit connection using circuit wire.
7883
+ * The secondary target of the upgrade order.
6260
7884
  */
6261
- source_circuit_id?: defines.circuit_connector_id;
7885
+ secondary_target?: LuaEntity;
6262
7886
  /**
6263
- * Mandatory if the target entity has more than one circuit connection using circuit wire.
7887
+ * The cliff explosive for the cliff explode job.
6264
7888
  */
6265
- target_circuit_id?: defines.circuit_connector_id;
7889
+ cliff_explosive_id?: LuaItemPrototype;
6266
7890
  /**
6267
- * Mandatory if the source entity has more than one wire connection using copper wire.
7891
+ * The target item of the pickup or deliver order.
6268
7892
  */
6269
- source_wire_id?: defines.wire_connection_id;
7893
+ target_item?: ItemIDAndQualityIDPair;
6270
7894
  /**
6271
- * Mandatory if the target entity has more than one wire connection using copper wire.
7895
+ * The target count of the pickup or deliver order.
6272
7896
  */
6273
- target_wire_id?: defines.wire_connection_id;
7897
+ target_count?: ItemCountType;
6274
7898
  }
6275
7899
  /**
6276
7900
  * A double-precision floating-point number. This is the same data type as all Lua numbers use.