isaacscript-common 1.2.252 → 1.2.255

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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
2
3
  /**
3
4
  * Helper function to get all of the `EntityType.ENTITY_BOMB` in the room.
4
5
  *
@@ -218,7 +219,7 @@ export declare function spawnLaser(variant: LaserVariant | int, subType: int, po
218
219
  /** Helper function to spawn a `EntityType.ENTITY_LASER` (7) with a specific seed. */
219
220
  export declare function spawnLaserWithSeed(variant: LaserVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityLaser;
220
221
  /** Helper function to spawn an NPC. */
221
- export declare function spawnNPC(entityType: EntityType | int, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
222
+ export declare function spawnNPC<T extends number>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
222
223
  /** Helper function to spawn an NPC with a specific seed. */
223
224
  export declare function spawnNPCWithSeed(entityType: EntityType | int, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
224
225
  /** Helper function to spawn a `EntityType.ENTITY_PICKUP` (5). */
@@ -92,6 +92,11 @@ export declare function hexToKColor(hexString: string, alpha: float): KColor;
92
92
  * is enabled or not.
93
93
  */
94
94
  export declare function isLuaDebugEnabled(): boolean;
95
+ /**
96
+ * Since this is a UI element, we do not want to draw it in water reflections. `renderOffset` will
97
+ * be a non-zero value in reflections.
98
+ */
99
+ export declare function isReflectionRender(): boolean;
95
100
  /**
96
101
  * Helper function to print something to the in-game console. Use this instead of invoking the
97
102
  * `Isaac.ConsoleOutput` method directly because it will automatically insert a newline at the end
@@ -6,6 +6,8 @@ local __TS__StringSubstr = ____lualib.__TS__StringSubstr
6
6
  local __TS__ObjectKeys = ____lualib.__TS__ObjectKeys
7
7
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
8
8
  local ____exports = {}
9
+ local ____cachedClasses = require("cachedClasses")
10
+ local game = ____cachedClasses.game
9
11
  local ____directionNames = require("objects.directionNames")
10
12
  local DIRECTION_NAMES = ____directionNames.DIRECTION_NAMES
11
13
  local HEX_STRING_LENGTH = 6
@@ -66,6 +68,11 @@ end
66
68
  function ____exports.isLuaDebugEnabled(self)
67
69
  return package ~= nil
68
70
  end
71
+ function ____exports.isReflectionRender(self)
72
+ local room = game:GetRoom()
73
+ local renderMode = room:GetRenderMode()
74
+ return renderMode == RenderMode.RENDER_WATER_REFLECT
75
+ end
69
76
  function ____exports.printConsole(self, msg)
70
77
  Isaac.ConsoleOutput(msg .. "\n")
71
78
  end
@@ -0,0 +1,2 @@
1
+ /** We cannot use EntityType values directly since it will break the exclusion hack. */
2
+ export declare type EntityTypeNonNPC = 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 1000;
@@ -0,0 +1,3 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.252",
3
+ "version": "1.2.255",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",