isaacscript-common 87.5.1 → 87.6.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 (205) hide show
  1. package/dist/callbackClasses.d.ts +1 -0
  2. package/dist/callbackClasses.d.ts.map +1 -1
  3. package/dist/callbackClasses.js +5 -3
  4. package/dist/callbackClasses.lua +4 -0
  5. package/dist/callbacks.d.ts +118 -117
  6. package/dist/callbacks.d.ts.map +1 -1
  7. package/dist/callbacks.js +1 -0
  8. package/dist/callbacks.lua +1 -0
  9. package/dist/classes/ModUpgraded.js +2 -2
  10. package/dist/classes/callbacks/InputActionFilter.js +3 -3
  11. package/dist/classes/callbacks/InputActionPlayer.js +6 -6
  12. package/dist/classes/callbacks/PostBoneSwing.js +2 -2
  13. package/dist/classes/callbacks/PostCollectibleEmpty.js +2 -2
  14. package/dist/classes/callbacks/PostCursedTeleport.js +5 -5
  15. package/dist/classes/callbacks/PostDiceRoomActivated.js +2 -2
  16. package/dist/classes/callbacks/PostEntityRemoveFilter.d.ts +9 -0
  17. package/dist/classes/callbacks/PostEntityRemoveFilter.d.ts.map +1 -0
  18. package/dist/classes/callbacks/PostEntityRemoveFilter.js +21 -0
  19. package/dist/classes/callbacks/PostEntityRemoveFilter.lua +23 -0
  20. package/dist/classes/callbacks/PostGridEntityCollision.js +10 -10
  21. package/dist/classes/callbacks/PostGridEntityCustomCollision.js +8 -8
  22. package/dist/classes/callbacks/PostGridEntityCustomRemove.js +2 -2
  23. package/dist/classes/callbacks/PostGridEntityRemove.js +3 -3
  24. package/dist/classes/callbacks/PostItemDischarge.js +2 -2
  25. package/dist/classes/callbacks/PostKeyboardChanged.js +2 -2
  26. package/dist/classes/callbacks/PostNewRoomEarly.js +2 -2
  27. package/dist/classes/callbacks/PostPickupSelectionFilter.d.ts.map +1 -1
  28. package/dist/classes/callbacks/PostPickupSelectionFilter.js +4 -3
  29. package/dist/classes/callbacks/PostPlayerChangeHealth.js +2 -2
  30. package/dist/classes/callbacks/PostPurchase.js +9 -9
  31. package/dist/classes/callbacks/PostUsePillFilter.js +2 -2
  32. package/dist/classes/callbacks/PreBerserkDeath.js +4 -4
  33. package/dist/classes/callbacks/PreEntitySpawnFilter.js +3 -3
  34. package/dist/classes/callbacks/PreRoomEntitySpawnFilter.js +5 -5
  35. package/dist/classes/features/callbackLogic/EsauJrDetection.js +2 -2
  36. package/dist/classes/features/callbackLogic/GameReorderedCallbacks.js +5 -5
  37. package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.js +4 -4
  38. package/dist/classes/features/callbackLogic/ItemPickupDetection.js +4 -4
  39. package/dist/classes/features/callbackLogic/PlayerCollectibleDetection.js +2 -2
  40. package/dist/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
  41. package/dist/classes/features/other/CustomTrapdoors.js +21 -21
  42. package/dist/classes/features/other/DeployJSONRoom.js +4 -4
  43. package/dist/classes/features/other/DisableInputs.js +3 -3
  44. package/dist/classes/features/other/ModdedElementSets.js +2 -2
  45. package/dist/classes/features/other/NoSirenSteal.js +4 -4
  46. package/dist/classes/features/other/PickupIndexCreation.js +5 -5
  47. package/dist/classes/features/other/PonyDetection.js +2 -2
  48. package/dist/classes/features/other/PressInput.js +2 -2
  49. package/dist/classes/features/other/PreventChildEntities.js +4 -4
  50. package/dist/classes/features/other/RoomHistory.js +5 -5
  51. package/dist/classes/features/other/SaveDataManager.js +2 -2
  52. package/dist/classes/features/other/StageHistory.js +2 -2
  53. package/dist/classes/features/other/StartAmbush.js +2 -2
  54. package/dist/classes/features/other/TaintedLazarusPlayers.js +2 -2
  55. package/dist/classes/features/other/customStages/gridEntities.js +4 -4
  56. package/dist/classes/features/other/customStages/streakText.js +4 -4
  57. package/dist/classes/features/other/extraConsoleCommands/commands.js +8 -8
  58. package/dist/classes/features/other/saveDataManager/glowingHourGlass.js +2 -2
  59. package/dist/enums/ModCallbackCustom.d.ts +134 -117
  60. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  61. package/dist/enums/ModCallbackCustom.js +134 -117
  62. package/dist/enums/ModCallbackCustom.lua +119 -117
  63. package/dist/functions/bosses.js +2 -2
  64. package/dist/functions/charge.js +2 -2
  65. package/dist/functions/collectibles.js +2 -2
  66. package/dist/functions/deepCopy.js +6 -6
  67. package/dist/functions/doors.js +3 -3
  68. package/dist/functions/easing.js +2 -2
  69. package/dist/functions/emptyRoom.js +5 -5
  70. package/dist/functions/entities.js +8 -8
  71. package/dist/functions/familiars.js +2 -2
  72. package/dist/functions/flag.js +2 -2
  73. package/dist/functions/gridEntities.js +23 -23
  74. package/dist/functions/gridEntitiesSpecific.js +2 -2
  75. package/dist/functions/isaacAPIClass.js +2 -2
  76. package/dist/functions/level.js +3 -3
  77. package/dist/functions/levelGrid.js +6 -6
  78. package/dist/functions/logEntities.js +8 -8
  79. package/dist/functions/logMisc.d.ts.map +1 -1
  80. package/dist/functions/logMisc.js +3 -2
  81. package/dist/functions/logMisc.lua +4 -2
  82. package/dist/functions/math.js +4 -4
  83. package/dist/functions/nextStage.js +10 -10
  84. package/dist/functions/npcs.js +10 -10
  85. package/dist/functions/pickupVariants.js +6 -6
  86. package/dist/functions/playerCollectibles.js +2 -2
  87. package/dist/functions/playerHealth.js +8 -8
  88. package/dist/functions/playerIndex.js +3 -3
  89. package/dist/functions/players.js +4 -4
  90. package/dist/functions/pocketItems.js +2 -2
  91. package/dist/functions/revive.js +15 -15
  92. package/dist/functions/roomGrid.js +2 -2
  93. package/dist/functions/rooms.d.ts +1 -2
  94. package/dist/functions/rooms.d.ts.map +1 -1
  95. package/dist/functions/rooms.js +39 -41
  96. package/dist/functions/rooms.lua +1 -2
  97. package/dist/functions/sort.js +2 -2
  98. package/dist/functions/spawnCollectible.js +3 -3
  99. package/dist/functions/stage.js +16 -16
  100. package/dist/functions/string.js +6 -6
  101. package/dist/functions/tears.js +2 -2
  102. package/dist/functions/trinketGive.js +4 -4
  103. package/dist/functions/types.js +3 -3
  104. package/dist/index.rollup.d.ts +151 -122
  105. package/dist/interfaces/private/AddCallbackParametersCustom.d.ts +6 -0
  106. package/dist/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
  107. package/dist/isaacscript-common.lua +163 -125
  108. package/dist/lib/jsonLua.js +32 -32
  109. package/dist/shouldFire.d.ts.map +1 -1
  110. package/dist/shouldFire.js +54 -57
  111. package/dist/types/Increment.d.ts.map +1 -1
  112. package/dist/types/PickingUpItem.d.ts +10 -3
  113. package/dist/types/PickingUpItem.d.ts.map +1 -1
  114. package/dist/types/PickingUpItem.js +10 -3
  115. package/dist/types/PickingUpItem.lua +8 -3
  116. package/package.json +1 -1
  117. package/src/callbackClasses.ts +1 -0
  118. package/src/callbacks.ts +1 -0
  119. package/src/classes/ModUpgraded.ts +2 -2
  120. package/src/classes/callbacks/InputActionFilter.ts +3 -3
  121. package/src/classes/callbacks/InputActionPlayer.ts +6 -6
  122. package/src/classes/callbacks/PostBoneSwing.ts +2 -2
  123. package/src/classes/callbacks/PostCollectibleEmpty.ts +2 -2
  124. package/src/classes/callbacks/PostCursedTeleport.ts +5 -5
  125. package/src/classes/callbacks/PostDiceRoomActivated.ts +2 -2
  126. package/src/classes/callbacks/PostEntityRemoveFilter.ts +22 -0
  127. package/src/classes/callbacks/PostGridEntityCollision.ts +10 -10
  128. package/src/classes/callbacks/PostGridEntityCustomCollision.ts +8 -8
  129. package/src/classes/callbacks/PostGridEntityCustomRemove.ts +2 -2
  130. package/src/classes/callbacks/PostGridEntityRemove.ts +3 -3
  131. package/src/classes/callbacks/PostItemDischarge.ts +2 -2
  132. package/src/classes/callbacks/PostKeyboardChanged.ts +2 -2
  133. package/src/classes/callbacks/PostNewRoomEarly.ts +2 -2
  134. package/src/classes/callbacks/PostPickupSelectionFilter.ts +4 -3
  135. package/src/classes/callbacks/PostPlayerChangeHealth.ts +2 -2
  136. package/src/classes/callbacks/PostPurchase.ts +9 -9
  137. package/src/classes/callbacks/PostUsePillFilter.ts +2 -2
  138. package/src/classes/callbacks/PreBerserkDeath.ts +4 -4
  139. package/src/classes/callbacks/PreEntitySpawnFilter.ts +3 -3
  140. package/src/classes/callbacks/PreRoomEntitySpawnFilter.ts +5 -5
  141. package/src/classes/features/callbackLogic/EsauJrDetection.ts +2 -2
  142. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +5 -5
  143. package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +4 -4
  144. package/src/classes/features/callbackLogic/ItemPickupDetection.ts +4 -4
  145. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +2 -2
  146. package/src/classes/features/other/CustomTrapdoors.ts +23 -21
  147. package/src/classes/features/other/DeployJSONRoom.ts +4 -4
  148. package/src/classes/features/other/DisableInputs.ts +3 -3
  149. package/src/classes/features/other/ModdedElementSets.ts +2 -2
  150. package/src/classes/features/other/NoSirenSteal.ts +4 -4
  151. package/src/classes/features/other/PickupIndexCreation.ts +5 -5
  152. package/src/classes/features/other/PonyDetection.ts +2 -2
  153. package/src/classes/features/other/PressInput.ts +2 -2
  154. package/src/classes/features/other/PreventChildEntities.ts +4 -4
  155. package/src/classes/features/other/RoomHistory.ts +5 -5
  156. package/src/classes/features/other/SaveDataManager.ts +2 -2
  157. package/src/classes/features/other/StageHistory.ts +2 -2
  158. package/src/classes/features/other/StartAmbush.ts +2 -2
  159. package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -2
  160. package/src/classes/features/other/customStages/gridEntities.ts +4 -4
  161. package/src/classes/features/other/customStages/streakText.ts +4 -4
  162. package/src/classes/features/other/extraConsoleCommands/commands.ts +8 -8
  163. package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +4 -2
  164. package/src/enums/ModCallbackCustom.ts +18 -0
  165. package/src/functions/bosses.ts +2 -2
  166. package/src/functions/charge.ts +2 -2
  167. package/src/functions/collectibles.ts +2 -2
  168. package/src/functions/deepCopy.ts +6 -6
  169. package/src/functions/doors.ts +3 -3
  170. package/src/functions/easing.ts +2 -2
  171. package/src/functions/emptyRoom.ts +5 -5
  172. package/src/functions/entities.ts +8 -8
  173. package/src/functions/familiars.ts +2 -2
  174. package/src/functions/flag.ts +2 -2
  175. package/src/functions/gridEntities.ts +23 -23
  176. package/src/functions/gridEntitiesSpecific.ts +2 -2
  177. package/src/functions/isaacAPIClass.ts +2 -2
  178. package/src/functions/level.ts +3 -3
  179. package/src/functions/levelGrid.ts +6 -6
  180. package/src/functions/logEntities.ts +8 -8
  181. package/src/functions/logMisc.ts +6 -2
  182. package/src/functions/math.ts +4 -4
  183. package/src/functions/nextStage.ts +10 -10
  184. package/src/functions/npcs.ts +10 -10
  185. package/src/functions/pickupVariants.ts +6 -6
  186. package/src/functions/playerCollectibles.ts +2 -2
  187. package/src/functions/playerHealth.ts +8 -8
  188. package/src/functions/playerIndex.ts +3 -3
  189. package/src/functions/players.ts +4 -4
  190. package/src/functions/pocketItems.ts +2 -2
  191. package/src/functions/revive.ts +15 -15
  192. package/src/functions/roomGrid.ts +2 -2
  193. package/src/functions/rooms.ts +39 -41
  194. package/src/functions/sort.ts +2 -2
  195. package/src/functions/spawnCollectible.ts +3 -3
  196. package/src/functions/stage.ts +16 -16
  197. package/src/functions/string.ts +6 -6
  198. package/src/functions/tears.ts +2 -2
  199. package/src/functions/trinketGive.ts +4 -4
  200. package/src/functions/types.ts +3 -3
  201. package/src/interfaces/private/AddCallbackParametersCustom.ts +7 -0
  202. package/src/lib/jsonLua.js +32 -32
  203. package/src/shouldFire.ts +54 -57
  204. package/src/types/Increment.ts +2 -2
  205. package/src/types/PickingUpItem.ts +10 -3
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import type { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireEntity } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostEntityRemoveFilter extends CustomCallback<ModCallbackCustom.POST_ENTITY_REMOVE_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 67
12
+ [ModCallback.POST_ENTITY_REMOVE, this.postEntityRemove],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireEntity;
17
+
18
+ // ModCallback.POST_ENTITY_REMOVE (67)
19
+ private readonly postEntityRemove = (entity: Entity) => {
20
+ this.fire(entity);
21
+ };
22
+ }
@@ -29,16 +29,16 @@ export class PostGridEntityCollision extends CustomCallback<T> {
29
29
  const gridEntityVariant = gridEntity.GetVariant();
30
30
 
31
31
  return (
32
- (callbackGridEntityType === undefined ||
33
- callbackGridEntityType === gridEntityType) &&
34
- (callbackGridEntityVariant === undefined ||
35
- callbackGridEntityVariant === gridEntityVariant) &&
36
- (callbackEntityType === undefined ||
37
- callbackEntityType === entity.Type) &&
38
- (callbackEntityVariant === undefined ||
39
- callbackEntityVariant === entity.Variant) &&
40
- (callbackEntitySubType === undefined ||
41
- callbackEntitySubType === entity.SubType)
32
+ (callbackGridEntityType === undefined
33
+ || callbackGridEntityType === gridEntityType)
34
+ && (callbackGridEntityVariant === undefined
35
+ || callbackGridEntityVariant === gridEntityVariant)
36
+ && (callbackEntityType === undefined
37
+ || callbackEntityType === entity.Type)
38
+ && (callbackEntityVariant === undefined
39
+ || callbackEntityVariant === entity.Variant)
40
+ && (callbackEntitySubType === undefined
41
+ || callbackEntitySubType === entity.SubType)
42
42
  );
43
43
  };
