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
@@ -1,6 +1,84 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Set = ____lualib.Set
3
+ local __TS__New = ____lualib.__TS__New
1
4
  local ____exports = {}
5
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
+ local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
2
7
  local ____defaultPlayerStatMap = require("maps.defaultPlayerStatMap")
3
8
  local DEFAULT_PLAYER_STAT_MAP = ____defaultPlayerStatMap.DEFAULT_PLAYER_STAT_MAP
9
+ local ____tears = require("functions.tears")
10
+ local addTearsStat = ____tears.addTearsStat
11
+ local STAT_CACHE_FLAGS_SET = __TS__New(Set, {
12
+ CacheFlag.DAMAGE,
13
+ CacheFlag.FIRE_DELAY,
14
+ CacheFlag.SHOT_SPEED,
15
+ CacheFlag.RANGE,
16
+ CacheFlag.SPEED,
17
+ CacheFlag.LUCK
18
+ })
19
+ --- Helper function to add a stat to a player based on the `CacheFlag` provided. Call this function
20
+ -- from the `EVALUATE_CACHE` callback.
21
+ --
22
+ -- Note that for `CacheFlag.FIRE_DELAY`, the "amount" argument will be interpreted as the tear stat
23
+ -- to add (and not the amount to mutate `EntityPlayer.MaxFireDelay` by).
24
+ --
25
+ -- This function supports the following cache flags:
26
+ -- - CacheFlag.DAMAGE (1 << 0)
27
+ -- - CacheFlag.FIRE_DELAY (1 << 1)
28
+ -- - CacheFlag.SHOT_SPEED (1 << 2)
29
+ -- - CacheFlag.RANGE (1 << 3)
30
+ -- - CacheFlag.SPEED (1 << 4)
31
+ -- - CacheFlag.LUCK (1 << 10)
32
+ function ____exports.addStat(self, player, cacheFlag, amount)
33
+ if not STAT_CACHE_FLAGS_SET:has(cacheFlag) then
34
+ error("You cannot add a stat to a player with the cache flag of: " .. tostring(cacheFlag))
35
+ end
36
+ repeat
37
+ local ____switch4 = cacheFlag
38
+ local ____cond4 = ____switch4 == CacheFlag.DAMAGE
39
+ if ____cond4 then
40
+ do
41
+ player.Damage = player.Damage + amount
42
+ break
43
+ end
44
+ end
45
+ ____cond4 = ____cond4 or ____switch4 == CacheFlag.FIRE_DELAY
46
+ if ____cond4 then
47
+ do
48
+ addTearsStat(nil, player, amount)
49
+ break
50
+ end
51
+ end
52
+ ____cond4 = ____cond4 or ____switch4 == CacheFlag.SHOT_SPEED
53
+ if ____cond4 then
54
+ do
55
+ player.ShotSpeed = player.ShotSpeed + amount
56
+ break
57
+ end
58
+ end
59
+ ____cond4 = ____cond4 or ____switch4 == CacheFlag.RANGE
60
+ if ____cond4 then
61
+ do
62
+ player.TearHeight = player.TearHeight + amount
63
+ break
64
+ end
65
+ end
66
+ ____cond4 = ____cond4 or ____switch4 == CacheFlag.SPEED
67
+ if ____cond4 then
68
+ do
69
+ player.MoveSpeed = player.MoveSpeed + amount
70
+ break
71
+ end
72
+ end
73
+ ____cond4 = ____cond4 or ____switch4 == CacheFlag.LUCK
74
+ if ____cond4 then
75
+ do
76
+ player.Luck = player.Luck + amount
77
+ break
78
+ end
79
+ end
80
+ until true
81
+ end
4
82
  --- Returns the starting stat that Isaac (the default character) starts with. For example, if you
5
83
  -- pass this function `CacheFlag.DAMAGE`, it will return 3.5.
6
84
  --
@@ -9,7 +9,7 @@ import { CollectibleType, PlayerForm } from "isaac-typescript-definitions";
9
9
  * const guppyCollectibleTypes = getCollectibleTypesForTransformation(PlayerForm.GUPPY);
