isaacscript-common 8.4.6 → 8.7.0

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.
Files changed (77) hide show
  1. package/dist/enums/ModCallbackCustom.d.ts +2 -2
  2. package/dist/features/characterStats.d.ts.map +1 -1
  3. package/dist/features/characterStats.lua +1 -2
  4. package/dist/features/firstLast.d.ts +6 -3
  5. package/dist/features/firstLast.d.ts.map +1 -1
  6. package/dist/features/firstLast.lua +6 -3
  7. package/dist/features/playerInventory.d.ts +11 -3
  8. package/dist/features/playerInventory.d.ts.map +1 -1
  9. package/dist/features/playerInventory.lua +24 -11
  10. package/dist/functions/bosses.d.ts +8 -2
  11. package/dist/functions/bosses.d.ts.map +1 -1
  12. package/dist/functions/bosses.lua +14 -6
  13. package/dist/functions/collectibleCacheFlag.d.ts +1 -1
  14. package/dist/functions/collectibleCacheFlag.d.ts.map +1 -1
  15. package/dist/functions/collectibleCacheFlag.lua +1 -2
  16. package/dist/functions/collectibleSet.lua +32 -32
  17. package/dist/functions/collectibleTag.d.ts +1 -1
  18. package/dist/functions/collectibleTag.d.ts.map +1 -1
  19. package/dist/functions/collectibleTag.lua +1 -3
  20. package/dist/functions/collectibles.d.ts +10 -1
  21. package/dist/functions/collectibles.d.ts.map +1 -1
  22. package/dist/functions/collectibles.lua +17 -1
  23. package/dist/functions/eden.d.ts +1 -1
  24. package/dist/functions/eden.d.ts.map +1 -1
  25. package/dist/functions/eden.lua +1 -2
  26. package/dist/functions/flying.d.ts +1 -1
  27. package/dist/functions/flying.d.ts.map +1 -1
  28. package/dist/functions/flying.lua +5 -2
  29. package/dist/functions/input.d.ts +2 -2
  30. package/dist/functions/input.d.ts.map +1 -1
  31. package/dist/functions/input.lua +2 -4
  32. package/dist/functions/playerHealth.d.ts +93 -0
  33. package/dist/functions/playerHealth.d.ts.map +1 -1
  34. package/dist/functions/playerHealth.lua +216 -33
  35. package/dist/functions/players.d.ts +1 -111
  36. package/dist/functions/players.d.ts.map +1 -1
  37. package/dist/functions/players.lua +20 -279
  38. package/dist/functions/revive.d.ts.map +1 -1
  39. package/dist/functions/revive.lua +2 -1
  40. package/dist/functions/stats.d.ts +16 -0
  41. package/dist/functions/stats.d.ts.map +1 -1
  42. package/dist/functions/stats.lua +78 -0
  43. package/dist/functions/transformations.d.ts +1 -1
  44. package/dist/functions/transformations.d.ts.map +1 -1
  45. package/dist/functions/trinketCacheFlag.d.ts +1 -1
  46. package/dist/functions/trinketCacheFlag.d.ts.map +1 -1
  47. package/dist/functions/trinketCacheFlag.lua +1 -3
  48. package/dist/functions/trinketSet.lua +32 -32
  49. package/dist/functions/trinkets.d.ts +14 -0
  50. package/dist/functions/trinkets.d.ts.map +1 -1
  51. package/dist/functions/trinkets.lua +26 -0
  52. package/dist/index.d.ts +63 -36
  53. package/dist/sets/bossSets.d.ts +1 -0
  54. package/dist/sets/bossSets.d.ts.map +1 -1
  55. package/dist/sets/bossSets.lua +23 -0
  56. package/package.json +1 -1
  57. package/src/enums/ModCallbackCustom.ts +2 -2
  58. package/src/features/characterStats.ts +1 -2
  59. package/src/features/firstLast.ts +6 -3
  60. package/src/features/playerInventory.ts +37 -8
  61. package/src/functions/bosses.ts +18 -6
  62. package/src/functions/collectibleCacheFlag.ts +3 -3
  63. package/src/functions/collectibleSet.ts +32 -32
  64. package/src/functions/collectibleTag.ts +2 -3
  65. package/src/functions/collectibles.ts +25 -1
  66. package/src/functions/eden.ts +3 -3
  67. package/src/functions/flying.ts +4 -4
  68. package/src/functions/input.ts +4 -5
  69. package/src/functions/playerHealth.ts +269 -7
  70. package/src/functions/players.ts +1 -348
  71. package/src/functions/revive.ts +2 -6
  72. package/src/functions/stats.ts +75 -0
  73. package/src/functions/transformations.ts +1 -1
  74. package/src/functions/trinketCacheFlag.ts +2 -3
  75. package/src/functions/trinketSet.ts +32 -32
  76. package/src/functions/trinkets.ts +34 -0
  77. package/src/sets/bossSets.ts +33 -0
