isaacscript-common 1.2.128 → 1.2.129
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local Map = ____lualib.Map
|
|
3
4
|
local __TS__New = ____lualib.__TS__New
|
|
4
5
|
local ____exports = {}
|
|
5
6
|
local hasSubscriptions, entityTakeDmgPlayer, v
|
|
@@ -10,13 +11,11 @@ local saveDataManager = ____exports.saveDataManager
|
|
|
10
11
|
local ____player = require("functions.player")
|
|
11
12
|
local isChildPlayer = ____player.isChildPlayer
|
|
12
13
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
13
|
-
local
|
|
14
|
+
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
14
15
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
15
16
|
local ____revive = require("functions.revive")
|
|
16
17
|
local isDamageToPlayerFatal = ____revive.isDamageToPlayerFatal
|
|
17
18
|
local willPlayerRevive = ____revive.willPlayerRevive
|
|
18
|
-
local ____DefaultMap = require("types.DefaultMap")
|
|
19
|
-
local DefaultMap = ____DefaultMap.DefaultMap
|
|
20
19
|
local ____postPlayerFatalDamage = require("callbacks.subscriptions.postPlayerFatalDamage")
|
|
21
20
|
local postPlayerFatalDamageFire = ____postPlayerFatalDamage.postPlayerFatalDamageFire
|
|
22
21
|
local postPlayerFatalDamageHasSubscriptions = ____postPlayerFatalDamage.postPlayerFatalDamageHasSubscriptions
|
|
@@ -35,7 +34,7 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, damageFlags, damage
|
|
|
35
34
|
return nil
|
|
36
35
|
end
|
|
37
36
|
local gameFrameCount = game:GetFrameCount()
|
|
38
|
-
local lastDamageGameFrame =
|
|
37
|
+
local lastDamageGameFrame = mapGetPlayer(nil, v.run.playersLastDamageGameFrame, player)
|
|
39
38
|
mapSetPlayer(nil, v.run.playersLastDamageGameFrame, player, gameFrameCount)
|
|
40
39
|
if willPlayerRevive(nil, player) then
|
|
41
40
|
return nil
|
|
@@ -62,7 +61,7 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, damageFlags, damage
|
|
|
62
61
|
end
|
|
63
62
|
return nil
|
|
64
63
|
end
|
|
65
|
-
v = {run = {playersLastDamageGameFrame = __TS__New(
|
|
64
|
+
v = {run = {playersLastDamageGameFrame = __TS__New(Map)}}
|
|
66
65
|
function ____exports.postPlayerFatalDamageCallbackInit(self, mod)
|
|
67
66
|
saveDataManager(nil, "postPlayerFatalDamage", v)
|
|
68
67
|
mod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.ENTITY_PLAYER)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Uses the player's current health and other miscellaneous things to determine if incoming damage
|
|
4
4
|
* will be fatal.
|
|
5
5
|
*/
|
|
6
|
-
export declare function isDamageToPlayerFatal(player: EntityPlayer, damageAmount: int, damageSource: EntityRef, lastDamageGameFrame: int |
|
|
6
|
+
export declare function isDamageToPlayerFatal(player: EntityPlayer, damageAmount: int, damageSource: EntityRef, lastDamageGameFrame: int | undefined): boolean;
|
|
7
7
|
/**
|
|
8
8
|
* The `EntityPlayer.WillPlayerRevive()` function does not properly account for Mysterious Paper, so
|
|
9
9
|
* use this helper function instead for more robust revival detection.
|