44
44
  }
@@ -25,14 +25,14 @@ export class PostGridEntityCustomCollision extends CustomCallback<T> {
25
25
  ] = optionalArgs;
26
26
 
27
27
  return (
28
- (callbackGridEntityTypeCustom === undefined ||
29
- callbackGridEntityTypeCustom === gridEntityTypeCustom) &&
30
- (callbackEntityType === undefined ||
31
- callbackEntityType === entity.Type) &&
32
- (callbackEntityVariant === undefined ||
33
- callbackEntityVariant === entity.Variant) &&
34
- (callbackEntitySubType === undefined ||
35
- callbackEntitySubType === entity.SubType)
28
+ (callbackGridEntityTypeCustom === undefined
29
+ || callbackGridEntityTypeCustom === gridEntityTypeCustom)
30
+ && (callbackEntityType === undefined
31
+ || callbackEntityType === entity.Type)
32
+ && (callbackEntityVariant === undefined
33
+ || callbackEntityVariant === entity.Variant)
34
+ && (callbackEntitySubType === undefined
35
+ || callbackEntitySubType === entity.SubType)
36
36
  );
37
37
  };
38
38
  }
@@ -20,8 +20,8 @@ export class PostGridEntityCustomRemove extends CustomCallback<T> {
20
20
  const [callbackGridEntityTypeCustom] = optionalArgs;
21
21
 
22
22
  return (
23
- callbackGridEntityTypeCustom === undefined ||
24
- callbackGridEntityTypeCustom === gridEntityTypeCustom
23
+ callbackGridEntityTypeCustom === undefined
24
+ || callbackGridEntityTypeCustom === gridEntityTypeCustom
25
25
  );
26
26
  };
