The dungeon factory
Methods
-
<inner> _generate()
-
Generate the tiles using ROT's digger
-
<inner> _getItem(x, y) → {object}
-
Return the item at (x, y), if there is one
Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- object
-
<inner> _getMonster(x, y) → {object}
-
Return the monster at (x, y), if there is one
Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- object
-
<inner> _getSeed() → {boolean}
-
Get ROT's current seed
Returns:
- Type
- boolean
-
<inner> _hasDoor(x, y) → {boolean}
-
Return true if a door exists at (x, y)
Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- boolean
-
<inner> _hasItem(x, y) → {boolean}
-
Return true if an item exists at (x, y)
Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- boolean
-
<inner> _hasMonster(x, y) → {boolean}
-
Return true if a monster is at (x, y)
Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- boolean
-
<inner> _isAvailable(x, y) → {boolean}
-
Return true if (x, y) is a valid, unoccupied tile
(i.e. it is unoccupied by the player, a monster, or a door, and it's a valid tile)Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- boolean
-
<inner> _moveCreature(creature, x, y) → {object}
-
Attempt to move add (x, y) to the creature position, and return the outcome
Parameters:
Name Type Description creatureobject xnumber ynumber Returns:
Object containing the following boolean value: moved (did the creature move?), door (did they open a door?), combat (did they engage in combat?)- Type
- object
-
<inner> _placeDoors()
-
Analyze ROT rooms and place doors
-
<inner> _placeWalls()
-
Place and autojoin walls around tiles
-
<inner> _spawnItems()
-
Place items throughout the dungeon
-
<inner> _spawnMonsters()
-
Place a monster in the middle of each room, if the tile is available
-
<inner> _spawnPlayer(x, y)
-
Spawn the player at (x, y)
Parameters:
Name Type Description xnumber ynumber -
<inner> _spawnStairs()
-
Spawn the stairs in the room that was sorted to be furthest from the playher
-
<inner> _validTile(x, y) → {boolean}
-
Return true if (x, y) exists in this.tiles
Parameters:
Name Type Description xnumber ynumber Returns:
- Type
- boolean