isaacscript-common 1.0.607 → 1.0.608
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.
|
@@ -8,7 +8,7 @@ local ____flag = require("functions.flag")
|
|
|
8
8
|
local hasFlag = ____flag.hasFlag
|
|
9
9
|
local ____player = require("functions.player")
|
|
10
10
|
local getPlayerIndex = ____player.getPlayerIndex
|
|
11
|
-
local
|
|
11
|
+
local getPlayerNumHitsRemaining = ____player.getPlayerNumHitsRemaining
|
|
12
12
|
local ____postCursedTeleport = require("callbacks.subscriptions.postCursedTeleport")
|
|
13
13
|
local postCursedTeleportFire = ____postCursedTeleport.postCursedTeleportFire
|
|
14
14
|
local postCursedTeleportHasSubscriptions = ____postCursedTeleport.postCursedTeleportHasSubscriptions
|
|
@@ -93,8 +93,8 @@ function playerIsTeleportingFromCursedTeleport(self, player, lastDamageFrame)
|
|
|
93
93
|
if player:HasCollectible(CollectibleType.COLLECTIBLE_CURSED_EYE) then
|
|
94
94
|
return true
|
|
95
95
|
end
|
|
96
|
-
local
|
|
97
|
-
if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and
|
|
96
|
+
local numHitsRemaining = getPlayerNumHitsRemaining(nil, player)
|
|
97
|
+
if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and numHitsRemaining == 1 then
|
|
98
98
|
return true
|
|
99
99
|
end
|
|
100
100
|
return false
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
local ____exports = {}
|
|
3
3
|
local hasSubscriptions, postPEffectUpdateReordered
|
|
4
4
|
local ____player = require("functions.player")
|
|
5
|
-
local
|
|
5
|
+
local getPlayerNumHitsRemaining = ____player.getPlayerNumHitsRemaining
|
|
6
6
|
local isChildPlayer = ____player.isChildPlayer
|
|
7
7
|
local ____revive = require("functions.revive")
|
|
8
8
|
local willPlayerRevive = ____revive.willPlayerRevive
|
|
@@ -23,8 +23,8 @@ function postPEffectUpdateReordered(self, player)
|
|
|
23
23
|
end
|
|
24
24
|
local effects = player:GetEffects()
|
|
25
25
|
local berserkEffect = effects:GetCollectibleEffect(CollectibleType.COLLECTIBLE_BERSERK)
|
|
26
|
-
local
|
|
27
|
-
if berserkEffect ~= nil and berserkEffect.Cooldown == 1 and
|
|
26
|
+
local numHitsRemaining = getPlayerNumHitsRemaining(nil, player)
|
|
27
|
+
if berserkEffect ~= nil and berserkEffect.Cooldown == 1 and numHitsRemaining == 0 and not willPlayerRevive(nil, player) then
|
|
28
28
|
preBerserkDeathFire(nil, player)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -132,10 +132,15 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
|
|
|
132
132
|
*/
|
|
133
133
|
export declare function getPlayerMaxHeartContainers(player: EntityPlayer): int;
|
|
134
134
|
/**
|
|
135
|
-
* Returns the combined value of all of the player's red hearts, soul/black hearts, and bone hearts
|
|
136
|
-
*
|
|
135
|
+
* Returns the combined value of all of the player's red hearts, soul/black hearts, and bone hearts,
|
|
136
|
+
* minus the value of the player's rotten hearts.
|
|
137
|
+
*
|
|
138
|
+
* This is equivalent to the number of hits that the player can currently take, but does not take
|
|
139
|
+
* into account double damage from champion enemies and/or being on later floors. (For example, on
|
|
140
|
+
* Womb 1, players who have 1 soul heart remaining would die in 1 hit to anything, even though this
|
|
141
|
+
* function would report that they have 2 hits remaining.)
|
|
137
142
|
*/
|
|
138
|
-
export declare function
|
|
143
|
+
export declare function getPlayerNumHitsRemaining(player: EntityPlayer): int;
|
|
139
144
|
/**
|
|
140
145
|
* This function always excludes players with a non-undefined parent, since they are not real
|
|
141
146
|
* players. (e.g. the Strawman Keeper)
|
|
@@ -299,7 +299,7 @@ function ____exports.getPlayerIndexVanilla(self, playerToFind)
|
|
|
299
299
|
end
|
|
300
300
|
return nil
|
|
301
301
|
end
|
|
302
|
-
function ____exports.
|
|
302
|
+
function ____exports.getPlayerNumHitsRemaining(self, player)
|
|
303
303
|
local hearts = player:GetHearts()
|
|
304
304
|
local soulHearts = player:GetSoulHearts()
|
|
305
305
|
local boneHearts = player:GetBoneHearts()
|
|
@@ -371,7 +371,7 @@ function ____exports.isDamageToPlayerFatal(self, player, damageAmount, damageSou
|
|
|
371
371
|
if ____exports.hasLostCurse(nil, player) then
|
|
372
372
|
return true
|
|
373
373
|
end
|
|
374
|
-
local playerNumAllHearts = ____exports.
|
|
374
|
+
local playerNumAllHearts = ____exports.getPlayerNumHitsRemaining(nil, player)
|
|
375
375
|
if damageAmount < playerNumAllHearts then
|
|
376
376
|
return false
|
|
377
377
|
end
|