10
10
  * ```
11
11
  */
12
- export declare function getCollectibleTypesForTransformation(playerForm: PlayerForm): Set<CollectibleType>;
12
+ export declare function getCollectibleTypesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
13
13
  /** Returns the number of items that a player has towards a particular transformation. */
14
14
  export declare function getPlayerNumCollectiblesForTransformation(player: EntityPlayer, playerForm: PlayerForm): int;
15
15
  /** Returns a set of the player's current transformations. */
@@ -1 +1 @@
1
- {"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/functions/transformations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,UAAU,EACX,MAAM,8BAA8B,CAAC;AAiCtC;;;;;;;;;GASG;AACH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,UAAU,GACrB,GAAG,CAAC,eAAe,CAAC,CAStB;AAED,yFAAyF;AACzF,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAGL;AAED,6DAA6D;AAC7D,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,GACnB,GAAG,CAAC,UAAU,CAAC,CASjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAEpE;AAED,wBAAgB,oCAAoC,CAClD,eAAe,EAAE,eAAe,GAC/B,GAAG,CAAC,UAAU,CAAC,CAiBjB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAQrE;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEtE"}
1
+ {"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/functions/transformations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,UAAU,EACX,MAAM,8BAA8B,CAAC;AAiCtC;;;;;;;;;GASG;AACH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,UAAU,GACrB,WAAW,CAAC,eAAe,CAAC,CAS9B;AAED,yFAAyF;AACzF,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAGL;AAED,6DAA6D;AAC7D,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,GACnB,GAAG,CAAC,UAAU,CAAC,CASjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAEpE;AAED,wBAAgB,oCAAoC,CAClD,eAAe,EAAE,eAAe,GAC/B,GAAG,CAAC,UAAU,CAAC,CAiBjB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAQrE;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEtE"}
@@ -13,7 +13,7 @@ export declare function getPlayerTrinketsForCacheFlag(player: EntityPlayer, cach
13
13
  * This function can only be called if at least one callback has been executed. This is because not
14
14
  * all trinkets will necessarily be present when a mod first loads (due to mod load order).
15
15
  */
16
- export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): Set<TrinketType>;
16
+ export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): ReadonlySet<TrinketType>;
17
17
  /** Helper function to check in the item config if a given trinket has a given cache flag. */
18
18
  export declare function trinketHasCacheFlag(trinketType: TrinketType, cacheFlag: CacheFlag): boolean;
19
19
  //# sourceMappingURL=trinketCacheFlag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trinketCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/trinketCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA2BtE;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAYvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,WAAW,CAAC,CASlB;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT"}
1
+ {"version":3,"file":"trinketCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/trinketCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA0BtE;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAYvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,WAAW,CAAC,CAS1B;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT"}
@@ -15,8 +15,6 @@ local ____enums = require("functions.enums")
15
15
  local getEnumValues = ____enums.getEnumValues
16
16
  local ____flag = require("functions.flag")
17
17
  local hasFlag = ____flag.hasFlag
18
- local ____set = require("functions.set")
19
- local copySet = ____set.copySet
20
18
  function lazyInitCacheFlagMap(self)
21
19
  if CACHE_FLAG_TO_TRINKETS_MAP.size > 0 then
22
20
  return
@@ -41,7 +39,7 @@ function ____exports.getTrinketsForCacheFlag(self, cacheFlag)
41
39
  if trinketsSet == nil then
42
40
  return __TS__New(Set)
43
41
  end
44
- return copySet(nil, trinketsSet)
42
+ return trinketsSet
45
43
  end
46
44
  --- Helper function to check in the item config if a given trinket has a given cache flag.
47
45
  function ____exports.trinketHasCacheFlag(self, trinketType, cacheFlag)
@@ -8,42 +8,42 @@ local ____firstLast = require("features.firstLast")
8
8
  local getModdedTrinketTypes = ____firstLast.getModdedTrinketTypes
9
9
  local ____trinkets = require("functions.trinkets")
10
10
  local getVanillaTrinketTypes = ____trinkets.getVanillaTrinketTypes
11
- local ALL_TRINKETS_ARRAY = {}
12
- local ALL_TRINKETS_SET = __TS__New(Set)
13
- local VANILLA_TRINKETS_ARRAY = {}
14
- local VANILLA_TRINKETS_SET = __TS__New(Set)
15
- local MODDED_TRINKETS_ARRAY = {}
16
- local MODDED_TRINKETS_SET = __TS__New(Set)
17
- local function lazyInitVanillaTrinkets(self)
18
- if #VANILLA_TRINKETS_ARRAY > 0 then
11
+ local ALL_TRINKET_TYPES_ARRAY = {}
12
+ local ALL_TRINKET_TYPES_SET = __TS__New(Set)
13
+ local VANILLA_TRINKET_TYPES_ARRAY = {}
14
+ local VANILLA_TRINKET_TYPES_SET = __TS__New(Set)
15
+ local MODDED_TRINKET_TYPES_ARRAY = {}
16
+ local MODDED_TRINKET_TYPES_SET = __TS__New(Set)
17
+ local function lazyInitVanillaTrinketTypes(self)
18
+ if #VANILLA_TRINKET_TYPES_ARRAY > 0 then
19
19
  return
20
20
  end
21
21
  local vanillaTrinketTypes = getVanillaTrinketTypes(nil)
22
22
  for ____, trinketType in ipairs(vanillaTrinketTypes) do
23
23
  local itemConfigItem = itemConfig:GetTrinket(trinketType)
24
24
  if itemConfigItem ~= nil then
25
- VANILLA_TRINKETS_ARRAY[#VANILLA_TRINKETS_ARRAY + 1] = trinketType
26
- VANILLA_TRINKETS_SET:add(trinketType)
25
+ VANILLA_TRINKET_TYPES_ARRAY[#VANILLA_TRINKET_TYPES_ARRAY + 1] = trinketType
26
+ VANILLA_TRINKET_TYPES_SET:add(trinketType)
27
27
  end
28
28
  end
29
29
  end
30
- local function lazyInitModdedTrinkets(self)
31
- if #MODDED_TRINKETS_ARRAY > 0 then
30
+ local function lazyInitModdedTrinketTypes(self)
31
+ if #MODDED_TRINKET_TYPES_ARRAY > 0 then
32
32
  return
33
33
  end
34
- lazyInitVanillaTrinkets(nil)
35
- for ____, trinketType in ipairs(VANILLA_TRINKETS_ARRAY) do
36
- ALL_TRINKETS_ARRAY[#ALL_TRINKETS_ARRAY + 1] = trinketType
37
- ALL_TRINKETS_SET:add(trinketType)
34
+ lazyInitVanillaTrinketTypes(nil)
35
+ for ____, trinketType in ipairs(VANILLA_TRINKET_TYPES_ARRAY) do
36
+ ALL_TRINKET_TYPES_ARRAY[#ALL_TRINKET_TYPES_ARRAY + 1] = trinketType
37
+ ALL_TRINKET_TYPES_SET:add(trinketType)
38
38
  end
39
39
  local moddedTrinketTypes = getModdedTrinketTypes(nil)
40
40
  for ____, trinketType in ipairs(moddedTrinketTypes) do
41
41
  local itemConfigItem = itemConfig:GetTrinket(trinketType)
42
42
  if itemConfigItem ~= nil then
43
- MODDED_TRINKETS_ARRAY[#MODDED_TRINKETS_ARRAY + 1] = trinketType
44
- MODDED_TRINKETS_SET:add(trinketType)
45
- ALL_TRINKETS_ARRAY[#ALL_TRINKETS_ARRAY + 1] = trinketType
46
- ALL_TRINKETS_SET:add(trinketType)
43
+ MODDED_TRINKET_TYPES_ARRAY[#MODDED_TRINKET_TYPES_ARRAY + 1] = trinketType
44
+ MODDED_TRINKET_TYPES_SET:add(trinketType)
45
+ ALL_TRINKET_TYPES_ARRAY[#ALL_TRINKET_TYPES_ARRAY + 1] = trinketType
46
+ ALL_TRINKET_TYPES_SET:add(trinketType)
47
47
  end
48
48
  end
49
49
  end
@@ -55,8 +55,8 @@ end
55
55
  -- This function can only be called if at least one callback has been executed. This is because not
56
56
  -- all trinkets will necessarily be present when a mod first loads (due to mod load order).
57
57
  function ____exports.getModdedTrinketArray(self)
58
- lazyInitModdedTrinkets(nil)
59
- return MODDED_TRINKETS_ARRAY
58
+ lazyInitModdedTrinketTypes(nil)
59
+ return MODDED_TRINKET_TYPES_ARRAY
60
60
  end
61
61
  --- Returns a set containing every valid trinket type in the game, including modded trinkets.
62
62
  --
@@ -66,8 +66,8 @@ end
66
66
  -- This function can only be called if at least one callback has been executed. This is because not
67
67
  -- all trinkets will necessarily be present when a mod first loads (due to mod load order).
68
68
  function ____exports.getModdedTrinketSet(self)
69
- lazyInitModdedTrinkets(nil)
70
- return MODDED_TRINKETS_SET
69
+ lazyInitModdedTrinketTypes(nil)
70
+ return MODDED_TRINKET_TYPES_SET
71
71
  end
72
72
  --- Returns an array containing every modded trinket type in the game.
73
73
  --
@@ -77,8 +77,8 @@ end
77
77
  -- This function can only be called if at least one callback has been executed. This is because not
78
78
  -- all trinkets will necessarily be present when a mod first loads (due to mod load order).
79
79
  function ____exports.getTrinketArray(self)
80
- lazyInitModdedTrinkets(nil)
81
- return ALL_TRINKETS_ARRAY
80
+ lazyInitModdedTrinketTypes(nil)
81
+ return ALL_TRINKET_TYPES_ARRAY
82
82
  end
83
83
  --- Returns a set containing every modded trinket type in the game.
84
84
  --
@@ -88,23 +88,23 @@ end
88
88
  -- This function can only be called if at least one callback has been executed. This is because not
89
89
  -- all trinkets will necessarily be present when a mod first loads (due to mod load order).
90
90
  function ____exports.getTrinketSet(self)
91
- lazyInitModdedTrinkets(nil)
92
- return ALL_TRINKETS_SET
91
+ lazyInitModdedTrinketTypes(nil)
92
+ return ALL_TRINKET_TYPES_SET
93
93
  end
94
94
  --- Returns an array containing every valid vanilla trinket type in the game.
95
95
  --
96
96
  -- Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, then
97
97
  -- use the `getVanillaTrinketSet` helper function instead.
98
98
  function ____exports.getVanillaTrinketArray(self)
99
- lazyInitVanillaTrinkets(nil)
100
- return VANILLA_TRINKETS_ARRAY
99
+ lazyInitVanillaTrinketTypes(nil)
100
+ return VANILLA_TRINKET_TYPES_ARRAY
101
101
  end
102
102
  --- Returns a set containing every valid vanilla trinket type in the game.
103
103
  --
104
104
  -- Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, then
105
105
  -- use the `getVanillaTrinketArray` helper function instead.
106
106
  function ____exports.getVanillaTrinketSet(self)
107
- lazyInitVanillaTrinkets(nil)
108
- return VANILLA_TRINKETS_SET
107
+ lazyInitVanillaTrinketTypes(nil)
108
+ return VANILLA_TRINKET_TYPES_SET
109
109
  end
110
110
  return ____exports
@@ -26,6 +26,15 @@ export declare function getOpenTrinketSlot(player: EntityPlayer): int | undefine
26
26
  * trinket type was not valid.
27
27
  */
28
28
  export declare function getTrinketDescription(trinketType: TrinketType): string;
29
+ /**
30
+ * Helper function to get the path to a trinket PNG file. Returns the path to the question mark
31
+ * sprite (i.e. from Curse of the Blind) if the provided trinket type was not valid.
32
+ *
33
+ * Note that this does not return the file name, but the full path to the trinket's PNG file. The
34
+ * function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
35
+ * field.
36
+ */
37
+ export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
29
38
  /**
30
39
  * Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
31
40
  * not valid.
@@ -51,6 +60,11 @@ export declare function hasOpenTrinketSlot(player: EntityPlayer): boolean;
51
60
  export declare function isGoldenTrinketType(trinketType: TrinketType): boolean;
52
61
  export declare function isModdedTrinketType(trinketType: TrinketType): boolean;
53
62
  export declare function isVanillaTrinketType(trinketType: TrinketType): boolean;
63
+ /**
64
+ * Helper function to generate a new sprite based on a collectible. If the provided collectible type
65
+ * is invalid, a sprite with a Curse of the Blind question mark will be returned.
66
+ */
67
+ export declare function newTrinketSprite(trinketType: TrinketType): Sprite;
54
68
  /**
55
69
  * Helper function to change the sprite of a trinket entity.
56
70
  *
@@ -1 +1 @@
1
- {"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA6BtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAc/D;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,IAAI,WAAW,EAAE,CAEtD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAOhE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAEtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN"}
1
+ {"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAc/D;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,IAAI,WAAW,EAAE,CAEtD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAOhE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CASjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN"}
@@ -5,6 +5,8 @@ local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
5
5
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
6
6
  local ____cachedClasses = require("core.cachedClasses")
7
7
  local itemConfig = ____cachedClasses.itemConfig
8
+ local ____constants = require("core.constants")
9
+ local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
8
10
  local ____constantsFirstLast = require("core.constantsFirstLast")
9
11
  local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
10
12
  local LAST_VANILLA_TRINKET_TYPE = ____constantsFirstLast.LAST_VANILLA_TRINKET_TYPE
@@ -35,6 +37,7 @@ end
35
37
  --
36
38
  -- 1 << 15
37
39
  local GOLDEN_TRINKET_ADJUSTMENT = 32768
40
+ local TRINKET_ANM2_PATH = "gfx/005.350_trinket.anm2"
38
41
  local TRINKET_SPRITE_LAYER = 0
39
42
  --- Helper function to get the corresponding golden trinket type from a normal trinket type.
40
43
  --
@@ -83,6 +86,19 @@ function ____exports.getTrinketDescription(self, trinketType)
83
86
  end
84
87
  return DEFAULT_TRINKET_DESCRIPTION
85
88
  end
89
+ --- Helper function to get the path to a trinket PNG file. Returns the path to the question mark
90
+ -- sprite (i.e. from Curse of the Blind) if the provided trinket type was not valid.
91
+ --
92
+ -- Note that this does not return the file name, but the full path to the trinket's PNG file. The
93
+ -- function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
94
+ -- field.
95
+ function ____exports.getTrinketGfxFilename(self, trinketType)
96
+ local itemConfigItem = itemConfig:GetTrinket(trinketType)
97
+ if itemConfigItem == nil then
98
+ return BLIND_ITEM_PNG_PATH
99
+ end
100
+ return itemConfigItem.GfxFileName
101
+ end
86
102
  --- Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
87
103
  -- not valid.
88
104
  --
@@ -125,6 +141,16 @@ end
125
141
  function ____exports.isModdedTrinketType(self, trinketType)
126
142
  return not ____exports.isVanillaTrinketType(nil, trinketType)
127
143
  end
144
+ --- Helper function to generate a new sprite based on a collectible. If the provided collectible type
145
+ -- is invalid, a sprite with a Curse of the Blind question mark will be returned.
146
+ function ____exports.newTrinketSprite(self, trinketType)
147
+ local sprite = Sprite()
148
+ sprite:Load(TRINKET_ANM2_PATH, false)
149
+ local gfxFileName = ____exports.getTrinketGfxFilename(nil, trinketType)
150
+ sprite:ReplaceSpritesheet(TRINKET_SPRITE_LAYER, gfxFileName)
151
+ sprite:LoadGraphics()
152
+ return sprite
153
+ end
128
154
  --- Helper function to change the sprite of a trinket entity.
129
155
  --
130
156
  -- For more information about removing the trinket sprite, see the documentation for the
package/dist/index.d.ts CHANGED
@@ -294,23 +294,6 @@ export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlo
294
294
  */
295
295
  export declare function addSetsToSet<T>(mainSet: Set<T>, ...setsToAdd: Array<Set<T> | ReadonlySet<T>>): void;
296
296
 
297
- /**
298
- * Helper function to add a stat to a player based on the `CacheFlag` provided. Call this function
299
- * from the `EVALUATE_CACHE` callback.
300
- *
301
- * Note that for `CacheFlag.FIRE_DELAY`, the "amount" argument will be interpreted as the tear stat
302
- * to add (and not the amount to mutate `EntityPlayer.MaxFireDelay` by).
303
- *
304
- * This function supports the following cache flags:
305
- * - CacheFlag.DAMAGE (1 << 0)
306
- * - CacheFlag.FIRE_DELAY (1 << 1)
307
- * - CacheFlag.SHOT_SPEED (1 << 2)
308
- * - CacheFlag.RANGE (1 << 3)
309
- * - CacheFlag.SPEED (1 << 4)
310
- * - CacheFlag.LUCK (1 << 10)
311
- */
312
- export declare function addStat(player: EntityPlayer, cacheFlag: CacheFlag, amount: number): void;
313
-
314
297
  /**
315
298
  * - Converts the specified amount of tears stat into the format of `EntityPlayer.MaxFireDelay` and
316
299
  * adds it to the player.
@@ -2297,9 +2280,15 @@ export declare function getAliveNPCs(entityType?: EntityType, variant?: number,
2297
2280
  *
2298
2281
  * The set contains strings with the entity type and variant, separated by a period.
2299
2282
  *
2283
+ * Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
2284
+ * and Gabriel.).
2285
+ *
2300
2286
  * Also see the `getBossSet` and `getCombinedBossSet` functions.
2287
+ *
2288
+ * @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
2289
+ * Default is true.
2301
2290
  */
2302
- export declare function getAllBossesSet(): Set<string>;
2291
+ export declare function getAllBossesSet(includeStoryBosses?: boolean): ReadonlySet<string>;
2303
2292
 
2304
2293
  /**
2305
2294
  * Helper function to get an array with every valid card sub-type. This includes modded cards.
@@ -2606,8 +2595,12 @@ export declare function getCollectibleDevilCoinPrice(collectibleType: Collectibl
2606
2595
  export declare function getCollectibleDevilHeartPrice(collectibleType: CollectibleType, player: EntityPlayer): PickupPrice;
2607
2596
 
2608
2597
  /**
2609
- * Helper function to get the path to a collectible's sprite. Returns the path to the question mark
2598
+ * Helper function to get the path to a collectible PNG file. Returns the path to the question mark
2610
2599
  * sprite (i.e. from Curse of the Blind) if the provided collectible type was not valid.
2600
+ *
2601
+ * Note that this does not return the file name, but the full path to the collectible's PNG file.
2602
+ * The function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
2603
+ * field.
2611
2604
  */
2612
2605
  export declare function getCollectibleGfxFilename(collectibleType: CollectibleType): string;
2613
2606
 
@@ -2739,7 +2732,7 @@ export declare function getCollectibleSet(): ReadonlySet<CollectibleType>;
2739
2732
  * This function can only be called if at least one callback has been executed. This is because not
2740
2733
  * all collectibles will necessarily be present when a mod first loads (due to mod load order).
2741
2734
  */
2742
- export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Set<CollectibleType>;
2735
+ export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): ReadonlySet<CollectibleType>;
2743
2736
 
2744
2737
  /**
2745
2738
  * Helper function to get the remaining collectibles in a given item pool. This function is
@@ -2770,7 +2763,7 @@ export declare function getCollectibleTags(collectibleType: CollectibleType): Bi
2770
2763
  * const guppyCollectibleTypes = getCollectibleTypesForTransformation(PlayerForm.GUPPY);
2771
2764
  * ```
