Class "Level"⚓︎
Functions⚓︎
CanPlaceRoom ()⚓︎
boolean CanPlaceRoom ( RoomConfigRoom RoomConfigToPlace, int GridIndex, Dimension Dimension = -1, bool AllowMultipleDoors = true, bool AllowSpecialNeighbors = false, bool AllowNoNeighbors = false )⚓︎
Returns true if the provided room could be successfully placed at this location using TryPlaceRoom. See documentation for TryPlaceRoom for more information.
CanPlaceRoomAtDoor ()⚓︎
boolean CanPlaceRoomAtDoor ( RoomConfigRoom RoomConfigToPlace, RoomDescriptor NeighborRoomDescriptor, DoorSlot DoorSlot, bool AllowMultipleDoors = true, bool AllowSpecialNeighbors = false )⚓︎
See documentation for TryPlaceRoomAtDoor and TryPlaceRoom for more information. Returns true if the provided room (the RoomConfigRoom) could be successfully placed as a neighbor of an existing room (the RoomDescriptor) at the specified DoorSlot, using TryPlaceRoomAtDoor.
CanSpawnDoorOutline ()⚓︎
boolean CanSpawnDoorOutline ( int RoomIdx, DoorSlot DoorSlot )⚓︎
FindValidRoomPlacementLocations ()⚓︎
int[] FindValidRoomPlacementLocations ( RoomConfigRoom RoomConfig, Dimension Dimension = -1, bool AllowMultipleDoors = true, bool AllowSpecialNeighbors = false )⚓︎
See TryPlaceRoom for more information on room placement and example code.
Returns a table of room grid indices that would be valid locations to place the specified room using TryPlaceRoom.
Note that if you set AllowSpecialNeighbors
to true
, you can get weird placements next to the ultra secret room. You can use GetNeighboringRooms to confirm that potential neighbors are desired before placing your room.
GetDimension ()⚓︎
Dimension GetDimension ( )⚓︎
Get's the current Dimension the player is in.
GetForceSpecialQuest ()⚓︎
SpecialQuest GetForceSpecialQuest ( )⚓︎
If set, the level will automatically attempt to place the Knife Piece puzzle door for this LevelStage.
Info
This is set to SpecialQuest.DEFAULT
immediately before calling MC_PRE_LEVEL_INIT
.
GetGreedWavesClearedWithoutRedHeartDamage ()⚓︎
int GetGreedWavesClearedWithoutRedHeartDamage ( )⚓︎
GetMyosotisPickups ()⚓︎
EntitiesSaveStateVector GetMyosotisPickups ( )⚓︎
Returns the pickups that will be transferred to the next floor by the Myosotis trinket effect.
GetNeighboringRooms ()⚓︎
table GetNeighboringRooms ( int GridIndex, RoomShape, Dimension Dimension = -1 )⚓︎
If you want to get the neighbors of an existing room, you can simply use RoomDescriptor:GetNeighboringRooms() instead.
if roomType == RoomType.ROOM_SECRET or roomType == RoomType.ROOM_SUPERSECRET or roomType == RoomType.ROOM_ULTRASECRET then
Returns a table that maps DoorSlot to RoomDescriptor for all of the neighbors that a room of the specified shape would have if placed at this location.
return false
Note that this does not give you any information on if a room would actually fit here, or if the neighbors would even allow the connection.
for doorSlot, neighborDesc in pairs(Game():GetLevel():GetNeighboringRooms(gridIndex, roomShape)) do
end
Don't use ipairs
to iterate over this, use pairs
!
1 2 3 4 5 |
|
HasAbandonedMineshaft ()⚓︎
boolean HasAbandonedMineshaft ( )⚓︎
Returns true
if the floor has the mineshaft room used for the second Knife Piece puzzle.
HasMirrorDimension ()⚓︎
boolean HasMirrorDimension ( )⚓︎
Returns true
if the floor has the mirror dimension used for the first Knife Piece puzzle.
HasPhotoDoor ()⚓︎
boolean HasPhotoDoor ( )⚓︎
Returns true
if the floor has the photo door used to enter Mausoleum/Gehenna leading to the Ascent sequence.
IsStageAvailable ()⚓︎
void IsStageAvailable ( LevelStage Level, StageType Stage )⚓︎
Returns true
if the provided Level
and Stage
combination is available to be generated in any given run. Returns false
if locked behind an achievement.
PlaceRoom ()⚓︎
boolean PlaceRoom ( LevelGeneratorEntry Room, RoomConfigRoom RoomConfig, int Seed )⚓︎
Places a room into the game. Returns true
if successful.
See TryPlaceRoom and related functions if you want to properly add new rooms to the floor after level generation, similarly to what Red Key does.
Note that this function does not really check if a room placement would be considered valid, nor does it create the doors necessary to connect the new room to its neighbors.
SetForceSpecialQuest ()⚓︎
void SetForceSpecialQuest ( SpecialQuest Quest )⚓︎
Sets whether the level should attempt to place the Knife Piece puzzle door for this LevelStage.
Info
This is set to SpecialQuest.DEFAULT
immediately before calling MC_PRE_LEVEL_INIT
.
SetGreedWavesClearedWithoutRedHeartDamage ()⚓︎
void SetGreedWavesClearedWithoutRedHeartDamage ( int WavesCleared )⚓︎
SetName ()⚓︎
void SetName ( string Name )⚓︎
TryPlaceRoom ()⚓︎
RoomDescriptor TryPlaceRoom ( RoomConfigRoom RoomConfigToPlace, int GridIndex, Dimension Dimension = -1, int Seed = 0, bool AllowMultipleDoors = true, bool AllowSpecialNeighbors = false, bool AllowNoNeighbors = false )⚓︎
-- Try to place the room. Attempts to place the provided room at the specified location.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
TryPlaceRoomAtDoor ()⚓︎
RoomDescriptor TryPlaceRoomAtDoor ( RoomConfigRoom RoomConfigToPlace, RoomDescriptor NeighborRoomDescriptor, DoorSlot DoorSlot, int Seed = 0, bool AllowMultipleDoors = true, bool AllowSpecialNeighbors = false )⚓︎
local room = game:GetRoom() success = true local newRoom = level:TryPlaceRoomAtDoor(roomConfig, roomDesc, doorSlot, seed, true, false) -- Bitmask check to identify if the current room would even allow a door to be placed here. if newRoom then return {ShowAnim=true}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|