isaacscript-common 1.0.586 → 1.0.590
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.
|
@@ -18,7 +18,7 @@ local postPlayerFatalDamageHasSubscriptions = ____postPlayerFatalDamage.postPlay
|
|
|
18
18
|
function hasSubscriptions(self)
|
|
19
19
|
return postPlayerFatalDamageHasSubscriptions(nil)
|
|
20
20
|
end
|
|
21
|
-
function entityTakeDmgPlayer(self, tookDamage, damageAmount, _damageFlags,
|
|
21
|
+
function entityTakeDmgPlayer(self, tookDamage, damageAmount, _damageFlags, damageSource, _damageCountdownFrames)
|
|
22
22
|
if not hasSubscriptions(nil) then
|
|
23
23
|
return nil
|
|
24
24
|
end
|
|
@@ -34,12 +34,16 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, _damageFlags, _dama
|
|
|
34
34
|
end
|
|
35
35
|
local game = Game()
|
|
36
36
|
local gameFrameCount = game:GetFrameCount()
|
|
37
|
+
local character = player:GetPlayerType()
|
|
37
38
|
local playerIndex = getPlayerIndex(nil, player)
|
|
38
39
|
local lastDamageFrame = v.run.playerLastDamageFrame:get(playerIndex)
|
|
39
40
|
v.run.playerLastDamageFrame:set(playerIndex, gameFrameCount)
|
|
40
41
|
if willPlayerRevive(nil, player) then
|
|
41
42
|
return nil
|
|
42
43
|
end
|
|
44
|
+
if character == PlayerType.PLAYER_JACOB_B and damageSource.Type == EntityType.ENTITY_DARK_ESAU then
|
|
45
|
+
return nil
|
|
46
|
+
end
|
|
43
47
|
if not damageIsFatal(nil, player, damageAmount, lastDamageFrame) and not hasLostCurse(nil, player) then
|
|
44
48
|
return nil
|
|
45
49
|
end
|
|
@@ -100,14 +100,18 @@ export declare function setGridEntityInvisible(gridEntity: GridEntity): void;
|
|
|
100
100
|
export declare function spawnGiantPoop(topLeftGridIndex: int): void;
|
|
101
101
|
/**
|
|
102
102
|
* Helper function to spawn a grid entity. This function assumes you want to give the grid entity a
|
|
103
|
-
* variant of 0. Use this instead of the `Isaac.GridSpawn()` method since it
|
|
104
|
-
*
|
|
103
|
+
* variant of 0. Use this instead of the `Isaac.GridSpawn()` method since it:
|
|
104
|
+
* - handles giving pits collision
|
|
105
|
+
* - removes existing grid entities on the same tile, if any
|
|
106
|
+
* - allows you to specify the grid index instead of the position
|
|
105
107
|
*/
|
|
106
108
|
export declare function spawnGridEntity(gridEntityType: GridEntityType, gridIndex: int): GridEntity;
|
|
107
109
|
/**
|
|
108
110
|
* Helper function to spawn a grid entity with a specific variant. Use this instead of the
|
|
109
|
-
* `Isaac.GridSpawn()` method since it
|
|
110
|
-
*
|
|
111
|
+
* `Isaac.GridSpawn()` method since it:
|
|
112
|
+
* - handles giving pits collision
|
|
113
|
+
* - removes existing grid entities on the same tile, if any
|
|
114
|
+
* - allows you to specify the grid index instead of the position
|
|
111
115
|
*/
|
|
112
116
|
export declare function spawnGridEntityWithVariant(gridEntityType: GridEntityType, variant: int, gridIndex: int): GridEntity;
|
|
113
117
|
/**
|
|
@@ -32,6 +32,10 @@ end
|
|
|
32
32
|
function ____exports.spawnGridEntityWithVariant(self, gridEntityType, variant, gridIndex)
|
|
33
33
|
local game = Game()
|
|
34
34
|
local room = game:GetRoom()
|
|
35
|
+
local existingGridEntity = room:GetGridEntity(gridIndex)
|
|
36
|
+
if existingGridEntity ~= nil then
|
|
37
|
+
____exports.removeGridEntity(nil, existingGridEntity)
|
|
38
|
+
end
|
|
35
39
|
local position = room:GetGridPosition(gridIndex)
|
|
36
40
|
local gridEntity = Isaac.GridSpawn(gridEntityType, variant, position, true)
|
|
37
41
|
if gridEntityType == GridEntityType.GRID_PIT then
|
|
@@ -39,6 +43,8 @@ function ____exports.spawnGridEntityWithVariant(self, gridEntityType, variant, g
|
|
|
39
43
|
if pit ~= nil then
|
|
40
44
|
pit:UpdateCollision()
|
|
41
45
|
end
|
|
46
|
+
elseif gridEntityType == GridEntityType.GRID_WALL then
|
|
47
|
+
gridEntity.CollisionClass = GridCollisionClass.COLLISION_WALL
|
|
42
48
|
end
|
|
43
49
|
return gridEntity
|
|
44
50
|
end
|
|
@@ -185,6 +191,7 @@ function ____exports.spawnGridEntity(self, gridEntityType, gridIndex)
|
|
|
185
191
|
end
|
|
186
192
|
function ____exports.spawnVoidPortal(self, gridIndex)
|
|
187
193
|
local voidPortal = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.GRID_TRAPDOOR, 1, gridIndex)
|
|
194
|
+
voidPortal.VarData = 1
|
|
188
195
|
local sprite = voidPortal:GetSprite()
|
|
189
196
|
sprite:Load("gfx/grid/voidtrapdoor.anm2", true)
|
|
190
197
|
end
|