2772
2765
  */
2773
- export declare function getCollectibleTypesForTransformation(playerForm: PlayerForm): Set<CollectibleType>;
2766
+ export declare function getCollectibleTypesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
2774
2767
 
2775
2768
  /**
2776
2769
  * Helper function to get all of the collectible types in the game that have a certain tag.
@@ -2782,7 +2775,7 @@ export declare function getCollectibleTypesForTransformation(playerForm: PlayerF
2782
2775
  * const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
2783
2776
  * ```
2784
2777
  */
2785
- export declare function getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): Set<CollectibleType>;
2778
+ export declare function getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
2786
2779
 
2787
2780
  /**
2788
2781
  * Gets the entities that have a hitbox that overlaps with any part of the square that the grid
@@ -2802,7 +2795,7 @@ export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntit
2802
2795
  *
2803
2796
  * Also see the `getAllBossesSet` and `getBossSet` functions.
2804
2797
  */
2805
- export declare function getCombinedBossSet(stage: int): Set<string> | undefined;
2798
+ export declare function getCombinedBossSet(stage: int): ReadonlySet<string> | undefined;
2806
2799
 
2807
2800
  /**
2808
2801
  * Helper function to get all of the crawl spaces in the room.
@@ -2903,7 +2896,7 @@ export declare function getDoorSlotsForRoomShape(roomShape: RoomShape): Readonly
2903
2896
  */
