isaacscript-common 9.2.1 → 9.4.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.
Files changed (37) hide show
  1. package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +4 -2
  2. package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts.map +1 -1
  3. package/dist/callbacks/subscriptions/postGridEntityCollision.lua +8 -0
  4. package/dist/callbacks/subscriptions/postGridEntityCustomCollision.d.ts +4 -2
  5. package/dist/callbacks/subscriptions/postGridEntityCustomCollision.d.ts.map +1 -1
  6. package/dist/callbacks/subscriptions/postGridEntityCustomCollision.lua +8 -0
  7. package/dist/core/constants.d.ts +2 -0
  8. package/dist/core/constants.d.ts.map +1 -1
  9. package/dist/core/constants.lua +2 -0
  10. package/dist/enums/ModCallbackCustom.d.ts +52 -26
  11. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  12. package/dist/features/customStage/customStageGridEntities.d.ts +4 -4
  13. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  14. package/dist/features/customStage/customStageGridEntities.lua +4 -4
  15. package/dist/functions/effects.d.ts +1 -1
  16. package/dist/functions/effects.d.ts.map +1 -1
  17. package/dist/functions/effects.lua +1 -1
  18. package/dist/functions/entities.d.ts +4 -0
  19. package/dist/functions/entities.d.ts.map +1 -1
  20. package/dist/functions/entities.lua +4 -0
  21. package/dist/functions/entityTypes.d.ts +1 -1
  22. package/dist/functions/entityTypes.d.ts.map +1 -1
  23. package/dist/functions/entityTypes.lua +1 -1
  24. package/dist/functions/pickupVariants.d.ts +11 -11
  25. package/dist/functions/pickupVariants.d.ts.map +1 -1
  26. package/dist/functions/pickupVariants.lua +11 -11
  27. package/dist/index.d.ts +78 -41
  28. package/package.json +2 -2
  29. package/src/callbacks/subscriptions/postGridEntityCollision.ts +21 -1
  30. package/src/callbacks/subscriptions/postGridEntityCustomCollision.ts +25 -2
  31. package/src/core/constants.ts +3 -0
  32. package/src/enums/ModCallbackCustom.ts +52 -26
  33. package/src/features/customStage/customStageGridEntities.ts +4 -4
  34. package/src/functions/effects.ts +1 -1
  35. package/src/functions/entities.ts +4 -0
  36. package/src/functions/entityTypes.ts +1 -1
  37. package/src/functions/pickupVariants.ts +11 -11