27
27
  }
@@ -20,9 +20,9 @@ export class PostGridEntityRemove extends CustomCallback<T> {
20
20
  const [callbackGridEntityType, callbackVariant] = optionalArgs;
21
21
 
22
22
  return (
23
- (callbackGridEntityType === undefined ||
24
- callbackGridEntityType === gridEntityType) &&
25
- (callbackVariant === undefined || callbackVariant === variant)
23
+ (callbackGridEntityType === undefined
24
+ || callbackGridEntityType === gridEntityType)
25
+ && (callbackVariant === undefined || callbackVariant === variant)
26
26
  );
27
27
  };
28
28
  }
@@ -72,8 +72,8 @@ export class PostItemDischarge extends CustomCallback<T> {
72
72
  const [callbackCollectibleType] = optionalArgs;
73
73
 
74
74
  return (
75
- callbackCollectibleType === undefined ||
76
- callbackCollectibleType === collectibleType
75
+ callbackCollectibleType === undefined
76
+ || callbackCollectibleType === collectibleType
77
77
  );
78
78
  };
79
79
 
@@ -34,8 +34,8 @@ export class PostKeyboardChanged extends CustomCallback<T> {
34
34
  const [callbackKeyboard, callbackPressed] = optionalArgs;
35
35
 
36
36
  return (
37
- (callbackKeyboard === undefined || callbackKeyboard === keyboard) &&
38
- (callbackPressed === undefined || callbackPressed === pressed)
37
+ (callbackKeyboard === undefined || callbackKeyboard === keyboard)
38
+ && (callbackPressed === undefined || callbackPressed === pressed)
39
39
  );
40
40
  };
