factorio-types 1.2.16 → 1.2.18
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.
- package/dist/classes.d.ts +110 -34
- package/dist/concepts.d.ts +26 -7
- package/dist/datacollection.d.ts +1 -1
- package/dist/defines.d.ts +2 -2
- package/dist/events.d.ts +7 -5
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +45 -5
- package/dist/types.d.ts +57 -13
- package/package.json +2 -2
package/dist/classes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -22,6 +22,10 @@ interface LuaAISettings {
|
|
|
22
22
|
* If enabled, units will try to separate themselves from nearby friendly units.
|
|
23
23
|
*/
|
|
24
24
|
do_separation: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If enabled, the unit will join attack groups.
|
|
27
|
+
*/
|
|
28
|
+
join_attacks: boolean;
|
|
25
29
|
/**
|
|
26
30
|
* The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
|
|
27
31
|
*/
|
|
@@ -30,6 +34,12 @@ interface LuaAISettings {
|
|
|
30
34
|
* Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
|
|
31
35
|
*/
|
|
32
36
|
path_resolution_modifier: int8;
|
|
37
|
+
/**
|
|
38
|
+
* The number of "slots" that the unit takes up in a unit group. Must be greater than 0.
|
|
39
|
+
*
|
|
40
|
+
* If this value is changed after the unit has been added to a group, the exact behavior is undefined.
|
|
41
|
+
*/
|
|
42
|
+
size_in_group: float;
|
|
33
43
|
/**
|
|
34
44
|
* Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
|
|
35
45
|
*/
|
|
@@ -344,21 +354,25 @@ interface LuaAutoplaceControlPrototype extends LuaPrototypeBase {
|
|
|
344
354
|
interface LuaBootstrap {
|
|
345
355
|
/**
|
|
346
356
|
* Generate a new, unique event ID that can be used to raise custom events with {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event}.
|
|
347
|
-
* @returns The newly generated event ID.
|
|
357
|
+
* @returns The newly generated event ID. This will be a new value that does not correspond to any named entry in defines.events.
|
|
348
358
|
*/
|
|
349
|
-
generate_event_name(this: void):
|
|
359
|
+
generate_event_name(this: void): defines.events;
|
|
350
360
|
/**
|
|
351
361
|
* Gets the filters for the given event.
|
|
352
362
|
* @param event ID of the event to get.
|
|
353
363
|
* @returns The filters or `nil` if none are defined.
|
|
354
364
|
*/
|
|
355
|
-
get_event_filter(this: void, event:
|
|
365
|
+
get_event_filter(this: void, event: LuaEventType): EventFilter | null;
|
|
356
366
|
/**
|
|
357
367
|
* Find the event handler for an event.
|
|
358
368
|
* @param event The event identifier to get a handler for.
|
|
359
369
|
* @returns Reference to the function currently registered as the handler, if it was found.
|
|
360
370
|
*/
|
|
361
|
-
get_event_handler(this: void, event:
|
|
371
|
+
get_event_handler(this: void, event: LuaEventType): ((this: void, arg0: EventData) => any) | null;
|
|
372
|
+
/**
|
|
373
|
+
* Converts LuaEventType into related value of defines.events. Value will be provided also if event was not given a constant inside of defines.events.
|
|
374
|
+
*/
|
|
375
|
+
get_event_id(this: void, event: LuaEventType): defines.events;
|
|
362
376
|
/**
|
|
363
377
|
* Gets the mod event order as a string.
|
|
364
378
|
*/
|
|
@@ -3989,7 +4003,7 @@ interface LuaBootstrap {
|
|
|
3989
4003
|
{{filter = "name", name = "fast-inserter"}})
|
|
3990
4004
|
```
|
|
3991
4005
|
*/
|
|
3992
|
-
on_event(this: void, event:
|
|
4006
|
+
on_event(this: void, event: LuaEventType | LuaEventType[], handler: ((this: void, arg0: EventData) => any) | nil, filters?: EventFilter): void;
|
|
3993
4007
|
/**
|
|
3994
4008
|
* Register a function to be run on mod initialization.
|
|
3995
4009
|
*
|
|
@@ -4206,7 +4220,7 @@ interface LuaBootstrap {
|
|
|
4206
4220
|
* @param event ID of the event to filter.
|
|
4207
4221
|
* @param filters The filters or `nil` to clear them.
|
|
4208
4222
|
*/
|
|
4209
|
-
set_event_filter(this: void, event:
|
|
4223
|
+
set_event_filter(this: void, event: LuaEventType, filters?: EventFilter): void;
|
|
4210
4224
|
/**
|
|
4211
4225
|
* A dictionary listing the names of all currently active mods and mapping them to their version.
|
|
4212
4226
|
* @example ```
|
|
@@ -4336,6 +4350,8 @@ interface LuaBurnerPrototype {
|
|
|
4336
4350
|
*/
|
|
4337
4351
|
readonly fuel_categories: Record<string, true>;
|
|
4338
4352
|
readonly fuel_inventory_size: uint;
|
|
4353
|
+
readonly initial_fuel?: LuaItemPrototype;
|
|
4354
|
+
readonly initial_fuel_percent: double;
|
|
4339
4355
|
/**
|
|
4340
4356
|
* The light flicker definition for this burner prototype.
|
|
4341
4357
|
*/
|
|
@@ -5259,6 +5275,10 @@ interface LuaCustomChartTag {
|
|
|
5259
5275
|
* Prototype of a custom event.
|
|
5260
5276
|
*/
|
|
5261
5277
|
interface LuaCustomEventPrototype extends LuaPrototypeBase {
|
|
5278
|
+
/**
|
|
5279
|
+
* Event identifier associated with this custom event.
|
|
5280
|
+
*/
|
|
5281
|
+
readonly event_id: defines.events;
|
|
5262
5282
|
/**
|
|
5263
5283
|
* The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
|
|
5264
5284
|
*/
|
|
@@ -5304,6 +5324,10 @@ interface LuaCustomInputPrototype extends LuaPrototypeBase {
|
|
|
5304
5324
|
* Whether this custom input is enabled while using the spectator controller.
|
|
5305
5325
|
*/
|
|
5306
5326
|
readonly enabled_while_spectating: boolean;
|
|
5327
|
+
/**
|
|
5328
|
+
* Event identifier associated with this custom input.
|
|
5329
|
+
*/
|
|
5330
|
+
readonly event_id: defines.events;
|
|
5307
5331
|
/**
|
|
5308
5332
|
* Whether this custom input will include the selected prototype (if any) when triggered.
|
|
5309
5333
|
*/
|
|
@@ -6520,6 +6544,20 @@ interface LuaEntity extends LuaControl {
|
|
|
6520
6544
|
* The current direction this entity is facing.
|
|
6521
6545
|
*/
|
|
6522
6546
|
direction: defines.direction;
|
|
6547
|
+
/**
|
|
6548
|
+
* If the updatable entity is disabled by control behavior.
|
|
6549
|
+
*/
|
|
6550
|
+
readonly disabled_by_control_behavior: boolean;
|
|
6551
|
+
/**
|
|
6552
|
+
* If the updatable entity is disabled by recipe.
|
|
6553
|
+
*/
|
|
6554
|
+
readonly disabled_by_recipe: boolean;
|
|
6555
|
+
/**
|
|
6556
|
+
* If the updatable entity is disabled by script.
|
|
6557
|
+
*
|
|
6558
|
+
* Note: Some entities (Corpse, FireFlame, Roboport, RollingStock, dying entities) need to remain active and will ignore writes.
|
|
6559
|
+
*/
|
|
6560
|
+
disabled_by_script: boolean;
|
|
6523
6561
|
/**
|
|
6524
6562
|
* Gives a draw data of the given entity if it supports such data.
|
|
6525
6563
|
*/
|
|
@@ -6622,6 +6660,10 @@ interface LuaEntity extends LuaControl {
|
|
|
6622
6660
|
```
|
|
6623
6661
|
*/
|
|
6624
6662
|
friction_modifier: float;
|
|
6663
|
+
/**
|
|
6664
|
+
* If the freezable entity is currently frozen.
|
|
6665
|
+
*/
|
|
6666
|
+
readonly frozen: boolean;
|
|
6625
6667
|
readonly ghost_localised_description: LocalisedString;
|
|
6626
6668
|
/**
|
|
6627
6669
|
* Localised name of the entity or tile contained in this ghost.
|
|
@@ -6707,7 +6749,7 @@ interface LuaEntity extends LuaControl {
|
|
|
6707
6749
|
*/
|
|
6708
6750
|
inserter_filter_mode?: 'whitelist' | 'blacklist';
|
|
6709
6751
|
/**
|
|
6710
|
-
* Sets the stack size limit on this inserter.
|
|
6752
|
+
* Sets the stack size limit on this inserter.
|
|
6711
6753
|
*
|
|
6712
6754
|
* Set to `0` to reset.
|
|
6713
6755
|
*/
|
|
@@ -6726,6 +6768,10 @@ interface LuaEntity extends LuaControl {
|
|
|
6726
6768
|
* If this entity is EntityWithOwner
|
|
6727
6769
|
*/
|
|
6728
6770
|
readonly is_entity_with_owner: boolean;
|
|
6771
|
+
/**
|
|
6772
|
+
* If the entity is freezable.
|
|
6773
|
+
*/
|
|
6774
|
+
readonly is_freezable: boolean;
|
|
6729
6775
|
/**
|
|
6730
6776
|
* If the rolling stock is facing train's front.
|
|
6731
6777
|
*/
|
|
@@ -6734,6 +6780,10 @@ interface LuaEntity extends LuaControl {
|
|
|
6734
6780
|
* Whether this entity is a MilitaryTarget. Can be written to if {@link LuaEntityPrototype::allow_run_time_change_of_is_military_target | runtime:LuaEntityPrototype::allow_run_time_change_of_is_military_target} returns `true`.
|
|
6735
6781
|
*/
|
|
6736
6782
|
is_military_target: boolean;
|
|
6783
|
+
/**
|
|
6784
|
+
* If the entity is updatable.
|
|
6785
|
+
*/
|
|
6786
|
+
readonly is_updatable: boolean;
|
|
6737
6787
|
/**
|
|
6738
6788
|
* Items this ghost will request when revived or items this item request proxy is requesting.
|
|
6739
6789
|
*/
|
|
@@ -6800,9 +6850,15 @@ interface LuaEntity extends LuaControl {
|
|
|
6800
6850
|
/**
|
|
6801
6851
|
* Not minable entities can still be destroyed.
|
|
6802
6852
|
*
|
|
6803
|
-
*
|
|
6853
|
+
* Tells if entity reports as being minable right now. This takes into account minable_flag and entity specific conditions (for example rail under rolling stocks is not minable, vehicle with passenger is not minable).
|
|
6854
|
+
*
|
|
6855
|
+
* Write to this field since 2.0.26 is deprecated and it will result in write to minable_flag instead.
|
|
6804
6856
|
*/
|
|
6805
6857
|
minable: boolean;
|
|
6858
|
+
/**
|
|
6859
|
+
* Script controlled flag that allows entity to be mined.
|
|
6860
|
+
*/
|
|
6861
|
+
minable_flag: boolean;
|
|
6806
6862
|
/**
|
|
6807
6863
|
* The filter mode for this mining drill. `nil` if this mining drill doesn't have filters.
|
|
6808
6864
|
*/
|
|
@@ -6816,7 +6872,7 @@ interface LuaEntity extends LuaControl {
|
|
|
6816
6872
|
*/
|
|
6817
6873
|
readonly mining_target?: LuaEntity;
|
|
6818
6874
|
/**
|
|
6819
|
-
* If the entity is currently mirrored.
|
|
6875
|
+
* If the entity is currently mirrored. This state is referred to as `flipped` elsewhere, such as on the {@link on_player_flipped_entity | runtime:on_player_flipped_entity} event.
|
|
6820
6876
|
*/
|
|
6821
6877
|
mirroring: boolean;
|
|
6822
6878
|
/**
|
|
@@ -7857,6 +7913,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7857
7913
|
* The bounding box used for map generator collision checking.
|
|
7858
7914
|
*/
|
|
7859
7915
|
readonly map_generator_bounding_box: BoundingBox;
|
|
7916
|
+
/**
|
|
7917
|
+
* Count of defensive enemies this spawner can sustain.
|
|
7918
|
+
*/
|
|
7919
|
+
readonly max_count_of_owned_defensive_units?: double;
|
|
7860
7920
|
/**
|
|
7861
7921
|
* Count of enemies this spawner can sustain.
|
|
7862
7922
|
*/
|
|
@@ -7865,6 +7925,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7865
7925
|
* The maximum darkness at which this unit spawner can spawn entities.
|
|
7866
7926
|
*/
|
|
7867
7927
|
readonly max_darkness_to_spawn?: float;
|
|
7928
|
+
/**
|
|
7929
|
+
* How many defensive friendly units are required within the spawning_radius of this spawner for it to stop producing more units.
|
|
7930
|
+
*/
|
|
7931
|
+
readonly max_defensive_friends_around_to_spawn?: double;
|
|
7868
7932
|
/**
|
|
7869
7933
|
* How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.
|
|
7870
7934
|
*/
|
|
@@ -8606,14 +8670,14 @@ interface LuaFlowStatistics {
|
|
|
8606
8670
|
* Use `sample_index` to access the data used to generate the statistics graphs. Each precision level contains 300 samples of data so at a precision of 1 minute, each sample contains data averaged across 60s / 300 = 0.2s = 12 ticks.
|
|
8607
8671
|
*
|
|
8608
8672
|
* All return values are normalized to be per-tick for electric networks and per-minute for all other types.
|
|
8609
|
-
* @param table.
|
|
8673
|
+
* @param table.name The prototype ID.
|
|
8610
8674
|
* @param table.category The statistics category to read from. Valid choices are `"input"`, `"output"` and `"storage"`.
|
|
8611
8675
|
* @param table.precision_index The precision to read.
|
|
8612
8676
|
* @param table.sample_index The sample index to read from within the precision range. If not provided, the entire precision range is read. Must be between 1 and 300 where 1 is the most recent sample and 300 is the oldest.
|
|
8613
8677
|
* @param table.count If true, the count of items/fluids/entities is returned instead of the per-time-frame value.
|
|
8614
8678
|
*/
|
|
8615
8679
|
get_flow_count(this: void, table: {
|
|
8616
|
-
|
|
8680
|
+
name: FlowStatisticsID;
|
|
8617
8681
|
category: string;
|
|
8618
8682
|
precision_index: defines.flow_precision_index;
|
|
8619
8683
|
sample_index?: uint16;
|
|
@@ -10037,7 +10101,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
|
|
|
10037
10101
|
/**
|
|
10038
10102
|
* `true` if this should connect to the logistic network.
|
|
10039
10103
|
*/
|
|
10040
|
-
|
|
10104
|
+
connect_to_logistic_network: boolean;
|
|
10041
10105
|
/**
|
|
10042
10106
|
* If the entity is currently disabled because of the control behavior.
|
|
10043
10107
|
*/
|
|
@@ -10054,7 +10118,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
|
|
|
10054
10118
|
}
|
|
10055
10119
|
```
|
|
10056
10120
|
*/
|
|
10057
|
-
|
|
10121
|
+
logistic_condition: CircuitConditionDefinition;
|
|
10058
10122
|
}
|
|
10059
10123
|
/**
|
|
10060
10124
|
* Item group or subgroup.
|
|
@@ -11762,7 +11826,7 @@ interface LuaItemCommon {
|
|
|
11762
11826
|
/**
|
|
11763
11827
|
* Gets the entity filter at the given index for this deconstruction item.
|
|
11764
11828
|
*/
|
|
11765
|
-
get_entity_filter(this: void, index: uint):
|
|
11829
|
+
get_entity_filter(this: void, index: uint): ItemFilter | null;
|
|
11766
11830
|
/**
|
|
11767
11831
|
* Access the inner inventory of an item.
|
|
11768
11832
|
* @param inventory Index of the inventory to access, which can only be {@link defines.inventory.item_main | runtime:defines.inventory.item_main}.
|
|
@@ -11820,7 +11884,7 @@ interface LuaItemCommon {
|
|
|
11820
11884
|
* @param filter Writing `nil` removes the filter.
|
|
11821
11885
|
* @returns Whether the new filter was successfully set (meaning it was valid).
|
|
11822
11886
|
*/
|
|
11823
|
-
set_entity_filter(this: void, index: uint, filter:
|
|
11887
|
+
set_entity_filter(this: void, index: uint, filter: ItemFilter | nil): boolean;
|
|
11824
11888
|
/**
|
|
11825
11889
|
* Sets the module filter at the given index for this upgrade item.
|
|
11826
11890
|
*
|
|
@@ -11892,9 +11956,9 @@ interface LuaItemCommon {
|
|
|
11892
11956
|
*/
|
|
11893
11957
|
entity_filter_mode: defines.deconstruction_item.entity_filter_mode;
|
|
11894
11958
|
/**
|
|
11895
|
-
* The entity filters for this deconstruction item. The attribute is a sparse array with the keys representing the index of the filter. All
|
|
11959
|
+
* The entity filters for this deconstruction item. The attribute is a sparse array with the keys representing the index of the filter. All prototypes in this array must not have the `"not-deconstructable"` flag set and are either a `cliff` or marked as `minable`.
|
|
11896
11960
|
*/
|
|
11897
|
-
entity_filters:
|
|
11961
|
+
entity_filters: ItemFilter[];
|
|
11898
11962
|
/**
|
|
11899
11963
|
* If this is an item with entity data, get the stored entity label.
|
|
11900
11964
|
*/
|
|
@@ -14761,7 +14825,7 @@ interface LuaRecord {
|
|
|
14761
14825
|
raise_built?: boolean;
|
|
14762
14826
|
}): LuaEntity[];
|
|
14763
14827
|
/**
|
|
14764
|
-
* Cancel deconstruct the given area with this deconstruction planner
|
|
14828
|
+
* Cancel deconstruct the given area with this deconstruction planner.
|
|
14765
14829
|
* @param table.surface Surface to cancel deconstruct on
|
|
14766
14830
|
* @param table.force Force to use for canceling deconstruction
|
|
14767
14831
|
* @param table.area The area to deconstruct
|
|
@@ -14814,7 +14878,7 @@ interface LuaRecord {
|
|
|
14814
14878
|
include_fuel?: boolean;
|
|
14815
14879
|
}): Record<uint, LuaEntity>;
|
|
14816
14880
|
/**
|
|
14817
|
-
* Deconstruct the given area with this deconstruction planner
|
|
14881
|
+
* Deconstruct the given area with this deconstruction planner.
|
|
14818
14882
|
* @param table.surface Surface to deconstruct on
|
|
14819
14883
|
* @param table.force Force to use for the deconstruction
|
|
14820
14884
|
* @param table.area The area to deconstruct
|
|
@@ -14853,9 +14917,9 @@ interface LuaRecord {
|
|
|
14853
14917
|
*/
|
|
14854
14918
|
get_blueprint_tiles(this: void): Tile[] | null;
|
|
14855
14919
|
/**
|
|
14856
|
-
* Gets the entity filter at the given index for this deconstruction planner
|
|
14920
|
+
* Gets the entity filter at the given index for this deconstruction planner.
|
|
14857
14921
|
*/
|
|
14858
|
-
get_entity_filter(this: void, index: uint):
|
|
14922
|
+
get_entity_filter(this: void, index: uint): ItemFilter | null;
|
|
14859
14923
|
/**
|
|
14860
14924
|
* Gets the filter at the given index for this upgrade item.
|
|
14861
14925
|
*
|
|
@@ -14865,7 +14929,7 @@ interface LuaRecord {
|
|
|
14865
14929
|
*/
|
|
14866
14930
|
get_mapper(this: void, index: uint, type: string): UpgradeMapperSource | UpgradeMapperDestination;
|
|
14867
14931
|
/**
|
|
14868
|
-
* Gets the tile filter at the given index for this deconstruction planner
|
|
14932
|
+
* Gets the tile filter at the given index for this deconstruction planner.
|
|
14869
14933
|
*/
|
|
14870
14934
|
get_tile_filter(this: void, index: uint): string | null;
|
|
14871
14935
|
/**
|
|
@@ -14895,11 +14959,11 @@ interface LuaRecord {
|
|
|
14895
14959
|
*/
|
|
14896
14960
|
set_blueprint_tiles(this: void, tiles: Tile[]): void;
|
|
14897
14961
|
/**
|
|
14898
|
-
* Sets the entity filter at the given index for this deconstruction planner
|
|
14962
|
+
* Sets the entity filter at the given index for this deconstruction planner.
|
|
14899
14963
|
* @param filter Writing `nil` removes the filter.
|
|
14900
14964
|
* @returns Whether the new filter was successfully set (ie. was valid).
|
|
14901
14965
|
*/
|
|
14902
|
-
set_entity_filter(this: void, index: uint, filter:
|
|
14966
|
+
set_entity_filter(this: void, index: uint, filter: ItemFilter | nil): boolean;
|
|
14903
14967
|
/**
|
|
14904
14968
|
* Sets the module filter at the given index for this upgrade item.
|
|
14905
14969
|
*
|
|
@@ -14910,7 +14974,7 @@ interface LuaRecord {
|
|
|
14910
14974
|
*/
|
|
14911
14975
|
set_mapper(this: void, index: uint, type: string, mapper: UpgradeMapperSource | UpgradeMapperDestination): void;
|
|
14912
14976
|
/**
|
|
14913
|
-
* Sets the tile filter at the given index for this deconstruction planner
|
|
14977
|
+
* Sets the tile filter at the given index for this deconstruction planner.
|
|
14914
14978
|
* @param filter Setting to nil erases the filter.
|
|
14915
14979
|
* @returns Whether the new filter was successfully set (ie. was valid).
|
|
14916
14980
|
*/
|
|
@@ -14944,13 +15008,13 @@ interface LuaRecord {
|
|
|
14944
15008
|
*/
|
|
14945
15009
|
readonly entity_filter_count: uint;
|
|
14946
15010
|
/**
|
|
14947
|
-
* The blacklist/whitelist entity filter mode for this deconstruction planner
|
|
15011
|
+
* The blacklist/whitelist entity filter mode for this deconstruction planner.
|
|
14948
15012
|
*/
|
|
14949
15013
|
entity_filter_mode: defines.deconstruction_item.entity_filter_mode;
|
|
14950
15014
|
/**
|
|
14951
|
-
* The entity filters for this deconstruction planner. The attribute is a sparse array with the keys representing the index of the filter. All
|
|
15015
|
+
* The entity filters for this deconstruction planner. The attribute is a sparse array with the keys representing the index of the filter. All prototypes in this array must not have the `"not-deconstructable"` flag set and are either a `cliff` or marked as `minable`.
|
|
14952
15016
|
*/
|
|
14953
|
-
entity_filters:
|
|
15017
|
+
entity_filters: ItemFilter[];
|
|
14954
15018
|
/**
|
|
14955
15019
|
* Is this blueprint record a preview? A preview record must be synced by the player before entity and tile data can be read.
|
|
14956
15020
|
*/
|
|
@@ -14968,15 +15032,15 @@ interface LuaRecord {
|
|
|
14968
15032
|
*/
|
|
14969
15033
|
readonly tile_filter_count: uint;
|
|
14970
15034
|
/**
|
|
14971
|
-
* The blacklist/whitelist tile filter mode for this deconstruction planner
|
|
15035
|
+
* The blacklist/whitelist tile filter mode for this deconstruction planner.
|
|
14972
15036
|
*/
|
|
14973
15037
|
tile_filter_mode: defines.deconstruction_item.tile_filter_mode;
|
|
14974
15038
|
/**
|
|
14975
|
-
* The tile filters for this deconstruction planner
|
|
15039
|
+
* The tile filters for this deconstruction planner. The attribute is a sparse array with the keys representing the index of the filter. Reading filters always returns an array of strings which are the tile prototype names.
|
|
14976
15040
|
*/
|
|
14977
15041
|
tile_filters: TileID[];
|
|
14978
15042
|
/**
|
|
14979
|
-
* The tile selection mode for this deconstruction planner
|
|
15043
|
+
* The tile selection mode for this deconstruction planner.
|
|
14980
15044
|
*/
|
|
14981
15045
|
tile_selection_mode: defines.deconstruction_item.tile_selection_mode;
|
|
14982
15046
|
/**
|
|
@@ -15984,6 +16048,10 @@ interface LuaSpacePlatform {
|
|
|
15984
16048
|
* The unique index of this space platform.
|
|
15985
16049
|
*/
|
|
15986
16050
|
readonly index: uint;
|
|
16051
|
+
/**
|
|
16052
|
+
* The space location this space platform previously went through or stopped at.
|
|
16053
|
+
*/
|
|
16054
|
+
readonly last_visited_space_location?: LuaSpaceLocationPrototype;
|
|
15987
16055
|
/**
|
|
15988
16056
|
* The name of this space platform.
|
|
15989
16057
|
*/
|
|
@@ -15992,6 +16060,10 @@ interface LuaSpacePlatform {
|
|
|
15992
16060
|
* The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
|
|
15993
16061
|
*/
|
|
15994
16062
|
readonly object_name: string;
|
|
16063
|
+
/**
|
|
16064
|
+
* When `true`, the platform has paused thrust and does not advance its schedule.
|
|
16065
|
+
*/
|
|
16066
|
+
paused: boolean;
|
|
15995
16067
|
/**
|
|
15996
16068
|
* This platform's current schedule, if any. Set to `nil` to clear.
|
|
15997
16069
|
*
|
|
@@ -16012,7 +16084,7 @@ interface LuaSpacePlatform {
|
|
|
16012
16084
|
/**
|
|
16013
16085
|
* The starter pack used to create this space platform.
|
|
16014
16086
|
*/
|
|
16015
|
-
readonly starter_pack
|
|
16087
|
+
readonly starter_pack?: ItemIDAndQualityIDPair;
|
|
16016
16088
|
/**
|
|
16017
16089
|
* The current state of this space platform.
|
|
16018
16090
|
*/
|
|
@@ -17140,6 +17212,10 @@ interface LuaSurface {
|
|
|
17140
17212
|
* Whether this surface currently has a global electric network.
|
|
17141
17213
|
*/
|
|
17142
17214
|
readonly has_global_electric_network: boolean;
|
|
17215
|
+
/**
|
|
17216
|
+
* If surface condition checks should not be performed on this surface.
|
|
17217
|
+
*/
|
|
17218
|
+
ignore_surface_conditions: bool;
|
|
17143
17219
|
/**
|
|
17144
17220
|
* This surface's index in {@link LuaGameScript::surfaces | runtime:LuaGameScript::surfaces} (unique ID). It is assigned when a surface is created, and remains so until it is {@link deleted | runtime:on_surface_deleted}. Indexes of deleted surfaces can be reused.
|
|
17145
17221
|
*/
|
|
@@ -18774,7 +18850,7 @@ interface LuaWireConnector {
|
|
|
18774
18850
|
*/
|
|
18775
18851
|
readonly is_ghost: boolean;
|
|
18776
18852
|
/**
|
|
18777
|
-
* Index of a CircuitNetwork or ElectricSubNetwork which is going through this wire connector. Returns 0 if there is no network associated with this wire connector right now. CircuitNetwork indexes are independent of indexes of ElectricSubNetwork so they may collide with each other
|
|
18853
|
+
* Index of a CircuitNetwork or ElectricSubNetwork which is going through this wire connector. Returns 0 if there is no network associated with this wire connector right now. CircuitNetwork indexes are independent of indexes of ElectricSubNetwork so they may collide with each other.
|
|
18778
18854
|
*/
|
|
18779
18855
|
readonly network_id: uint;
|
|
18780
18856
|
/**
|
package/dist/concepts.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -3560,6 +3560,22 @@ interface LuaEntityMarkedForUpgradeEventFilterType extends BaseLuaEntityMarkedFo
|
|
|
3560
3560
|
*/
|
|
3561
3561
|
'type': string;
|
|
3562
3562
|
}
|
|
3563
|
+
/**
|
|
3564
|
+
* Event name may be specified in one of four ways.
|
|
3565
|
+
*/
|
|
3566
|
+
type LuaEventType = /**
|
|
3567
|
+
* Custom event prototype.
|
|
3568
|
+
*/
|
|
3569
|
+
LuaCustomEventPrototype | /**
|
|
3570
|
+
* Custom input prototype.
|
|
3571
|
+
*/
|
|
3572
|
+
LuaCustomInputPrototype | /**
|
|
3573
|
+
* Event identifier.
|
|
3574
|
+
*/
|
|
3575
|
+
defines.events | /**
|
|
3576
|
+
* Name of the event.
|
|
3577
|
+
*/
|
|
3578
|
+
string;
|
|
3563
3579
|
/**
|
|
3564
3580
|
* Any LuaObject listed on the {@link Classes | runtime:classes} page.
|
|
3565
3581
|
*/
|
|
@@ -5293,15 +5309,14 @@ interface ModSettingPrototypeFilterType extends BaseModSettingPrototypeFilter {
|
|
|
5293
5309
|
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';
|
|
5294
5310
|
/**
|
|
5295
5311
|
* The percentual increase of the attribute. A value of `0.6` means a 60% increase.
|
|
5312
|
+
*
|
|
5313
|
+
* Quality values are divided by 10 internally, allowing for one more decimal of precision.
|
|
5296
5314
|
*/
|
|
5297
5315
|
type ModuleEffectValue = float;
|
|
5298
5316
|
/**
|
|
5299
5317
|
* @example ```
|
|
5300
|
-
-- These are the effects of the vanilla
|
|
5301
|
-
{consumption=0.
|
|
5302
|
-
speed=-0.15,
|
|
5303
|
-
productivity=0.06,
|
|
5304
|
-
pollution=0.075}
|
|
5318
|
+
-- These are the effects of the vanilla Speed Module 3
|
|
5319
|
+
{speed = 0.5, consumption = 0.7, quality = -0.25}
|
|
5305
5320
|
```
|
|
5306
5321
|
*/
|
|
5307
5322
|
interface ModuleEffects {
|
|
@@ -6650,6 +6665,10 @@ interface SignalID {
|
|
|
6650
6665
|
* Name of the prototype.
|
|
6651
6666
|
*/
|
|
6652
6667
|
name?: string;
|
|
6668
|
+
/**
|
|
6669
|
+
* The prototype name of the signal's quality. Defaults to `normal`.
|
|
6670
|
+
*/
|
|
6671
|
+
quality?: QualityID;
|
|
6653
6672
|
}
|
|
6654
6673
|
type SignalIDType = 'item' | 'fluid' | 'virtual' | 'entity' | 'recipe' | 'space-location' | 'asteroid-chunk' | 'quality';
|
|
6655
6674
|
/**
|
|
@@ -7501,7 +7520,7 @@ interface TriggerEffectItem {
|
|
|
7501
7520
|
/**
|
|
7502
7521
|
* Used by {@link TriggerEffectItem | runtime:TriggerEffectItem}.
|
|
7503
7522
|
*/
|
|
7504
|
-
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';
|
|
7523
|
+
type TriggerEffectItemType = 'damage' | 'damage-tile' | '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';
|
|
7505
7524
|
interface TriggerItem {
|
|
7506
7525
|
type: 'direct' | 'area' | 'line' | 'cluster';
|
|
7507
7526
|
action_delivery?: TriggerDelivery[];
|
package/dist/datacollection.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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/prototype-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
package/dist/defines.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
|
@@ -2078,7 +2078,7 @@ enum space_platform_state {
|
|
|
2078
2078
|
*/
|
|
2079
2079
|
no_path = 6,
|
|
2080
2080
|
/**
|
|
2081
|
-
*
|
|
2081
|
+
* Doesn't have any stations in schedule.
|
|
2082
2082
|
*/
|
|
2083
2083
|
no_schedule = 5,
|
|
2084
2084
|
/**
|
package/dist/events.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -1422,9 +1422,9 @@ interface on_mod_item_opened {
|
|
|
1422
1422
|
tick: uint;
|
|
1423
1423
|
}
|
|
1424
1424
|
/**
|
|
1425
|
-
* Called after an object is destroyed
|
|
1425
|
+
* Called after an object is destroyed which was registered with {@link LuaBootstrap::register_on_object_destroyed | runtime:LuaBootstrap::register_on_object_destroyed} previously.
|
|
1426
1426
|
*
|
|
1427
|
-
* Depending on when a given object is destroyed, this event will be fired at the end of the current tick or at the end of the next tick.
|
|
1427
|
+
* Depending on when a given object is destroyed, this event will be fired at the end of the current tick or at the end of the next tick. The event's timing is independent of the in-world object being destroyed.
|
|
1428
1428
|
*/
|
|
1429
1429
|
interface on_object_destroyed {
|
|
1430
1430
|
/**
|
|
@@ -2184,7 +2184,9 @@ interface on_player_fast_transferred {
|
|
|
2184
2184
|
tick: uint;
|
|
2185
2185
|
}
|
|
2186
2186
|
/**
|
|
2187
|
-
* Called when the player flips an entity. This event is only fired when the entity actually changes its orientation or mirroring
|
|
2187
|
+
* Called when the player flips an entity. This event is only fired when the entity actually changes its orientation or mirroring, so it won't be triggered when pressing the flip keys on an entity that can't be flipped.
|
|
2188
|
+
*
|
|
2189
|
+
* This event reflects a change in the {@link LuaEntity::mirroring | runtime:LuaEntity::mirroring} property.
|
|
2188
2190
|
*/
|
|
2189
2191
|
interface on_player_flipped_entity {
|
|
2190
2192
|
/**
|
|
@@ -2192,7 +2194,7 @@ interface on_player_flipped_entity {
|
|
|
2192
2194
|
*/
|
|
2193
2195
|
entity: LuaEntity;
|
|
2194
2196
|
/**
|
|
2195
|
-
* The enacted flip. true
|
|
2197
|
+
* The enacted flip. `true` means a horizontal flip, `false` a vertical one.
|
|
2196
2198
|
*/
|
|
2197
2199
|
horizontal: boolean;
|
|
2198
2200
|
/**
|
package/dist/global.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/prototypes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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/prototype-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
|
@@ -826,6 +826,9 @@ interface AssemblingMachinePrototype extends CraftingMachinePrototype {
|
|
|
826
826
|
draw_circuit_wires?: bool;
|
|
827
827
|
draw_copper_wires?: bool;
|
|
828
828
|
enable_logistic_control_behavior?: bool;
|
|
829
|
+
/**
|
|
830
|
+
* Only loaded when fixed_recipe is provided.
|
|
831
|
+
*/
|
|
829
832
|
fixed_quality?: QualityID;
|
|
830
833
|
/**
|
|
831
834
|
* The preset recipe of this machine. This machine does not show a recipe selection if this is set. The base game uses this for the {@link rocket silo | https://wiki.factorio.com/Rocket_silo}.
|
|
@@ -1339,6 +1342,7 @@ interface CargoLandingPadPrototype extends EntityWithOwnerPrototype {
|
|
|
1339
1342
|
graphics_set?: CargoBayConnectableGraphicsSet;
|
|
1340
1343
|
inventory_size: ItemStackIndex;
|
|
1341
1344
|
radar_range?: uint32;
|
|
1345
|
+
radar_visualisation_color?: Color;
|
|
1342
1346
|
/**
|
|
1343
1347
|
* Drawn when a robot brings/takes items from this landing pad.
|
|
1344
1348
|
*/
|
|
@@ -2712,6 +2716,7 @@ interface EditorControllerPrototype {
|
|
|
2712
2716
|
generate_neighbor_chunks: bool;
|
|
2713
2717
|
gun_inventory_size: ItemStackIndex;
|
|
2714
2718
|
ignore_surface_conditions: bool;
|
|
2719
|
+
ignore_tile_conditions: bool;
|
|
2715
2720
|
instant_blueprint_building: bool;
|
|
2716
2721
|
instant_deconstruction: bool;
|
|
2717
2722
|
instant_rail_planner: bool;
|
|
@@ -2859,11 +2864,19 @@ interface EnemySpawnerPrototype extends EntityWithOwnerPrototype {
|
|
|
2859
2864
|
* Whether this prototype should be a high priority target for enemy forces. See {@link Military units and structures | https://wiki.factorio.com/Military_units_and_structures}.
|
|
2860
2865
|
*/
|
|
2861
2866
|
is_military_target?: true;
|
|
2867
|
+
/**
|
|
2868
|
+
* Count of defensive enemies this spawner can sustain. Defensive units are units with {@link UnitAISettings::join_attacks | prototype:UnitAISettings::join_attacks} set to false. If set below {@link EnemySpawnerPrototype::max_count_of_owned_units | prototype:EnemySpawnerPrototype::max_count_of_owned_units}, the difference will be the space reserved for non-defensive units.
|
|
2869
|
+
*/
|
|
2870
|
+
max_count_of_owned_defensive_units?: uint32;
|
|
2862
2871
|
/**
|
|
2863
2872
|
* Count of enemies this spawner can sustain.
|
|
2864
2873
|
*/
|
|
2865
2874
|
max_count_of_owned_units: uint32;
|
|
2866
2875
|
max_darkness_to_spawn?: float;
|
|
2876
|
+
/**
|
|
2877
|
+
* How many friendly defensive units are required within the {@link EnemySpawnerPrototype::spawning_radius | prototype:EnemySpawnerPrototype::spawning_radius} of this spawner for it to stop producing more units. Defensive units are units with {@link UnitAISettings::join_attacks | prototype:UnitAISettings::join_attacks} set to false. If set below {@link EnemySpawnerPrototype::max_friends_around_to_spawn | prototype:EnemySpawnerPrototype::max_friends_around_to_spawn}, the difference will be the space reserved for non-defensive units.
|
|
2878
|
+
*/
|
|
2879
|
+
max_defensive_friends_around_to_spawn?: uint32;
|
|
2867
2880
|
/**
|
|
2868
2881
|
* How many friendly units are required within the {@link EnemySpawnerPrototype::spawning_radius | prototype:EnemySpawnerPrototype::spawning_radius} of this spawner for it to stop producing more units.
|
|
2869
2882
|
*/
|
|
@@ -3782,6 +3795,9 @@ interface FluidTurretPrototype extends TurretPrototype {
|
|
|
3782
3795
|
prepared_muzzle_animation_shift?: AnimatedVector;
|
|
3783
3796
|
preparing_muzzle_animation_shift?: AnimatedVector;
|
|
3784
3797
|
starting_attack_muzzle_animation_shift?: AnimatedVector;
|
|
3798
|
+
/**
|
|
3799
|
+
* Always `true`, forcing the turret's collision box to be affected by its rotation.
|
|
3800
|
+
*/
|
|
3785
3801
|
turret_base_has_direction: true;
|
|
3786
3802
|
}
|
|
3787
3803
|
/**
|
|
@@ -4194,6 +4210,10 @@ interface HeatPipePrototype extends EntityWithOwnerPrototype {
|
|
|
4194
4210
|
connection_sprites?: ConnectableEntityGraphics;
|
|
4195
4211
|
heat_buffer: HeatBuffer;
|
|
4196
4212
|
heat_glow_sprites?: ConnectableEntityGraphics;
|
|
4213
|
+
/**
|
|
4214
|
+
* Must be >= 0.
|
|
4215
|
+
*/
|
|
4216
|
+
heating_radius?: float;
|
|
4197
4217
|
}
|
|
4198
4218
|
/**
|
|
4199
4219
|
* Used to attach graphics for {@link cursor boxes | prototype:CursorBoxType} to entities during runtime. HighlightBoxEntity can also be independent from entities so it is simply drawn somewhere in the world. See {@link LuaSurface::create_entity | runtime:LuaSurface::create_entity} for the available options for type "highlight-box".
|
|
@@ -4335,6 +4355,7 @@ interface InserterPrototype extends EntityWithOwnerPrototype {
|
|
|
4335
4355
|
* Stack size bonus that is inherent to the prototype without having to be researched.
|
|
4336
4356
|
*/
|
|
4337
4357
|
stack_size_bonus?: uint8;
|
|
4358
|
+
starting_distance?: double;
|
|
4338
4359
|
/**
|
|
4339
4360
|
* Whether the inserter should be able to fish {@link fish | https://wiki.factorio.com/Raw_fish}.
|
|
4340
4361
|
*/
|
|
@@ -6395,6 +6416,10 @@ interface ReactorPrototype extends EntityWithOwnerPrototype {
|
|
|
6395
6416
|
*/
|
|
6396
6417
|
heat_connection_patches_disconnected?: SpriteVariations;
|
|
6397
6418
|
heat_lower_layer_picture?: Sprite;
|
|
6419
|
+
/**
|
|
6420
|
+
* Must be >= 0.
|
|
6421
|
+
*/
|
|
6422
|
+
heating_radius?: double;
|
|
6398
6423
|
light?: LightDefinition;
|
|
6399
6424
|
lower_layer_picture?: Sprite;
|
|
6400
6425
|
/**
|
|
@@ -7020,6 +7045,7 @@ interface RoboportPrototype extends EntityWithOwnerPrototype {
|
|
|
7020
7045
|
* Defaults to the max of logistic range or construction range rounded up to chunks.
|
|
7021
7046
|
*/
|
|
7022
7047
|
radar_range?: uint32;
|
|
7048
|
+
radar_visualisation_color?: Color;
|
|
7023
7049
|
/**
|
|
7024
7050
|
* Minimum charge that the roboport has to have after a blackout (0 charge/buffered energy) to begin working again. Additionally, freshly placed roboports will have their energy buffer filled with `0.25 × recharge_minimum` energy.
|
|
7025
7051
|
*
|
|
@@ -7825,7 +7851,7 @@ interface SoundPrototype {
|
|
|
7825
7851
|
audible_distance_modifier?: double;
|
|
7826
7852
|
category?: SoundType;
|
|
7827
7853
|
/**
|
|
7828
|
-
* Supported sound file formats are `.ogg` (Vorbis) and `.wav`.
|
|
7854
|
+
* Supported sound file formats are `.ogg` (Vorbis and Opus) and `.wav`.
|
|
7829
7855
|
*
|
|
7830
7856
|
* Only loaded, and mandatory if `variations` is not defined.
|
|
7831
7857
|
*/
|
|
@@ -9188,6 +9214,7 @@ interface TurretPrototype extends EntityWithOwnerPrototype {
|
|
|
9188
9214
|
*/
|
|
9189
9215
|
attacking_speed?: float;
|
|
9190
9216
|
call_for_help_radius: double;
|
|
9217
|
+
can_retarget_while_starting_attack?: bool;
|
|
9191
9218
|
/**
|
|
9192
9219
|
* Set of {@link circuit connector definitions | prototype:CircuitConnectorDefinition} for all directions used by this turret. Required amount of elements is based on other prototype values: 8 elements if building-direction-8-way flag is set, or 16 elements if building-direction-16-way flag is set, or 4 elements if turret_base_has_direction is set to true, or 1 element.
|
|
9193
9220
|
*/
|
|
@@ -9319,7 +9346,7 @@ interface TurretPrototype extends EntityWithOwnerPrototype {
|
|
|
9319
9346
|
spawn_decorations_on_expansion?: bool;
|
|
9320
9347
|
special_effect?: TurretSpecialEffect;
|
|
9321
9348
|
/**
|
|
9322
|
-
* When `false` turret will enter `starting_attack` state without checking its ammo or energy levels. {@link FluidTurretPrototype | prototype:FluidTurretPrototype} forces this to `true`.
|
|
9349
|
+
* When `false` the turret will enter `starting_attack` state without checking its ammo or energy levels. {@link FluidTurretPrototype | prototype:FluidTurretPrototype} forces this to `true`.
|
|
9323
9350
|
*/
|
|
9324
9351
|
start_attacking_only_when_can_shoot?: bool;
|
|
9325
9352
|
starting_attack_animation?: RotatedAnimation8Way;
|
|
@@ -9331,6 +9358,9 @@ interface TurretPrototype extends EntityWithOwnerPrototype {
|
|
|
9331
9358
|
starting_attack_speed_secondary?: float;
|
|
9332
9359
|
starting_attack_speed_when_killed?: float;
|
|
9333
9360
|
starting_attack_starting_progress_when_killed?: float;
|
|
9361
|
+
/**
|
|
9362
|
+
* When `true` the turret's collision box will affected by its rotation.
|
|
9363
|
+
*/
|
|
9334
9364
|
turret_base_has_direction?: bool;
|
|
9335
9365
|
unfolds_before_dying?: bool;
|
|
9336
9366
|
}
|
|
@@ -9469,7 +9499,7 @@ interface UseEntityInEnergyProductionAchievementPrototype extends AchievementPro
|
|
|
9469
9499
|
consumed_condition = "uranium-fuel-cell"
|
|
9470
9500
|
```
|
|
9471
9501
|
*/
|
|
9472
|
-
consumed_condition?:
|
|
9502
|
+
consumed_condition?: ItemIDFilter;
|
|
9473
9503
|
/**
|
|
9474
9504
|
* This entity is needed to produce energy, for the player to complete the achievement.
|
|
9475
9505
|
* @example ```
|
|
@@ -9477,6 +9507,10 @@ interface UseEntityInEnergyProductionAchievementPrototype extends AchievementPro
|
|
|
9477
9507
|
```
|
|
9478
9508
|
*/
|
|
9479
9509
|
entity: EntityID;
|
|
9510
|
+
/**
|
|
9511
|
+
* This item needs to be produced before gaining the achievement.
|
|
9512
|
+
*/
|
|
9513
|
+
produced_condition?: ItemIDFilter;
|
|
9480
9514
|
/**
|
|
9481
9515
|
* This item need to be built before gaining the achievement.
|
|
9482
9516
|
* @example ```
|
|
@@ -9833,6 +9867,9 @@ interface UtilitySounds extends PrototypeBase {
|
|
|
9833
9867
|
rotated_medium: Sound;
|
|
9834
9868
|
rotated_small: Sound;
|
|
9835
9869
|
scenario_message: Sound;
|
|
9870
|
+
/**
|
|
9871
|
+
* Only present when the Space Age mod is loaded.
|
|
9872
|
+
*/
|
|
9836
9873
|
segment_dying_sound?: Sound;
|
|
9837
9874
|
smart_pipette: Sound;
|
|
9838
9875
|
switch_gun: Sound;
|
|
@@ -10277,7 +10314,10 @@ interface UtilitySprites extends PrototypeBase {
|
|
|
10277
10314
|
pin_center: Sprite;
|
|
10278
10315
|
pipeline_disabled_icon: Sprite;
|
|
10279
10316
|
placement_indicator_leg: Sprite;
|
|
10280
|
-
|
|
10317
|
+
/**
|
|
10318
|
+
* Only present when the Space Age mod is loaded.
|
|
10319
|
+
*/
|
|
10320
|
+
platform_entity_build_animations?: EntityBuildAnimations;
|
|
10281
10321
|
play: Sprite;
|
|
10282
10322
|
played_dark_green: Sprite;
|
|
10283
10323
|
played_green: Sprite;
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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/prototype-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 2.0.
|
|
5
|
+
// Factorio version 2.0.27
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace prototype {
|
|
@@ -2099,6 +2099,8 @@ interface BurnerEnergySource extends BaseEnergySource {
|
|
|
2099
2099
|
*/
|
|
2100
2100
|
fuel_categories?: FuelCategoryID[];
|
|
2101
2101
|
fuel_inventory_size: ItemStackIndex;
|
|
2102
|
+
initial_fuel?: ItemID;
|
|
2103
|
+
initial_fuel_percent?: double;
|
|
2102
2104
|
light_flicker?: LightFlickeringDefinition;
|
|
2103
2105
|
smoke?: SmokeSource[];
|
|
2104
2106
|
type: 'burner';
|
|
@@ -2305,6 +2307,12 @@ interface CharacterArmorAnimation {
|
|
|
2305
2307
|
idle_with_gun_in_air?: RotatedAnimation;
|
|
2306
2308
|
landing?: RotatedAnimation;
|
|
2307
2309
|
mining_with_tool: RotatedAnimation;
|
|
2310
|
+
/**
|
|
2311
|
+
* List of positions in the mining with tool animation when the mining sound and mining particles are created.
|
|
2312
|
+
*
|
|
2313
|
+
* Overrides {@link CharacterPrototype::mining_with_tool_particles_animation_positions | prototype:CharacterPrototype::mining_with_tool_particles_animation_positions} if defined
|
|
2314
|
+
*/
|
|
2315
|
+
mining_with_tool_particles_animation_positions?: float[];
|
|
2308
2316
|
running?: RotatedAnimation;
|
|
2309
2317
|
/**
|
|
2310
2318
|
* Must contain exactly 18 or 40 directions, so all of the combination of gun direction and moving direction can be covered. Some of these variations are used in reverse to save space. You can use the character animation in the base game for reference.
|
|
@@ -3404,6 +3412,11 @@ interface DamageParameters {
|
|
|
3404
3412
|
*/
|
|
3405
3413
|
type: DamageTypeID;
|
|
3406
3414
|
}
|
|
3415
|
+
interface DamageTileTriggerEffectItem extends TriggerEffectItem {
|
|
3416
|
+
damage: DamageParameters;
|
|
3417
|
+
radius?: float;
|
|
3418
|
+
type: 'damage';
|
|
3419
|
+
}
|
|
3407
3420
|
interface DamageTriggerEffectItem extends TriggerEffectItem {
|
|
3408
3421
|
apply_damage_to_trees?: bool;
|
|
3409
3422
|
damage: DamageParameters;
|
|
@@ -3691,15 +3704,10 @@ interface DropItemTipTrigger extends CountBasedTipTrigger {
|
|
|
3691
3704
|
type: 'drop-item';
|
|
3692
3705
|
}
|
|
3693
3706
|
/**
|
|
3694
|
-
* When applied to {@link modules | prototype:ModulePrototype}, the resulting effect is a sum of all module effects, multiplied through calculations: `(1 + sum module effects)
|
|
3707
|
+
* When applied to {@link modules | prototype:ModulePrototype}, the resulting effect is a sum of all module effects, multiplied through calculations: `(1 + sum module effects)`, or `(0 + sum)` for productivity. Quality calculations follow their own separate logic.
|
|
3695
3708
|
* @example ```
|
|
3696
|
-
|
|
3697
|
-
{
|
|
3698
|
-
productivity = 0.04,
|
|
3699
|
-
consumption = 0.4,
|
|
3700
|
-
pollution = 0.05,
|
|
3701
|
-
speed = -0.05
|
|
3702
|
-
}
|
|
3709
|
+
-- These are the effects of the vanilla Speed Module 3
|
|
3710
|
+
{speed = 0.5, consumption = 0.7, quality = -0.25}
|
|
3703
3711
|
```
|
|
3704
3712
|
*/
|
|
3705
3713
|
interface Effect {
|
|
@@ -3715,6 +3723,9 @@ interface Effect {
|
|
|
3715
3723
|
* Multiplied against work completed, adds to the bonus results of operating. E.g. an extra crafted recipe or immediate research bonus. The minimum possible sum is 0%.
|
|
3716
3724
|
*/
|
|
3717
3725
|
productivity?: EffectValue;
|
|
3726
|
+
/**
|
|
3727
|
+
* Adds a bonus chance to increase a product's quality. The minimum possible sum is 0%. Quality is a special case because its effect value is divided by 10 internally for actual usage. This allows for one more decimal of precision, as anything beyond two decimals of effect value is ignored.
|
|
3728
|
+
*/
|
|
3718
3729
|
quality?: EffectValue;
|
|
3719
3730
|
/**
|
|
3720
3731
|
* Modifier to crafting speed, research speed, etc. The minimum possible sum is -80%.
|
|
@@ -3765,7 +3776,10 @@ type EffectTypeLimitation = (/**
|
|
|
3765
3776
|
'consumption' | /**
|
|
3766
3777
|
* Modules that make the machine produce more or less pollution.
|
|
3767
3778
|
*/
|
|
3768
|
-
'pollution' |
|
|
3779
|
+
'pollution' | /**
|
|
3780
|
+
* Modules that provide a bonus chance to increase a product's quality.
|
|
3781
|
+
*/
|
|
3782
|
+
'quality') | (/**
|
|
3769
3783
|
* Modules that increase or decrease the machine's speed.
|
|
3770
3784
|
*/
|
|
3771
3785
|
'speed' | /**
|
|
@@ -3777,11 +3791,19 @@ type EffectTypeLimitation = (/**
|
|
|
3777
3791
|
'consumption' | /**
|
|
3778
3792
|
* Modules that make the machine produce more or less pollution.
|
|
3779
3793
|
*/
|
|
3780
|
-
'pollution' |
|
|
3794
|
+
'pollution' | /**
|
|
3795
|
+
* Modules that provide a bonus chance to increase a product's quality.
|
|
3796
|
+
*/
|
|
3797
|
+
'quality')[];
|
|
3781
3798
|
/**
|
|
3782
3799
|
* Precision is ignored beyond two decimals - `0.567` results in `0.56` and means 56% etc. Values can range from `-327.68` to `327.67`. Numbers outside of this range will wrap around.
|
|
3800
|
+
*
|
|
3801
|
+
* Quality values are divided by 10 internally, allowing for one more decimal of precision.
|
|
3783
3802
|
* @example ```
|
|
3784
|
-
0.07
|
|
3803
|
+
{speed = 0.07} -- 7% bonus
|
|
3804
|
+
```
|
|
3805
|
+
* @example ```
|
|
3806
|
+
{quality = 0.25} -- 2.5% bonus
|
|
3785
3807
|
```
|
|
3786
3808
|
*/
|
|
3787
3809
|
type EffectValue = float;
|
|
@@ -4499,6 +4521,14 @@ interface FluidBox {
|
|
|
4499
4521
|
```
|
|
4500
4522
|
*/
|
|
4501
4523
|
minimum_temperature?: float;
|
|
4524
|
+
/**
|
|
4525
|
+
* Pipe picture variation used when owner machine is flipped. If no picture is loaded, pipe_picture is used instead.
|
|
4526
|
+
*/
|
|
4527
|
+
mirrored_pipe_picture?: Sprite4Way;
|
|
4528
|
+
/**
|
|
4529
|
+
* Frozen pipe picture variation used when owner machine is flipped. If no picture is loaded, pipe_picture_frozen is used instead.
|
|
4530
|
+
*/
|
|
4531
|
+
mirrored_pipe_picture_frozen?: Sprite4Way;
|
|
4502
4532
|
/**
|
|
4503
4533
|
* Connection points to connect to other fluidboxes. This is also marked as blue arrows in alt mode. Fluid may flow in or out depending on the `type` field of each connection.
|
|
4504
4534
|
*
|
|
@@ -9029,7 +9059,7 @@ type Sound = {
|
|
|
9029
9059
|
audible_distance_modifier?: double;
|
|
9030
9060
|
category?: SoundType;
|
|
9031
9061
|
/**
|
|
9032
|
-
* Supported sound file formats are `.ogg` (Vorbis) and `.wav`.
|
|
9062
|
+
* Supported sound file formats are `.ogg` (Vorbis and Opus) and `.wav`.
|
|
9033
9063
|
*
|
|
9034
9064
|
* Only loaded, and mandatory if `variations` is not defined.
|
|
9035
9065
|
*/
|
|
@@ -11497,6 +11527,9 @@ type TriggerEffect = (/**
|
|
|
11497
11527
|
* Loaded when the `type` is `"damage"`.
|
|
11498
11528
|
*/
|
|
11499
11529
|
DamageTriggerEffectItem | /**
|
|
11530
|
+
* Loaded when the `type` is `"damage-tile"`.
|
|
11531
|
+
*/
|
|
11532
|
+
DamageTileTriggerEffectItem | /**
|
|
11500
11533
|
* Loaded when the `type` is `"create-entity"`.
|
|
11501
11534
|
*/
|
|
11502
11535
|
CreateEntityTriggerEffectItem | /**
|
|
@@ -11563,6 +11596,9 @@ ActivateImpactTriggerEffectItem) | (/**
|
|
|
11563
11596
|
* Loaded when the `type` is `"damage"`.
|
|
11564
11597
|
*/
|
|
11565
11598
|
DamageTriggerEffectItem | /**
|
|
11599
|
+
* Loaded when the `type` is `"damage-tile"`.
|
|
11600
|
+
*/
|
|
11601
|
+
DamageTileTriggerEffectItem | /**
|
|
11566
11602
|
* Loaded when the `type` is `"create-entity"`.
|
|
11567
11603
|
*/
|
|
11568
11604
|
CreateEntityTriggerEffectItem | /**
|
|
@@ -11813,10 +11849,18 @@ interface UnitAISettings {
|
|
|
11813
11849
|
* If enabled, units will try to separate themselves from nearby friendly units.
|
|
11814
11850
|
*/
|
|
11815
11851
|
do_separation?: bool;
|
|
11852
|
+
/**
|
|
11853
|
+
* If enabled, the unit is permitted to join attack groups.
|
|
11854
|
+
*/
|
|
11855
|
+
join_attacks?: bool;
|
|
11816
11856
|
/**
|
|
11817
11857
|
* Must be between -8 and 8.
|
|
11818
11858
|
*/
|
|
11819
11859
|
path_resolution_modifier?: int8;
|
|
11860
|
+
/**
|
|
11861
|
+
* The amount of slots in a unit group this unit takes up. For example, a unit with `groupingSize` of 2 will count as 2 normal-sized units when filling up a unit group. Must be greater than 0.
|
|
11862
|
+
*/
|
|
11863
|
+
size_in_group?: float;
|
|
11820
11864
|
strafe_settings?: PrototypeStrafeSettings;
|
|
11821
11865
|
}
|
|
11822
11866
|
interface UnitAlternativeFrameSequence {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "factorio-types",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"description": "Typescript declarations for the Factorio mod API",
|
|
5
5
|
"main": "index.d.ts",
|
|
6
6
|
"repository": "https://github.com/sguest/factorio-types.git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"src/**/*.d.ts",
|
|
24
24
|
"dist/**/*.d.ts"
|
|
25
25
|
],
|
|
26
|
-
"factorioVersion": "2.0.
|
|
26
|
+
"factorioVersion": "2.0.27",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"lua-types": "^2.13.1"
|
|
29
29
|
},
|