isaacscript-common 51.3.0 → 51.5.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.
@@ -5628,6 +5628,9 @@ export declare function getFloorDisplayFlags(minimapAPI?: boolean): Map<int, Bit
5628
5628
  /**
5629
5629
  * Helper function to get the corresponding golden trinket type from a normal trinket type.
5630
5630
  *
5631
+ * If the provided trinket type is already a golden trinket type, then the trinket type will be
5632
+ * returned unmodified.
5633
+ *
5631
5634
  * For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
5632
5635
  * corresponds to the golden trinket sub-type for Swallowed Penny.
5633
5636
  */
@@ -6145,6 +6148,14 @@ export declare function getNormalPillColorFromHorse(pillColor: PillColor): PillC
6145
6148
  /** Helper function to get an array with every non-gold and non-horse pill color. */
6146
6149
  export declare function getNormalPillColors(): PillColor[];
6147
6150
 
6151
+ /**
6152
+ * Helper function to get the corresponding normal trinket type from a golden trinket type.
6153
+ *
6154
+ * If the provided trinket type is already a normal trinket type, then the trinket type will be
6155
+ * returned unmodified.
6156
+ */
6157
+ export declare function getNormalTrinketType(trinketType: TrinketType): TrinketType;
6158
+
6148
6159
  /**
6149
6160
  * Helper function to get all of the NPCs in the room.
6150
6161
  *
@@ -8109,6 +8120,12 @@ export declare function includes<T>(array: T[], element: T): boolean;
8109
8120
  */
8110
8121
  export declare function inCrawlSpace(): boolean;
8111
8122
 
8123
+ /**
8124
+ * Helper function for checking whether the current room is a crawl space with a door corresponding
8125
+ * to `DoorSlotFlag.RIGHT_0` (1 << 2).
8126
+ */
8127
+ export declare function inCrawlSpaceWithBlackMarketEntrance(): boolean;
8128
+
8112
8129
  /**
8113
8130
  * Helper type to add one to a number type.
8114
8131
  *
@@ -8703,6 +8720,12 @@ export declare function isCopyableIsaacAPIClass(object: unknown): object is Copy
8703
8720
  */
8704
8721
  export declare function isCrawlSpace(roomData: RoomConfig): boolean;
8705
8722
 