2904
2897
  export declare function getDoorsToRoomIndex(...roomGridIndex: int[]): GridEntityDoor[];
2905
2898
 
2906
- export declare function getEdenPassives(): Set<CollectibleType>;
2899
+ export declare function getEdenPassives(): ReadonlySet<CollectibleType>;
2907
2900
 
2908
2901
  /**
2909
2902
  * Helper function to account for Repentance floors being offset by 1. For example, Downpour 2 is
@@ -3169,7 +3162,7 @@ export declare function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>>;
3169
3162
  * @param pruneConditionalItems Whether or not collectibles that only grant flight conditionally
3170
3163
  * should be included in the set (like Empty Vessel).
3171
3164
  */
3172
- export declare function getFlyingCollectibles(pruneConditionalItems: boolean): Set<CollectibleType>;
3165
+ export declare function getFlyingCollectibles(pruneConditionalItems: boolean): ReadonlySet<CollectibleType>;
3173
3166
 
3174
3167
  /**
3175
3168
  * Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
@@ -3535,11 +3528,11 @@ export declare function getModdedCollectibleSet(): ReadonlySet<CollectibleType>;
3535
3528
  /**
3536
3529
  * Helper function to get an array that represents the all modded collectible types.
3537
3530
  *
3538
- * This function is only useful when building collectible type objects. For most purposes, you
3539
- * should use the `getModdedCollectibleSet` helper function instead.
3540
- *
3541
3531
  * Returns an empty array if there are no modded collectible types.
3542
3532
  *
3533
+ * This function is only useful when building collectible type objects. For most purposes, you
3534
+ * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function instead.
3535
+ *
3543
3536
  * (This function is named differently from the `getVanillaCollectibleTypeRange` function because
3544
3537
  * all modded collectible types are contiguous. Thus, each value represents a real
3545
3538
  * `CollectibleType`.)
@@ -3586,12 +3579,15 @@ export declare function getModdedTrinketSet(): ReadonlySet<TrinketType>;
3586
3579
  *
3587
3580
  * Returns an empty array if there are no modded trinket types.
3588
3581
  *
3582
+ * This function is only useful when building collectible type objects. For most purposes, you
3583
+ * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function instead.
3584
+ *
3589
3585
  * This function can only be called if at least one callback has been executed. This is because not
3590
3586
  * all trinkets will necessarily be present when a mod first loads (due to mod load order).
3591
3587
  */
