isaacscript-common 4.7.3 → 4.8.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.
@@ -16,6 +16,7 @@ export declare function getPlayerHealthType(player: EntityPlayer, healthType: He
16
16
  export declare function newPlayerHealth(): PlayerHealth;
17
17
  export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
18
18
  export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
19
+ export declare function playerHasHealthLeft(player: EntityPlayer): boolean;
19
20
  export declare function removeAllPlayerHealth(player: EntityPlayer): void;
20
21
  /**
21
22
  * Helper function to set a player's health to a specific state. You can use this in combination
@@ -340,4 +340,10 @@ function ____exports.playerConvertSoulHeartsToBlackHearts(self, player)
340
340
  )
341
341
  ____exports.setPlayerHealth(nil, player, playerHealth)
342
342
  end
343
+ function ____exports.playerHasHealthLeft(self, player)
344
+ local hearts = player:GetHearts()
345
+ local soulHearts = player:GetSoulHearts()
346
+ local boneHearts = player:GetBoneHearts()
347
+ return hearts == 0 and soulHearts == 0 and boneHearts == 0
348
+ end
343
349
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "4.7.3",
3
+ "version": "4.8.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",