@@ -25,7 +25,7 @@ import {
25
25
  import { DEFAULT_BASE_STAGE } from "./exports";
26
26
  import v from "./v";
27
27
 
28
- /** For `GridEntityType.DECORATION` (1) */
28
+ /** For `GridEntityType.DECORATION` (1). */
29
29
  export function setCustomDecorationGraphics(
30
30
  customStage: CustomStage,
31
31
  gridEntity: GridEntity,
@@ -71,7 +71,7 @@ export function setCustomDecorationGraphics(
71
71
  }
72
72
  }
73
73
 
74
- /** For `GridEntityType.ROCK` (2) */
74
+ /** For `GridEntityType.ROCK` (2). */
75
75
  export function setCustomRockGraphics(
76
76
  customStage: CustomStage,
77
77
  gridEntity: GridEntity,
@@ -134,7 +134,7 @@ export function setCustomRockGraphics(
134
134
  }
135
135
  }
136
136
 
137
- /** For `GridEntityType.PIT` (7) */
137
+ /** For `GridEntityType.PIT` (7). */
138
138
  export function setCustomPitGraphics(
139
139
  customStage: CustomStage,
140
140
  gridEntity: GridEntity,
@@ -164,7 +164,7 @@ export function setCustomPitGraphics(
164
164
  }
165
165
  }
166
166
 
167
- /** For GridEntityType.DOOR (16) */
167
+ /** For `GridEntityType.DOOR` (16). */
168
168
  export function setCustomDoorGraphics(
169
169
  customStage: CustomStage,
170
170
  gridEntity: GridEntity,
@@ -1,6 +1,6 @@
1
1
  import { inRectangle } from "./math";
2
2
 
3
- /** For `EntityType.EFFECT` (1000), `EffectVariant.DICE_FLOOR` (76) */
3
+ /** For `EntityType.EFFECT` (1000), `EffectVariant.DICE_FLOOR` (76). */
4
4
  export const DICE_FLOOR_TRIGGER_SQUARE_SIZE = 75;
5
5
 
6
6
  /** Helper function to see if a player is close enough to activate a Dice Room floor. */
@@ -234,6 +234,10 @@ export function getFilteredNewEntities<T extends AnyEntity>(
234
234
  /**
235
235
  * Helper function to measure an entity's velocity to see if it is moving.
236
236
  *
237
+ * Use this helper function over checking if the velocity length is equal to 0 because entities can
238
+ * look like they are completely immobile but yet still have a non zero velocity. Thus, using a
239
+ * threshold is needed.
240
+ *
237
241
  * @param entity The entity whose velocity to measure.
238
242
  * @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
239
243
  */
@@ -1,6 +1,6 @@
1
1
  import { EntityType } from "isaac-typescript-definitions";
2
2
 
3
- /** For `EntityType.SLOT` (6) */
3
+ /** For `EntityType.SLOT` (6). */
4
4
  export function isSlot(entity: Entity): entity is EntitySlot {
5
5
  return entity.Type === EntityType.SLOT;
6
6
  }
@@ -2,59 +2,59 @@
2
2
 
3
3
  import { PickupVariant } from "isaac-typescript-definitions";
4
4
 
5
- /** For `PickupVariant.HEART` (10) */
5
+ /** For `PickupVariant.HEART` (10). */
6
6
  export function isHeart(pickup: EntityPickup): pickup is EntityPickupHeart {
7
7
  return pickup.Variant === PickupVariant.HEART;
8
8
  }
9
9
 
10
- /** For `PickupVariant.COIN` (20) */
10
+ /** For `PickupVariant.COIN` (20). */
11
11
  export function isCoin(pickup: EntityPickup): pickup is EntityPickupCoin {
12
12
  return pickup.Variant === PickupVariant.COIN;
13
13
  }
14
14
 
15
- /** For `PickupVariant.KEY` (30) */
15
+ /** For `PickupVariant.KEY` (30). */
16
16
  export function isKey(pickup: EntityPickup): pickup is EntityPickupKey {
17
17
  return pickup.Variant === PickupVariant.KEY;
18
18
  }
19
19
 
20
- /** For `PickupVariant.BOMB` (40) */
20
+ /** For `PickupVariant.BOMB` (40). */
21
21
  export function isBombPickup(pickup: EntityPickup): pickup is EntityPickupBomb {
22
22
  return pickup.Variant === PickupVariant.BOMB;
23
23
  }
24
24
 
25
- /** For `PickupVariant.POOP` (42) */
25
+ /** For `PickupVariant.POOP` (42). */
26
26
  export function isPoopPickup(pickup: EntityPickup): pickup is EntityPickupPoop {
27
27
  return pickup.Variant === PickupVariant.POOP;
28
28
  }
29
29
 
30
- /** For `PickupVariant.SACK` (69) */
30
+ /** For `PickupVariant.SACK` (69). */
31
31
  export function isSack(pickup: EntityPickup): pickup is EntityPickupSack {
32
32
  return pickup.Variant === PickupVariant.SACK;
33
33
  }
34
34
 
35
- /** For `PickupVariant.PILL` (70) */
35
+ /** For `PickupVariant.PILL` (70). */
36
36
  export function isPill(pickup: EntityPickup): pickup is EntityPickupPill {
37
37
  return pickup.Variant === PickupVariant.PILL;
38
38
  }
39
39
 
40
- /** For `PickupVariant.LIL_BATTERY` (90) */
40
+ /** For `PickupVariant.LIL_BATTERY` (90). */
41
41
  export function isBattery(pickup: EntityPickup): pickup is EntityPickupBattery {
42
42
  return pickup.Variant === PickupVariant.LIL_BATTERY;
43
43
  }
44
44
 
45
- /** For `PickupVariant.COLLECTIBLE` (100) */
45
+ /** For `PickupVariant.COLLECTIBLE` (100). */
46
46
  export function isCollectible(
47
47
  pickup: EntityPickup,
48
48
  ): pickup is EntityPickupCollectible {
49
49
  return pickup.Variant === PickupVariant.COLLECTIBLE;
50
50
  }
51
51
 
52
- /** For `PickupVariant.TAROT_CARD` (300) */
52
+ /** For `PickupVariant.TAROT_CARD` (300). */
53
53
  export function isCardPickup(pickup: EntityPickup): pickup is EntityPickupCard {
54
54
  return pickup.Variant === PickupVariant.TAROT_CARD;
55
55
  }
56
56
 
57
- /** For `PickupVariant.TRINKET` (350) */
57
+ /** For `PickupVariant.TRINKET` (350). */
58
58
  export function isTrinket(pickup: EntityPickup): pickup is EntityPickupTrinket {
59
59
  return pickup.Variant === PickupVariant.TRINKET;
60
60
  }