8723
+ /**
8724
+ * Helper function for checking whether the provided room is a crawl space with a door corresponding
8725
+ * to `DoorSlotFlag.RIGHT_0` (1 << 2).
8726
+ */
8727
+ export declare function isCrawlSpaceWithBlackMarketEntrance(roomData: RoomConfig): boolean;
8728
+
8706
8729
  /**
8707
8730
  * Helper function to distinguish between a normal Daddy Long Legs / Triachnid and the child entity
8708
8731
  * that is spawned when the boss does the multi-stomp attack.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 51.3.0
3
+ isaacscript-common 51.5.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -27887,6 +27887,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescri
27887
27887
  local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
27888
27888
  local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
27889
27889
  local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
27890
+ local DoorSlotFlag = ____isaac_2Dtypescript_2Ddefinitions.DoorSlotFlag
27890
27891
  local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSubType
27891
27892
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
27892
27893
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
@@ -28000,6 +28001,9 @@ end
28000
28001
  function ____exports.isCrawlSpace(self, roomData)
28001
28002
  return roomData.Type == RoomType.DUNGEON and roomData.Subtype == asNumber(nil, DungeonSubType.NORMAL)
28002
28003
  end
28004
+ function ____exports.isCrawlSpaceWithBlackMarketEntrance(self, roomData)
28005
+ return ____exports.isCrawlSpace(nil, roomData) and hasFlag(nil, roomData.Doors, DoorSlotFlag.RIGHT_0)
28006
+ end
28003
28007
  function ____exports.isDeathCertificateArea(self, roomData)
28004
28008
  return roomData.StageID == StageID.HOME and (roomData.Subtype == asNumber(nil, HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE) or roomData.Subtype == asNumber(nil, HomeRoomSubType.DEATH_CERTIFICATE_ITEMS))
28005
28009
  end
@@ -28130,6 +28134,10 @@ function ____exports.inCrawlSpace(self)
28130
28134
  local roomData = getRoomData(nil)
28131
28135
  return ____exports.isCrawlSpace(nil, roomData)
28132
28136
  end
28137
+ function ____exports.inCrawlSpaceWithBlackMarketEntrance(self)
28138
+ local roomData = getRoomData(nil)
28139
+ return ____exports.isCrawlSpaceWithBlackMarketEntrance(nil, roomData)
28140
+ end
28133
28141
  function ____exports.inDeathCertificateArea(self)
28134
28142
  local roomData = getRoomData(nil)
28135
28143
  return ____exports.isDeathCertificateArea(nil, roomData)
@@ -28253,12 +28261,12 @@ function ____exports.setRoomCleared(self)
28253
28261
  for ____, door in ipairs(getDoors(nil)) do
28254
28262
  do
28255
28263
  if isHiddenSecretRoomDoor(nil, door) then
28256
- goto __continue78
28264
+ goto __continue80
28257
28265
  end
28258
28266
  openDoorFast(nil, door)
28259
28267
  door.ExtraVisible = false
28260
28268
  end
28261
- ::__continue78::
28269
+ ::__continue80::
28262
28270
  end
28263
28271
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
28264
28272
  game:ShakeScreen(0)
@@ -29740,6 +29748,7 @@ return ____exports
29740
29748
  end,
29741
29749
  ["src.functions.trinkets"] = function(...)
29742
29750
  local ____exports = {}
29751
+ local GOLDEN_TRINKET_ADJUSTMENT
29743
29752
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
29744
29753
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
29745
29754
  local ____cachedClasses = require("src.core.cachedClasses")
@@ -29768,15 +29777,18 @@ local ____sprites = require("src.functions.sprites")
29768
29777
  local clearSprite = ____sprites.clearSprite
29769
29778
  local ____types = require("src.functions.types")
29770
29779
  local asNumber = ____types.asNumber
29780
+ function ____exports.isGoldenTrinketType(self, trinketType)
29781
+ return asNumber(nil, trinketType) > GOLDEN_TRINKET_ADJUSTMENT
29782
+ end
29771
29783
  function ____exports.isVanillaTrinketType(self, trinketType)
29772
29784
  return trinketType <= LAST_VANILLA_TRINKET_TYPE
29773
29785
  end
29774
- local GOLDEN_TRINKET_ADJUSTMENT = 32768
29786
+ GOLDEN_TRINKET_ADJUSTMENT = 32768
29775
29787
  local NUM_MYSTERIOUS_PAPER_EFFECTS = getEnumLength(nil, MysteriousPaperEffect)
29776
29788
  local TRINKET_ANM2_PATH = "gfx/005.350_trinket.anm2"
29777
29789
  local TRINKET_SPRITE_LAYER = 0
29778
29790
  function ____exports.getGoldenTrinketType(self, trinketType)
29779
- return asNumber(nil, trinketType) + GOLDEN_TRINKET_ADJUSTMENT
29791
+ return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType or asNumber(nil, trinketType) + GOLDEN_TRINKET_ADJUSTMENT
29780
29792
  end
29781
29793
  function ____exports.getMysteriousPaperEffectForFrame(self, player, frameCount)
29782
29794
  if frameCount == nil then
@@ -29787,6 +29799,9 @@ function ____exports.getMysteriousPaperEffectForFrame(self, player, frameCount)
29787
29799
  end
29788
29800
  return frameCount % NUM_MYSTERIOUS_PAPER_EFFECTS
29789
29801
  end
29802
+ function ____exports.getNormalTrinketType(self, trinketType)
29803
+ return ____exports.isGoldenTrinketType(nil, trinketType) and asNumber(nil, trinketType) - GOLDEN_TRINKET_ADJUSTMENT or trinketType
29804
+ end
29790
29805
  function ____exports.getTrinketDescription(self, trinketType)
29791
29806
  local trinketDescription = TRINKET_DESCRIPTION_MAP:get(trinketType)
29792
29807
  if trinketDescription ~= nil then
@@ -29816,9 +29831,6 @@ function ____exports.getTrinketName(self, trinketType)
29816
29831
  end
29817
29832
  return DEFAULT_TRINKET_NAME
29818
29833
  end
29819
- function ____exports.isGoldenTrinketType(self, trinketType)
29820
- return asNumber(nil, trinketType) > GOLDEN_TRINKET_ADJUSTMENT
29821
- end
29822
29834
  function ____exports.isModdedTrinketType(self, trinketType)
29823
29835
  return not ____exports.isVanillaTrinketType(nil, trinketType)
29824
29836
  end
@@ -121,6 +121,11 @@ export declare function inBossRoomOf(bossID: BossID): boolean;
121
121
  * player being in a boss fight that takes place in a dungeon.
122
122
  */