3592
3588
  export declare function getModdedTrinketTypes(): TrinketType[];
3593
3589
 
3594
- export declare function getMoveActions(): Set<ButtonAction>;
3590
+ export declare function getMoveActions(): ReadonlySet<ButtonAction>;
3595
3591
 
3596
3592
  /**
3597
3593
  * Helper function to get the first player with the lowest frame count. Useful to find a freshly
@@ -4033,9 +4029,6 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
4033
4029
  * Helper function to get all of the collectibles that the player has gotten so far on this run, in
4034
4030
  * order.
4035
4031
  *
4036
- * Note that this does not include active collectibles that have since been dropped for other
4037
- * collectibles.
4038
- *
4039
4032
  * In the case of inventory initialization or the case where the player rerolls their build in the
4040
4033
  * middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
4041
4034
  * that the items were actually given to the player. In this case, the inventory will be in the
@@ -4047,6 +4040,10 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
4047
4040
  * would not be updated. In vanilla, this situation would never happen, but another mod might do
4048
4041
  * this for some reason. (With that said, the next time that a collectible is normally added or
4049
4042
  * removed, it would trigger a re-scan, and the previous changes would be picked up.)
4043
+ *
4044
+ * @param player The player to get the inventory for.
4045
+ * @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
4046
+ * is true.
4050
4047
  */
