isaacscript-common 12.3.6 → 12.3.7
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.
- package/dist/index.d.ts +6 -1
- package/dist/isaacscript-common.lua +1292 -5610
- package/dist/src/functions/collectibles.d.ts +6 -1
- package/dist/src/functions/collectibles.d.ts.map +1 -1
- package/dist/src/functions/collectibles.lua +9 -0
- package/dist/src/indexLua.d.ts +181 -0
- package/dist/src/indexLua.d.ts.map +1 -0
- package/dist/src/indexLua.lua +1282 -0
- package/package.json +1 -1
- package/src/functions/collectibles.ts +15 -1
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ItemType,
|
|
10
10
|
PickupPrice,
|
|
11
11
|
PickupVariant,
|
|
12
|
+
RenderMode,
|
|
12
13
|
RoomType,
|
|
13
14
|
} from "isaac-typescript-definitions";
|
|
14
15
|
import { game, itemConfig } from "../core/cachedClasses";
|
|
@@ -408,7 +409,12 @@ export function isActiveCollectible(collectibleType: CollectibleType): boolean {
|
|
|
408
409
|
return itemType === ItemType.ACTIVE;
|
|
409
410
|
}
|
|
410
411
|
|
|
411
|
-
/**
|
|
412
|
+
/**
|
|
413
|
+
* Returns true if the collectible has a red question mark sprite.
|
|
414
|
+
*
|
|
415
|
+
* Note that this function will not work properly in a render callback with the `RenderMode` set to
|
|
416
|
+
* `RenderMode.WATER_REFLECT`. If this is detected, this function will throw a run-time error.
|
|
417
|
+
*/
|
|
412
418
|
export function isBlindCollectible(collectible: EntityPickup): boolean {
|
|
413
419
|
if (!isCollectible(collectible)) {
|
|
414
420
|
const entityID = getEntityID(collectible);
|
|
@@ -417,6 +423,14 @@ export function isBlindCollectible(collectible: EntityPickup): boolean {
|
|
|
417
423
|
);
|
|
418
424
|
}
|
|
419
425
|
|
|
426
|
+
const room = game.GetRoom();
|
|
427
|
+
const renderMode = room.GetRenderMode();
|
|
428
|
+
if (renderMode === RenderMode.WATER_REFLECT) {
|
|
429
|
+
error(
|
|
430
|
+
'The "isBlindCollectible" function will not work properly in a render callback with the render mode equal to "RenderMode.WATER_REFLECT". Make sure that you properly account for this case if you are calling this function in a render callback.',
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
|
|
420
434
|
const sprite = collectible.GetSprite();
|
|
421
435
|
const animation = sprite.GetAnimation();
|
|
422
436
|
const frame = sprite.GetFrame();
|