isaacscript-common 1.2.111 → 1.2.114

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.
@@ -15,9 +15,9 @@ import { JSONRoom } from "../types/JSONRoom";
15
15
  * deployJSONRoom(firstJSONRoom);
16
16
  * ```
17
17
  * @param seed Optional. Specifies the seed that will be used for spawning every entity in the room.
18
- * Equal to `Random()` by default.
18
+ * Default is `Random()`.
19
19
  * @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
20
- * what the function is doing. False by default.
20
+ * what the function is doing. Default is false.
21
21
  * @returns Before using the seed for spawning each entity, it is iterated with `nextSeed()`. The
22
22
  * function returns the final iterated seed after spawning everything, which can be used in
23
23
  * subsequent room deployments.
@@ -43,9 +43,9 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom, seed?: number, verbos
43
43
  * deployRandomJSONRoom(jsonRooms);
44
44
  * ```
45
45
  * @param seed Optional. Specifies the seed that will be used for determining the random room. After
46
- * that, it is also used for spawning every entity in the room. Equal to `Random()` by default.
46
+ * that, it is also used for spawning every entity in the room. Default is `Random()`.
47
47
  * @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
48
- * what the function is doing. False by default.
48
+ * what the function is doing. Default is false.
49
49
  * @returns Before using the seed for spawning each entity, it is iterated with `nextSeed()`. The
50
50
  * function returns the final iterated seed after spawning everything, which can be used in
51
51
  * subsequent room deployments.