123
123
  export declare function inCrawlSpace(): boolean;
124
+ /**
125
+ * Helper function for checking whether the current room is a crawl space with a door corresponding
126
+ * to `DoorSlotFlag.RIGHT_0` (1 << 2).
127
+ */
128
+ export declare function inCrawlSpaceWithBlackMarketEntrance(): boolean;
124
129
  /**
125
130
  * Helper function to detect if the current room is one of the rooms in the Death Certificate area.
126
131
  */
@@ -241,6 +246,11 @@ export declare function isBossRoomOf(roomData: RoomConfig, bossID: BossID): bool
241
246
  * the player being in a boss fight that takes place in a dungeon.
242
247
  */
243
248
  export declare function isCrawlSpace(roomData: RoomConfig): boolean;
249
+ /**
250
+ * Helper function for checking whether the provided room is a crawl space with a door corresponding
251
+ * to `DoorSlotFlag.RIGHT_0` (1 << 2).
252
+ */
253
+ export declare function isCrawlSpaceWithBlackMarketEntrance(roomData: RoomConfig): boolean;
244
254
  /**
245
255
  * Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
246
256
  */
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAOT,SAAS,EACT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBA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,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEvE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAOzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,UAAU,GACrB,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAO1D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,UAAU,EACpB,GAAG,UAAU,EAAE,SAAS,EAAE,GACzB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -15,6 +15,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
15
15
  local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
16
16
  local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
17
17
  local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
18
+ local DoorSlotFlag = ____isaac_2Dtypescript_2Ddefinitions.DoorSlotFlag
18
19
  local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSubType
19
20
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
20
21
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
@@ -159,6 +160,11 @@ end
159
160
  function ____exports.isCrawlSpace(self, roomData)
160
161
  return roomData.Type == RoomType.DUNGEON and roomData.Subtype == asNumber(nil, DungeonSubType.NORMAL)
161
162
  end
163
+ --- Helper function for checking whether the provided room is a crawl space with a door corresponding
164
+ -- to `DoorSlotFlag.RIGHT_0` (1 << 2).
165
+ function ____exports.isCrawlSpaceWithBlackMarketEntrance(self, roomData)
166
+ return ____exports.isCrawlSpace(nil, roomData) and hasFlag(nil, roomData.Doors, DoorSlotFlag.RIGHT_0)
167
+ end
162
168
  --- Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
163
169
  function ____exports.isDeathCertificateArea(self, roomData)
164
170
  return roomData.StageID == StageID.HOME and (roomData.Subtype == asNumber(nil, HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE) or roomData.Subtype == asNumber(nil, HomeRoomSubType.DEATH_CERTIFICATE_ITEMS))
@@ -388,6 +394,12 @@ function ____exports.inCrawlSpace(self)
388
394
  local roomData = getRoomData(nil)
389
395
  return ____exports.isCrawlSpace(nil, roomData)
390
396
  end
397
+ --- Helper function for checking whether the current room is a crawl space with a door corresponding
398
+ -- to `DoorSlotFlag.RIGHT_0` (1 << 2).
399
+ function ____exports.inCrawlSpaceWithBlackMarketEntrance(self)
400
+ local roomData = getRoomData(nil)
401
+ return ____exports.isCrawlSpaceWithBlackMarketEntrance(nil, roomData)
402
+ end
391
403
  --- Helper function to detect if the current room is one of the rooms in the Death Certificate area.
392
404
  function ____exports.inDeathCertificateArea(self)
393
405
  local roomData = getRoomData(nil)
@@ -577,12 +589,12 @@ function ____exports.setRoomCleared(self)
577
589
  for ____, door in ipairs(getDoors(nil)) do
578
590
  do
579
591
  if isHiddenSecretRoomDoor(nil, door) then
580
- goto __continue78
592
+ goto __continue80
581
593
  end
582
594
  openDoorFast(nil, door)
583
595
  door.ExtraVisible = false
584
596
  end
585
- ::__continue78::
597
+ ::__continue80::
586
598
  end
587
599
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
588
600
  game:ShakeScreen(0)