@@ -892,7 +892,7 @@ export declare enum ModCallbackCustom {
892
892
  POST_PLAYER_CHANGE_TYPE = 57,
893
893
  /**
894
894
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is higher than
895
- * what it was on the previous frame.
895
+ * what it was on the previous frame or when a new active collectible is acquired.
896
896
  *
897
897
  * When registering the callback, takes an optional second argument that will make the callback
898
898
  * only fire if the collectible matches the `CollectibleType` provided.
@@ -907,7 +907,7 @@ export declare enum ModCallbackCustom {
907
907
  POST_PLAYER_COLLECTIBLE_ADDED = 58,
908
908
  /**
909
909
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is lower than
910
- * what it was on the previous frame.
910
+ * what it was on the previous frame or when an active collectible is no longer present.
911
911
  *
912
912
  * When registering the callback, takes an optional second argument that will make the callback
913
913
  * only fire if the collectible matches the `CollectibleType` provided.
@@ -1 +1 @@
1
- {"version":3,"file":"characterStats.d.ts","sourceRoot":"","sources":["../../src/features/characterStats.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EAET,UAAU,EACX,MAAM,8BAA8B,CAAC;AAiCtC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/D,IAAI,CAGN"}
1
+ {"version":3,"file":"characterStats.d.ts","sourceRoot":"","sources":["../../src/features/characterStats.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EAET,UAAU,EACX,MAAM,8BAA8B,CAAC;AAgCtC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/D,IAAI,CAGN"}
@@ -7,9 +7,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
7
7
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
8
8
  local ____featuresInitialized = require("featuresInitialized")
9
9
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
10
- local ____players = require("functions.players")
11
- local addStat = ____players.addStat
12
10
  local ____stats = require("functions.stats")
11
+ local addStat = ____stats.addStat
13
12
  local getDefaultPlayerStat = ____stats.getDefaultPlayerStat
14
13
  function evaluateCache(self, player, cacheFlag)
15
14
  local character = player:GetPlayerType()
@@ -19,11 +19,11 @@ export declare function getLastCollectibleType(): CollectibleType;
19
19
  /**
20
20
  * Helper function to get an array that represents the all modded collectible types.
21
21
  *
22
- * This function is only useful when building collectible type objects. For most purposes, you
23
- * should use the `getModdedCollectibleSet` helper function instead.
24
- *
25
22
  * Returns an empty array if there are no modded collectible types.
26
23
  *
24
+ * This function is only useful when building collectible type objects. For most purposes, you
25
+ * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function instead.
26
+ *
27
27
  * (This function is named differently from the `getVanillaCollectibleTypeRange` function because
28
28
  * all modded collectible types are contiguous. Thus, each value represents a real
29
29
  * `CollectibleType`.)
@@ -66,6 +66,9 @@ export declare function getLastTrinketType(): TrinketType;
66
66
  *
67
67
  * Returns an empty array if there are no modded trinket types.
68
68
  *
69
+ * This function is only useful when building collectible type objects. For most purposes, you
70
+ * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function instead.
71
+ *
69
72
  * This function can only be called if at least one callback has been executed. This is because not
70
73
  * all trinkets will necessarily be present when a mod first loads (due to mod load order).
71
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"firstLast.d.ts","sourceRoot":"","sources":["../../src/features/firstLast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAwDtC;;;;;GAKG;AACH,wBAAgB,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IAAI,EAAE,CAQvC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAKjC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAMvC;AAMD;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CAGhD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,UAAU,GAAG,SAAS,CASjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAM9C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,EAAE,CAQnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAKvC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,GAAG,CAM7C"}
@@ -146,11 +146,11 @@ function ____exports.getFirstModdedCollectibleType(self)
146
146
  end
147
147
  --- Helper function to get an array that represents the all modded collectible types.
148
148
  --
149
- -- This function is only useful when building collectible type objects. For most purposes, you
150
- -- should use the `getModdedCollectibleSet` helper function instead.
151
- --
152
149
  -- Returns an empty array if there are no modded collectible types.
153
150
  --
151
+ -- This function is only useful when building collectible type objects. For most purposes, you
152
+ -- should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function instead.
153
+ --
154
154
  -- (This function is named differently from the `getVanillaCollectibleTypeRange` function because
155
155
  -- all modded collectible types are contiguous. Thus, each value represents a real
156
156
  -- `CollectibleType`.)
@@ -212,6 +212,9 @@ end
212
212
  --
213
213
  -- Returns an empty array if there are no modded trinket types.
214
214
  --
215
+ -- This function is only useful when building collectible type objects. For most purposes, you
216
+ -- should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function instead.
217
+ --
215
218
  -- This function can only be called if at least one callback has been executed. This is because not
216
219
  -- all trinkets will necessarily be present when a mod first loads (due to mod load order).
217
220
  function ____exports.getModdedTrinketTypes(self)
@@ -3,9 +3,6 @@ import { CollectibleType } from "isaac-typescript-definitions";
3
3
  * Helper function to get all of the collectibles that the player has gotten so far on this run, in
4
4
  * order.
5
5
  *
6
- * Note that this does not include active collectibles that have since been dropped for other
7
- * collectibles.
8
- *
9
6
  * In the case of inventory initialization or the case where the player rerolls their build in the
10
7
  * middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
11
8
  * that the items were actually given to the player. In this case, the inventory will be in the
@@ -17,6 +14,17 @@ import { CollectibleType } from "isaac-typescript-definitions";
17
14
  * would not be updated. In vanilla, this situation would never happen, but another mod might do
18
15
  * this for some reason. (With that said, the next time that a collectible is normally added or
19
16
  * removed, it would trigger a re-scan, and the previous changes would be picked up.)
17
+ *
18
+ * @param player The player to get the inventory for.
19
+ * @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
20
+ * is true.
20
21
  */
21
22
  export declare function getPlayerInventory(player: EntityPlayer, includeActiveCollectibles?: boolean): CollectibleType[];
23
+ /**
24
+ * Helper function to get the last passive collectible that the player picked up. In most cases,
25
+ * this will be the passive that is removed when the player would use Clicker.
26
+ *
27
+ * Returns undefined if the player does not have any passive collectibles.
28
+ */
29
+ export declare function getPlayerLastPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
22
30
  //# sourceMappingURL=playerInventory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAyG5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAanB"}
1
+ {"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAsH5E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAanB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,GACnB,eAAe,GAAG,SAAS,CAK7B"}
@@ -15,6 +15,7 @@ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNot
15
15
  local ____array = require("functions.array")
16
16
  local arrayRemoveInPlace = ____array.arrayRemoveInPlace
17
17
  local copyArray = ____array.copyArray
18
+ local getLastElement = ____array.getLastElement
18
19
  local ____collectibles = require("functions.collectibles")
19
20
  local isActiveCollectible = ____collectibles.isActiveCollectible
20
21
  local ____collectibleSet = require("functions.collectibleSet")
@@ -32,14 +33,16 @@ local saveDataManager = ____exports.saveDataManager
32
33
  function newPlayerInventory(self, player)
33
34
  local inventory = {}
34
35
  for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
35
- local numCollectibles = player:GetCollectibleNum(collectibleType, true)
36
- ____repeat(
37
- nil,
38
- numCollectibles,
39
- function()
40
- inventory[#inventory + 1] = collectibleType
41
- end
42
- )
36
+ if player:HasCollectible(collectibleType) then
37
+ local numCollectibles = player:GetCollectibleNum(collectibleType, true)
38
+ ____repeat(
39
+ nil,
40
+ numCollectibles,
41
+ function()
42
+ inventory[#inventory + 1] = collectibleType
43
+ end
44
+ )
45
+ end
43
46
  end
44
47
  return inventory
45
48
  end
@@ -84,9 +87,6 @@ end
84
87
  --- Helper function to get all of the collectibles that the player has gotten so far on this run, in
85
88
  -- order.
86
89
  --
87
- -- Note that this does not include active collectibles that have since been dropped for other
88
- -- collectibles.
89
- --
90
90
  -- In the case of inventory initialization or the case where the player rerolls their build in the
91
91
  -- middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
92
92
  -- that the items were actually given to the player. In this case, the inventory will be in the
@@ -98,6 +98,10 @@ end
98
98
  -- would not be updated. In vanilla, this situation would never happen, but another mod might do
99
99
  -- this for some reason. (With that said, the next time that a collectible is normally added or
100
100
  -- removed, it would trigger a re-scan, and the previous changes would be picked up.)
101
+ --
102
+ -- @param player The player to get the inventory for.
103
+ -- @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
104
+ -- is true.
101
105
  function ____exports.getPlayerInventory(self, player, includeActiveCollectibles)
102
106
  if includeActiveCollectibles == nil then
103
107
  includeActiveCollectibles = true
@@ -113,4 +117,13 @@ function ____exports.getPlayerInventory(self, player, includeActiveCollectibles)
113
117
  function(____, collectibleType) return not isActiveCollectible(nil, collectibleType) end
114
118
  )
115
119
  end
120
+ --- Helper function to get the last passive collectible that the player picked up. In most cases,
121
+ -- this will be the passive that is removed when the player would use Clicker.
122
+ --
123
+ -- Returns undefined if the player does not have any passive collectibles.
124
+ function ____exports.getPlayerLastPassiveCollectible(self, player)
125
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
126
+ local inventory = ____exports.getPlayerInventory(nil, player, false)
127
+ return getLastElement(nil, inventory)
128
+ end
116
129
  return ____exports
@@ -19,9 +19,15 @@ export declare function getAliveBosses(entityType?: EntityType, variant?: number
19
19
  *
20
20
  * The set contains strings with the entity type and variant, separated by a period.
21
21
  *
22
+ * Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
23
+ * and Gabriel.).
24
+ *
22
25
  * Also see the `getBossSet` and `getCombinedBossSet` functions.
26
+ *
27
+ * @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
28
+ * Default is true.
23
29
  */
24
- export declare function getAllBossesSet(): Set<string>;
30
+ export declare function getAllBossesSet(includeStoryBosses?: boolean): ReadonlySet<string>;
25
31
  /**
26
32
  * Helper function to get the set of vanilla bosses for a particular stage and stage type
27
33
  * combination.
@@ -52,7 +58,7 @@ export declare function getBosses(entityType?: EntityType, variant?: int, subTyp
52
58
  *
53
59
  * Also see the `getAllBossesSet` and `getBossSet` functions.
54
60
  */
55
- export declare function getCombinedBossSet(stage: int): Set<string> | undefined;
61
+ export declare function getCombinedBossSet(stage: int): ReadonlySet<string> | undefined;
56
62
  /** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
57
63
  export declare function isSin(npc: EntityNPC): boolean;
58
64
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAyBtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,GAAG,CAAC,MAAM,CAAC,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,GAAG,EACb,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAOtE;AAED,6FAA6F;AAC7F,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WA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GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAyBX;AAmCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
@@ -10,6 +10,7 @@ local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
10
10
  local ____constants = require("core.constants")
11
11
  local VectorZero = ____constants.VectorZero
12
12
  local ____bossSets = require("sets.bossSets")
13
+ local ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = ____bossSets.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
13
14
  local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
14
15
  local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
15
16
  local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
@@ -22,8 +23,6 @@ local ____npcs = require("functions.npcs")
22
23
  local getAliveNPCs = ____npcs.getAliveNPCs
23
24
  local ____rng = require("functions.rng")
24
25
  local isRNG = ____rng.isRNG
25
- local ____set = require("functions.set")
26
- local copySet = ____set.copySet
27
26
  local ____types = require("functions.types")
28
27
  local asNumber = ____types.asNumber
29
28
  local ____utils = require("functions.utils")
@@ -108,9 +107,18 @@ end
108
107
  --
109
108
  -- The set contains strings with the entity type and variant, separated by a period.
110
109
  --
110
+ -- Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
111
+ -- and Gabriel.).
112
+ --
111
113
  -- Also see the `getBossSet` and `getCombinedBossSet` functions.
112
- function ____exports.getAllBossesSet(self)
113
- return copySet(nil, ALL_BOSSES_SET)
114
+ --
115
+ -- @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
116
+ -- Default is true.
117
+ function ____exports.getAllBossesSet(self, includeStoryBosses)
118
+ if includeStoryBosses == nil then
119
+ includeStoryBosses = true
120
+ end
121
+ return includeStoryBosses and ALL_BOSSES_SET or ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
114
122
  end
115
123
  --- Helper function to get the set of vanilla bosses for a particular stage and stage type
116
124
  -- combination.
@@ -127,7 +135,7 @@ function ____exports.getBossSet(self, stage, stageType)
127
135
  if bossSet == nil then
128
136
  return nil
129
137
  end
130
- return copySet(nil, bossSet)
138
+ return bossSet
131
139
  end
132
140
  --- Helper function to get all of the bosses in the room.
133
141
  --
@@ -166,7 +174,7 @@ function ____exports.getCombinedBossSet(self, stage)
166
174
  if bossSet == nil then
167
175
  return nil
168
176
  end
169
- return copySet(nil, bossSet)
177
+ return bossSet
170
178
  end
171
179
  --- Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
172
180
  function ____exports.isSin(self, npc)
@@ -8,7 +8,7 @@ export declare function collectibleHasCacheFlag(collectibleType: CollectibleType
8
8
  * This function can only be called if at least one callback has been executed. This is because not
9
9
  * all collectibles will necessarily be present when a mod first loads (due to mod load order).
10
10
  */
11
- export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Set<CollectibleType>;
11
+ export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): ReadonlySet<CollectibleType>;
12
12
  /**
13
13
  * Returns an array containing every collectible type that the player has that matches the provided
14
14
  * CacheFlag.
@@ -1 +1 @@
1
- {"version":3,"file":"collectibleCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA+B1E,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,eAAe,CAAC,CAStB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,eAAe,EAAE,CAYnB"}
1
+ {"version":3,"file":"collectibleCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA+B1E,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,eAAe,CAAC,CAS9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,eAAe,EAAE,CAYnB"}
@@ -14,7 +14,6 @@ local getEnumValues = ____enums.getEnumValues
14
14
  local ____flag = require("functions.flag")
15
15
  local hasFlag = ____flag.hasFlag
16
16
  local ____set = require("functions.set")
17
- local copySet = ____set.copySet
18
17
  local getSortedSetValues = ____set.getSortedSetValues
19
18
  local ____utils = require("functions.utils")
20
19
  local ____repeat = ____utils["repeat"]
@@ -52,7 +51,7 @@ function ____exports.getCollectiblesForCacheFlag(self, cacheFlag)
52
51
  if collectiblesSet == nil then
53
52
  return __TS__New(Set)
54
53
  end
55
- return copySet(nil, collectiblesSet)
54
+ return collectiblesSet
56
55
  end
57
56
  --- Returns an array containing every collectible type that the player has that matches the provided
58
57
  -- CacheFlag.
@@ -8,42 +8,42 @@ local ____firstLast = require("features.firstLast")
8
8
  local getModdedCollectibleTypes = ____firstLast.getModdedCollectibleTypes
9
9
  local ____collectibles = require("functions.collectibles")
10
10
  local getVanillaCollectibleTypeRange = ____collectibles.getVanillaCollectibleTypeRange
11
- local ALL_COLLECTIBLES_ARRAY = {}
12
- local ALL_COLLECTIBLES_SET = __TS__New(Set)
13
- local VANILLA_COLLECTIBLES_ARRAY = {}
14
- local VANILLA_COLLECTIBLES_SET = __TS__New(Set)
15
- local MODDED_COLLECTIBLES_ARRAY = {}
16
- local MODDED_COLLECTIBLES_SET = __TS__New(Set)
17
- local function lazyInitVanillaCollectibles(self)
18
- if #VANILLA_COLLECTIBLES_ARRAY > 0 then
11
+ local ALL_COLLECTIBLE_TYPES_ARRAY = {}
12
+ local ALL_COLLECTIBLE_TYPES_SET = __TS__New(Set)
13
+ local VANILLA_COLLECTIBLE_TYPES_ARRAY = {}
14
+ local VANILLA_COLLECTIBLE_TYPES_SET = __TS__New(Set)
15
+ local MODDED_COLLECTIBLE_TYPES_ARRAY = {}
16
+ local MODDED_COLLECTIBLE_TYPES_SET = __TS__New(Set)
17
+ local function lazyInitVanillaCollectibleTypes(self)
18
+ if #VANILLA_COLLECTIBLE_TYPES_ARRAY > 0 then
19
19
  return
20
20
  end
21
21
  local vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange(nil)
22
22
  for ____, collectibleType in ipairs(vanillaCollectibleTypeRange) do
23
23
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
24
24
  if itemConfigItem ~= nil then
25
- VANILLA_COLLECTIBLES_ARRAY[#VANILLA_COLLECTIBLES_ARRAY + 1] = collectibleType
26
- VANILLA_COLLECTIBLES_SET:add(collectibleType)
25
+ VANILLA_COLLECTIBLE_TYPES_ARRAY[#VANILLA_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
26
+ VANILLA_COLLECTIBLE_TYPES_SET:add(collectibleType)
27
27
  end
28
28
  end
29
29
  end
30
- local function lazyInitModdedCollectibles(self)
31
- if #MODDED_COLLECTIBLES_ARRAY > 0 then
30
+ local function lazyInitModdedCollectibleTypes(self)
31
+ if #MODDED_COLLECTIBLE_TYPES_ARRAY > 0 then
32
32
  return
33
33
  end
34
- lazyInitVanillaCollectibles(nil)
35
- for ____, collectibleType in ipairs(VANILLA_COLLECTIBLES_ARRAY) do
36
- ALL_COLLECTIBLES_ARRAY[#ALL_COLLECTIBLES_ARRAY + 1] = collectibleType
37
- ALL_COLLECTIBLES_SET:add(collectibleType)
34
+ lazyInitVanillaCollectibleTypes(nil)
35
+ for ____, collectibleType in ipairs(VANILLA_COLLECTIBLE_TYPES_ARRAY) do
36
+ ALL_COLLECTIBLE_TYPES_ARRAY[#ALL_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
37
+ ALL_COLLECTIBLE_TYPES_SET:add(collectibleType)
38
38
  end
39
39
  local moddedCollectibleTypes = getModdedCollectibleTypes(nil)
40
40
  for ____, collectibleType in ipairs(moddedCollectibleTypes) do
41
41
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
42
42
  if itemConfigItem ~= nil then
43
- MODDED_COLLECTIBLES_ARRAY[#MODDED_COLLECTIBLES_ARRAY + 1] = collectibleType
44
- MODDED_COLLECTIBLES_SET:add(collectibleType)
45
- ALL_COLLECTIBLES_ARRAY[#ALL_COLLECTIBLES_ARRAY + 1] = collectibleType
46
- ALL_COLLECTIBLES_SET:add(collectibleType)
43
+ MODDED_COLLECTIBLE_TYPES_ARRAY[#MODDED_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
44
+ MODDED_COLLECTIBLE_TYPES_SET:add(collectibleType)
45
+ ALL_COLLECTIBLE_TYPES_ARRAY[#ALL_COLLECTIBLE_TYPES_ARRAY + 1] = collectibleType
46
+ ALL_COLLECTIBLE_TYPES_SET:add(collectibleType)
47
47
  end
48
48
  end
49
49
  end
@@ -56,8 +56,8 @@ end
56
56
  -- This function can only be called if at least one callback has been executed. This is because not
57
57
  -- all collectibles will necessarily be present when a mod first loads (due to mod load order).
58
58
  function ____exports.getCollectibleArray(self)
59
- lazyInitModdedCollectibles(nil)
60
- return ALL_COLLECTIBLES_ARRAY
59
+ lazyInitModdedCollectibleTypes(nil)
60
+ return ALL_COLLECTIBLE_TYPES_ARRAY
61
61
  end
62
62
  --- Returns a set containing every valid collectible type in the game, including modded collectibles.
63
63
  --
@@ -67,8 +67,8 @@ end
67
67
  -- This function can only be called if at least one callback has been executed. This is because not
68
68
  -- all collectibles will necessarily be present when a mod first loads (due to mod load order).
69
69
  function ____exports.getCollectibleSet(self)
70
- lazyInitModdedCollectibles(nil)
71
- return ALL_COLLECTIBLES_SET
70
+ lazyInitModdedCollectibleTypes(nil)
71
+ return ALL_COLLECTIBLE_TYPES_SET
72
72
  end
73
73
  --- Returns an array containing every modded collectible type in the game.
74
74
  --
@@ -78,8 +78,8 @@ end
78
78
  -- This function can only be called if at least one callback has been executed. This is because not
79
79
  -- all collectibles will necessarily be present when a mod first loads (due to mod load order).
80
80
  function ____exports.getModdedCollectibleArray(self)
81
- lazyInitModdedCollectibles(nil)
82
- return MODDED_COLLECTIBLES_ARRAY
81
+ lazyInitModdedCollectibleTypes(nil)
82
+ return MODDED_COLLECTIBLE_TYPES_ARRAY
83
83
  end
84
84
  --- Returns a set containing every modded collectible type in the game.
85
85
  --
@@ -89,23 +89,23 @@ end
89
89
  -- This function can only be called if at least one callback has been executed. This is because not
90
90
  -- all collectibles will necessarily be present when a mod first loads (due to mod load order).
91
91
  function ____exports.getModdedCollectibleSet(self)
92
- lazyInitModdedCollectibles(nil)
93
- return MODDED_COLLECTIBLES_SET
92
+ lazyInitModdedCollectibleTypes(nil)
93
+ return MODDED_COLLECTIBLE_TYPES_SET
94
94
  end
95
95
  --- Returns an array containing every valid vanilla collectible type in the game.
96
96
  --
97
97
  -- Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
98
98
  -- then use the `getVanillaCollectibleSet` helper function instead.
99
99
  function ____exports.getVanillaCollectibleArray(self)
100
- lazyInitVanillaCollectibles(nil)
101
- return VANILLA_COLLECTIBLES_ARRAY
100
+ lazyInitVanillaCollectibleTypes(nil)
101
+ return VANILLA_COLLECTIBLE_TYPES_ARRAY
102
102
  end
103
103
  --- Returns a set containing every valid vanilla collectible type in the game.
104
104
  --
105
105
  -- Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
106
106
  -- then use the `getVanillaCollectibleArray` helper function instead.
107
107
  function ____exports.getVanillaCollectibleSet(self)
108
- lazyInitVanillaCollectibles(nil)
109
- return VANILLA_COLLECTIBLES_SET
108
+ lazyInitVanillaCollectibleTypes(nil)
109
+ return VANILLA_COLLECTIBLE_TYPES_SET
110
110
  end
111
111
  return ____exports
@@ -10,7 +10,7 @@ export declare function collectibleHasTag(collectibleType: CollectibleType, tag:
10
10
  * const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
11
11
  * ```
12
12
  */
13
- export declare function getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): Set<CollectibleType>;
13
+ export declare function getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
14
14
  /** Returns the number of items that a player has towards a particular transformation. */