4051
4048
  export declare function getPlayerInventory(player: EntityPlayer, includeActiveCollectibles?: boolean): CollectibleType[];
4052
4049
 
@@ -4056,6 +4053,14 @@ export declare function getPlayerInventory(player: EntityPlayer, includeActiveCo
4056
4053
  */
4057
4054
  export declare function getPlayerLastHeart(player: EntityPlayer): HealthType;
4058
4055
 
4056
+ /**
4057
+ * Helper function to get the last passive collectible that the player picked up. In most cases,
4058
+ * this will be the passive that is removed when the player would use Clicker.
4059
+ *
4060
+ * Returns undefined if the player does not have any passive collectibles.
4061
+ */
4062
+ export declare function getPlayerLastPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
4063
+
4059
4064
  /**
4060
4065
  * Returns the maximum heart containers that the provided player can have. Normally, this is 12, but
4061
4066
  * it can change depending on the character (e.g. Keeper) and other things (e.g. Mother's Kiss).
@@ -4836,7 +4841,7 @@ export declare function getScreenTopRightPos(): Vector;
4836
4841
  */
4837
4842
  export declare function getSetCombinations<T>(set: Set<T> | ReadonlySet<T>, includeEmptyArray: boolean): ReadonlyArray<ReadonlySet<T>>;
4838
4843
 
4839
- export declare function getShootActions(): Set<ButtonAction>;
4844
+ export declare function getShootActions(): ReadonlySet<ButtonAction>;
4840
4845
 
4841
4846
  /**
4842
4847
  * Helper function to get all of the slots in the room.
@@ -5027,6 +5032,16 @@ export declare function getTrinketArray(): readonly TrinketType[];
5027
5032
  */
5028
5033
  export declare function getTrinketDescription(trinketType: TrinketType): string;
5029
5034
 
5035
+ /**
5036
+ * Helper function to get the path to a trinket PNG file. Returns the path to the question mark
5037
+ * sprite (i.e. from Curse of the Blind) if the provided trinket type was not valid.
5038
+ *
5039
+ * Note that this does not return the file name, but the full path to the trinket's PNG file. The
5040
+ * function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
5041
+ * field.
5042
+ */
5043
+ export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
5044
+
5030
5045
  /**
5031
5046
  * Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
5032
5047
  * not valid.
@@ -5065,7 +5080,7 @@ export declare function getTrinketSet(): ReadonlySet<TrinketType>;
5065
5080
  * This function can only be called if at least one callback has been executed. This is because not
5066
5081
  * all trinkets will necessarily be present when a mod first loads (due to mod load order).
5067
5082
  */
5068
- export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): Set<TrinketType>;
5083
+ export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): ReadonlySet<TrinketType>;
5069
5084
 