41
41
 
@@ -95,8 +95,8 @@ export class PostNewRoomEarly extends CustomCallback<ModCallbackCustom.POST_NEW_
95
95
  this.currentRoomTopLeftWallPtrHash2 = GetPtrHash(topLeftWall2);
96
96
 
97
97
  return (
98
- oldTopLeftWallPtrHash !== this.currentRoomTopLeftWallPtrHash ||
99
- oldTopLeftWallPtrHash2 !== this.currentRoomTopLeftWallPtrHash2
98
+ oldTopLeftWallPtrHash !== this.currentRoomTopLeftWallPtrHash
99
+ || oldTopLeftWallPtrHash2 !== this.currentRoomTopLeftWallPtrHash2
100
100
  );
101
101
  }
102
102
  }
@@ -29,9 +29,10 @@ export class PostPickupSelectionFilter extends CustomCallback<T> {
29
29
  const [callbackPickupVariant, callbackPickupSubType] = optionalArgs;
30
30
 
31
31
  return (
32
- (callbackPickupVariant === undefined ||
33
- callbackPickupVariant === pickupVariant) &&
34
- (callbackPickupSubType === undefined || callbackPickupSubType === subType)
32
+ (callbackPickupVariant === undefined
33
+ || callbackPickupVariant === pickupVariant)
34
+ && (callbackPickupSubType === undefined
35
+ || callbackPickupSubType === subType)
35
36
  );
36
37
  };
37
38
 
@@ -47,8 +47,8 @@ export class PostPlayerChangeHealth extends CustomCallback<ModCallbackCustom.POS
47
47
  playerHealthMap.set(healthType, currentHealthValue);
48
48
 
