isaacscript-common 1.0.587 → 1.0.588
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.
|
@@ -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
|