isaacscript-common 1.0.504 → 1.0.505

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.
@@ -44,6 +44,12 @@ export declare function isDoorToMines(door: GridEntityDoor): boolean;
44
44
  export declare function isDoorToMomsHeart(door: GridEntityDoor): boolean;
45
45
  export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
46
46
  export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
47
+ /**
48
+ * Helper function to reset an unlocked door back to a locked state. Doing this is non-trivial
49
+ * because you must also set the variant and close the door in addition to calling the `SetLocked()`
50
+ * method.
51
+ */
52
+ export declare function lockDoor(door: GridEntityDoor): void;
47
53
  /**
48
54
  * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been
49
55
  * discovered yet will not be opened.
@@ -125,6 +125,11 @@ function ____exports.isDoorToMomsHeart(self, door)
125
125
  local filename = sprite:GetFilename()
126
126
  return filename == "gfx/grid/Door_MomsHeart.anm2"
127
127
  end
128
+ function ____exports.lockDoor(self, door)
129
+ door:SetVariant(DoorVariant.DOOR_LOCKED)
130
+ door:SetLocked(true)
131
+ door:Close(true)
132
+ end
128
133
  function ____exports.openAllDoors(self)
129
134
  for ____, door in ipairs(____exports.getDoors(nil)) do
130
135
  door:Open()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.504",
3
+ "version": "1.0.505",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",