isaacscript-common 1.2.116 → 1.2.117

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.
@@ -218,7 +218,7 @@ export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPl
218
218
  * This function does not validate whether or not the provided player is Tainted Magdalene; that
219
219
  * should be accomplished before invoking this function.
220
220
  */
221
- export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): 4 | 6;
221
+ export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): number;
222
222
  /**
223
223
  * Helper function to return the active charge and the battery charge combined. This is useful
224
224
  * because you are not able to set the battery charge directly.
@@ -504,8 +504,10 @@ function ____exports.getSoulHearts(self, player)
504
504
  return soulHearts - blackHearts
505
505
  end
506
506
  function ____exports.getTaintedMagdaleneNonTemporaryMaxHearts(self, player)
507
+ local maxHearts = player:GetMaxHearts()
507
508
  local hasBirthright = player:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT)
508
- return hasBirthright and 6 or 4
509
+ local maxNonTemporaryMaxHearts = hasBirthright and 6 or 4
510
+ return math.min(maxHearts, maxNonTemporaryMaxHearts)
509
511
  end
510
512
  function ____exports.getTotalCharge(self, player, activeSlot)
511
513
  local activeCharge = player:GetActiveCharge(activeSlot)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.116",
3
+ "version": "1.2.117",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",