5070
5085
  /**
5071
5086
  * Helper function to get an array that contains every trinket type.
@@ -7559,7 +7574,7 @@ export declare enum ModCallbackCustom {
7559
7574
  POST_PLAYER_CHANGE_TYPE = 57,
7560
7575
  /**
7561
7576
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is higher than
7562
- * what it was on the previous frame.
7577
+ * what it was on the previous frame or when a new active collectible is acquired.
7563
7578
  *
7564
7579
  * When registering the callback, takes an optional second argument that will make the callback
7565
7580
  * only fire if the collectible matches the `CollectibleType` provided.
@@ -7574,7 +7589,7 @@ export declare enum ModCallbackCustom {
7574
7589
  POST_PLAYER_COLLECTIBLE_ADDED = 58,
7575
7590
  /**
7576
7591
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is lower than
7577
- * what it was on the previous frame.
7592
+ * what it was on the previous frame or when an active collectible is no longer present.
7578
7593
  *
7579
7594
  * When registering the callback, takes an optional second argument that will make the callback
7580
7595
  * only fire if the collectible matches the `CollectibleType` provided.
@@ -8130,6 +8145,12 @@ export declare const NEW_RUN_PLAYER_STARTING_POSITION: Vector;
8130
8145
  */
8131
8146
  export declare function newChargeBarSprites(maxCharges: int): ChargeBarSprites;
8132
8147
 
8148
+ /**
8149
+ * Helper function to generate a new sprite based on a collectible. If the provided collectible type
8150
+ * is invalid, a sprite with a Curse of the Blind question mark will be returned.
8151
+ */
8152
+ export declare function newCollectibleSprite(collectibleType: CollectibleType): Sprite;
8153
+
8133
8154
  export declare function newPickingUpItem(): PickingUpItem;
8134
8155
 
8135
8156
  /** Returns a `PlayerHealth` object with all zeros. */