49
49
  if (
50
- storedHealthValue !== undefined &&
51
- storedHealthValue !== currentHealthValue
50
+ storedHealthValue !== undefined
51
+ && storedHealthValue !== currentHealthValue
52
52
  ) {
53
53
  const difference = currentHealthValue - storedHealthValue;
54
54
  this.fire(
@@ -60,10 +60,10 @@ export class PostPurchase extends CustomCallback<T> {
60
60
  const [callbackPickupVariant, callbackPickupSubType] = optionalArgs;
61
61
 
62
62
  return (
63
- (callbackPickupVariant === undefined ||
64
- callbackPickupVariant === pickup.Variant) &&
65
- (callbackPickupSubType === undefined ||
66
- callbackPickupSubType === pickup.SubType)
63
+ (callbackPickupVariant === undefined
64
+ || callbackPickupVariant === pickup.Variant)
65
+ && (callbackPickupSubType === undefined
66
+ || callbackPickupSubType === pickup.SubType)
67
67
  );
68
68
  };
69
69
 
@@ -111,9 +111,9 @@ export class PostPurchase extends CustomCallback<T> {
111
111
  // Assume that if the player did not use an active item, card, or pill recently, then they
112
112
  // purchased an item.
113
113
  if (
114
- !wasHoldingItemOnLastFrame &&
115
- isHoldingItem &&
116
- !this.playerUsedItemRecently(player)
114
+ !wasHoldingItemOnLastFrame
115
+ && isHoldingItem
116
+ && !this.playerUsedItemRecently(player)
117
117
  ) {
118
118
  this.playerPickedUpNewItem(player);
119
119
  }
@@ -126,8 +126,8 @@ export class PostPurchase extends CustomCallback<T> {
126
126
  player,
127
127
  );
128
128
  return (
129
- gameFrameCount === usedCollectibleOnFrame ||
130
- gameFrameCount === usedCollectibleOnFrame + 1
129
+ gameFrameCount === usedCollectibleOnFrame
130
+ || gameFrameCount === usedCollectibleOnFrame + 1
131
131
  );
132
132
  }
133
133
 
@@ -76,8 +76,8 @@ export class PostUsePillFilter extends CustomCallback<ModCallbackCustom.POST_USE
76
76
  (pocketItem) => pocketItem.slot === PocketItemSlot.SLOT_1,
77
77
  );
78
78
  if (
79
- oldPocketItemSlot1 !== undefined &&
80
- oldPocketItemSlot1.type === PocketItemType.PILL
79
+ oldPocketItemSlot1 !== undefined
80
+ && oldPocketItemSlot1.type === PocketItemType.PILL
81
81
  ) {
82
82
  return oldPocketItemSlot1.subType;
83
83
  }
@@ -36,10 +36,10 @@ export class PreBerserkDeath extends CustomCallback<ModCallbackCustom.PRE_BERSER
36
36
 
37
37
  // If the Berserk effect will end on the next frame and we have no hearts left.
38
38
  if (
39
- berserkEffect !== undefined &&
40
- berserkEffect.Cooldown === 1 &&
41
- numHitsRemaining === 0 &&
42
- !willPlayerRevive(player)
39
+ berserkEffect !== undefined
40
+ && berserkEffect.Cooldown === 1
41
+ && numHitsRemaining === 0
42
+ && !willPlayerRevive(player)
43
43
  ) {
44
44
  this.fire(player);
45
45
  }
@@ -24,9 +24,9 @@ export class PreEntitySpawnFilter extends CustomCallback<T> {
24
24
  const [callbackEntityType, callbackVariant, callbackSubType] = optionalArgs;
25
25
 
26
26
  return (
27
- (callbackEntityType === undefined || callbackEntityType === entityType) &&
28
- (callbackVariant === undefined || callbackVariant === variant) &&
29
- (callbackSubType === undefined || callbackSubType === subType)
27
+ (callbackEntityType === undefined || callbackEntityType === entityType)
28
+ && (callbackVariant === undefined || callbackVariant === variant)
29
+ && (callbackSubType === undefined || callbackSubType === subType)
30
30
  );
31
31
  };
32
32
 
@@ -31,11 +31,11 @@ export class PreRoomEntitySpawnFilter extends CustomCallback<T> {
31
31
  ] = optionalArgs;
32
32
 
33
33
  return (
34
- (callbackEntityTypeOrGridEntityXMLType === undefined ||
35
- callbackEntityTypeOrGridEntityXMLType ===
36
- entityTypeOrGridEntityXMLType) &&
37
- (callbackVariant === undefined || callbackVariant === variant) &&
38
- (callbackSubType === undefined || callbackSubType === subType)
34
+ (callbackEntityTypeOrGridEntityXMLType === undefined
35
+ || callbackEntityTypeOrGridEntityXMLType
36
+ === entityTypeOrGridEntityXMLType)
37
+ && (callbackVariant === undefined || callbackVariant === variant)
38
+ && (callbackSubType === undefined || callbackSubType === subType)
39
39
  );
40
40
  };
41
41
 
