isaacscript-common 1.0.464 → 1.0.468

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.
@@ -28,8 +28,8 @@ export declare function deployRandomJSONRoom(jsonRooms: JSONRoom[], seed?: numbe
28
28
  /**
29
29
  * Helper function to remove all naturally spawning entities and grid entities from a room. Notably,
30
30
  * this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8),
31
- * projectiles (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, and persistent
32
- * NPCs.
31
+ * projectiles (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent
32
+ * NPCs, doors, and walls.
33
33
  *
34
34
  * @param fillWithDecorations Optional. Set to true to fill every grid tile with an invisible
35
35
  * decoration, which prevents vanilla entities in the room from respawning the next time that the
@@ -11,6 +11,7 @@ local removeAllPickups = ____entity.removeAllPickups
11
11
  local ____gridEntity = require("functions.gridEntity")
12
12
  local convertXMLGridEntityType = ____gridEntity.convertXMLGridEntityType
13
13
  local getGridEntities = ____gridEntity.getGridEntities
14
+ local removeAllGridEntitiesExceptFor = ____gridEntity.removeAllGridEntitiesExceptFor
14
15
  local setGridEntityInvisible = ____gridEntity.setGridEntityInvisible
15
16
  local ____jsonRoom = require("functions.jsonRoom")
16
17
  local getRandomJSONRoom = ____jsonRoom.getRandomJSONRoom
@@ -74,6 +75,7 @@ function ____exports.emptyRoom(self, fillWithDecorations)
74
75
  removeAllPickups(nil)
75
76
  removeAllMatchingEntities(nil, EntityType.ENTITY_SLOT)
76
77
  removeSpecificNPCs(nil)
78
+ removeAllGridEntitiesExceptFor(nil, GridEntityType.GRID_WALL, GridEntityType.GRID_DOOR)
77
79
  setRoomCleared(nil)
78
80
  if fillWithDecorations then
79
81
  fillRoomWithDecorations(nil)
@@ -34,6 +34,11 @@ export declare function isGlitchedCollectible(entity: Entity): boolean;
34
34
  export declare function isPassiveCollectible(collectibleType: CollectibleType | int): boolean;
35
35
  export declare function isQuestCollectible(collectibleType: CollectibleType | int): boolean;
36
36
  export declare function removeAllCollectibles(): void;
37
+ /**
38
+ * Helper function to remove all pickup delay on a collectible. By default, collectibles have a 20
39
+ * frame delay before they can be picked up by a player.
40
+ */
41
+ export declare function removeCollectiblePickupDelay(collectible: EntityPickup): void;
37
42
  /**
38
43
  * Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
39
44
  * should remove an item.
@@ -115,6 +115,14 @@ end
115
115
  function ____exports.removeAllCollectibles(self)
116
116
  removeAllMatchingEntities(nil, EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE)
117
117
  end
118
+ function ____exports.removeCollectiblePickupDelay(self, collectible)
119
+ if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
120
+ error(
121
+ "You cannot remove pickup delay for pickups of variant: " .. tostring(collectible.Variant)
122
+ )
123
+ end
124
+ collectible.Wait = 0
125
+ end
118
126
  function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
119
127
  local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
120
128
  Isaac.DebugString(
@@ -1,2 +1,15 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Helper function to spawn a collectible. Use this instead of `Game.Spawn()` because it handles the
4
+ * cases of Tainted Keeper collectibles costing coins and preventing quest items from being rotated
5
+ * by Tainted Isaac's rotation mechanic.
6
+ *
7
+ * @param collectibleType The collectible type to spawn.
8
+ * @param position The position to spawn the collectible at.
9
+ * @param seed Optional. Random() by default.
10
+ * @param options Optional. Set to true to make the collectible a "There's Options" style
11
+ * collectible. False by default.
12
+ * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
13
+ * Tainted Keeper. False by default.
14
+ */
2
15
  export declare function spawnCollectible(collectibleType: CollectibleType | int, position: Vector, seed?: number, options?: boolean, forceFreeItem?: boolean): EntityPickup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.464",
3
+ "version": "1.0.468",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",