isaacscript-common 1.0.444 → 1.0.448

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.
@@ -10,6 +10,12 @@ export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
10
10
  /** This is also the distance that a player spawns from the door that they enter a room from. */
11
11
  export declare const DISTANCE_OF_GRID_TILE = 40;
12
12
  export declare const DOOR_HITBOX_DISTANCE = 11;
13
+ /**
14
+ * When Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and spawn 14 Swarm Spiders
15
+ * while their StateFrame ticks upwards. The 14th spider appears when the StateFrame is at this
16
+ * value.
17
+ */
18
+ export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
13
19
  /**
14
20
  * The random items that appear when the player has TMTRAINER are generated on the fly as they are
15
21
  * encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
@@ -6,6 +6,7 @@ ____exports.BOMB_EXPLODE_FRAME = 51
6
6
  ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B, PlayerType.PLAYER_BLUEBABY_B, PlayerType.PLAYER_THEFORGOTTEN_B, PlayerType.PLAYER_BETHANY_B})
7
7
  ____exports.DISTANCE_OF_GRID_TILE = 40
8
8
  ____exports.DOOR_HITBOX_DISTANCE = 11
9
+ ____exports.EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45
9
10
  ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
10
11
  ____exports.GENESIS_ROOM_VARIANT = 1000
11
12
  ____exports.GOLDEN_TRINKET_SHIFT = 1 << 15
@@ -1,9 +1,28 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local ____collectibleSet = require("collectibleSet")
5
- local COLLECTIBLE_SET = ____collectibleSet.COLLECTIBLE_SET
4
+ local ____collectibles = require("functions.collectibles")
5
+ local getMaxCollectibleID = ____collectibles.getMaxCollectibleID
6
+ local ____util = require("functions.util")
7
+ local copySet = ____util.copySet
8
+ local COLLECTIBLE_SET = __TS__New(Set)
9
+ local function initSet(self)
10
+ local itemConfig = Isaac.GetItemConfig()
11
+ do
12
+ local collectibleType = 1
13
+ while collectibleType <= getMaxCollectibleID(nil) do
14
+ local itemConfigItem = itemConfig:GetCollectible(collectibleType)
15
+ if itemConfigItem ~= nil then
16
+ COLLECTIBLE_SET:add(collectibleType)
17
+ end
18
+ collectibleType = collectibleType + 1
19
+ end
20
+ end
21
+ end
6
22
  function ____exports.getCollectibleSet(self)
7
- return __TS__New(Set, COLLECTIBLE_SET)
23
+ if COLLECTIBLE_SET.size == 0 then
24
+ initSet(nil)
25
+ end
26
+ return copySet(nil, COLLECTIBLE_SET)
8
27
  end
9
28
  return ____exports
@@ -23,8 +23,6 @@ export declare function getCollectibleMaxCharges(collectibleType: CollectibleTyp
23
23
  * ```
24
24
  */
25
25
  export declare function getCollectibleName(collectibleType: CollectibleType | int): string;
26
- /** Returns a set containing every valid collectible type in the game, including modded items. */
27
- export declare function getCollectibleSet(): Set<CollectibleType | int>;
28
26
  /** Helper function to get all of the collectible entities in the room. */
29
27
  export declare function getCollectibles(matchingSubType?: number): EntityPickup[];
30
28
  export declare function getMaxCollectibleID(): int;
@@ -6,12 +6,6 @@ local ____collectibleNameMap = require("collectibleNameMap")
6
6
  local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
7
7
  local ____entity = require("functions.entity")
8
8
  local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
9
- local ____util = require("functions.util")
10
- local copySet = ____util.copySet
11
- function ____exports.getMaxCollectibleID(self)
12
- local itemConfig = Isaac.GetItemConfig()
13
- return itemConfig:GetCollectibles().Size - 1
14
- end
15
9
  function ____exports.setCollectibleSprite(self, pickup, pngPath)
