isaacscript-common 1.2.128 → 1.2.131

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 defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
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 = defaultMapGetPlayer(nil, v.run.playersLastDamageGameFrame, player)
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(DefaultMap, nil)}}
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)
@@ -119,16 +119,21 @@ export declare function setGridEntityInvisible(gridEntity: GridEntity): void;
119
119
  */
120
120
  export declare function spawnGiantPoop(topLeftGridIndex: int): void;
121
121
  /**
122
- * Helper function to spawn a grid entity. This function assumes you want to give the grid entity a
123
- * variant of 0. Use this instead of the `Isaac.GridSpawn()` method since it:
122
+ * Helper function to spawn a grid entity.
123
+ *
124
+ * This function assumes you want to give the grid entity a variant of 0. If you want to specify a
125
+ * variant, use the `spawnGridEntityWithVariant` helper function instead.
126
+ *
127
+ * Use this instead of the `Isaac.GridSpawn()` method since it:
124
128
  * - handles giving pits collision
125
129
  * - removes existing grid entities on the same tile, if any
126
130
  * - allows you to specify the grid index instead of the position
127
131
  */
128
132
  export declare function spawnGridEntity(gridEntityType: GridEntityType, gridIndex: int): GridEntity | undefined;
129
133
  /**
130
- * Helper function to spawn a grid entity with a specific variant. Use this instead of the
131
- * `Isaac.GridSpawn()` method since it:
134
+ * Helper function to spawn a grid entity with a specific variant.
135
+ *
136
+ * Use this instead of the `Isaac.GridSpawn()` method since it:
132
137
  * - handles giving pits collision
133
138
  * - removes existing grid entities on the same tile, if any
134
139
  * - allows you to specify the grid index instead of the position
@@ -79,7 +79,8 @@ function ____exports.getPlayerIndex(self, player, differentiateForgottenAndSoul)
79
79
  if differentiateForgottenAndSoul == nil then
80
80
  differentiateForgottenAndSoul = false
81
81
  end
82
- local isSubPlayer = player:IsSubPlayer()
82
+ local character = player:GetPlayerType()
83
+ local isSubPlayer = player:IsSubPlayer() and character ~= PlayerType.PLAYER_LAZARUS2_B
83
84
  local ____isSubPlayer_0
84
85
  if isSubPlayer then
85
86
  ____isSubPlayer_0 = ____exports.getSubPlayerParent(nil, 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 | null): boolean;
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.128",
3
+ "version": "1.2.131",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "devDependencies": {
28
28
  "@zamiell/typescript-to-lua": "^1.4.2",
29
- "isaac-typescript-definitions": "^1.0.361",
29
+ "isaac-typescript-definitions": "^1.0.362",
30
30
  "isaacscript-lint": "^1.0.84",
31
31
  "isaacscript-tsconfig": "^1.1.8",
32
32
  "typedoc": "^0.22.13",