isaacscript-common 1.0.505 → 1.0.506

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.
@@ -46,8 +46,11 @@ export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
46
46
  export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
47
47
  /**
48
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.
49
+ * because in addition to calling the `SetLocked()` method, you must also:
50
+ *
51
+ * - Modify the `VisitedCount` of the room's `RoomDescription` to be set to 0.
52
+ * - Set the variant to `DoorVariant.DOOR_LOCKED`.
53
+ * - Close the door.
51
54
  */
52
55
  export declare function lockDoor(door: GridEntityDoor): void;
53
56
  /**
@@ -126,6 +126,10 @@ function ____exports.isDoorToMomsHeart(self, door)
126
126
  return filename == "gfx/grid/Door_MomsHeart.anm2"
127
127
  end
128
128
  function ____exports.lockDoor(self, door)
129
+ local game = Game()
130
+ local level = game:GetLevel()
131
+ local roomDesc = level:GetRoomByIdx(door.TargetRoomIndex)
132
+ roomDesc.VisitedCount = 0
129
133
  door:SetVariant(DoorVariant.DOOR_LOCKED)
130
134
  door:SetLocked(true)
131
135
  door:Close(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.505",
3
+ "version": "1.0.506",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",