15
15
  export declare function getPlayerNumCollectiblesWithTag(player: EntityPlayer, itemConfigTag: ItemConfigTag): int;
16
16
  export declare function isQuestCollectible(collectibleType: CollectibleType): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"collectibleTag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAqC9E,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,eAAe,EAChC,GAAG,EAAE,aAAa,GACjB,OAAO,CAOT;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,aAAa,GAC3B,GAAG,CAAC,eAAe,CAAC,CActB;AAED,yFAAyF;AACzF,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,aAAa,GAC3B,GAAG,CAGL;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAE5E"}
1
+ {"version":3,"file":"collectibleTag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAoC9E,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,eAAe,EAChC,GAAG,EAAE,aAAa,GACjB,OAAO,CAOT;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,aAAa,GAC3B,WAAW,CAAC,eAAe,CAAC,CAc9B;AAED,yFAAyF;AACzF,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,aAAa,GAC3B,GAAG,CAGL;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAE5E"}
@@ -16,8 +16,6 @@ local ____flag = require("functions.flag")
16
16
  local getFlagName = ____flag.getFlagName
17
17
  local ____players = require("functions.players")
18
18
  local getPlayerCollectibleCount = ____players.getPlayerCollectibleCount
19
- local ____set = require("functions.set")
20
- local copySet = ____set.copySet
21
19
  function ____exports.collectibleHasTag(self, collectibleType, tag)
