isaacscript-common 4.8.0 → 4.8.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.
|
@@ -16,6 +16,12 @@ 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
|
+
/**
|
|
20
|
+
* Helper function to see if the player is out of health.
|
|
21
|
+
*
|
|
22
|
+
* Specifically, this function will return false if the player has 0 red hearts, 0 soul/black
|
|
23
|
+
* hearts, and 0 bone hearts.
|
|
24
|
+
*/
|
|
19
25
|
export declare function playerHasHealthLeft(player: EntityPlayer): boolean;
|
|
20
26
|
export declare function removeAllPlayerHealth(player: EntityPlayer): void;
|
|
21
27
|
/**
|
|
@@ -340,10 +340,14 @@ function ____exports.playerConvertSoulHeartsToBlackHearts(self, player)
|
|
|
340
340
|
)
|
|
341
341
|
____exports.setPlayerHealth(nil, player, playerHealth)
|
|
342
342
|
end
|
|
343
|
+
--- Helper function to see if the player is out of health.
|
|
344
|
+
--
|
|
345
|
+
-- Specifically, this function will return false if the player has 0 red hearts, 0 soul/black
|
|
346
|
+
-- hearts, and 0 bone hearts.
|
|
343
347
|
function ____exports.playerHasHealthLeft(self, player)
|
|
344
348
|
local hearts = player:GetHearts()
|
|
345
349
|
local soulHearts = player:GetSoulHearts()
|
|
346
350
|
local boneHearts = player:GetBoneHearts()
|
|
347
|
-
return hearts
|
|
351
|
+
return hearts > 0 or soulHearts > 0 or boneHearts > 0
|
|
348
352
|
end
|
|
349
353
|
return ____exports
|