@@ -4,6 +4,9 @@ import { MysteriousPaperEffect } from "../enums/MysteriousPaperEffect";
4
4
  /**
5
5
  * Helper function to get the corresponding golden trinket type from a normal trinket type.
6
6
  *
7
+ * If the provided trinket type is already a golden trinket type, then the trinket type will be
8
+ * returned unmodified.
9
+ *
7
10
  * For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
8
11
  * corresponds to the golden trinket sub-type for Swallowed Penny.
9
12
  */
@@ -29,6 +32,13 @@ export declare function getGoldenTrinketType(trinketType: TrinketType): TrinketT
29
32
  * Default is the current frame.
30
33
  */
31
34
  export declare function getMysteriousPaperEffectForFrame(player: EntityPlayer, frameCount?: int): MysteriousPaperEffect | undefined;
35
+ /**
36
+ * Helper function to get the corresponding normal trinket type from a golden trinket type.
37
+ *
38
+ * If the provided trinket type is already a normal trinket type, then the trinket type will be
39
+ * returned unmodified.
40
+ */
41
+ export declare function getNormalTrinketType(trinketType: TrinketType): TrinketType;
32
42
  /**
33
43
  * Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
34
44
  * trinket type was not valid.
@@ -1 +1 @@
1
- {"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AA8BvE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CA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WAAW,GAAG,WAAW,CAI1E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,YAAY,EACpB,UAAU,CAAC,EAAE,GAAG,GACf,qBAAqB,GAAG,SAAS,CAUnC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAI1E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAc/D;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,CAYjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAiBN;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ local GOLDEN_TRINKET_ADJUSTMENT
2
3
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
4
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
4
5
  local ____cachedClasses = require("src.core.cachedClasses")
@@ -27,24 +28,25 @@ local ____sprites = require("src.functions.sprites")
27
28
  local clearSprite = ____sprites.clearSprite
28
29
  local ____types = require("src.functions.types")
29
30
  local asNumber = ____types.asNumber
31
+ function ____exports.isGoldenTrinketType(self, trinketType)
32
+ return asNumber(nil, trinketType) > GOLDEN_TRINKET_ADJUSTMENT
33
+ end
30
34
  function ____exports.isVanillaTrinketType(self, trinketType)
31
35
  return trinketType <= LAST_VANILLA_TRINKET_TYPE
32
36
  end
33
- --- Add this to a `TrinketType` to get the corresponding golden trinket type.
34
- --
35
- -- Corresponds to the vanilla `PillColor.TRINKET_GOLDEN_FLAG` value.
36
- --
37
- -- 1 << 15
38
- local GOLDEN_TRINKET_ADJUSTMENT = 32768
37
+ GOLDEN_TRINKET_ADJUSTMENT = 32768
39
38
  local NUM_MYSTERIOUS_PAPER_EFFECTS = getEnumLength(nil, MysteriousPaperEffect)
40
39
  local TRINKET_ANM2_PATH = "gfx/005.350_trinket.anm2"
41
40
  local TRINKET_SPRITE_LAYER = 0
42
41
  --- Helper function to get the corresponding golden trinket type from a normal trinket type.
43
42
  --
43
+ -- If the provided trinket type is already a golden trinket type, then the trinket type will be
44
+ -- returned unmodified.
45
+ --
44
46
  -- For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
45
47
  -- corresponds to the golden trinket sub-type for Swallowed Penny.
46
48
  function ____exports.getGoldenTrinketType(self, trinketType)
47
- return asNumber(nil, trinketType) + GOLDEN_TRINKET_ADJUSTMENT
49
+ return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType or asNumber(nil, trinketType) + GOLDEN_TRINKET_ADJUSTMENT
48
50
  end
49
51
  --- Helper function to get the current effect that the Mysterious Paper trinket is providing to the
50
52
  -- player. Returns undefined if the player does not have the Mysterious Paper trinket.
@@ -73,6 +75,13 @@ function ____exports.getMysteriousPaperEffectForFrame(self, player, frameCount)
73
75
  end
74
76
  return frameCount % NUM_MYSTERIOUS_PAPER_EFFECTS
75
77
  end
78
+ --- Helper function to get the corresponding normal trinket type from a golden trinket type.
79
+ --
80
+ -- If the provided trinket type is already a normal trinket type, then the trinket type will be
81
+ -- returned unmodified.
82
+ function ____exports.getNormalTrinketType(self, trinketType)
83
+ return ____exports.isGoldenTrinketType(nil, trinketType) and asNumber(nil, trinketType) - GOLDEN_TRINKET_ADJUSTMENT or trinketType
84
+ end
76
85
  --- Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
77
86
  -- trinket type was not valid.
78
87
  --
@@ -118,9 +127,6 @@ function ____exports.getTrinketName(self, trinketType)
118
127
  end
119
128
  return DEFAULT_TRINKET_NAME
120
129
  end
121
- function ____exports.isGoldenTrinketType(self, trinketType)
122
- return asNumber(nil, trinketType) > GOLDEN_TRINKET_ADJUSTMENT
123
- end
124
130
  function ____exports.isModdedTrinketType(self, trinketType)
125
131
  return not ____exports.isVanillaTrinketType(nil, trinketType)
126
132
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "51.3.0",
3
+ "version": "51.5.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -8,6 +8,7 @@ import {
8
8
  AngelRoomSubType,
9
9
  Dimension,
10
10
  DoorSlot,
11
+ DoorSlotFlag,
11
12
  DownpourRoomSubType,
12
13
  DungeonSubType,
13
14
  GridRoom,
@@ -327,6 +328,15 @@ export function inCrawlSpace(): boolean {
327
328
  return isCrawlSpace(roomData);
328
329
  }
329
330
 
331
+ /**
332
+ * Helper function for checking whether the current room is a crawl space with a door corresponding
333
+ * to `DoorSlotFlag.RIGHT_0` (1 << 2).
334
+ */
335
+ export function inCrawlSpaceWithBlackMarketEntrance(): boolean {
336
+ const roomData = getRoomData();
337
+ return isCrawlSpaceWithBlackMarketEntrance(roomData);
338
+ }
339
+
330
340
  /**
331
341
  * Helper function to detect if the current room is one of the rooms in the Death Certificate area.
332
342
  */