@@ -59,6 +59,6 @@ export declare function deployRandomJSONRoom(jsonRooms: JSONRoom[], seed?: numbe
59
59
  *
60
60
  * @param fillWithDecorations Optional. Set to true to fill every grid tile with an invisible
61
61
  * decoration, which prevents vanilla entities in the room from respawning the next time that the
62
- * player enters. False by default.
62
+ * player enters. Default is false.
63
63
  */
64
64
  export declare function emptyRoom(fillWithDecorations: boolean): void;
@@ -67,7 +67,7 @@ export declare function arrayRemoveInPlace<T>(array: T[], ...elementsToRemove: T
67
67
  * Helper function to get a random element from the provided array.
68
68
  *
69
69
  * @param array The array to get an element from.
70
- * @param seed Optional. The seed used to select the random element. `Random()` by default.
70
+ * @param seed Optional. The seed used to select the random element. Default is `Random()`.
71
71
  * @param exceptions Optional. An array of elements to skip over if selected.
72
72
  */
73
73
  export declare function getRandomArrayElement<T>(array: T[] | readonly T[], seed?: number, exceptions?: T[] | readonly T[]): T;
@@ -76,7 +76,7 @@ export declare function getRandomArrayElement<T>(array: T[] | readonly T[], seed
76
76
  * decided, it is then removed from the array (in-place).
77
77
  *
78
78
  * @param array The array to get an element from.
79
- * @param seed Optional. The seed used to select the random element. `Random()` by default.
79
+ * @param seed Optional. The seed used to select the random element. Default is `Random()`.
80
80
  * @param exceptions Optional. An array of elements to skip over if selected.
81
81
  */
82
82
  export declare function getRandomArrayElementAndRemove<T>(array: T[], seed?: number, exceptions?: T[] | readonly T[]): T;
@@ -37,13 +37,13 @@ export declare function getMaxCards(): int;
37
37
  * - any objects like Dice Shard
38
38
  * - any modded cards.
39
39
  *
40
- * @param seed Optional. The seed with which to select the random card. `Random()` by default.
40
+ * @param seed Optional. The seed with which to select the random card. Default is `Random()`.
41
41
  * @param exceptions Optional. An array of cards to not select.
42
42
  */
43
43
  export declare function getRandomCard(seed?: number, exceptions?: Card[]): Card;
44
44
  /**
45
45
  * @param cardType The card type that represents the pool of cards to select from.
46
- * @param seed Optional. The seed with which to select the random card. `Random()` by default.
46
+ * @param seed Optional. The seed with which to select the random card. Default is `Random()`.
47
47
  * @param exceptions Optional. An array of cards to not select.
48
48
  */
49
49
  export declare function getRandomCardOfType(cardType: CardType, seed?: number, exceptions?: Card[]): Card;
@@ -51,7 +51,7 @@ export declare function getRandomCardOfType(cardType: CardType, seed?: number, e
51
51
  * Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul of
52
52
  * Isaac, etc.). This will never return a Rune Shard.
53
53
  *
54
- * @param seed Optional. The seed with which to select the random rune. `Random()` by default.
54
+ * @param seed Optional. The seed with which to select the random rune. Default is `Random()`.
55
55
  * @param exceptions Optional. An array of runes to not select.
56
56
  */
57
57
  export declare function getRandomRune(seed?: number, exceptions?: Card[]): Card;
@@ -9,7 +9,7 @@
9
9
  * - AAA Battery
10
10
  *
11
11
  * @param ignoreBigRoomDoubleCharge Optional. If set to true, it will treat the current room as a
12
- * 1x1 room for the purposes of calculating how much charge to grant. False by default.
12
+ * 1x1 room for the purposes of calculating how much charge to grant. Default is false.
13
13
  */
14
14
  export declare function addRoomClearCharges(ignoreBigRoomDoubleCharge?: boolean): void;
15
15
  /**
@@ -23,7 +23,7 @@ export declare function addRoomClearCharges(ignoreBigRoomDoubleCharge?: boolean)
23
23
  *
24
24
  * @param player The player to grant the charges to.
25
25
  * @param ignoreBigRoomDoubleCharge Optional. If set to true, it will treat the current room as a
26
- * 1x1 room for the purposes of calculating how much charge to grant. False by default.
26
+ * 1x1 room for the purposes of calculating how much charge to grant. Default is false.
27
27
  */
28
28
  export declare function addRoomClearCharge(player: EntityPlayer, ignoreBigRoomDoubleCharge?: boolean): void;
29
29
  /**
@@ -38,7 +38,7 @@ export declare function addRoomClearCharge(player: EntityPlayer, ignoreBigRoomDo
38
38
  * @param player The player to grant the charges to.
39
39
  * @param activeSlot The active item slot to grant the charges to.
40
40
  * @param ignoreBigRoomDoubleCharge Optional. If set to true, it will treat the current room as a
41
- * 1x1 room for the purposes of calculating how much charge to grant. False by default.
41
+ * 1x1 room for the purposes of calculating how much charge to grant. Default is false.
42
42
  */
43
43
  export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot: ActiveSlot, ignoreBigRoomDoubleCharge?: boolean): void;
44
44
  export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot: ActiveSlot): void;
@@ -20,8 +20,8 @@ export declare enum SerializationType {
20
20
  *
21
21
  * @param oldObject The object to copy.
22
22
  * @param serializationType Has 3 possible values. Can leave TypeScriptToLua objects as-is, or can
23
- * serialize objects to Lua tables, or can deserialize Lua tables to objects. Will perform no
24
- * serialization by default.
23
+ * serialize objects to Lua tables, or can deserialize Lua tables to objects. Defaults to
24
+ * `SerializationType.NONE`.
25
25
  * @param traversalDescription Used to track the current key that we are operating on.
26
26
  */
27
27
  export declare function deepCopy(oldObject: LuaTable | Map<AnyNotNil, unknown> | Set<AnyNotNil>, serializationType?: SerializationType, traversalDescription?: string): LuaTable | Map<AnyNotNil, unknown> | Set<AnyNotNil>;
@@ -6,10 +6,10 @@ export declare function anyEntityCloserThan(entities: Entity[], position: Vector
6
6
  * `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
7
7
  * enemies.
8
8
  *
9
- * @param entityType -1 by default.
10
- * @param variant -1 by default.
11
- * @param subType -1 by default.
12
- * @param ignoreFriendly False by default.
9
+ * @param entityType Default is -1.
10
+ * @param variant Default is -1.
11
+ * @param subType Default is -1.
12
+ * @param ignoreFriendly Default is false.
13
13
  */
14
14
  export declare function countEntities(entityType?: EntityType | int, variant?: number, subType?: number, ignoreFriendly?: boolean): number;
15
15
  /**
@@ -50,7 +50,7 @@ export declare function getFilteredNewEntities<T extends AnyEntity>(oldEntities:
50
50
  * @param matchingVariant Optional. If specified, will only return NPCs that match this variant.
51
51
  * @param matchingSubType Optional. If specified, will only return NPCs that match this sub-type.
52
52
  * @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
53
- * returned. False by default. Will only be taken into account if `matchingEntityType` is specified.
53
+ * returned. Default is false. Will only be taken into account if `matchingEntityType` is specified.
54
54
  */
55
55
  export declare function getEntities(matchingEntityType?: EntityType | int, matchingVariant?: number, matchingSubType?: number, ignoreFriendly?: boolean): Entity[];
56
56
  /** Helper function to return a string containing an entity's type, variant, and sub-type. */
@@ -59,7 +59,7 @@ export declare function getEntityID(entity: Entity): string;
59
59
  * Helper function to measure an entity's velocity to see if it is moving.
60
60
  *
61
61
  * @param entity The entity whose velocity to measure.
62
- * @param threshold Optional. The threshold from 0 to consider to be moving. 0.01 by default.
62
+ * @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
63
63
  */
64
64
  export declare function isEntityMoving(entity: Entity, threshold?: number): boolean;
65
65
  /**
@@ -80,9 +80,9 @@ export declare function removeEntities(entities: Entity[], cap?: int): boolean;
80
80
  * Helper function to remove all of the matching entities in the room.
81
81
  *
82
82
  * @param entityType The entity type to match.
83
- * @param entityVariant Optional. The variant to match. -1 by default (which will match every
83
+ * @param entityVariant Optional. The variant to match. Default is -1 (which will match every
84
84
  * variant).
85
- * @param entitySubType Optional. The sub-type to match. -1 by default (which will match every
85
+ * @param entitySubType Optional. The sub-type to match. Default is -1 (which will match every
86
86
  * sub-type).
87
87
  * @param cap Optional. If specified, will only remove the given amount of collectibles.
88
88
  * @returns True if one or more entities was removed, false otherwise.
@@ -100,7 +100,7 @@ export declare function removeAllMatchingGridEntities(...gridEntityType: GridEnt
100
100
  *
101
101
  * @param gridEntity The grid entity to remove.
102
102
  * @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
103
- * True by default. This is generally a good idea because if the room is not updated, you will be
103
+ * Default is true. This is generally a good idea because if the room is not updated, you will be
104
104
  * unable to spawn another grid entity on the same tile until a frame has passed. However, doing
105
105
  * this is expensive, since it involves a call to `Isaac.GetRoomEntities()`, so set it to false if
106
106
  * you need to invoke this function multiple times.
@@ -38,6 +38,7 @@ export declare function logColor(this: void, color: Color): void;
38
38
  export declare function logEntity(this: void, entity: Entity): void;
39
39
  export declare function logKColor(this: void, kColor: KColor): void;
40
40
  export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
41
+ export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
41
42
  /** Helper function for printing out information about the current room. */
42
43
  export declare function logRoom(this: void): void;
43
44
  export declare function logTable(this: void, table: unknown, parentTables?: number): void;
@@ -14,6 +14,9 @@ local ____flag = require("functions.flag")
14
14
  local hasFlag = ____flag.hasFlag
15
15
  local ____player = require("functions.player")
16
16
  local getEffectsList = ____player.getEffectsList
17
+ local getPlayerName = ____player.getPlayerName
18
+ local ____playerHealth = require("functions.playerHealth")
19
+ local getPlayerHealth = ____playerHealth.getPlayerHealth
17
20
  local ____rooms = require("functions.rooms")
18
21
  local getRoomData = ____rooms.getRoomData
19
22
  local getRoomGridIndex = ____rooms.getRoomGridIndex
@@ -130,6 +133,22 @@ function ____exports.logMap(map)
130
133
  end
131
134
  ____exports.log("The size of the map was: " .. tostring(map.size))
132
135
  end
136
+ function ____exports.logPlayerHealth(player)
137
+ local playerName = getPlayerName(nil, player)
138
+ local playerHealth = getPlayerHealth(nil, player)
139
+ ____exports.log(("Player health for " .. playerName) .. ":")
140
+ ____exports.log("- Max hearts: " .. tostring(playerHealth.maxHearts))
141
+ ____exports.log("- Hearts: " .. tostring(playerHealth.hearts))
142
+ ____exports.log("- Eternal hearts: " .. tostring(playerHealth.eternalHearts))
143
+ ____exports.log("- Soul hearts: " .. tostring(playerHealth.soulHearts))
144
+ ____exports.log("- Bone hearts: " .. tostring(playerHealth.boneHearts))
145
+ ____exports.log("- Golden hearts: " .. tostring(playerHealth.goldenHearts))
146
+ ____exports.log("- Rotten hearts: " .. tostring(playerHealth.rottenHearts))
147
+ ____exports.log("- Broken hearts: " .. tostring(playerHealth.brokenHearts))
148
+ ____exports.log("- Soul charges: " .. tostring(playerHealth.soulCharges))
149
+ ____exports.log("- Blood charges: " .. tostring(playerHealth.bloodCharges))
150
+ ____exports.log(("- Soul heart types: [" .. table.concat(playerHealth.soulHeartTypes, "," or ",")) .. "]")
151
+ end
133
152
  function ____exports.logRoom()
134
153
  local roomGridIndex = getRoomGridIndex(nil)
135
154
  local roomListIndex = getRoomListIndex(nil)
@@ -6,10 +6,10 @@
6
6
  * @param npc The NPC to fire the projectile from.
7
7
  * @param position The staring position of the projectile.
8
8
  * @param velocity The starting velocity of the projectile.
9
- * @param projectilesMode The mode of the projectile. Optional. Equal to
10
- * `ProjectilesMode.ONE_PROJECTILE` by default.
11
- * @param projectileParams The parameters of the projectile. Optional. Equal to `ProjectileParams()`
12
- * by default.
9
+ * @param projectilesMode The mode of the projectile. Optional. Default is
10
+ * `ProjectilesMode.ONE_PROJECTILE`.
11
+ * @param projectileParams The parameters of the projectile. Optional. Default is
12
+ * `ProjectileParams()`.
13
13
  * @returns The fired projectile.
14
14
  */
15
15
  export declare function fireProjectiles(npc: EntityNPC, position: Vector, velocity: Vector, projectilesMode?: ProjectilesMode, projectileParams?: ProjectileParams): EntityProjectile[];
@@ -183,7 +183,7 @@ export declare function getPlayerNumHitsRemaining(player: EntityPlayer): int;
183
183
  * If this is not desired, use the `getAllPlayers` helper function instead.
184
184
  *
185
185
  * @param performCharacterExclusions Whether or not to exclude characters that are not directly
186
- * controlled by the player (i.e. Esau & Tainted Soul). False by default.
186
+ * controlled by the player (i.e. Esau & Tainted Soul). Default is false.
187
187
  */
188
188
  export declare function getPlayers(performCharacterExclusions?: boolean): EntityPlayer[];
189
189
  /**
@@ -208,6 +208,17 @@ export declare function getSoulHearts(player: EntityPlayer): int;
208
208
  * return undefined.
209
209
  */
210
210
  export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPlayer | undefined;
211
+ /**
212
+ * Helper function to determine how many heart containers that Tainted Magdalene has that will not
213
+ * be automatically depleted over time. By default, this is 2, but this function will return 4 so
214
+ * that it is consistent with the `player.GetHearts` and `player.GetMaxHearts` methods.
215
+ *
216
+ * If Tainted Magdalene has Birthright, she will gained an additional non-temporary heart container.
217
+ *
218
+ * This function does not validate whether or not the provided player is Tainted Magdalene; that
219
+ * should be accomplished before invoking this function.
220
+ */
221
+ export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): 4 | 6;
211
222
  /**
212
223
  * Helper function to return the active charge and the battery charge combined. This is useful
213
224
  * because you are not able to set the battery charge directly.
@@ -293,7 +304,7 @@ export declare function removeTrinketCostume(player: EntityPlayer, trinketType:
293
304
  * @param activeSlot The slot to set.
294
305
  * @param charge Optional. The argument of charges to set. If not specified, the item will be set
295
306
  * with maximum charges.
296
- * @param keepInPools Optional. Whether or not to remove the item from pools. False by default.
307
+ * @param keepInPools Optional. Whether or not to remove the item from pools. Default is false.
297
308
  */
298
309
  export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot, charge?: int, keepInPools?: boolean): void;
299
310
  /**
@@ -303,7 +314,7 @@ export declare function setActiveItem(player: EntityPlayer, collectibleType: Col
303
314
  *
304
315
  * @param player The player to apply or remove the blindfold state from.
305
316
  * @param enabled Whether or not to apply or remove the blindfold.
306
- * @param modifyCostume Optional. Whether to add or remove the blindfold costume. True by default.
317
+ * @param modifyCostume Optional. Whether to add or remove the blindfold costume. Default is true.
307
318
  */
308
319
  export declare function setBlindfold(player: EntityPlayer, enabled: boolean, modifyCostume?: boolean): void;
309
320
  /**
@@ -503,6 +503,10 @@ function ____exports.getSoulHearts(self, player)
503
503
  local blackHearts = ____exports.getBlackHearts(nil, player)
504
504
  return soulHearts - blackHearts
505
505
  end
506
+ function ____exports.getTaintedMagdaleneNonTemporaryMaxHearts(self, player)
507
+ local hasBirthright = player:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT)
508
+ return hasBirthright and 6 or 4
509
+ end
506
510
  function ____exports.getTotalCharge(self, player, activeSlot)
507
511
  local activeCharge = player:GetActiveCharge(activeSlot)
508
512
  local batteryCharge = player:GetBatteryCharge(activeSlot)
@@ -597,9 +601,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
597
601
  itemPool:RemoveCollectible(collectibleType)
598
602
  end
599
603
  repeat
600
- local ____switch127 = activeSlot
601
- local ____cond127 = ____switch127 == ActiveSlot.SLOT_PRIMARY
602
- if ____cond127 then
604
+ local ____switch128 = activeSlot
605
+ local ____cond128 = ____switch128 == ActiveSlot.SLOT_PRIMARY
606
+ if ____cond128 then
603
607
  do
604
608
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
605
609
  player:RemoveCollectible(primaryCollectibleType)
@@ -608,8 +612,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
608
612
  break
609
613
  end
610
614
  end
611
- ____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_SECONDARY
612
- if ____cond127 then
615
+ ____cond128 = ____cond128 or ____switch128 == ActiveSlot.SLOT_SECONDARY
616
+ if ____cond128 then
613
617
  do
614
618
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
615
619
  player:RemoveCollectible(primaryCollectibleType)
@@ -624,16 +628,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
624
628
  break
625
629
  end
626
630
  end
627
- ____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_POCKET
628
- if ____cond127 then
631
+ ____cond128 = ____cond128 or ____switch128 == ActiveSlot.SLOT_POCKET
632
+ if ____cond128 then
629
633
  do
630
634
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
631
635
  player:SetActiveCharge(charge, activeSlot)
632
636
  break
633
637
  end
634
638
  end
635
- ____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_POCKET2
636
- if ____cond127 then
639
+ ____cond128 = ____cond128 or ____switch128 == ActiveSlot.SLOT_POCKET2
640
+ if ____cond128 then
637
641
  do
638
642
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
639
643
  break
@@ -6,6 +6,7 @@ local ____exports = {}
6
6
  local ____constants = require("constants")
7
7
  local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
8
8
  function ____exports.removeAllPlayerHealth(self, player)
9
+ local character = player:GetPlayerType()
9
10
  local goldenHearts = player:GetGoldenHearts()
10
11
  local eternalHearts = player:GetEternalHearts()
11
12
  local boneHearts = player:GetBoneHearts()
@@ -16,6 +17,13 @@ function ____exports.removeAllPlayerHealth(self, player)
16
17
  player:AddBrokenHearts(brokenHearts * -1)
17
18
  player:AddMaxHearts(MAX_PLAYER_HEART_CONTAINERS * -2, true)
18
19
  player:AddSoulHearts(MAX_PLAYER_HEART_CONTAINERS * -2)
20
+ if character == PlayerType.PLAYER_THESOUL then
21
+ local forgotten = player:GetSubPlayer()
22
+ if forgotten ~= nil then
23
+ local forgottenBoneHearts = forgotten:GetBoneHearts()
24
+ forgotten:AddBoneHearts(forgottenBoneHearts * -1)
25
+ end
26
+ end
19
27
  end
20
28
  function ____exports.getPlayerHealth(self, player)
21
29
  local character = player:GetPlayerType()
@@ -67,7 +75,6 @@ function ____exports.getPlayerHealth(self, player)
67
75
  end
68
76
  end
69
77
  return {
70
- soulHeartTypes = soulHeartTypes,
71
78
  maxHearts = maxHearts,
72
79
  hearts = hearts,
73
80
  eternalHearts = eternalHearts,
@@ -77,7 +84,8 @@ function ____exports.getPlayerHealth(self, player)
77
84
  rottenHearts = rottenHearts,
78
85
  brokenHearts = brokenHearts,
79
86
  soulCharges = soulCharges,
80
- bloodCharges = bloodCharges
87
+ bloodCharges = bloodCharges,
88
+ soulHeartTypes = soulHeartTypes
81
89
  }
82
90
  end
83
91
  function ____exports.setPlayerHealth(self, player, playerHealth)
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @param startingPosition The position to start searching from. If this position is not overlapping
10
10
  * with anything, then it will be returned.
11
- * @param avoidActiveEntities Optional. False by default.
11
+ * @param avoidActiveEntities Optional. Default is false.
12
12
  */
13
13
  export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean): Vector;
14
14
  /**
@@ -22,20 +22,20 @@ export declare function getCurrentRoomDescriptorReadOnly(): RoomDescriptorReadOn
22
22
  /**
23
23
  * Helper function to get the room data for the provided room.
24
24
  *
25
- * @param roomGridIndex Optional. Equal to the current room index by default.
25
+ * @param roomGridIndex Optional. Default is the current room index.
26
26
  */
27
27
  export declare function getRoomData(roomGridIndex?: int): RoomConfig | undefined;
28
28
  /**
29
29
  * Helper function for getting the type of the room with the given grid index.
30
30
  *
31
- * @param roomGridIndex Optional. Equal to the current room index by default.
31
+ * @param roomGridIndex Optional. Default is the current room index.
32
32
  * @returns The room data type. Returns -1 if the type was not found.
33
33
  */
34
34
  export declare function getRoomType(roomGridIndex?: int): RoomType;
35
35
  /**
36
36
  * Helper function to get the descriptor for a room.
37
37
  *
38
- * @param roomGridIndex Optional. Equal to the current room index by default.
38
+ * @param roomGridIndex Optional. Default is the current room index.
39
39
  */
40
40
  export declare function getRoomDescriptor(roomGridIndex?: int): RoomDescriptor;
41
41
  /**
@@ -78,13 +78,13 @@ export declare function getRoomItemPoolType(): ItemPoolType;
78
78
  * Use this as an index for data structures that store data per room, since it is unique across
79
79
  * different dimensions.
80
80
  *
81
- * @param roomGridIndex Optional. Equal to the current room index by default.
81
+ * @param roomGridIndex Optional. Default is the current room index.
82
82
  */
83
83
  export declare function getRoomListIndex(roomGridIndex?: int): int;
84
84
  /**
85
85
  * Helper function to get the name of the room as it appears in the STB/XML data.
86
86
  *
87
- * @param roomGridIndex Optional. Equal to the current room index by default.
87
+ * @param roomGridIndex Optional. Default is the current room index.
88
88
  * @returns The room name. Returns "Unknown" if the type was not found.
89
89
  */
90
90
  export declare function getRoomName(roomGridIndex?: int): string;
@@ -93,7 +93,7 @@ export declare function getRoomName(roomGridIndex?: int): string;
93
93
  * correspond to the first number in the filename of the XML/STB file. For example, a Depths room
94
94
  * would have a stage ID of 7.
95
95
  *
96
- * @param roomGridIndex Optional. Equal to the current room index by default.
96
+ * @param roomGridIndex Optional. Default is the current room index.
97
97
  * @returns The room stage ID. Returns -1 if the stage ID was not found.
98
98
  */
99
99
  export declare function getRoomStageID(roomGridIndex?: int): StageID;
@@ -103,7 +103,7 @@ export declare function getRoomStageID(roomGridIndex?: int): StageID;
103
103
  * "00.special rooms.stb" file, an Angel Room with a sub-type of 0 will correspond to a normal Angel
104
104
  * Room and a sub-type of 1 will correspond to an Angel Room shop for The Stairway.
105
105
  *
106
- * @param roomGridIndex Optional. Equal to the current room index by default.
106
+ * @param roomGridIndex Optional. Default is the current room index.
107
107
  * @returns The room sub-type. Returns -1 if the sub-type was not found.
108
108
  */
109
109
  export declare function getRoomSubType(roomGridIndex?: int): int;
@@ -112,7 +112,7 @@ export declare function getRoomSubType(roomGridIndex?: int): int;
112
112
  * variant as its identifier. For example, to go to Basement room #123, you would use a console
113
113
  * command of `goto d.123` while on the Basement.
114
114
  *
115
- * @param roomGridIndex Optional. Equal to the current room index by default.
115
+ * @param roomGridIndex Optional. Default is the current room index.
116
116
  * @returns The room variant. Returns -1 if the variant was not found.
117
117
  */
118
118
  export declare function getRoomVariant(roomGridIndex?: int): int;
@@ -121,7 +121,7 @@ export declare function getRoomVariant(roomGridIndex?: int): int;
121
121
  * callback has fired (i.e. when entities are initializing and performing their first update). This
122
122
  * is because the variable is only incremented immediately before the PostNewRoom callback fires.
123
123
  *
124
- * @param roomGridIndex Optional. Equal to the current room index by default.
124
+ * @param roomGridIndex Optional. Default is the current room index.
125
125
  */
126
126
  export declare function getRoomVisitedCount(roomGridIndex?: int): int;
127
127
  /**
@@ -130,7 +130,7 @@ export declare function getRoomVisitedCount(roomGridIndex?: int): int;
130
130
  *
131
131
  * @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
132
132
  * extra-dimensional rooms are automatically be generated and can be seen when you iterate over the
133
- * `RoomList`. False by default.
133
+ * `RoomList`. Default is false.
134
134
  */
135
135
  export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
136
136
  /**
@@ -205,14 +205,14 @@ export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolea
205
205
  * Helper function to detect if the provided room was created by the Red Key item. Under the hood,
206
206
  * this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
207
207
  *
208
- * @param roomGridIndex Optional. Equal to the current room index by default.
208
+ * @param roomGridIndex Optional. Default is the current room index.
209
209
  */
210
210
  export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
211
211
  /**
212
212
  * Helper function to determine if the provided room is part of the floor layout. For
213
213
  * example, Devil Rooms and the Mega Satan room are not considered to be inside the map.
214
214
  *
215
- * @param roomGridIndex Optional. Equal to the current room index by default.
215
+ * @param roomGridIndex Optional. Default is the current room index.
216
216
  */
217
217
  export declare function isRoomInsideMap(roomGridIndex?: int): boolean;
218
218
  /**
@@ -24,7 +24,7 @@ export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: A
24
24
  * Helper function to get a random element from the provided set.
25
25
  *
26
26
  * @param set The set to get an element from.
27
- * @param seed Optional. The seed used to select the random element. `Random()` by default.
27
+ * @param seed Optional. The seed used to select the random element. Default is `Random()`.
28
28
  * @param exceptions Optional. An array of elements to skip over if selected.
29
29
  */
30
30
  export declare function getRandomSetElement<T>(set: Set<T> | ReadonlySet<T>, seed?: number, exceptions?: T[] | readonly T[]): T;
@@ -6,11 +6,11 @@
6
6
  *
7
7
  * @param collectibleType The collectible type to spawn.
8
8
  * @param position The position to spawn the collectible at.
9
- * @param seed Optional. Random() by default.
9
+ * @param seed Optional. Default is `Random()`.
10
10
  * @param options Optional. Set to true to make the collectible a "There's Options" style
11
- * collectible. False by default.
11
+ * collectible. Default is false.
12
12
  * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
13
- * Tainted Keeper. False by default.
13
+ * Tainted Keeper. Default is false.
14
14
  */
15
15
  export declare function spawnCollectible(collectibleType: CollectibleType | int, position: Vector, seed?: number, options?: boolean, forceFreeItem?: boolean): EntityPickup;
16
16
  /**
@@ -21,4 +21,4 @@ export declare function spawnCollectible(collectibleType: CollectibleType | int,
21
21
  * Instead, this function arbitrarily spawns a collectible with
22
22
  * `CollectibleType.COLLECTIBLE_SAD_ONION`, and then converts it to an empty pedestal afterward.
23
23
  */
24
- export declare function spawnEmptyCollectible(position: Vector, seed?: number): void;
24
+ export declare function spawnEmptyCollectible(position: Vector, seed?: number): EntityPickup;
@@ -60,5 +60,6 @@ function ____exports.spawnEmptyCollectible(self, position, seed)
60
60
  true
61
61
  )
62
62
  setCollectibleEmpty(nil, collectible)
63
+ return collectible
63
64
  end
64
65
  return ____exports
@@ -49,7 +49,7 @@ export declare function isGoldenTrinket(trinketType: TrinketType | int): boolean
49
49
  * @param player The player to smelt the trinkets to.
50
50
  * @param trinketType The trinket type to smelt.
51
51
  * @param numTrinkets Optional. If specified, will smelt the given number of trinkets. Use this to
52
- * avoid calling this function multiple times. 1 by default.
52
+ * avoid calling this function multiple times. Default is 1.
53
53
  */
54
54
  export declare function smeltTrinket(player: EntityPlayer, trinketType: TrinketType | int, numTrinkets?: number): void;
55
55
  export declare function trinketHasCacheFlag(trinketType: TrinketType | int, cacheFlag: CacheFlag): boolean;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export interface PlayerHealth {
3
- soulHeartTypes: HeartSubType[];
4
3
  maxHearts: int;
5
4
  hearts: int;
6
5
  eternalHearts: int;
@@ -11,4 +10,5 @@ export interface PlayerHealth {
11
10
  brokenHearts: int;
12
11
  soulCharges: int;
13
12
  bloodCharges: int;
13
+ soulHeartTypes: HeartSubType[];
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.111",
3
+ "version": "1.2.114",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -26,10 +26,10 @@
26
26
  ],
27
27
  "devDependencies": {
28
28
  "@zamiell/typescript-to-lua": "^1.4.2",
29
- "isaac-typescript-definitions": "^1.0.355",
29
+ "isaac-typescript-definitions": "^1.0.358",
30
30
  "isaacscript-lint": "^1.0.84",
31
31
  "isaacscript-tsconfig": "^1.1.8",
32
- "typedoc": "^0.22.12",
32
+ "typedoc": "^0.22.13",
33
33
  "typescript": "4.5.5"
34
34
  }
35
35
  }