isaacscript-common 1.0.497 → 1.0.498

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.
@@ -56,6 +56,12 @@ export declare function isGlitchedCollectible(entity: Entity): boolean;
56
56
  */
57
57
  export declare function isPassiveCollectible(collectibleType: CollectibleType | int): boolean;
58
58
  export declare function isQuestCollectible(collectibleType: CollectibleType | int): boolean;
59
+ /**
60
+ * Helper function to see if a particular collectible will disappear from the player's inventory
61
+ * upon use. Note that this will not work will modded items, as there is no way to dynamically know
62
+ * if a modded item will disappear.
63
+ */
64
+ export declare function isSingleUseCollectible(collectibleType: CollectibleType | int): boolean;
59
65
  /**
60
66
  * Helper function to remove all of the collectibles in the room.
61
67
  *
@@ -2,6 +2,8 @@
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
4
  local COLLECTIBLE_SPRITE_LAYER
5
+ local ____constants = require("constants")
6
+ local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = ____constants.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES
5
7
  local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
6
8
  local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
7
9
  local ____collectibleNameMap = require("maps.collectibleNameMap")
@@ -136,6 +138,9 @@ end
136
138
  function ____exports.isQuestCollectible(self, collectibleType)
137
139
  return ____exports.collectibleHasTag(nil, collectibleType, 32768)
138
140
  end
141
+ function ____exports.isSingleUseCollectible(self, collectibleType)
142
+ return SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES:has(collectibleType)
143
+ end
139
144
  function ____exports.removeAllCollectibles(self, collectibleType, cap)
140
145
  removeAllPickups(nil, PickupVariant.PICKUP_COLLECTIBLE, collectibleType, cap)
141
146
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.497",
3
+ "version": "1.0.498",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",