isaacscript-common 1.0.334 → 1.0.335

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.
@@ -11,6 +11,8 @@ export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: number;
11
11
  export declare const GENESIS_ROOM_VARIANT = 1000;
12
12
  export declare const GOLDEN_TRINKET_SHIFT: number;
13
13
  export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
14
+ export declare const GAME_FRAMES_PER_SECOND = 30;
15
+ export declare const ISAAC_FRAMES_PER_SECOND = 60;
14
16
  /** In a 2x2 room, there can be 8 doors. */
15
17
  export declare const MAX_NUM_DOORS = 8;
16
18
  /** The game can only handle up to four different players. */
@@ -8,6 +8,8 @@ ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
8
8
  ____exports.GENESIS_ROOM_VARIANT = 1000
9
9
  ____exports.GOLDEN_TRINKET_SHIFT = 1 << 15
10
10
  ____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
11
+ ____exports.GAME_FRAMES_PER_SECOND = 30
12
+ ____exports.ISAAC_FRAMES_PER_SECOND = 60
11
13
  ____exports.MAX_NUM_DOORS = 8
12
14
  ____exports.MAX_NUM_INPUTS = 4
13
15
  ____exports.MAX_PLAYER_POCKET_ITEM_SLOTS = 4
@@ -10,8 +10,8 @@ import PocketItemDescription from "../types/PocketItemDescription";
10
10
  *
11
11
  * This type is branded for extra type safety.
12
12
  */