@@ -45,8 +45,8 @@ export class EsauJrDetection extends Feature {
45
45
 
46
46
  // Check to see if it is the frame after the player has used Esau Jr.
47
47
  if (
48
- v.run.usedEsauJrFrame === null ||
49
- gameFrameCount < v.run.usedEsauJrFrame + 1
48
+ v.run.usedEsauJrFrame === null
49
+ || gameFrameCount < v.run.usedEsauJrFrame + 1
50
50
  ) {
51
51
  return;
52
52
  }
@@ -162,11 +162,11 @@ export class GameReorderedCallbacks extends Feature {
162
162
  }
163
163
 
164
164
  if (
165
- (onGameFrame(0) ||
166
- onRenderFrame(this.renderFrameRunStarted) ||
167
- this.currentStage !== stage ||
168
- this.currentStageType !== stageType) &&
169
- !this.forceNewRoom
165
+ (onGameFrame(0)
166
+ || onRenderFrame(this.renderFrameRunStarted)
167
+ || this.currentStage !== stage
168
+ || this.currentStageType !== stageType)
169
+ && !this.forceNewRoom
170
170
  ) {
171
171
  return;
172
172
  }
@@ -115,8 +115,8 @@ export class GridEntityUpdateDetection extends Feature {
115
115
  const [storedGridEntityType, storedGridEntityVariant] = gridEntityTuple;
116
116
  const gridEntity = gridEntitiesMap.get(gridIndex);
117
117
  if (
118
- gridEntity === undefined ||
119
- gridEntity.GetType() !== storedGridEntityType
118
+ gridEntity === undefined
119
+ || gridEntity.GetType() !== storedGridEntityType
120
120
  ) {
121
121
  v.room.initializedGridEntities.delete(gridIndex);
122
122
 
@@ -182,8 +182,8 @@ export class GridEntityUpdateDetection extends Feature {
182
182
  const gridEntityTuple = v.room.initializedGridEntities.get(gridIndex);
183
183
 
184
184
  if (
185
- gridEntityTuple === undefined ||
186
- gridEntityTuple[0] !== gridEntityType
185
+ gridEntityTuple === undefined
186
+ || gridEntityTuple[0] !== gridEntityType
187
187
  ) {
188
188
  this.updateTupleInMap(gridEntity);
189
189
 
@@ -66,8 +66,8 @@ export class ItemPickupDetection extends Feature {
66
66
 
67
67
  private queueEmpty(player: EntityPlayer, pickingUpItem: PickingUpItem) {
68
68
  if (
69
- pickingUpItem.itemType === ItemType.NULL ||
70
- asNumber(pickingUpItem.subType) === 0
69
+ pickingUpItem.itemType === ItemType.NULL
70
+ || asNumber(pickingUpItem.subType) === 0
71
71
  ) {
72
72
  return;
73
73
  }
@@ -84,8 +84,8 @@ export class ItemPickupDetection extends Feature {
84
84
  }
85
85
 
86
86
  if (
87
- queuedItem.Type !== pickingUpItem.itemType ||
88
- queuedItem.ID !== pickingUpItem.subType
87
+ queuedItem.Type !== pickingUpItem.itemType
88
+ || queuedItem.ID !== pickingUpItem.subType
89
89
  ) {
90
90
  // Record which item we are picking up.
91
91
  pickingUpItem.itemType = queuedItem.Type;
@@ -200,8 +200,8 @@ export class PlayerCollectibleDetection extends Feature {
200
200
  pickingUpItem: PickingUpItem,
201
201
  ) => {
202
202
  if (
203
- pickingUpItem.itemType === ItemType.TRINKET ||
204
- pickingUpItem.itemType === ItemType.NULL
203
+ pickingUpItem.itemType === ItemType.TRINKET
204
+ || pickingUpItem.itemType === ItemType.NULL
205
205
  ) {
206
206
  return;
207
207
  }
@@ -220,8 +220,8 @@ export class CustomTrapdoors extends Feature {
220
220
 
221
221
  private checkPixelationToBlackComplete() {
222
222
  if (
223
- v.run.state !== StageTravelState.PIXELATION_TO_BLACK ||
224
- v.run.stateRenderFrame === null
223
+ v.run.state !== StageTravelState.PIXELATION_TO_BLACK
224
+ || v.run.stateRenderFrame === null
225
225
  ) {
226
226
  return;
227
227
  }
@@ -310,9 +310,9 @@ export class CustomTrapdoors extends Feature {
310
310
 
311
311
  private checkSecondPixelationHalfWay() {
312
312
  if (
313
- v.run.state !==
314
- StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY ||
315
- v.run.stateRenderFrame === null
313
+ v.run.state
314
+ !== StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY
315
+ || v.run.stateRenderFrame === null
316
316
  ) {
317
317
  return;
318
318
  }
@@ -378,9 +378,9 @@ export class CustomTrapdoors extends Feature {
378
378
 
379
379
  private drawBlackSprite(): void {
380
380
  if (
381
- v.run.state !== StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END &&
382
- v.run.state !==
383
- StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY
381
+ v.run.state !== StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END
382
+ && v.run.state
383
+ !== StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY
384
384
  ) {
385
385
  return;
386
386
  }
@@ -443,9 +443,9 @@ export class CustomTrapdoors extends Feature {
443
443
  const roomClear = room.IsClear();
444
444
 
445
445
  return (
446
- !anyPlayerCloserThan(gridEntity.Position, TRAPDOOR_OPEN_DISTANCE) &&
447
- !this.isPlayerCloseAfterBoss(gridEntity.Position) &&
448
- !shouldBeClosedFromStartingInRoomWithEnemies(firstSpawn, roomClear)
446
+ !anyPlayerCloserThan(gridEntity.Position, TRAPDOOR_OPEN_DISTANCE)
447
+ && !this.isPlayerCloseAfterBoss(gridEntity.Position)
448
+ && !shouldBeClosedFromStartingInRoomWithEnemies(firstSpawn, roomClear)
449
449
  );
450
450
  }
451
451
 
@@ -457,9 +457,11 @@ export class CustomTrapdoors extends Feature {
457
457
  // In order to prevent a player from accidentally entering a freshly-spawned trapdoor after
458
458
  // killing the boss of the floor, we use a wider open distance for a short amount of frames.
459
459
  if (
460
- roomType !== RoomType.BOSS ||
461
- roomClearGameFrame === undefined ||
462
- onOrAfterRenderFrame(roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES)
460
+ roomType !== RoomType.BOSS
461
+ || roomClearGameFrame === undefined
462
+ || onOrAfterRenderFrame(
463
+ roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES,
464
+ )
463
465
  ) {
464
466
  return false;
465
467
  }
@@ -492,9 +494,9 @@ export class CustomTrapdoors extends Feature {
492
494
 
493
495
  if (
494
496
  // We don't want a Pony dash to transition to a new floor or a crawl space.
495
- !this.ponyDetection.isPlayerUsingPony(player) &&
496
- !isChildPlayer(player) &&
497
- canPlayerInteractWithTrapdoor(player)
497
+ !this.ponyDetection.isPlayerUsingPony(player)
498
+ && !isChildPlayer(player)
499
+ && canPlayerInteractWithTrapdoor(player)
498
500
  ) {
499
501
  this.playerTouchedCustomTrapdoor(
500
502
  gridEntity,
@@ -754,8 +756,8 @@ export class CustomTrapdoors extends Feature {
754
756
  spawnOpen?: boolean,
755
757
  ): GridEntity {
756
758
  if (
757
- destinationName !== undefined &&
758
- !this.destinationFuncMap.has(destinationName)
759
+ destinationName !== undefined
760
+ && !this.destinationFuncMap.has(destinationName)
759
761
  ) {
760
762
  error(
761
763
  `Failed to spawn a custom trapdoor with a destination of "${destinationName}" since a destination with that name has not been registered with the "registerCustomTrapdoorDestination" function. (If you are trying to go to a custom stage, the custom stage library should automatically do this for you when your mod first boots.)`,
@@ -831,8 +833,8 @@ function canPlayerInteractWithTrapdoor(player: EntityPlayer) {
831
833
  const sprite = player.GetSprite();
832
834
  const animation = sprite.GetAnimation();
833
835
  return (
834
- !player.IsHoldingItem() &&
835
- !ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL.has(animation)
836
+ !player.IsHoldingItem()
837
+ && !ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL.has(animation)
836
838
  );
837
839
  }
838
840
 
@@ -161,9 +161,9 @@ export class DeployJSONRoom extends Feature {
161
161
 
162
162
  let entity: Entity;
163
163
  if (
164
- entityType === EntityType.PICKUP &&
164
+ entityType === EntityType.PICKUP
165
165
  // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
166
- variant === PickupVariant.COLLECTIBLE
166
+ && variant === PickupVariant.COLLECTIBLE
167
167
  ) {
168
168
  const collectibleType = asCollectibleType(subType);
169
169
  const options = roomType === RoomType.ANGEL;
@@ -174,9 +174,9 @@ export class DeployJSONRoom extends Feature {
174
174
 
175
175
  // For some reason, Pitfalls do not spawn with the correct collision classes.
176
176
  if (
177
- entityType === EntityType.PITFALL &&
177
+ entityType === EntityType.PITFALL
178
178
  // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
179
- variant === PitfallVariant.PITFALL
179
+ && variant === PitfallVariant.PITFALL
180
180
  ) {
181
181
  entity.EntityCollisionClass = EntityCollisionClass.ENEMIES;
182
182
  entity.GridCollisionClass = EntityGridCollisionClass.WALLS;
@@ -122,9 +122,9 @@ export class DisableInputs extends Feature {
122
122
  @Exported
123
123
  public areInputsEnabled(): boolean {
124
124
  return (
125
- v.run.disableInputs.size === 0 &&
126
- v.run.enableAllInputsWithBlacklistMap.size === 0 &&
127
- v.run.disableAllInputsWithWhitelistMap.size === 0
125
+ v.run.disableInputs.size === 0
126
+ && v.run.enableAllInputsWithBlacklistMap.size === 0
127
+ && v.run.disableAllInputsWithWhitelistMap.size === 0
128
128
  );
129
129
  }
130
130
 
@@ -411,8 +411,8 @@ export class ModdedElementSets extends Feature {
411
411
  private lazyInitEdenCollectibleTypesSet() {
412
412
  for (const collectibleType of this.getCollectibleTypes()) {
413
413
  if (
414
- isHiddenCollectible(collectibleType) ||
415
- collectibleHasTag(collectibleType, ItemConfigTag.NO_EDEN)
414
+ isHiddenCollectible(collectibleType)
415
+ || collectibleHasTag(collectibleType, ItemConfigTag.NO_EDEN)
416
416
  ) {
417
417
  continue;
418
418
  }
@@ -59,16 +59,16 @@ export class NoSirenSteal extends Feature {
59
59
  const [familiarVariant, familiarSubType] = familiarTuple;
60
60
 
61
61
  if (
62
- familiarVariant === incomingFamiliarVariant &&
63
- familiarSubType === incomingFamiliarSubType
62
+ familiarVariant === incomingFamiliarVariant
63
+ && familiarSubType === incomingFamiliarSubType
64
64
  ) {
65
65
  // There is an entry that matches the variant and sub-type exactly.
66
66
  return true;
67
67
  }
68
68
 
69
69
  if (
70
- familiarVariant === incomingFamiliarVariant &&
71
- familiarSubType === undefined
70
+ familiarVariant === incomingFamiliarVariant
71
+ && familiarSubType === undefined
72
72
  ) {
73
73
  // There is an entry that matches all sub-types for this variant.
74
74
  return true;
@@ -95,9 +95,9 @@ export class PickupIndexCreation extends Feature {
95
95
  const room = game.GetRoom();
96
96
  const isFirstVisit = room.IsFirstVisit();
97
97
  if (
98
- pickupIndexFromLevelData !== undefined &&
99
- !isFirstVisit &&
100
- onOrBeforeRoomFrame(0)
98
+ pickupIndexFromLevelData !== undefined
99
+ && !isFirstVisit
100
+ && onOrBeforeRoomFrame(0)
101
101
  ) {
102
102
  v.room.pickupIndexes.set(ptrHash, pickupIndexFromLevelData);
103
103
  return;
@@ -282,8 +282,8 @@ function getStoredPickupIndex(
282
282
  ): PickupIndex | undefined {
283
283
  for (const [pickupIndex, pickupDescription] of pickupDescriptions) {
284
284
  if (
285
- vectorEquals(pickupDescription.position, pickup.Position) &&
286
- pickupDescription.initSeed === pickup.InitSeed
285
+ vectorEquals(pickupDescription.position, pickup.Position)
286
+ && pickupDescription.initSeed === pickup.InitSeed
287
287
  ) {
288
288
  return pickupIndex;
289
289
  }
@@ -44,8 +44,8 @@ export class PonyDetection extends Feature {
44
44
  const effects = player.GetEffects();
45
45
  const entityFlags = player.GetEntityFlags();
46
46
  const hasPonyCollectibleEffect =
47
- effects.HasCollectibleEffect(CollectibleType.PONY) ||
48
- effects.HasCollectibleEffect(CollectibleType.WHITE_PONY);
47
+ effects.HasCollectibleEffect(CollectibleType.PONY)
48
+ || effects.HasCollectibleEffect(CollectibleType.WHITE_PONY);
49
49
  const isPonyActiveOnPreviousFrame = setHasPlayer(
50
50
  v.run.playersIsPonyActive,
51
51
  player,
@@ -55,8 +55,8 @@ export class PressInput extends Feature {
55
55
  const pair = v.run.buttonActionPairs[i]!;
56
56
 
57
57
  if (
58
- pair.playerIndex === playerIndex &&
59
- pair.buttonAction === buttonAction
58
+ pair.playerIndex === playerIndex
59
+ && pair.buttonAction === buttonAction
60
60
  ) {
61
61
  v.run.buttonActionPairs.splice(i);
62
62
  return true;
@@ -25,12 +25,12 @@ export class PreventChildEntities extends Feature {
25
25
  // ModCallback.POST_NPC_INIT (27)
26
26
  private readonly postNPCInit = (npc: EntityNPC) => {
27
27
  const spawnerEntityMatch =
28
- npc.SpawnerEntity !== undefined &&
29
- v.room.preventingEntities.has(GetPtrHash(npc.SpawnerEntity));
28
+ npc.SpawnerEntity !== undefined
29
+ && v.room.preventingEntities.has(GetPtrHash(npc.SpawnerEntity));
30
30
 
31
31
  const parentMatch =
32
- npc.Parent !== undefined &&
33
- v.room.preventingEntities.has(GetPtrHash(npc.Parent));
32
+ npc.Parent !== undefined
33
+ && v.room.preventingEntities.has(GetPtrHash(npc.Parent));
34
34
 
35
35
  if (spawnerEntityMatch || parentMatch) {
36
36
  npc.Remove();
@@ -192,11 +192,11 @@ export class RoomHistory extends Feature {
192
192
  }
193
193
 
194
194
  return (
195
- startSeedString !== latestRoomDescription.startSeedString ||
196
- stage !== latestRoomDescription.stage ||
197
- stageType !== latestRoomDescription.stageType ||
198
- roomListIndex !== latestRoomDescription.roomListIndex ||
199
- roomVisitedCount !== latestRoomDescription.roomVisitedCount
195
+ startSeedString !== latestRoomDescription.startSeedString
196
+ || stage !== latestRoomDescription.stage
197
+ || stageType !== latestRoomDescription.stageType
198
+ || roomListIndex !== latestRoomDescription.roomListIndex
199
+ || roomVisitedCount !== latestRoomDescription.roomVisitedCount
200
200
  );
201
201
  }
202
202
  }
@@ -393,8 +393,8 @@ export class SaveDataManager extends Feature {
393
393
  private storeClassConstructorsFromObject(luaMap: LuaMap<AnyNotNil, unknown>) {
394
394
  const tstlClassName = getTSTLClassName(luaMap);
395
395
  if (
396
- tstlClassName !== undefined &&
397
- !NON_USER_DEFINED_CLASS_NAMES.has(tstlClassName)
396
+ tstlClassName !== undefined
397
+ && !NON_USER_DEFINED_CLASS_NAMES.has(tstlClassName)
398
398
  ) {
399
399
  this.classConstructors.set(tstlClassName, luaMap as unknown as AnyClass);
400
400
  }
@@ -323,8 +323,8 @@ export class StageHistory extends Feature {
323
323
 
324
324
  return v.run.stageHistory.some(
325
325
  (stageHistoryEntry) =>
326
- stageHistoryEntry.stage === stage &&
327
- stageHistoryEntry.stageType === stageType,
326
+ stageHistoryEntry.stage === stage
327
+ && stageHistoryEntry.stageType === stageType,
328
328
  );
329
329
  }
330
330
  }
@@ -60,8 +60,8 @@ export class StartAmbush extends Feature {
60
60
  const coins = getCoins();
61
61
  const coinsFromSack = coins.filter(
62
62
  (pickup) =>
63
- pickup.SpawnerEntity !== undefined &&
64
- GetPtrHash(pickup.SpawnerEntity) === sackPtrHash,
63
+ pickup.SpawnerEntity !== undefined
64
+ && GetPtrHash(pickup.SpawnerEntity) === sackPtrHash,
65
65
  );
66
66
  removeEntities(coinsFromSack);
67
67
  });