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
|
|
50
|
-
*
|
|
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
|
/**
|
package/dist/functions/doors.lua
CHANGED
|
@@ -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)
|