Class "RoomDescriptor"⚓︎
Modified Variables⚓︎
AllowedDoors⚓︎
DoorSet AllowedDoors⚓︎
Now properly returns a value.
Returns a bitmask corresponding to which door slots are currently enabled.
Doors are typically only included in this bitmask when there is a door currently present, even if the room would allow a door in that slot.
Example
This tests if the DoorSlot LEFT0 is enabled.
1 2 3 | |
Functions⚓︎
AddRestrictedGridIndex ()⚓︎
void AddRestrictedGridIndex ( int GridIndex )⚓︎
GetDecoSaveState ()⚓︎
EntitiesSaveStateVector GetDecoSaveState ( )⚓︎
GetDimension ()⚓︎
Dimension GetDimension ( )⚓︎
Returns the Dimension that this room exists in.
GetEntitiesSaveState ()⚓︎
EntitiesSaveStateVector GetEntitiesSaveState ( )⚓︎
GetErrorTrinketEffect ()⚓︎
TrinketType GetErrorTrinketEffect ( )⚓︎
Returns the current effect that would be mimicked by the "Error" trinket (TrinketType.TRINKET_ERROR) for a player in this room.
Note that this effect is based entirely on the SpawnSeed.
GetGridEntitiesSaveState ()⚓︎
GridEntitiesSaveStateVector GetGridEntitiesSaveState ( )⚓︎
GetNeighboringRooms ()⚓︎
table GetNeighboringRooms ( )⚓︎
Returns a table that maps DoorSlot to RoomDescriptor for all of the current neighbors of this room.
Don't use ipairs to iterate over this, use pairs!
Example Code
1 2 3 4 5 6 7 8 9 10 | |
GetRestrictedGridIndexes ()⚓︎
int[] GetRestrictedGridIndexes ( )⚓︎
GetTaintedKeeperCoinSpawns ()⚓︎
int GetTaintedKeeperCoinSpawns ( )⚓︎
Prevent coin spawn from killed enemies on room reenter when counter reaches 10.
GetValidNeighborPlacementLocations ()⚓︎
int[] GetValidNeighborPlacementLocations ( RoomConfigRoom RoomConfig, boolean AllowMultipleDoors = true, boolean AllowSpecialNeighbors = false )⚓︎
int[] GetValidNeighborPlacementLocations ( RoomShape RoomShape = 1, DoorMask DoorMask = -1, boolean AllowMultipleDoors = true, boolean AllowSpecialNeighbors = false )⚓︎
Returns a table of room grid indices that would be valid locations to place the specified room as a neighbor of this room using TryPlaceRoom.
See TryPlaceRoom for more information on room placement and example code.
InitSeeds ()⚓︎
void InitSeeds ( RNG RNG )⚓︎
SetTaintedKeeperCoinSpawns ()⚓︎
void SetTaintedKeeperCoinSpawns ( int Num )⚓︎
GetGroup ()⚓︎
int GetGroup ()⚓︎
Usage
Group is only used by effects that need to randomly select a room to warp to (e.g. Teleport, Gold Pill Teleport, etc.).
A room can only be selected if its group is either RoomGroup.GROUP_NONE or matches the current room's group.
By default, all rooms use RoomGroup.GROUP_NONE. The only exception is Ultra Secret Rooms, which are assigned a different group by the game during level generation.
SetGroup ()⚓︎
void SetGroup ( int group )⚓︎
It is suggested to use CreateGroup instead of setting an arbitrary group.
Usage
Group is only used by effects that need to randomly select a room to warp to (e.g. Teleport, Gold Pill Teleport, etc.).
A room can only be selected if its group is either RoomGroup.GROUP_NONE or matches the current room's group.
By default, all rooms use RoomGroup.GROUP_NONE. The only exception is Ultra Secret Rooms, which are assigned a different group by the game during level generation.
CreateGroup ()⚓︎
static int CreateGroup ( string groupName )⚓︎
Creates a new unique group id for SetGroup
Errors
The function will error if a group with the specified name already exists.
GetGroupByName ()⚓︎
static int? GetGroupByName ( string groupName )⚓︎
Returns the group id tied to the specified name.
Returns nil if the name has not been registered.
Variables⚓︎
BossDeathSeed⚓︎
const int BossDeathSeed⚓︎
Doors⚓︎
const int[] Doors⚓︎
Allows you to check which level grid index each DoorSlot in the room connects to.
For example, roomdesc.Doors[DoorSlot.UP0] provides the level grid index that the upwards door would connect to.
The value will be -1 if the RoomShape does not allow a door in that slot.
Note that this typically provides a valid index even if there is no door present, and even if the room itself does not allow a door in that slot.