typed-factorio 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
package/Changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.17.0
2
+
3
+ - Updated to factorio version 1.1.52
4
+
1
5
  # v0.16.0
2
6
 
3
7
  - `LuaCustomTable` can be iterated on in a for-of loop directly (without using `pairs`). This requires TSTL v1.3.0 or later.
@@ -3258,8 +3258,8 @@ interface LuaEntity extends LuaControl {
3258
3258
  is_registered_for_construction(): boolean
3259
3259
  /**
3260
3260
  * Is this entity registered for deconstruction with this force? If false, it means a construction robot has been
3261
- * dispatched to deconstruct it, or it is not marked for deconstruction. This is worst-case O(N) complexity where N
3262
- * is the current number of things in the deconstruct queue.
3261
+ * dispatched to deconstruct it, or it is not marked for deconstruction. The complexity is effectively O(1) - it
3262
+ * depends on the number of objects targeting this entity which should be small enough.
3263
3263
  *
3264
3264
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_deconstruction View documentation}
3265
3265
  *
@@ -3317,6 +3317,14 @@ interface LuaEntity extends LuaControl {
3317
3317
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_linked_belts View documentation}
3318
3318
  */
3319
3319
  disconnect_linked_belts(): void
3320
+ /**
3321
+ * Gets legs of given SpiderVehicle.
3322
+ *
3323
+ * *Can only be used if this is SpiderVehicle*
3324
+ *
3325
+ * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_spider_legs View documentation}
3326
+ */
3327
+ get_spider_legs(): LuaEntity[]
3320
3328
  /**
3321
3329
  * Name of the entity prototype. E.g. "inserter" or "filter-inserter".
3322
3330
  *
@@ -3671,6 +3679,8 @@ interface LuaEntity extends LuaControl {
3671
3679
  * - When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none.
3672
3680
  * - When called on a wall-connectable entity or reactor, this is a dictionary of all connections indexed by the
3673
3681
  * connection direction "north", "south", "east", and "west".
3682
+ * - When called on a cliff entity, this is a dictionary of all connections indexed by the connection direction
3683
+ * "north", "south", "east", and "west".
3674
3684
  *
3675
3685
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbours View documentation}
3676
3686
  */
@@ -4551,11 +4561,18 @@ interface LuaEntity extends LuaControl {
4551
4561
  */
4552
4562
  trains_limit: uint
4553
4563
  /**
4554
- * If this entity is EntityWithForce
4564
+ * (deprecated by 1.1.51) If this entity is a MilitaryTarget. Returns same value as LuaEntity::is_military_target
4555
4565
  *
4556
4566
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_force View documentation}
4557
4567
  */
4558
4568
  readonly is_entity_with_force: boolean
4569
+ /**
4570
+ * If this entity is a MilitaryTarget. Can be written to if
4571
+ * LuaEntityPrototype::allow_run_time_change_of_is_military_target returns true
4572
+ *
4573
+ * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_military_target View documentation}
4574
+ */
4575
+ is_military_target: boolean
4559
4576
  /**
4560
4577
  * If this entity is EntityWithOwner
4561
4578
  *
@@ -5242,8 +5259,8 @@ interface BaseEntity extends LuaControl {
5242
5259
  is_registered_for_construction(): boolean
5243
5260
  /**
5244
5261
  * Is this entity registered for deconstruction with this force? If false, it means a construction robot has been
5245
- * dispatched to deconstruct it, or it is not marked for deconstruction. This is worst-case O(N) complexity where N
5246
- * is the current number of things in the deconstruct queue.
5262
+ * dispatched to deconstruct it, or it is not marked for deconstruction. The complexity is effectively O(1) - it
5263
+ * depends on the number of objects targeting this entity which should be small enough.
5247
5264
  *
5248
5265
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_deconstruction View documentation}
5249
5266
  *
@@ -5447,6 +5464,8 @@ interface BaseEntity extends LuaControl {
5447
5464
  * - When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none.
5448
5465
  * - When called on a wall-connectable entity or reactor, this is a dictionary of all connections indexed by the
5449
5466
  * connection direction "north", "south", "east", and "west".
5467
+ * - When called on a cliff entity, this is a dictionary of all connections indexed by the connection direction
5468
+ * "north", "south", "east", and "west".
5450
5469
  *
5451
5470
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbours View documentation}
5452
5471
  */
@@ -5826,11 +5845,18 @@ interface BaseEntity extends LuaControl {
5826
5845
  */
5827
5846
  tags: Tags | undefined
5828
5847
  /**
5829
- * If this entity is EntityWithForce
5848
+ * (deprecated by 1.1.51) If this entity is a MilitaryTarget. Returns same value as LuaEntity::is_military_target
5830
5849
  *
5831
5850
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_force View documentation}
5832
5851
  */
5833
5852
  readonly is_entity_with_force: boolean
5853
+ /**
5854
+ * If this entity is a MilitaryTarget. Can be written to if
5855
+ * LuaEntityPrototype::allow_run_time_change_of_is_military_target returns true
5856
+ *
5857
+ * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_military_target View documentation}
5858
+ */
5859
+ is_military_target: boolean
5834
5860
  /**
5835
5861
  * If this entity is EntityWithOwner
5836
5862
  *
@@ -6687,6 +6713,14 @@ interface SpiderVehicleEntity extends BaseEntity {
6687
6713
  * @param position - The position the spidertron should move to.
6688
6714
  */
6689
6715
  add_autopilot_destination(position: MapPosition): void
6716
+ /**
6717
+ * Gets legs of given SpiderVehicle.
6718
+ *
6719
+ * *Can only be used if this is SpiderVehicle*
6720
+ *
6721
+ * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_spider_legs View documentation}
6722
+ */
6723
+ get_spider_legs(): LuaEntity[]
6690
6724
  /**
6691
6725
  * The torso orientation of this spider vehicle.
6692
6726
  *
@@ -8170,6 +8204,12 @@ interface LuaEntityPrototype {
8170
8204
  * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.timeout View documentation}
8171
8205
  */
8172
8206
  readonly timeout: uint
8207
+ /**
8208
+ * Collision mask entity must collide with to make landmine blowup
8209
+ *
8210
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.trigger_collision_mask View documentation}
8211
+ */
8212
+ readonly trigger_collision_mask: CollisionMask
8173
8213
  /**
8174
8214
  * The fluidbox prototypes for this entity.
8175
8215
  *
@@ -8470,6 +8510,35 @@ interface LuaEntityPrototype {
8470
8510
  * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_stack_size_bonus View documentation}
8471
8511
  */
8472
8512
  readonly inserter_stack_size_bonus: double | undefined
8513
+ /**
8514
+ * True if this entity prototype should be included during tile collision checks with
8515
+ * {@link LuaTilePrototype.check_collision_with_entities LuaTilePrototype::check_collision_with_entities} enabled.
8516
+ *
8517
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.protected_from_tile_building View documentation}
8518
+ */
8519
+ readonly protected_from_tile_building: boolean
8520
+ /**
8521
+ * True if this is entity-with-owner
8522
+ *
8523
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_entity_with_owner View documentation}
8524
+ */
8525
+ readonly is_entity_with_owner: boolean
8526
+ /**
8527
+ * True if this entity-with-owner is military target
8528
+ *
8529
+ * *Can only be used if this is EntityWithOwnerPrototype*
8530
+ *
8531
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_military_target View documentation}
8532
+ */
8533
+ readonly is_military_target: boolean
8534
+ /**
8535
+ * True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)
8536
+ *
8537
+ * *Can only be used if this is EntityWithOwnerPrototype*
8538
+ *
8539
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_run_time_change_of_is_military_target View documentation}
8540
+ */
8541
+ readonly allow_run_time_change_of_is_military_target: boolean
8473
8542
  /**
8474
8543
  * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
8475
8544
  *
@@ -9475,6 +9544,12 @@ interface BaseEntityPrototype {
9475
9544
  * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.timeout View documentation}
9476
9545
  */
9477
9546
  readonly timeout: uint
9547
+ /**
9548
+ * Collision mask entity must collide with to make landmine blowup
9549
+ *
9550
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.trigger_collision_mask View documentation}
9551
+ */
9552
+ readonly trigger_collision_mask: CollisionMask
9478
9553
  /**
9479
9554
  * The fluidbox prototypes for this entity.
9480
9555
  *
@@ -9713,6 +9788,19 @@ interface BaseEntityPrototype {
9713
9788
  * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.inserter_stack_size_bonus View documentation}
9714
9789
  */
9715
9790
  readonly inserter_stack_size_bonus: double | undefined
9791
+ /**
9792
+ * True if this entity prototype should be included during tile collision checks with
9793
+ * {@link LuaTilePrototype.check_collision_with_entities LuaTilePrototype::check_collision_with_entities} enabled.
9794
+ *
9795
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.protected_from_tile_building View documentation}
9796
+ */
9797
+ readonly protected_from_tile_building: boolean
9798
+ /**
9799
+ * True if this is entity-with-owner
9800
+ *
9801
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_entity_with_owner View documentation}
9802
+ */
9803
+ readonly is_entity_with_owner: boolean
9716
9804
  /**
9717
9805
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that
9718
9806
  * the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the
@@ -9803,6 +9891,25 @@ interface TransportBeltEntityPrototype extends BaseEntityPrototype {
9803
9891
  readonly related_underground_belt: LuaEntityPrototype
9804
9892
  }
9805
9893
 
9894
+ interface EntityWithOwnerEntityPrototype extends BaseEntityPrototype {
9895
+ /**
9896
+ * True if this entity-with-owner is military target
9897
+ *
9898
+ * *Can only be used if this is EntityWithOwnerPrototype*
9899
+ *
9900
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_military_target View documentation}
9901
+ */
9902
+ readonly is_military_target: boolean
9903
+ /**
9904
+ * True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)
9905
+ *
9906
+ * *Can only be used if this is EntityWithOwnerPrototype*
9907
+ *
9908
+ * {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_run_time_change_of_is_military_target View documentation}
9909
+ */
9910
+ readonly allow_run_time_change_of_is_military_target: boolean
9911
+ }
9912
+
9806
9913
  interface CharacterEntityPrototype extends BaseEntityPrototype {
9807
9914
  /**
9808
9915
  * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
@@ -23894,12 +24001,12 @@ interface LuaSurface {
23894
24001
  readonly condition: ForceCondition
23895
24002
  }): LuaEntity[]
23896
24003
  /**
23897
- * Find the enemy entity-with-force ({@link https://wiki.factorio.com/Military_units_and_structures military entity})
24004
+ * Find the enemy military target ({@link https://wiki.factorio.com/Military_units_and_structures military entity})
23898
24005
  * closest to the given position.
23899
24006
  *
23900
24007
  * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy View documentation}
23901
24008
  *
23902
- * @returns The nearest enemy entity-with-force or `nil` if no enemy could be found within the given area.
24009
+ * @returns The nearest enemy military target or `nil` if no enemy could be found within the given area.
23903
24010
  */
23904
24011
  find_nearest_enemy(params: {
23905
24012
  /** Center of the search area. */
@@ -24656,7 +24763,7 @@ interface LuaSurface {
24656
24763
  */
24657
24764
  calculate_tile_properties(property_names: readonly string[], positions: readonly Position[]): Record<string, double[]>
24658
24765
  /**
24659
- * Returns all the entities with force on this chunk for the given force.
24766
+ * Returns all the military targets (entities with force) on this chunk for the given force.
24660
24767
  *
24661
24768
  * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_entities_with_force View documentation}
24662
24769
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",