@@ -579,6 +589,18 @@ export function isCrawlSpace(roomData: RoomConfig): boolean {
579
589
  );
580
590
  }
581
591
 
592
+ /**
593
+ * Helper function for checking whether the provided room is a crawl space with a door corresponding
594
+ * to `DoorSlotFlag.RIGHT_0` (1 << 2).
595
+ */
596
+ export function isCrawlSpaceWithBlackMarketEntrance(
597
+ roomData: RoomConfig,
598
+ ): boolean {
599
+ return (
600
+ isCrawlSpace(roomData) && hasFlag(roomData.Doors, DoorSlotFlag.RIGHT_0)
601
+ );
602
+ }
603
+
582
604
  /**
583
605
  * Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
584
606
  */
@@ -36,11 +36,16 @@ const TRINKET_SPRITE_LAYER = 0;
36
36
  /**
37
37
  * Helper function to get the corresponding golden trinket type from a normal trinket type.
38
38
  *
39
+ * If the provided trinket type is already a golden trinket type, then the trinket type will be
40
+ * returned unmodified.
41
+ *
39
42
  * For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
40
43
  * corresponds to the golden trinket sub-type for Swallowed Penny.
41
44
  */
42
45
  export function getGoldenTrinketType(trinketType: TrinketType): TrinketType {
43
- return asNumber(trinketType) + GOLDEN_TRINKET_ADJUSTMENT;
46
+ return isGoldenTrinketType(trinketType)
47
+ ? trinketType
48
+ : asNumber(trinketType) + GOLDEN_TRINKET_ADJUSTMENT;
44
49
  }
45
50
 
46
51
  /**
@@ -78,6 +83,18 @@ export function getMysteriousPaperEffectForFrame(
78
83
  return frameCount % NUM_MYSTERIOUS_PAPER_EFFECTS;
79
84
  }
80
85
 
86
+ /**
87
+ * Helper function to get the corresponding normal trinket type from a golden trinket type.
88
+ *
89
+ * If the provided trinket type is already a normal trinket type, then the trinket type will be
90
+ * returned unmodified.
91
+ */
92
+ export function getNormalTrinketType(trinketType: TrinketType): TrinketType {
93
+ return isGoldenTrinketType(trinketType)
94
+ ? asNumber(trinketType) - GOLDEN_TRINKET_ADJUSTMENT
95
+ : trinketType;
96
+ }
97
+
81
98
  /**
82
99
  * Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
83
100
  * trinket type was not valid.