@@ -8156,6 +8177,12 @@ export declare function newRNG(seed?: Seed): RNG;
8156
8177
  */
8157
8178
  export declare function newRoom(): int | undefined;
8158
8179
 
8180
+ /**
8181
+ * Helper function to generate a new sprite based on a collectible. If the provided collectible type
8182
+ * is invalid, a sprite with a Curse of the Blind question mark will be returned.
8183
+ */
8184
+ export declare function newTrinketSprite(trinketType: TrinketType): Sprite;
8185
+
8159
8186
  /**
8160
8187
  * Initializes a new TypeScriptToLua class in the situation where you do not know what kind of class
8161
8188
  * it is. This function requires that you provide an instantiated class of the same type, as it will
@@ -2,4 +2,5 @@
2
2
  export declare const STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP: ReadonlyMap<int, ReadonlyMap<int, ReadonlySet<string>>>;
3
3
  export declare const STAGE_TO_COMBINED_BOSS_SET_MAP: ReadonlyMap<int, ReadonlySet<string>>;
4
4
  export declare const ALL_BOSSES_SET: ReadonlySet<string>;
5
+ export declare const ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET: ReadonlySet<string>;
5
6
  //# sourceMappingURL=bossSets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bossSets.d.ts","sourceRoot":"","sources":["../../src/sets/bossSets.ts"],"names":[],"mappings":";AA2aA,eAAO,MAAM,mCAAmC,EAAE,WAAW,CAC3D,GAAG,EACH,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAarC,CAAC;AAEH,eAAO,MAAM,8BAA8B,EAAE,WAAW,CACtD,GAAG,EACH,WAAW,CAAC,MAAM,CAAC,CAanB,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAQ7C,CAAC"}
1
+ {"version":3,"file":"bossSets.d.ts","sourceRoot":"","sources":["../../src/sets/bossSets.ts"],"names":[],"mappings":";AAibA,eAAO,MAAM,mCAAmC,EAAE,WAAW,CAC3D,GAAG,EACH,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAarC,CAAC;AAEH,eAAO,MAAM,8BAA8B,EAAE,WAAW,CACtD,GAAG,EACH,WAAW,CAAC,MAAM,CAAC,CAanB,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAQ7C,CAAC;AAEH,eAAO,MAAM,qCAAqC,qBACX,CAAC"}
@@ -7,6 +7,7 @@ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
7
7
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
8
8
  local Map = ____lualib.Map
9
9
  local ____exports = {}
10
+ local getAllBossesExcludingStoryBossesSet
10
11
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
11
12
  local BigHornVariant = ____isaac_2Dtypescript_2Ddefinitions.BigHornVariant
12
13
  local ChubVariant = ____isaac_2Dtypescript_2Ddefinitions.ChubVariant
@@ -37,6 +38,27 @@ local SatanVariant = ____isaac_2Dtypescript_2Ddefinitions.SatanVariant
37
38
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
38
39
  local WarVariant = ____isaac_2Dtypescript_2Ddefinitions.WarVariant
39
40
  local WidowVariant = ____isaac_2Dtypescript_2Ddefinitions.WidowVariant
41
+ local ____entities = require("functions.entities")
42
+ local parseEntityTypeVariantString = ____entities.parseEntityTypeVariantString
43
+ local ____set = require("functions.set")
44
+ local copySet = ____set.copySet
45
+ local ____storyBossesSet = require("sets.storyBossesSet")
46
+ local STORY_BOSSES_SET = ____storyBossesSet.STORY_BOSSES_SET
47
+ function getAllBossesExcludingStoryBossesSet(self)
48
+ local allBossesExcludingStoryBossesSet = copySet(nil, ____exports.ALL_BOSSES_SET)
49
+ local allBosses = {__TS__Spread(____exports.ALL_BOSSES_SET:values())}
50
+ for ____, entityTypeVariantString in ipairs(allBosses) do
51
+ local tuple = parseEntityTypeVariantString(nil, entityTypeVariantString)
52
+ if tuple == nil then
53
+ error("Failed to parse a boss tuple when constructing the story boss set.")
54
+ end
55
+ local entityType, _variant = table.unpack(tuple)
56
+ if STORY_BOSSES_SET:has(entityType) then
57
+ allBossesExcludingStoryBossesSet:delete(entityTypeVariantString)
58
+ end
59
+ end
60
+ return allBossesExcludingStoryBossesSet
61
+ end
40
62
  --- Contains just the bosses in Basement (not e.g. Burning Basement).
41
63
  local BASEMENT_BOSSES_SET = __TS__New(
42
64
  Set,
@@ -551,4 +573,5 @@ ____exports.ALL_BOSSES_SET = __TS__New(
551
573
  ____Set_13,
552
574
  {__TS__SparseArraySpread(____array_12)}
553
575
  )
576
+ ____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = getAllBossesExcludingStoryBossesSet(nil)
554
577
  return ____exports