isaacscript-common 30.3.0 → 30.4.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "30.3.0",
3
+ "version": "30.4.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -134,9 +134,15 @@ export function hideRoomOnMinimap(roomGridIndex: int): void {
134
134
  }
135
135
  }
136
136
 
137
- /** Helper function to check if a given room is visible on the minimap. */
138
- export function isRoomVisible(roomGridIndex: int): boolean {
139
- const roomDisplayFlags = getRoomDisplayFlags(roomGridIndex);
137
+ /**
138
+ * Helper function to check if a given room is visible on the minimap.
139
+ *
140
+ * @param roomGridIndex The room to check.
141
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
142
+ * true.
143
+ */
144
+ export function isRoomVisible(roomGridIndex: int, minimapAPI = true): boolean {
145
+ const roomDisplayFlags = getRoomDisplayFlags(roomGridIndex, minimapAPI);
140
146
  return roomDisplayFlags !== DisplayFlagZero;
141
147
  }
142
148
 
@@ -608,14 +608,14 @@ export function setPlayerHealth(
608
608
  /**
609
609
  * Fill in the red heart containers.
610
610
  *
611
- * (Rotten Hearts must be filled in first in order for this to work properly, since they conflict
612
- * with half red hearts.)
611
+ * Rotten Hearts must be filled in first in order for this to work properly, since they conflict
612
+ * with half red hearts.
613
613
  *
614
- * The `EntityPlayer.AddRottenHearts` method is not like actually picking up a rotten heart, since
615
- * it will only grant one rotten heart to Tainted Magdalene (whereas picking up a rotten heart
616
- * would grant two).
614
+ * We multiply by two because the `EntityPlayer.GetRottenHearts` function returns the actual
615
+ * number of rotten hearts, but the `EntityPlayer.AddRottenHearts` works like the other heart
616
+ * functions in that a value of 1 is equivalent to a half-heart.
617
617
  */
618
- player.AddRottenHearts(playerHealth.rottenHearts);
618
+ player.AddRottenHearts(playerHealth.rottenHearts * 2);
619
619
 
620
620
  if (character === PlayerType.MAGDALENE_B) {
621
621
  // Adding 1 heart to Tainted Magdalene will actually add two hearts.