22
20
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
23
21
  if itemConfigItem == nil then
@@ -66,7 +64,7 @@ function ____exports.getCollectibleTypesWithTag(self, itemConfigTag)
66
64
  if collectibleTypes == nil then
67
65
  error(("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the ItemConfigTag enum.")
68
66
  end
69
- return copySet(nil, collectibleTypes)
67
+ return collectibleTypes
70
68
  end
71
69
  --- Returns the number of items that a player has towards a particular transformation.
72
70
  function ____exports.getPlayerNumCollectiblesWithTag(self, player, itemConfigTag)
@@ -19,8 +19,12 @@ export declare function getCollectibleDevilCoinPrice(collectibleType: Collectibl
19
19
  */
20
20
  export declare function getCollectibleDevilHeartPrice(collectibleType: CollectibleType, player: EntityPlayer): PickupPrice;
21
21
  /**
22
- * Helper function to get the path to a collectible's sprite. Returns the path to the question mark
22
+ * Helper function to get the path to a collectible PNG file. Returns the path to the question mark
23
23
  * sprite (i.e. from Curse of the Blind) if the provided collectible type was not valid.
24
+ *
25
+ * Note that this does not return the file name, but the full path to the collectible's PNG file.
26
+ * The function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
27
+ * field.
24
28
  */
25
29
  export declare function getCollectibleGfxFilename(collectibleType: CollectibleType): string;
26
30
  /**
@@ -163,6 +167,11 @@ export declare function isPassiveCollectible(collectibleType: CollectibleType):
163
167
  export declare function isSingleUseCollectible(collectibleType: CollectibleType): boolean;
164
168
  export declare function isValidCollectibleType(collectibleType: CollectibleType): boolean;
165
169
  export declare function isVanillaCollectibleType(collectibleType: CollectibleType): boolean;
170
+ /**
171
+ * Helper function to generate a new sprite based on a collectible. If the provided collectible type
172
+ * is invalid, a sprite with a Curse of the Blind question mark will be returned.
173
+ */
174
+ export declare function newCollectibleSprite(collectibleType: CollectibleType): Sprite;
166
175
  /**
167
176
  * Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
168
177
  * should remove an item.
@@ -1 +1 @@
1
- {"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC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AAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
1
+ {"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA0B7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,eAAe,GAC/B,GAAG,CAYL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAyBb;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAOR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,YAAY,GACxB,gBAAgB,CAsBlB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,GAAG,CAOL;AAED;;;GAGG;AACH,wB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GG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM,CAa7E;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,eAAe,GAC/B,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAS5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CASnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAUnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAuBtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
@@ -105,6 +105,7 @@ function ____exports.setCollectibleSubType(self, collectible, newCollectibleType
105
105
  true
106
106
  )
107
107
  end
108
+ local COLLECTIBLE_ANM2_PATH = "gfx/005.100_collectible.anm2"
108
109
  COLLECTIBLE_SPRITE_LAYER = 1
109
110
  COLLECTIBLE_SHADOW_LAYER = 4
110
111
  local GLITCHED_ITEM_THRESHOLD = 4000000000
@@ -174,8 +175,12 @@ function ____exports.getCollectibleDevilHeartPrice(self, collectibleType, player
174
175
  local twoHeartPrice = maxHearts == 2 and PickupPrice.ONE_HEART_AND_TWO_SOUL_HEARTS or PickupPrice.TWO_HEARTS
175
176
  return itemConfigItem.DevilPrice == 2 and twoHeartPrice or PickupPrice.ONE_HEART
176
177
  end
177
- --- Helper function to get the path to a collectible's sprite. Returns the path to the question mark
178
+ --- Helper function to get the path to a collectible PNG file. Returns the path to the question mark
178
179
  -- sprite (i.e. from Curse of the Blind) if the provided collectible type was not valid.
180
+ --
181
+ -- Note that this does not return the file name, but the full path to the collectible's PNG file.
182
+ -- The function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
183
+ -- field.
179
184
  function ____exports.getCollectibleGfxFilename(self, collectibleType)
180
185
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
181
186
  if itemConfigItem == nil then
@@ -386,6 +391,17 @@ function ____exports.isValidCollectibleType(self, collectibleType)
386
391
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
387
392
  return itemConfigItem ~= nil
388
393
  end
394
+ --- Helper function to generate a new sprite based on a collectible. If the provided collectible type
395
+ -- is invalid, a sprite with a Curse of the Blind question mark will be returned.
396
+ function ____exports.newCollectibleSprite(self, collectibleType)
397
+ local sprite = Sprite()
398
+ sprite:Load(COLLECTIBLE_ANM2_PATH, false)
399
+ clearSprite(nil, sprite)
400
+ local gfxFileName = ____exports.getCollectibleGfxFilename(nil, collectibleType)
401
+ sprite:ReplaceSpritesheet(COLLECTIBLE_SPRITE_LAYER, gfxFileName)
402
+ sprite:LoadGraphics()
403
+ return sprite
404
+ end
389
405
  --- Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
390
406
  -- should remove an item.
391
407
  --
@@ -1,4 +1,4 @@
1
1
  import { CollectibleType } from "isaac-typescript-definitions";
2
- export declare function getEdenPassives(): Set<CollectibleType>;
2
+ export declare function getEdenPassives(): ReadonlySet<CollectibleType>;
3
3
  export declare function getRandomEdenPassive(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
4
4
  //# sourceMappingURL=eden.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;AAqB9E,wBAAgB,eAAe,IAAI,GAAG,CAAC,eAAe,CAAC,CAOtD;AAED,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe,CAWjB"}
1
+ {"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;AAqB9E,wBAAgB,eAAe,IAAI,WAAW,CAAC,eAAe,CAAC,CAO9D;AAED,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe,CAWjB"}
@@ -14,7 +14,6 @@ local collectibleHasTag = ____collectibleTag.collectibleHasTag
14
14
  local ____rng = require("functions.rng")
15
15
  local getRandomSeed = ____rng.getRandomSeed
16
16
  local ____set = require("functions.set")
17
- local copySet = ____set.copySet
18
17
  local getRandomSetElement = ____set.getRandomSetElement
19
18
  local EDEN_PASSIVE_COLLECTIBLES_SET = __TS__New(Set)
20
19
  local function initCollectibleSet(self)
@@ -28,7 +27,7 @@ function ____exports.getEdenPassives(self)
28
27
  if EDEN_PASSIVE_COLLECTIBLES_SET.size == 0 then
29
28
  initCollectibleSet(nil)
30
29
  end
31
- return copySet(nil, EDEN_PASSIVE_COLLECTIBLES_SET)
30
+ return EDEN_PASSIVE_COLLECTIBLES_SET
32
31
  end
33
32
  function ____exports.getRandomEdenPassive(self, seedOrRNG, exceptions)
34
33
  if seedOrRNG == nil then
@@ -9,7 +9,7 @@ import { CollectibleType, TrinketType } from "isaac-typescript-definitions";
9
9
  * @param pruneConditionalItems Whether or not collectibles that only grant flight conditionally
10
10
  * should be included in the set (like Empty Vessel).
11
11
  */
12
- export declare function getFlyingCollectibles(pruneConditionalItems: boolean): Set<CollectibleType>;
12
+ export declare function getFlyingCollectibles(pruneConditionalItems: boolean): ReadonlySet<CollectibleType>;
13
13
  /**
14
14
  * Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
15
15
  * conditionally, like Bat Wing.)
@@ -1 +1 @@
1
- {"version":3,"file":"flying.d.ts","sourceRoot":"","sources":["../../src/functions/flying.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,qBAAqB,EAAE,OAAO,GAC7B,GAAG,CAAC,eAAe,CAAC,CAwBtB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,WAAW,CAAC,CAI5D;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CA0BtE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG/D"}
1
+ {"version":3,"file":"flying.d.ts","sourceRoot":"","sources":["../../src/functions/flying.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,qBAAqB,EAAE,OAAO,GAC7B,WAAW,CAAC,eAAe,CAAC,CAwB9B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,WAAW,CAAC,CAI5D;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CA0BtE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG/D"}