isaacscript-common 33.0.0 → 33.0.1

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.
@@ -5004,7 +5004,10 @@ export declare function getCollectibleTags(collectibleOrCollectibleType: EntityP
5004
5004
  * Gets the entities that have a hitbox that overlaps with any part of the square that the grid
5005
5005
  * entity is on.
5006
5006
  *
5007
- * Note that this function will not work properly in the `POST_NEW_ROOM` callback, since entities do
5007
+ * This function is useful because the vanilla collision callbacks do not work with grid entities.
5008
+ * This is used by `POST_GRID_ENTITY_COLLISION` custom callback.
5009
+ *
5010
+ * Note that this function will not work properly in the `POST_NEW_ROOM` callback since entities do
5008
5011
  * not have collision yet in that callback.
5009
5012
  */
5010
5013
  export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): Entity[];
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 33.0.0
3
+ isaacscript-common 33.0.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -28326,6 +28326,12 @@ function ____exports.spawnGiantPoop(self, topLeftGridIndex)
28326
28326
  local topRightGridIndex = topLeftGridIndex + 1
28327
28327
  local bottomLeftGridIndex = topLeftGridIndex + gridWidth
28328
28328
  local bottomRightGridIndex = bottomLeftGridIndex + 1
28329
+ for ____, gridIndex in ipairs({topLeftGridIndex, topRightGridIndex, bottomLeftGridIndex, bottomRightGridIndex}) do
28330
+ local gridEntity = room:GetGridEntity(gridIndex)
28331
+ if gridEntity ~= nil then
28332
+ return false
28333
+ end
28334
+ end
28329
28335
  local topLeft = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIANT_TOP_LEFT, topLeftGridIndex)
28330
28336
  local topRight = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIANT_TOP_RIGHT, topRightGridIndex)
28331
28337
  local bottomLeft = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIANT_BOTTOM_LEFT, bottomLeftGridIndex)
@@ -26,7 +26,10 @@ export declare function getAllGridIndexes(): int[];
26
26
  * Gets the entities that have a hitbox that overlaps with any part of the square that the grid
27
27
  * entity is on.
28
28
  *
29
- * Note that this function will not work properly in the `POST_NEW_ROOM` callback, since entities do
29
+ * This function is useful because the vanilla collision callbacks do not work with grid entities.
30
+ * This is used by `POST_GRID_ENTITY_COLLISION` custom callback.
31
+ *
32
+ * Note that this function will not work properly in the `POST_NEW_ROOM` callback since entities do
30
33
  * not have collision yet in that callback.
31
34
  */
32
35
  export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): Entity[];
@@ -1 +1 @@
1
- {"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAGL,cAAc,EAIf,MAAM,8BAA8B,CAAC;AAUtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAgC1D;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,GAAG,GACxB,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,SAAS,CAqBnC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,OAAO,SAAK,GACX,OAAO,CAiBT;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,EAAE,CAKzC;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,UAAU,GACrB,MAAM,EAAE,CAoBV;AAED,qFAAqF;AACrF,wBAAgB,+BAA+B,CAC7C,YAAY,EAAE,YAAY,GACzB,CAAC,cAAc,EA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UAAU,EAAE,CAiBd;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,cAAc,EAAE,cAAc,EAAE,GAClC,UAAU,EAAE,CAYd;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,MAAM,EAAE,EAClB,UAAU,EAAE,UAAU,GACrB,IAAI,CAON;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,aAAa,EACxD,YAAY,EAAE,CAAC,EAAE,EACjB,UAAU,EAAE,OAAO,EACnB,GAAG,CAAC,EAAE,GAAG,GACR,CAAC,EAAE,CAoBL;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,qBAAqB,EAAE,UAAU,GAAG,GAAG,EACvC,UAAU,EAAE,OAAO,GAClB,IAAI,CAqCN;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAwD7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAExB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAgCxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAkBtE"}
@@ -217,7 +217,10 @@ end
217
217
  --- Gets the entities that have a hitbox that overlaps with any part of the square that the grid
218
218
  -- entity is on.
219
219
  --
220
- -- Note that this function will not work properly in the `POST_NEW_ROOM` callback, since entities do
220
+ -- This function is useful because the vanilla collision callbacks do not work with grid entities.
221
+ -- This is used by `POST_GRID_ENTITY_COLLISION` custom callback.
222
+ --
223
+ -- Note that this function will not work properly in the `POST_NEW_ROOM` callback since entities do
221
224
  -- not have collision yet in that callback.
222
225
  function ____exports.getCollidingEntitiesWithGridEntity(self, gridEntity)
223
226
  local topLeft, bottomRight = table.unpack(____exports.getGridEntityCollisionPoints(nil, gridEntity))
@@ -563,6 +566,12 @@ function ____exports.spawnGiantPoop(self, topLeftGridIndex)
563
566
  local topRightGridIndex = topLeftGridIndex + 1
564
567
  local bottomLeftGridIndex = topLeftGridIndex + gridWidth
565
568
  local bottomRightGridIndex = bottomLeftGridIndex + 1
569
+ for ____, gridIndex in ipairs({topLeftGridIndex, topRightGridIndex, bottomLeftGridIndex, bottomRightGridIndex}) do
570
+ local gridEntity = room:GetGridEntity(gridIndex)
571
+ if gridEntity ~= nil then
572
+ return false
573
+ end
574
+ end
566
575
  local topLeft = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIANT_TOP_LEFT, topLeftGridIndex)
567
576
  local topRight = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIANT_TOP_RIGHT, topRightGridIndex)
568
577
  local bottomLeft = ____exports.spawnGridEntityWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIANT_BOTTOM_LEFT, bottomLeftGridIndex)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "33.0.0",
3
+ "version": "33.0.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -125,7 +125,10 @@ export function getAllGridIndexes(): int[] {
125
125
  * Gets the entities that have a hitbox that overlaps with any part of the square that the grid
126
126
  * entity is on.
127
127
  *
128
- * Note that this function will not work properly in the `POST_NEW_ROOM` callback, since entities do
128
+ * This function is useful because the vanilla collision callbacks do not work with grid entities.
129
+ * This is used by `POST_GRID_ENTITY_COLLISION` custom callback.
130
+ *
131
+ * Note that this function will not work properly in the `POST_NEW_ROOM` callback since entities do
129
132
  * not have collision yet in that callback.
130
133
  */
131
134
  export function getCollidingEntitiesWithGridEntity(
@@ -692,6 +695,19 @@ export function spawnGiantPoop(topLeftGridIndex: int): boolean {
692
695
  const bottomLeftGridIndex = topLeftGridIndex + gridWidth;
693
696
  const bottomRightGridIndex = bottomLeftGridIndex + 1;
694
697
 
698
+ // First, check to see if all of the tiles are open.
699
+ for (const gridIndex of [
700
+ topLeftGridIndex,
701
+ topRightGridIndex,
702
+ bottomLeftGridIndex,
703
+ bottomRightGridIndex,
704
+ ]) {
705
+ const gridEntity = room.GetGridEntity(gridIndex);
706
+ if (gridEntity !== undefined) {
707
+ return false;
708
+ }
709
+ }
710
+
695
711
  const topLeft = spawnGridEntityWithVariant(
696
712
  GridEntityType.POOP,
697
713
  PoopGridEntityVariant.GIANT_TOP_LEFT,