13
- export declare type PlayerIndex = string & {
14
- __playerIndexBrand: any;
13
+ export declare type PlayerIndex = int & {
14
+ __playerIndexBrand: unknown;
15
15
  };
16
16
  /** Iterates over all players and checks if any player is close enough to the specified position. */
17
17
  export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
@@ -81,9 +81,7 @@ export declare function getPlayersOfType(playerType: PlayerType): EntityPlayer[]
81
81
  * relaunching the game.
82
82
  *
83
83
  * Instead, we use `EntityPlayer.GetCollectibleRNG()` with an arbitrary value of 1 (i.e. Sad Onion).
84
- * This works even if the player does not have any Sad Onions. We also convert the numerical seed to
85
- * a string to avoid null element creation when saving the table as JSON (which is necessary when
86
- * saving variables on run exit).
84
+ * This works even if the player does not have any Sad Onions.
87
85
  *
88
86
  * Finally, this index fails in the case of Tainted Lazarus, since the RNG will be the same for both
89
87
  * Tainted Lazarus and Dead Tainted Lazarus. We revert to using the RNG of Inner Eye for this case.
@@ -40,8 +40,7 @@ function ____exports.getPlayerIndex(self, player)
40
40
  local collectibleToUse = ((character == PlayerType.PLAYER_LAZARUS2_B) and CollectibleType.COLLECTIBLE_INNER_EYE) or CollectibleType.COLLECTIBLE_SAD_ONION
41
41
  local collectibleRNG = player:GetCollectibleRNG(collectibleToUse)
42
42
  local seed = collectibleRNG:GetSeed()
43
- local seedString = tostring(seed)
44
- return seedString
43
+ return seed
45
44
  end
46
45
  function ____exports.isChildPlayer(self, player)
47
46
  return player.Parent ~= nil
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { forceNewLevelCallback, forceNewRoomCallback, } from "./callbacks/reorderedCallbacks";
2
- export { CHARACTERS_WITH_NO_RED_HEARTS, DISTANCE_OF_GRID_TILE, DOOR_HITBOX_DISTANCE, FIRST_GLITCHED_COLLECTIBLE_TYPE, GENESIS_ROOM_VARIANT, GOLDEN_TRINKET_SHIFT, GRID_INDEX_CENTER_OF_1X1_ROOM, MAX_NUM_DOORS, MAX_NUM_INPUTS, MAX_PLAYER_POCKET_ITEM_SLOTS, MAX_PLAYER_SPEED_IN_UNITS, MAX_PLAYER_TRINKET_SLOTS, MAX_ROOM_INDEX, MAX_VANILLA_COLLECTIBLE_TYPE, SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES, } from "./constants";
2
+ export { CHARACTERS_WITH_NO_RED_HEARTS, DISTANCE_OF_GRID_TILE, DOOR_HITBOX_DISTANCE, FIRST_GLITCHED_COLLECTIBLE_TYPE, GAME_FRAMES_PER_SECOND, GENESIS_ROOM_VARIANT, GOLDEN_TRINKET_SHIFT, GRID_INDEX_CENTER_OF_1X1_ROOM, ISAAC_FRAMES_PER_SECOND, MAX_NUM_DOORS, MAX_NUM_INPUTS, MAX_PLAYER_POCKET_ITEM_SLOTS, MAX_PLAYER_SPEED_IN_UNITS, MAX_PLAYER_TRINKET_SLOTS, MAX_ROOM_INDEX, MAX_VANILLA_COLLECTIBLE_TYPE, SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES, } from "./constants";
3
3
  export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
4
4
  export { forgottenSwitch } from "./features/forgottenSwitch";
5
5
  export { runInNFrames, runNextFrame } from "./features/runInNFrames";
package/dist/index.lua CHANGED
@@ -13,9 +13,11 @@ do
13
13
  local DISTANCE_OF_GRID_TILE = ____constants.DISTANCE_OF_GRID_TILE
14
14
  local DOOR_HITBOX_DISTANCE = ____constants.DOOR_HITBOX_DISTANCE
15
15
  local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
16
+ local GAME_FRAMES_PER_SECOND = ____constants.GAME_FRAMES_PER_SECOND
16
17
  local GENESIS_ROOM_VARIANT = ____constants.GENESIS_ROOM_VARIANT
17
18
  local GOLDEN_TRINKET_SHIFT = ____constants.GOLDEN_TRINKET_SHIFT
18
19
  local GRID_INDEX_CENTER_OF_1X1_ROOM = ____constants.GRID_INDEX_CENTER_OF_1X1_ROOM
20
+ local ISAAC_FRAMES_PER_SECOND = ____constants.ISAAC_FRAMES_PER_SECOND
19
21
  local MAX_NUM_DOORS = ____constants.MAX_NUM_DOORS
20
22
  local MAX_NUM_INPUTS = ____constants.MAX_NUM_INPUTS
21
23
  local MAX_PLAYER_POCKET_ITEM_SLOTS = ____constants.MAX_PLAYER_POCKET_ITEM_SLOTS
@@ -28,9 +30,11 @@ do
28
30
  ____exports.DISTANCE_OF_GRID_TILE = DISTANCE_OF_GRID_TILE
29
31
  ____exports.DOOR_HITBOX_DISTANCE = DOOR_HITBOX_DISTANCE
30
32
  ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = FIRST_GLITCHED_COLLECTIBLE_TYPE
33
+ ____exports.GAME_FRAMES_PER_SECOND = GAME_FRAMES_PER_SECOND
31
34
  ____exports.GENESIS_ROOM_VARIANT = GENESIS_ROOM_VARIANT
32
35
  ____exports.GOLDEN_TRINKET_SHIFT = GOLDEN_TRINKET_SHIFT
33
36
  ____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = GRID_INDEX_CENTER_OF_1X1_ROOM
37
+ ____exports.ISAAC_FRAMES_PER_SECOND = ISAAC_FRAMES_PER_SECOND
34
38
  ____exports.MAX_NUM_DOORS = MAX_NUM_DOORS
35
39
  ____exports.MAX_NUM_INPUTS = MAX_NUM_INPUTS
36
40
  ____exports.MAX_PLAYER_POCKET_ITEM_SLOTS = MAX_PLAYER_POCKET_ITEM_SLOTS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.334",
3
+ "version": "1.0.335",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",