isaacscript-common 1.0.574 → 1.0.575

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,5 +1,10 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export declare function closeAllDoors(): void;
3
+ /**
4
+ * Use this instead of the `door.Close()` method if you want the door to immediately close without
5
+ * an animation.
6
+ */
7
+ export declare function closeDoorFast(door: GridEntityDoor): void;
3
8
  /**
4
9
  * Helper function to get all of the doors in the room. By default, it will return every door. You
5
10
  * can optionally specify one or more room types to return only the doors that match the specified
@@ -63,3 +68,8 @@ export declare function lockDoor(door: GridEntityDoor): void;
63
68
  * discovered yet will not be opened.
64
69
  */
65
70
  export declare function openAllDoors(): void;
71
+ /**
72
+ * Use this instead of the `door.Open()` method if you want the door to immediately open without
73
+ * an animation.
74
+ */
75
+ export declare function openDoorFast(door: GridEntityDoor): void;
@@ -15,7 +15,7 @@ function ____exports.getDoors(self, ...)
15
15
  do
16
16
  local door = room:GetDoor(i)
17
17
  if door == nil then
18
- goto __continue5
18
+ goto __continue6
19
19
  end
20
20
  if #roomTypes == 0 then
21
21
  __TS__ArrayPush(doors, door)
@@ -23,7 +23,7 @@ function ____exports.getDoors(self, ...)
23
23
  __TS__ArrayPush(doors, door)
24
24
  end
25
25
  end
26
- ::__continue5::
26
+ ::__continue6::
27
27
  i = i + 1
28
28
  end
29
29
  end
@@ -50,6 +50,11 @@ function ____exports.closeAllDoors(self)
50
50
  door:Close(true)
51
51
  end
52
52
  end
53
+ function ____exports.closeDoorFast(self, door)
54
+ door.State = DoorState.STATE_CLOSED
55
+ local sprite = door:GetSprite()
56
+ sprite:Play("Closed", true)
57
+ end
53
58
  function ____exports.getAngelRoomDoor(self)
54
59
  for ____, door in ipairs(
55
60
  ____exports.getDoors(nil)
@@ -151,4 +156,9 @@ function ____exports.openAllDoors(self)
151
156
  door:Open()
152
157
  end
153
158
  end
159
+ function ____exports.openDoorFast(self, door)
160
+ door.State = DoorState.STATE_OPEN
161
+ local sprite = door:GetSprite()
162
+ sprite:Play("Opened", true)
163
+ end
154
164
  return ____exports
@@ -9,6 +9,7 @@ local ____doors = require("functions.doors")
9
9
  local closeAllDoors = ____doors.closeAllDoors
10
10
  local getDoors = ____doors.getDoors
11
11
  local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
12
+ local openDoorFast = ____doors.openDoorFast
12
13
  local ____entity = require("functions.entity")
13
14
  local getEntities = ____entity.getEntities
14
15
  local getEntityPositions = ____entity.getEntityPositions
@@ -297,9 +298,7 @@ function ____exports.setRoomCleared(self)
297
298
  if isHiddenSecretRoomDoor(nil, door) then
298
299
  goto __continue56
299
300
  end
300
- door.State = DoorState.STATE_OPEN
301
- local sprite = door:GetSprite()
302
- sprite:Play("Opened", true)
301
+ openDoorFast(nil, door)
303
302
  door.ExtraVisible = false
304
303
  end
305
304
  ::__continue56::
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.574",
3
+ "version": "1.0.575",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",