16
10
  if pickup.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
17
11
  error(
@@ -25,20 +19,6 @@ end
25
19
  COLLECTIBLE_SPRITE_LAYER = 1
26
20
  local BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
27
21
  local GLITCHED_ITEM_THRESHOLD = 4000000000
28
- local COLLECTIBLE_SET = __TS__New(Set)
29
- local function initSet(self)
30
- local itemConfig = Isaac.GetItemConfig()
31
- do
32
- local collectibleType = 1
33
- while collectibleType <= ____exports.getMaxCollectibleID(nil) do
34
- local itemConfigItem = itemConfig:GetCollectible(collectibleType)
35
- if itemConfigItem ~= nil then
36
- COLLECTIBLE_SET:add(collectibleType)
37
- end
38
- collectibleType = collectibleType + 1
39
- end
40
- end
41
- end
42
22
  function ____exports.changeCollectibleSubType(self, collectible, newCollectibleType)
43
23
  collectible.SubType = newCollectibleType
44
24
  local itemConfig = Isaac.GetItemConfig()
@@ -115,12 +95,6 @@ function ____exports.getCollectibleName(self, collectibleType)
115
95
  end
116
96
  return itemConfigItem.Name
117
97
  end
118
- function ____exports.getCollectibleSet(self)
119
- if COLLECTIBLE_SET.size == 0 then
120
- initSet(nil)
121
- end
122
- return copySet(nil, COLLECTIBLE_SET)
123
- end
124
98
  function ____exports.getCollectibles(self, matchingSubType)
125
99
  if matchingSubType == nil then
126
100
  matchingSubType = -1
@@ -135,6 +109,10 @@ function ____exports.getCollectibles(self, matchingSubType)
135
109
  end
136
110
  return collectibles
137
111
  end
112
+ function ____exports.getMaxCollectibleID(self)
113
+ local itemConfig = Isaac.GetItemConfig()
114
+ return itemConfig:GetCollectibles().Size - 1
115
+ end
138
116
  function ____exports.isGlitchedCollectible(self, entity)
139
117
  return ((entity.Type == EntityType.ENTITY_PICKUP) and (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE)) and (entity.SubType > GLITCHED_ITEM_THRESHOLD)
140
118
  end
@@ -11,5 +11,9 @@ export declare function isActionPressedOnAnyInput(buttonAction: ButtonAction): b
11
11
  */
12
12
  export declare function isActionTriggeredOnAnyInput(buttonAction: ButtonAction): boolean;
13
13
  export declare function isKeyboardPressed(key: Keyboard): boolean;
14
+ export declare function isMoveActionPressedOnAnyInput(): boolean;
15
+ export declare function isMoveActionTriggeredOnAnyInput(): boolean;
16
+ export declare function isShootActionPressedOnAnyInput(): boolean;
17
+ export declare function isShootActionTriggeredOnAnyInput(): boolean;
14
18
  /** Helper function to get the enum name for the specified `Keyboard` value. */
15
19
  export declare function keyboardToString(keyboard: Keyboard): string;
@@ -3,6 +3,8 @@ require("lualib_bundle");
3
3
  local ____exports = {}
4
4
  local ____constants = require("constants")
5
5
  local MAX_NUM_INPUTS = ____constants.MAX_NUM_INPUTS
6
+ local MOVEMENT_ACTIONS = ____constants.MOVEMENT_ACTIONS
7
+ local SHOOTING_ACTIONS = ____constants.SHOOTING_ACTIONS
6
8
  local ControllerLiteral = ControllerLiteral or ({})
7
9
  ControllerLiteral.DPAD_LEFT = 0
8
10
  ControllerLiteral[ControllerLiteral.DPAD_LEFT] = "DPAD_LEFT"
@@ -89,6 +91,46 @@ end
89
91
  function ____exports.isKeyboardPressed(self, key)
90
92
  return Input.IsButtonPressed(key, 0)
91
93
  end
94
+ function ____exports.isMoveActionPressedOnAnyInput(self)
95
+ for ____, buttonAction in __TS__Iterator(
96
+ MOVEMENT_ACTIONS:values()
97
+ ) do
98
+ if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
99
+ return true
100
+ end
101
+ end
102
+ return false
103
+ end
104
+ function ____exports.isMoveActionTriggeredOnAnyInput(self)
105
+ for ____, buttonAction in __TS__Iterator(
106
+ MOVEMENT_ACTIONS:values()
107
+ ) do
108
+ if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
109
+ return true
110
+ end
111
+ end
112
+ return false
113
+ end
114
+ function ____exports.isShootActionPressedOnAnyInput(self)
115
+ for ____, buttonAction in __TS__Iterator(
116
+ SHOOTING_ACTIONS:values()
117
+ ) do
118
+ if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
119
+ return true
120
+ end
121
+ end
122
+ return false
123
+ end
124
+ function ____exports.isShootActionTriggeredOnAnyInput(self)
125
+ for ____, buttonAction in __TS__Iterator(
126
+ SHOOTING_ACTIONS:values()
127
+ ) do
128
+ if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
129
+ return true
130
+ end
131
+ end
132
+ return false
133
+ end
92
134
  function ____exports.keyboardToString(self, keyboard)
93
135
  for keyName, keyCode in pairs(Keyboard) do
94
136
  if keyCode == keyboard then
@@ -22,6 +22,12 @@ export declare function getNPCs(matchingEntityType?: EntityType | int, matchingV
22
22
  * not actually keep the doors closed (like Death's scythes).
23
23
  */
24
24
  export declare function isAliveExceptionNPC(npc: EntityNPC): boolean;
25
+ /**
26
+ * Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
27
+ * dead by the game. Instead, when Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and
28
+ * spawn 14 Swarm Spiders while their StateFrame ticks upwards.
29
+ */
30
+ export declare function isDyingEggyWithNoSpidersLeft(npc: EntityNPC): boolean;
25
31
  /**
26
32
  * Helper function to detect the custom death state of a Rag Man Ragling. When Rag Man Raglings die,
27
33
  * they turn into a patch on the ground and can be revived by Rag Man at a later time. This causes
@@ -2,6 +2,8 @@
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
4
  local NON_ALIVE_NPCS_TYPE_VARIANT, NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE
5
+ local ____constants = require("constants")
6
+ local EGGY_STATE_FRAME_OF_FINAL_SPIDER = ____constants.EGGY_STATE_FRAME_OF_FINAL_SPIDER
5
7
  local ____entity = require("functions.entity")
6
8
  local getEntities = ____entity.getEntities
7
9
  function ____exports.getBosses(self)
@@ -41,8 +43,14 @@ function ____exports.isAliveExceptionNPC(self, npc)
41
43
  if ____exports.isRaglingDeathPatch(nil, npc) then
42
44
  return true
43
45
  end
46
+ if ____exports.isDyingEggyWithNoSpidersLeft(nil, npc) then
47
+ return true
48
+ end
44
49
  return false
45
50
  end
51
+ function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
52
+ return (npc.State == NpcState.STATE_SUICIDE) and (npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER)
53
+ end
46
54
  function ____exports.isRaglingDeathPatch(self, npc)
47
55
  return ((npc.Type == EntityType.ENTITY_RAGLING) and (npc.Variant == 1)) and (npc.State == NpcState.STATE_SPECIAL)
48
56
  end
@@ -9,8 +9,8 @@ local PocketItemType = ____PocketItemType.PocketItemType
9
9
  local ____bitwise = require("functions.bitwise")
10
10
  local getKBitOfN = ____bitwise.getKBitOfN
11
11
  local getNumBitsOfN = ____bitwise.getNumBitsOfN
12
- local ____collectibles = require("functions.collectibles")
13
- local getCollectibleSet = ____collectibles.getCollectibleSet
12
+ local ____collectibleSet = require("functions.collectibleSet")
13
+ local getCollectibleSet = ____collectibleSet.getCollectibleSet
14
14
  function ____exports.getPlayers(self, performExclusions)
15
15
  if performExclusions == nil then
16
16
  performExclusions = false
@@ -4,9 +4,9 @@ local ____player = require("functions.player")
4
4
  local getDeathAnimationName = ____player.getDeathAnimationName
5
5
  local ____sprite = require("functions.sprite")
6
6
  local getFinalFrameOfAnimation = ____sprite.getFinalFrameOfAnimation
7
- local ____trinkets = require("functions.trinkets")
8
- local giveTrinketsBack = ____trinkets.giveTrinketsBack
9
- local temporarilyRemoveTrinkets = ____trinkets.temporarilyRemoveTrinkets
7
+ local ____trinketGive = require("functions.trinketGive")
8
+ local giveTrinketsBack = ____trinketGive.giveTrinketsBack
9
+ local temporarilyRemoveTrinkets = ____trinketGive.temporarilyRemoveTrinkets
10
10
  function ____exports.willMysteriousPaperRevive(self, player)
11
11
  local game = Game()
12
12
  local gameFrameCount = game:GetFrameCount()
@@ -0,0 +1,24 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export interface TrinketSituation {
3
+ trinketTypeRemoved: TrinketType | int;
4
+ trinket1: TrinketType | int;
5
+ trinket2: TrinketType | int;
6
+ numSmeltedTrinkets: int;
7
+ }
8
+ /**
9
+ * Helper function to temporarily remove a trinket from the player. Use this in combination with the
10
+ * `giveTrinketBack` function to take away and give back a trinket on the same frame. This function
11
+ * correctly handles multiple trinket slots and ensures that all copies of the trinket are removed,
12
+ * including smelted trinkets.
13
+ *
14
+ * Note that for simplicity, this function assumes that all smelted trinkets are non-golden.
15
+ *
16
+ * @returns Null if the player does not have the trinket, or TrinketSituation if they do.
17
+ */
18
+ export declare function temporarilyRemoveTrinkets(player: EntityPlayer, trinketType: TrinketType): TrinketSituation | undefined;
19
+ /**
20
+ * Helper function to restore the player's trinkets back to the way they were before the
21
+ * `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
22
+ * removed.
23
+ */
24
+ export declare function giveTrinketsBack(player: EntityPlayer, trinketSituation: TrinketSituation | undefined): void;
@@ -0,0 +1,54 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local ____constants = require("constants")
4
+ local GOLDEN_TRINKET_SHIFT = ____constants.GOLDEN_TRINKET_SHIFT
5
+ function ____exports.temporarilyRemoveTrinkets(self, player, trinketType)
6
+ if not player:HasTrinket(trinketType) then
7
+ return nil
8
+ end
9
+ local trinket1 = player:GetTrinket(0)
10
+ local trinket2 = player:GetTrinket(1)
11
+ local numTrinkets = 0
12
+ while player:HasTrinket(trinketType) do
13
+ player:TryRemoveTrinket(trinketType)
14
+ numTrinkets = numTrinkets + 1
15
+ end
16
+ local numSmeltedTrinkets = numTrinkets
17
+ local trinketWasInSlot1 = (trinket1 == trinketType) or ((trinket1 + GOLDEN_TRINKET_SHIFT) == trinketType)
18
+ if trinketWasInSlot1 then
19
+ numSmeltedTrinkets = numSmeltedTrinkets - 1
20
+ end
21
+ local trinketWasInSlot2 = (trinket2 == trinketType) or ((trinket2 + GOLDEN_TRINKET_SHIFT) == trinketType)
22
+ if trinketWasInSlot2 then
23
+ numSmeltedTrinkets = numSmeltedTrinkets - 1
24
+ end
25
+ return {trinketTypeRemoved = trinketType, trinket1 = trinket1, trinket2 = trinket2, numSmeltedTrinkets = numSmeltedTrinkets}
26
+ end
27
+ function ____exports.giveTrinketsBack(self, player, trinketSituation)
28
+ if trinketSituation == nil then
29
+ return
30
+ end
31
+ local trinket1 = player:GetTrinket(0)
32
+ local trinket2 = player:GetTrinket(1)
33
+ if trinket1 ~= TrinketType.TRINKET_NULL then
34
+ player:TryRemoveTrinket(trinket1)
35
+ end
36
+ if trinket2 ~= TrinketType.TRINKET_NULL then
37
+ player:TryRemoveTrinket(trinket2)
38
+ end
39
+ do
40
+ local i = 0
41
+ while i < trinketSituation.numSmeltedTrinkets do
42
+ player:AddTrinket(trinketSituation.trinketTypeRemoved, false)
43
+ player:UseActiveItem(CollectibleType.COLLECTIBLE_SMELTER, UseFlag.USE_NOANIM)
44
+ i = i + 1
45
+ end
46
+ end
47
+ if trinketSituation.trinket1 ~= TrinketType.TRINKET_NULL then
48
+ player:AddTrinket(trinketSituation.trinket1, false)
49
+ end
50
+ if trinketSituation.trinket2 ~= TrinketType.TRINKET_NULL then
51
+ player:AddTrinket(trinketSituation.trinket2, false)
52
+ end
53
+ end
54
+ return ____exports
@@ -0,0 +1,3 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /** Returns a set containing every valid trinket type in the game, including modded items. */
3
+ export declare function getTrinketSet(): Set<TrinketType | int>;
@@ -0,0 +1,28 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ require("lualib_bundle");
3
+ local ____exports = {}
4
+ local ____trinkets = require("functions.trinkets")
5
+ local getMaxTrinketID = ____trinkets.getMaxTrinketID
6
+ local ____util = require("functions.util")
7
+ local copySet = ____util.copySet
8
+ local TRINKET_SET = __TS__New(Set)
9
+ local function initSet(self)
10
+ local itemConfig = Isaac.GetItemConfig()
11
+ do
12
+ local trinketType = 1
13
+ while trinketType <= getMaxTrinketID(nil) do
14
+ local itemConfigTrinket = itemConfig:GetTrinket(trinketType)
15
+ if itemConfigTrinket ~= nil then
16
+ TRINKET_SET:add(trinketType)
17
+ end
18
+ trinketType = trinketType + 1
19
+ end
20
+ end
21
+ end
22
+ function ____exports.getTrinketSet(self)
23
+ if TRINKET_SET.size == 0 then
24
+ initSet(nil)
25
+ end
26
+ return copySet(nil, TRINKET_SET)
27
+ end
28
+ return ____exports
@@ -1,27 +1,4 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export interface TrinketSituation {
3
- trinketTypeRemoved: TrinketType | int;
4
- trinket1: TrinketType | int;
5
- trinket2: TrinketType | int;
6
- numSmeltedTrinkets: int;
7
- }
8
- /**
9
- * Helper function to temporarily remove a trinket from the player. Use this in combination with the
10
- * `giveTrinketBack` function to take away and give back a trinket on the same frame. This function
11
- * correctly handles multiple trinket slots and ensures that all copies of the trinket are removed,
12
- * including smelted trinkets.
13
- *
14
- * Note that for simplicity, this function assumes that all smelted trinkets are non-golden.
15
- *
16
- * @returns Null if the player does not have the trinket, or TrinketSituation if they do.
17
- */
18
- export declare function temporarilyRemoveTrinkets(player: EntityPlayer, trinketType: TrinketType): TrinketSituation | undefined;
19
- /**
20
- * Helper function to restore the player's trinkets back to the way they were before the
21
- * `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
22
- * removed.
23
- */
24
- export declare function giveTrinketsBack(player: EntityPlayer, trinketSituation: TrinketSituation | undefined): void;
25
2
  export declare function getMaxTrinketID(): int;
26
3
  /** Helper function to get all of the collectible entities in the room. */
27
4
  export declare function getTrinkets(matchingSubType?: number): EntityPickup[];
@@ -35,5 +12,4 @@ export declare function getTrinkets(matchingSubType?: number): EntityPickup[];
35
12
  * ```
36
13
  */
37
14
  export declare function getTrinketName(trinketType: TrinketType | int): string;
38
- /** Returns a set containing every valid trinket type in the game, including modded items. */
39
- export declare function getTrinketSet(): Set<TrinketType | int>;
15
+ export declare function isGoldenTrinket(trinketType: TrinketType | int): boolean;
@@ -5,57 +5,6 @@ local ____constants = require("constants")
5
5
  local GOLDEN_TRINKET_SHIFT = ____constants.GOLDEN_TRINKET_SHIFT
6
6
  local ____trinketNameMap = require("trinketNameMap")
7
7
  local TRINKET_NAME_MAP = ____trinketNameMap.TRINKET_NAME_MAP
8
- local ____util = require("functions.util")
9
- local copySet = ____util.copySet
10
- function ____exports.temporarilyRemoveTrinkets(self, player, trinketType)
11
- if not player:HasTrinket(trinketType) then
12
- return nil
13
- end
14
- local trinket1 = player:GetTrinket(0)
15
- local trinket2 = player:GetTrinket(1)
16
- local numTrinkets = 0
17
- while player:HasTrinket(trinketType) do
18
- player:TryRemoveTrinket(trinketType)
19
- numTrinkets = numTrinkets + 1
20
- end
21
- local numSmeltedTrinkets = numTrinkets
22
- local trinketWasInSlot1 = (trinket1 == trinketType) or ((trinket1 + GOLDEN_TRINKET_SHIFT) == trinketType)
23
- if trinketWasInSlot1 then
24
- numSmeltedTrinkets = numSmeltedTrinkets - 1
25
- end
26
- local trinketWasInSlot2 = (trinket2 == trinketType) or ((trinket2 + GOLDEN_TRINKET_SHIFT) == trinketType)
27
- if trinketWasInSlot2 then
28
- numSmeltedTrinkets = numSmeltedTrinkets - 1
29
- end
30
- return {trinketTypeRemoved = trinketType, trinket1 = trinket1, trinket2 = trinket2, numSmeltedTrinkets = numSmeltedTrinkets}
31
- end
32
- function ____exports.giveTrinketsBack(self, player, trinketSituation)
33
- if trinketSituation == nil then
34
- return
35
- end
36
- local trinket1 = player:GetTrinket(0)
37
- local trinket2 = player:GetTrinket(1)
38
- if trinket1 ~= TrinketType.TRINKET_NULL then
39
- player:TryRemoveTrinket(trinket1)
40
- end
41
- if trinket2 ~= TrinketType.TRINKET_NULL then
42
- player:TryRemoveTrinket(trinket2)
43
- end
44
- do
45
- local i = 0
46
- while i < trinketSituation.numSmeltedTrinkets do
47
- player:AddTrinket(trinketSituation.trinketTypeRemoved, false)
48
- player:UseActiveItem(CollectibleType.COLLECTIBLE_SMELTER, UseFlag.USE_NOANIM)
49
- i = i + 1
50
- end
51
- end
52
- if trinketSituation.trinket1 ~= TrinketType.TRINKET_NULL then
53
- player:AddTrinket(trinketSituation.trinket1, false)
54
- end
55
- if trinketSituation.trinket2 ~= TrinketType.TRINKET_NULL then
56
- player:AddTrinket(trinketSituation.trinket2, false)
57
- end
58
- end
59
8
  function ____exports.getMaxTrinketID(self)
60
9
  local itemConfig = Isaac.GetItemConfig()
61
10
  return itemConfig:GetTrinkets().Size - 1
@@ -90,24 +39,7 @@ function ____exports.getTrinketName(self, trinketType)
90
39
  end
91
40
  return itemConfigItem.Name
92
41
  end
93
- local TRINKET_SET = __TS__New(Set)
94
- local function initSet(self)
95
- local itemConfig = Isaac.GetItemConfig()
96
- do
97
- local trinketType = 1
98
- while trinketType <= ____exports.getMaxTrinketID(nil) do
99
- local itemConfigTrinket = itemConfig:GetTrinket(trinketType)
100
- if itemConfigTrinket ~= nil then
101
- TRINKET_SET:add(trinketType)
102
- end
103
- trinketType = trinketType + 1
104
- end
105
- end
106
- end
107
- function ____exports.getTrinketSet(self)
108
- if TRINKET_SET.size == 0 then
109
- initSet(nil)
110
- end
111
- return copySet(nil, TRINKET_SET)
42
+ function ____exports.isGoldenTrinket(self, trinketType)
43
+ return trinketType > GOLDEN_TRINKET_SHIFT
112
44
  end
113
45
  return ____exports
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from "./functions/bitwise";
12
12
  export * from "./functions/card";
13
13
  export * from "./functions/charge";
14
14
  export * from "./functions/collectibles";
15
+ export * from "./functions/collectibleSet";
15
16
  export * from "./functions/color";
16
17
  export { deepCopy } from "./functions/deepCopy";
17
18
  export { deepCopyTests } from "./functions/deepCopyTests";
@@ -36,7 +37,9 @@ export * from "./functions/sprite";
36
37
  export * from "./functions/stage";
37
38
  export * from "./functions/tears";
38
39
  export * from "./functions/transformations";
40
+ export * from "./functions/trinketGive";
39
41
  export * from "./functions/trinkets";
42
+ export * from "./functions/trinketSet";
40
43
  export * from "./functions/ui";
41
44
  export * from "./functions/util";
42
45
  export * from "./functions/vector";
package/dist/index.lua CHANGED
@@ -113,6 +113,14 @@ do
113
113
  end
114
114
  end
115
115
  end
116
+ do
117
+ local ____export = require("functions.collectibleSet")
118
+ for ____exportKey, ____exportValue in pairs(____export) do
119
+ if ____exportKey ~= "default" then
120
+ ____exports[____exportKey] = ____exportValue
121
+ end
122
+ end
123
+ end
116
124
  do
117
125
  local ____export = require("functions.color")
118
126
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -299,6 +307,14 @@ do
299
307
  end
300
308
  end
301
309
  end
310
+ do
311
+ local ____export = require("functions.trinketGive")
312
+ for ____exportKey, ____exportValue in pairs(____export) do
313
+ if ____exportKey ~= "default" then
314
+ ____exports[____exportKey] = ____exportValue
315
+ end
316
+ end
317
+ end
302
318
  do
303
319
  local ____export = require("functions.trinkets")
304
320
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -307,6 +323,14 @@ do
307
323
  end
308
324
  end
309
325
  end
326
+ do
327
+ local ____export = require("functions.trinketSet")
328
+ for ____exportKey, ____exportValue in pairs(____export) do
329
+ if ____exportKey ~= "default" then
330
+ ____exports[____exportKey] = ____exportValue
331
+ end
332
+ end
333
+ end
310
334
  do
311
335
  local ____export = require("functions.ui")
312
336
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.444",
3
+ "version": "1.0.448",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,8 +25,8 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "isaac-typescript-definitions": "^1.0.274",
29
- "isaacscript-lint": "^1.0.65",
28
+ "isaac-typescript-definitions": "^1.0.275",
29
+ "isaacscript-lint": "^1.0.67",
30
30
  "typedoc": "^0.22.9",
31
31
  "typescript": "4.4.4",
32
32
  "typescript-to-lua": "^1.1.1"