Difference between revisions of "Modding:generator API (0.9.9.7)"
From DoomRL Wiki
Game Hunter (Talk | contribs) m (lua functions in list form: descriptions to come) |
Game Hunter (Talk | contribs) (added descriptions (valkyrie functions still required)) |
||
Line 1: | Line 1: | ||
− | The generator holds all of the ever-present functions used to create the random maps in DoomRL. It also contains a variety of helper functions, many of them useful if not vital to the creation of intricate | + | The generator holds all of the ever-present functions used to create the random maps in DoomRL. It also contains a variety of helper functions, many of them useful if not vital to the creation of intricate and meticulous game design. |
== API == | == API == | ||
Line 14: | Line 14: | ||
|void|Generator.[[#generator_setup_perma_event|setup_perma_event]]() | |void|Generator.[[#generator_setup_perma_event|setup_perma_event]]() | ||
|void|Generator.[[#generator_setup_alarm_event|setup_alarm_event]]() | |void|Generator.[[#generator_setup_alarm_event|setup_alarm_event]]() | ||
− | |void|Generator.[[#generator_setup_deadly_air_event|setup_deadly_air_event]]() | + | |void|Generator.[[#generator_setup_deadly_air_event|setup_deadly_air_event]]('''integer''' step) |
− | |void|Generator.[[#generator_setup_nuke_event|setup_nuke_event]]() | + | |void|Generator.[[#generator_setup_nuke_event|setup_nuke_event]]('''integer''' minutes) |
− | |void|Generator.[[#generator_setup_flood_event|setup_flood_event]]() | + | |void|Generator.[[#generator_setup_flood_event|setup_flood_event]]('''integer''' direction, '''integer''' step, [[Modding:Cell|Cell]] cell, '''boolean''' pure) |
|integer|Generator.[[#generator_being_weight|being_weight]]() | |integer|Generator.[[#generator_being_weight|being_weight]]() | ||
|integer|Generator.[[#generator_item_amount|item_amount]]() | |integer|Generator.[[#generator_item_amount|item_amount]]() | ||
− | |void|Generator.[[#generator_restore_walls|restore_walls]]() | + | |void|Generator.[[#generator_restore_walls|restore_walls]]([[Modding:Cell|Cell]] wall_cell, '''boolean''' keep_fluids) |
|list|Generator.[[#generator_cell_set|cell_set]]('''list''' list) | |list|Generator.[[#generator_cell_set|cell_set]]('''list''' list) | ||
|void|Generator.[[#generator_horiz_river|horiz_river]]([[Modding:Cell|Cell]] cell, '''integer''' width, '''boolean''' bridge) | |void|Generator.[[#generator_horiz_river|horiz_river]]([[Modding:Cell|Cell]] cell, '''integer''' width, '''boolean''' bridge) | ||
Line 27: | Line 27: | ||
|void|Generator.[[#generator_drunkard_walks|drunkard_walks]]('''integer''' amount, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge, [[Modding:Area|Area]] drunk_area) | |void|Generator.[[#generator_drunkard_walks|drunkard_walks]]('''integer''' amount, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge, [[Modding:Area|Area]] drunk_area) | ||
|void|Generator.[[#generator_contd_drunkard_walks|contd_drunkard_walks]]('''integer''' amount, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]] edges1, [[Modding:Cell|Cell]] edges2, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge) | |void|Generator.[[#generator_contd_drunkard_walks|contd_drunkard_walks]]('''integer''' amount, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]] edges1, [[Modding:Cell|Cell]] edges2, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge) | ||
− | |void|Generator.[[#generator_plot_lines|plot_lines]]([[Modding:Coord|Coord]] where, [[Modding:Area|Area]] larea, '''boolean''' horiz, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]] block) | + | |void|Generator.[[#generator_plot_lines|plot_lines]]([[Modding:Coord|Coord]] where, [[Modding:Area|Area]] larea, '''boolean''' horiz, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]]'''List''' block) |
|void|Generator.[[#generator_maze_dungeon|maze_dungeon]]([[Modding:Cell|Cell]] floor_cell, [[Modding:Cell|Cell]] wall_cell, '''integer''' granularity, '''integer''' tries, '''integer''' minl, '''integer''' maxl) | |void|Generator.[[#generator_maze_dungeon|maze_dungeon]]([[Modding:Cell|Cell]] floor_cell, [[Modding:Cell|Cell]] wall_cell, '''integer''' granularity, '''integer''' tries, '''integer''' minl, '''integer''' maxl) | ||
|void|Generator.[[#generator_warehouse_fill|warehouse_fill]]([[Modding:Cell|Cell]] wall_cell, [[Modding:Area|Area]] fill_area, '''integer''' box_size, '''integer''' amount) | |void|Generator.[[#generator_warehouse_fill|warehouse_fill]]([[Modding:Cell|Cell]] wall_cell, [[Modding:Area|Area]] fill_area, '''integer''' box_size, '''integer''' amount) | ||
− | |void|Generator.[[#generator_add_room|add_room]]() | + | |void|Generator.[[#generator_warehouse_dungeon|warehouse_dungeon]]() |
+ | |void|Generator.[[#generator_add_room|add_room]]([[Modding:Area|Area]] room) | ||
|boolean|Generator.[[#generator_add_rooms|add_rooms]]() | |boolean|Generator.[[#generator_add_rooms|add_rooms]]() | ||
|[[Modding:Generator|Room]]|Generator.[[#generator_get_room|get_room]]('''integer''' min_size, '''integer''' max_x, '''integer''' max_y) | |[[Modding:Generator|Room]]|Generator.[[#generator_get_room|get_room]]('''integer''' min_size, '''integer''' max_x, '''integer''' max_y) | ||
Line 58: | Line 59: | ||
|}} | |}} | ||
|} | |} | ||
+ | |||
+ | {{Anchor|generator_safe_empty_coord}} | ||
+ | ;Generator.safe_empty_coord() → [[Modding:Coord|Coord]] | ||
+ | :Gives a coordinate that satisfies all [[Modding:Constants#Empty Flags|empty flags]]. If one cannot be found, another attempt is made that excludes EF_NOSAFE; if one still cannot be found, another attempt is made that additionally excludes EF_NOSTAIRS and EF_NOHARM. | ||
+ | ---- | ||
+ | {{Anchor|generator_standard_empty_coord}} | ||
+ | ;Generator.standard_empty_coord() → [[Modding:Coord|Coord]] | ||
+ | :Gives a coordinate that satisfies all empty flags other than EF_NOSAFE. | ||
+ | ---- | ||
+ | {{Anchor|generator_set_permanence}} | ||
+ | ;Generator.set_permanence([[Modding:Area|Area]] ar, '''boolean''' val, [[Modding:Cell|Cell]] tile) | ||
+ | :Sets the state of all cells' [[Modding:Constants#LightFlag|LFPERMANENT]] flag within ''ar''. ''val'' determines the state of LFPERMANENT: it is true by default. If set, only cells of the ''tile'' identifier will be affected: by default, all wall tiles in the area are affected. | ||
+ | ---- | ||
+ | {{Anchor|generator_setup_ice_event}} | ||
+ | ;Generator.setup_ice_event() | ||
+ | :Adds the "frozen" level event to the map and records it in the mortem history. Levels with the frozen event change all walls into ice walls and all fluids into water. | ||
+ | ---- | ||
+ | {{Anchor|generator_setup_perma_event}} | ||
+ | ;Generator.setup_perma_event() | ||
+ | :Adds the "sturdy" level event to the map and records it in the mortem history. Levels with the sturdy event set all wall tiles to be permanent. | ||
+ | ---- | ||
+ | {{Anchor|generator_setup_alarm_event}} | ||
+ | ;Generator.setup_alarm_event() | ||
+ | :Adds the "alarm" level event to the map and records it in the mortem history. Levels with the alarm event set all non-player beings' [[Modding:Constants|Being Flags|BF_HUNTING]] flag to true. | ||
+ | ---- | ||
+ | {{Anchor|generator_setup_deadly_air_event}} | ||
+ | ;Generator.setup_deadly_air_event('''integer''' step) | ||
+ | :Adds the "deadly air" event to the map and records it in the mortem history. Levels with the deadly air event cause all beings to lose hit points every '''step''' turns. | ||
+ | ---- | ||
+ | {{Anchor|generator_setup_nuke_event}} | ||
+ | ;Generator.setup_nuke_event('''integer''' minutes) | ||
+ | :Adds the "armed nuke" event to the map and records it in the mortem history. Levels with the armed nuke event begin with a [[thermonuclear bomb]] set at the player's starting position, which will explode in ''minutes'' game minutes. | ||
+ | ---- | ||
+ | {{Anchor|generator_setup_flood_event}} | ||
+ | ;Generator.setup_flood_event('''integer''' direction, '''integer''' step, [[Modding:Cell|Cell]] cell, '''boolean''' pure) | ||
+ | :Adds the "flood" event to the map and records it in the mortem history. Levels with the flood event are slowly filled with a fluid: ''direction'' determines whether the floor travels from the right (-1) or from the left (+1); every ''step'' turns, ''cell'' will replace all tiles in a next column to be flooded. Setting ''pure'' to false will move the player and stairs to opposite sides of the map, with the player nearest the flood. | ||
+ | ---- | ||
+ | {{Anchor|generator_being_weight}} | ||
+ | ;Generator.being_weight() → '''integer''' | ||
+ | :Gives a value equal to the difficulty-adjusted weight of beings for a given danger level. These are the results used for the base game's monster generation parameters. | ||
+ | ---- | ||
+ | {{Anchor|generator_item_amount}} | ||
+ | ;Generator.item_amount() → '''integer''' | ||
+ | :Gives a value equal to the number of items spawned for a given danger level. On level types where the this amount isn't preset, this is the result used for the base game's item generation parameters. | ||
+ | ---- | ||
+ | {{Anchor|generator_restore_walls}} | ||
+ | ;Generator.restore_walls([[Modding:Cell|Cell]] wall_cell, '''boolean''' keep_fluids) | ||
+ | :Sets all cells on the edge of the map to ''wall_cell''. If ''keep_fluids'' is set to true, fluid tiles will be maintained but set as permanent. | ||
+ | ---- | ||
+ | {{Anchor|generator_cell_set}} | ||
+ | ;Generator.cell_set('''list''' list) → '''list''' | ||
+ | :Creates a cellset for all cells in ''list''. The returned list functions just like any [[Modding:Constants#Cellsets|CELLSET constant]]. | ||
+ | ---- | ||
+ | {{Anchor|generator_horiz_river}} | ||
+ | ;Generator.horiz_river([[Modding:Cell|Cell]] cell, '''integer''' width, '''boolean''' bridge) | ||
+ | :Adds a horizontal river to the map, created using ''cell'' tiles. ''width'' sets the tile-width of the river. If ''bridge'' is set to true, a non-fluid floor bridge will be created on the river. | ||
+ | ---- | ||
+ | {{Anchor|generator_vert_river}} | ||
+ | ;Generator.vert_river([[Modding:Cell|Cell]] cell, '''integer''' width, '''boolean''' bridge, [[Modding:Coord|Coord]] pos) | ||
+ | ;Generator.vert_river([[Modding:Cell|Cell]] cell, '''integer''' width, '''boolean''' bridge, '''integer''' pos) | ||
+ | :Adds a vertical river to the map, created using ''cell'' tiles. ''width'' sets the tile-width of the river, and ''pos'' sets the starting position of the river. If ''pos'' is given as an integer, then the starting y-coordinate of the river is at the top of the map. If ''bridge'' is set to true, a non-fluid floor bridge will be created on the river. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_rivers}} | ||
+ | ;Generator.generate_rivers('''boolean''' allow_horiz, '''boolean''' allow_more) | ||
+ | :Generates a random number of horizontal and vertical rivers on the map. See [[Fluids#Rivers|Rivers]] for more information. The fluid type varies with map depth. | ||
+ | ---- | ||
+ | {{Anchor|generator_drunkard_walk}} | ||
+ | ;Generator.drunkard_walk([[Modding:Coord|Coord]] start, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge) | ||
+ | :Generates ''cell'' tiles according to a drunken walk algorithm. It travels ''steps'' times, starting at the coordinate ''start''. Any cells in ''ignore'' will not be set over but the algorithm will still continue. If ''break_on_edge'' is set to true, the drunken walk will stop if it hits a map border: otherwise it will continue, clamping cells within the map as necessary. | ||
+ | ---- | ||
+ | {{Anchor|generator_drunkard_walks}} | ||
+ | ;Generator.drunkard_walks('''integer''' amount, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge, [[Modding:Area|Area]] drunk_area) | ||
+ | :As Generator.drunkard_walk, but repeated ''amount'' times. Additionally, rather than specifically a starting position, all walks are chosen from a random coordinate within ''drunk_area''. | ||
+ | ---- | ||
+ | {{Anchor|generator_contd_drunkard_walks}} | ||
+ | ;Generator.contd_drunkard_walks('''integer''' amount, '''integer''' steps, [[Modding:Cell|Cell]] cell, [[Modding:Coord|Coord]] edges1, [[Modding:Coord|Coord]] edges2, [[Modding:Cell|Cell]]'''List''' ignore, '''boolean''' break_on_edge) | ||
+ | :As Generator.drunkard_walks, but rather than limiting the walk's starting position, the walk will stop prematurely if it has reached the x- or y-coordinates of both ''edges1'' and ''edges2''. | ||
+ | ---- | ||
+ | {{Anchor|generator_plot_lines}} | ||
+ | ;Generator.plot_lines([[Modding:Coord|Coord]] where, [[Modding:Area|Area]] larea, '''boolean''' horiz, [[Modding:Cell|Cell]] cell, [[Modding:Cell|Cell]]'''List''' block) | ||
+ | :Generates a line of ''cell'' tiles on the map, starting at ''where'' and extending to the boundaries of ''larea''. ''horiz'' set to true will produce horizontal lines: otherwise it will produce vertical lines. If a cell from ''block'' is found, the line will end prematurely at the end on which it was blocked. | ||
+ | ---- | ||
+ | {{Anchor|generator_maze_dungeon}} | ||
+ | ;Generator.maze_dungeon([[Modding:Cell|Cell]] floor_cell, [[Modding:Cell|Cell]] wall_cell, '''integer''' granularity, '''integer''' tries, '''integer''' minl, '''integer''' maxl) | ||
+ | :Generates a map-wide maze, using ''wall_cell'' as the wall tiles and ''floor_cell'' as the floor tiles. Wall corridors are at least ''minl'' tiles apart and at most ''maxl'' tiles apart: ''granularity'' sets a rough complexity of the map. The number of walls attempted to be made is equal to ''tries''. | ||
+ | ---- | ||
+ | {{Anchor|generator_warehouse_fill}} | ||
+ | ;Generator.warehouse_fill([[Modding:Cell|Cell]] wall_cell, [[Modding:Area|Area]] fill_area, '''integer''' box_size, '''integer''' amount) | ||
+ | :Generates ''wall_cell'' tiles in the shape of a square within ''fill_area''. ''boxsize'' sets the size of the side of a box, and ''amount'' sets the number of tries for boxes to be added. | ||
+ | ---- | ||
+ | {{Anchor|generator_warehouse_dungeon}} | ||
+ | ;Generator.warehouse_dungeon() | ||
+ | :Generates a map-wide warehouse setting. Warehouse dungeons are divided into three large rooms, each attempting 50 tries with boxes of side length 3. | ||
+ | ---- | ||
+ | {{Anchor|generator_add_room}} | ||
+ | ;Generator.add_room([[Modding:Area|Area]] room) | ||
+ | :Adds ''room'' to the Generator.room_list and Generator.room_meta lists. This is used in conjunction with room generation functions. | ||
+ | ---- | ||
+ | {{Anchor|generator_add_rooms}} | ||
+ | ;Generator.add_rooms() → '''boolean''' | ||
+ | :As Generator.add_room, but locates all rooms on the map and adds them to Generator.room_list and Generator.room_meta instead. | ||
+ | ---- | ||
+ | {{Anchor|generator_get_room}} | ||
+ | ;Generator.get_room('''integer''' min_size, '''integer''' max_x, '''integer''' max_y) → [[Modding:Generator|Room]] | ||
+ | :Finds a room that contains at least ''min_size'' in both height and width, and has a width and height no bigger than ''max_x'' and ''max_y'', respectively. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_tiled}} | ||
+ | ;Generator.generate_tiled() | ||
+ | :Generates a "normal" map. Normal levels are divided randomly into rectangular rooms. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_warehouse_dungeon}} | ||
+ | ;Generator.generate_warehouse_dungeon() | ||
+ | :Builds a "warehouse" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_tiled_arena_dungeon}} | ||
+ | ;Generator.generate_tiled_arena_dungeon() | ||
+ | :Builds a "single-monster" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_city_dungeon}} | ||
+ | ;Generator.generate_city_dungeon() | ||
+ | :Builds a "city" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_maze_dungeon}} | ||
+ | ;Generator.generate_maze_dungeon() | ||
+ | :Builds a "maze" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_archi_dungeon}} | ||
+ | ;Generator.generate_archi_dungeon() | ||
+ | :Builds an "archi" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_caves_dungeon}} | ||
+ | ;Generator.generate_caves_dungeon() | ||
+ | :Builds a "cave" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_arena_dungeon}} | ||
+ | ;Generator.generate_arena_dungeon() | ||
+ | :Builds an "arena" level. This includes everything necessary to be played as a typical random level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_fluids}} | ||
+ | ;Generator.generate_fluids([[Modding:Area|Area]] drunk_area) | ||
+ | :Generates all non-river fluids on the map using drunken walks, within ''drunk_area''. The fluid type varies with danger level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_barrels}} | ||
+ | ;Generator.generate_barrels() | ||
+ | :Generates all barrels on the map, The barrel type varies with danger level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_stairs}} | ||
+ | ;Generator.generate_stairs() | ||
+ | :Generates stairs on the map. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_special_stairs}} | ||
+ | ;Generator.generate_special_stairs() | ||
+ | :Generates special stairs on the map, if a special level exists at the current map depth. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_lever_room}} | ||
+ | ;Generator.generate_lever_room() | ||
+ | :Finds a room of appropriate size and adjusts it into a lever room. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_teleport_room}} | ||
+ | ;Generator.generate_teleport_room() | ||
+ | :Finds a room of appropriate size and adjusts it into a teleporter room. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_ammo_room}} | ||
+ | ;Generator.generate_ammo_room() | ||
+ | :Finds a room of appropriate size and adjusts it into an ammo room. The type of ammo varies with danger level. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_basain}} | ||
+ | ;Generator.generate_basain() | ||
+ | :Finds a room of appropriate size and adjusts it into a room filled with fluid. | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_warehouse_room}} | ||
+ | ;Generator.generate_warehouse_room() | ||
+ | :Finds a room of appropriate size and adjusts it into a room with boxes (as Generator.warehouse_fill). | ||
+ | ---- | ||
+ | {{Anchor|generator_generate_vault}} | ||
+ | ;Generator.generate_vault() | ||
+ | :Finds a room of appropriate size and adjust it into a vault. The monsters, items, and type of vault vary with danger level. | ||
+ | ---- | ||
+ | {{Anchor|generator_add_room_feature}} | ||
+ | ;Generator.add_room_feature('''boolean''' no_monsters) | ||
+ | :Randomly selects a room generation function to be added to the map. ''no_monsters'' set to true excludes the possibility of a vault room being generated. | ||
+ | ---- | ||
+ | {{Anchor|generator_handle_rooms}} | ||
+ | ;Generator.handle_rooms('''boolean''' no_monsters) | ||
+ | :Generates up to seven special rooms on the map and restores walls that were otherwise removed as a result of the room generation. | ||
+ | ---- | ||
+ | {{Anchor|generator_place_player}} | ||
+ | ;Generator.place_player() | ||
+ | :Adds to player to the map. | ||
+ | ---- | ||
+ | {{Anchor|generator_roll_event}} | ||
+ | ;Generator.roll_event() | ||
+ | :Randomly select a level event function to be added to the map. | ||
+ | ---- | ||
+ | {{Anchor|generator_reset}} | ||
+ | ;Generator.reset() | ||
+ | :Clears all generation properties and hooks, and changes the map into one bordered with the level style's walls and otherwise filled with the level style's floors. |
Revision as of 21:03, 25 January 2012
The generator holds all of the ever-present functions used to create the random maps in DoomRL. It also contains a variety of helper functions, many of them useful if not vital to the creation of intricate and meticulous game design.
API
Level Interface | |
---|---|
Coord | Generator.safe_empty_coord() |
Coord | Generator.standard_empty_coord() |
void | Generator.set_permanence(Area ar, boolean val, Cell tile) |
void | Generator.setup_ice_event() |
void | Generator.setup_perma_event() |
void | Generator.setup_alarm_event() |
void | Generator.setup_deadly_air_event(integer step) |
void | Generator.setup_nuke_event(integer minutes) |
void | Generator.setup_flood_event(integer direction, integer step, Cell cell, boolean pure) |
integer | Generator.being_weight() |
integer | Generator.item_amount() |
void | Generator.restore_walls(Cell wall_cell, boolean keep_fluids) |
list | Generator.cell_set(list list) |
void | Generator.horiz_river(Cell cell, integer width, boolean bridge) |
void | Generator.vert_river(Cell cell, integer width, boolean bridge, Coord pos) |
void | Generator.generate_rivers(boolean allow_horiz, boolean allow_more) |
void | Generator.drunkard_walk(Coord start, integer steps, Cell cell, CellList ignore, boolean break_on_edge) |
void | Generator.drunkard_walks(integer amount, integer steps, Cell cell, CellList ignore, boolean break_on_edge, Area drunk_area) |
void | Generator.contd_drunkard_walks(integer amount, integer steps, Cell cell, Cell edges1, Cell edges2, CellList ignore, boolean break_on_edge) |
void | Generator.plot_lines(Coord where, Area larea, boolean horiz, Cell cell, CellList block) |
void | Generator.maze_dungeon(Cell floor_cell, Cell wall_cell, integer granularity, integer tries, integer minl, integer maxl) |
void | Generator.warehouse_fill(Cell wall_cell, Area fill_area, integer box_size, integer amount) |
void | Generator.warehouse_dungeon() |
void | Generator.add_room(Area room) |
boolean | Generator.add_rooms() |
Room | Generator.get_room(integer min_size, integer max_x, integer max_y) |
void | Generator.generate_tiled() |
void | Generator.generate_warehouse_dungeon() |
void | Generator.generate_tiled_arena_dungeon() |
void | Generator.generate_city_dungeon() |
void | Generator.generate_maze_dungeon() |
void | Generator.generate_archi_dungeon() |
void | Generator.generate_caves_dungeon() |
void | Generator.generate_arena_dungeon() |
void | Generator.generate_fluids(Area drunk_area) |
void | Generator.generate_barrels() |
void | Generator.generate_stairs() |
void | Generator.generate_special_stairs() |
void | Generator.generate_lever_room() |
void | Generator.generate_teleport_room() |
void | Generator.generate_ammo_room() |
void | Generator.generate_basain() |
void | Generator.generate_warehouse_room() |
void | Generator.generate_vault() |
void | Generator.add_room_feature(boolean no_monsters) |
void | Generator.handle_rooms(boolean no_monsters) |
void | Generator.place_player() |
void | Generator.roll_event() |
void | Generator.reset() |
- Generator.safe_empty_coord() → Coord
- Gives a coordinate that satisfies all empty flags. If one cannot be found, another attempt is made that excludes EF_NOSAFE; if one still cannot be found, another attempt is made that additionally excludes EF_NOSTAIRS and EF_NOHARM.
- Generator.standard_empty_coord() → Coord
- Gives a coordinate that satisfies all empty flags other than EF_NOSAFE.
- Generator.set_permanence(Area ar, boolean val, Cell tile)
- Sets the state of all cells' LFPERMANENT flag within ar. val determines the state of LFPERMANENT: it is true by default. If set, only cells of the tile identifier will be affected: by default, all wall tiles in the area are affected.
- Generator.setup_ice_event()
- Adds the "frozen" level event to the map and records it in the mortem history. Levels with the frozen event change all walls into ice walls and all fluids into water.
- Generator.setup_perma_event()
- Adds the "sturdy" level event to the map and records it in the mortem history. Levels with the sturdy event set all wall tiles to be permanent.
- Generator.setup_alarm_event()
- Adds the "alarm" level event to the map and records it in the mortem history. Levels with the alarm event set all non-player beings' Being Flags|BF_HUNTING flag to true.
- Generator.setup_deadly_air_event(integer step)
- Adds the "deadly air" event to the map and records it in the mortem history. Levels with the deadly air event cause all beings to lose hit points every step turns.
- Generator.setup_nuke_event(integer minutes)
- Adds the "armed nuke" event to the map and records it in the mortem history. Levels with the armed nuke event begin with a thermonuclear bomb set at the player's starting position, which will explode in minutes game minutes.
- Generator.setup_flood_event(integer direction, integer step, Cell cell, boolean pure)
- Adds the "flood" event to the map and records it in the mortem history. Levels with the flood event are slowly filled with a fluid: direction determines whether the floor travels from the right (-1) or from the left (+1); every step turns, cell will replace all tiles in a next column to be flooded. Setting pure to false will move the player and stairs to opposite sides of the map, with the player nearest the flood.
- Generator.being_weight() → integer
- Gives a value equal to the difficulty-adjusted weight of beings for a given danger level. These are the results used for the base game's monster generation parameters.
- Generator.item_amount() → integer
- Gives a value equal to the number of items spawned for a given danger level. On level types where the this amount isn't preset, this is the result used for the base game's item generation parameters.
- Generator.restore_walls(Cell wall_cell, boolean keep_fluids)
- Sets all cells on the edge of the map to wall_cell. If keep_fluids is set to true, fluid tiles will be maintained but set as permanent.
- Generator.cell_set(list list) → list
- Creates a cellset for all cells in list. The returned list functions just like any CELLSET constant.
- Generator.horiz_river(Cell cell, integer width, boolean bridge)
- Adds a horizontal river to the map, created using cell tiles. width sets the tile-width of the river. If bridge is set to true, a non-fluid floor bridge will be created on the river.
- Generator.vert_river(Cell cell, integer width, boolean bridge, Coord pos)
- Generator.vert_river(Cell cell, integer width, boolean bridge, integer pos)
- Adds a vertical river to the map, created using cell tiles. width sets the tile-width of the river, and pos sets the starting position of the river. If pos is given as an integer, then the starting y-coordinate of the river is at the top of the map. If bridge is set to true, a non-fluid floor bridge will be created on the river.
- Generator.generate_rivers(boolean allow_horiz, boolean allow_more)
- Generates a random number of horizontal and vertical rivers on the map. See Rivers for more information. The fluid type varies with map depth.
- Generator.drunkard_walk(Coord start, integer steps, Cell cell, CellList ignore, boolean break_on_edge)
- Generates cell tiles according to a drunken walk algorithm. It travels steps times, starting at the coordinate start. Any cells in ignore will not be set over but the algorithm will still continue. If break_on_edge is set to true, the drunken walk will stop if it hits a map border: otherwise it will continue, clamping cells within the map as necessary.
- Generator.drunkard_walks(integer amount, integer steps, Cell cell, CellList ignore, boolean break_on_edge, Area drunk_area)
- As Generator.drunkard_walk, but repeated amount times. Additionally, rather than specifically a starting position, all walks are chosen from a random coordinate within drunk_area.
- Generator.contd_drunkard_walks(integer amount, integer steps, Cell cell, Coord edges1, Coord edges2, CellList ignore, boolean break_on_edge)
- As Generator.drunkard_walks, but rather than limiting the walk's starting position, the walk will stop prematurely if it has reached the x- or y-coordinates of both edges1 and edges2.
- Generator.plot_lines(Coord where, Area larea, boolean horiz, Cell cell, CellList block)
- Generates a line of cell tiles on the map, starting at where and extending to the boundaries of larea. horiz set to true will produce horizontal lines: otherwise it will produce vertical lines. If a cell from block is found, the line will end prematurely at the end on which it was blocked.
- Generator.maze_dungeon(Cell floor_cell, Cell wall_cell, integer granularity, integer tries, integer minl, integer maxl)
- Generates a map-wide maze, using wall_cell as the wall tiles and floor_cell as the floor tiles. Wall corridors are at least minl tiles apart and at most maxl tiles apart: granularity sets a rough complexity of the map. The number of walls attempted to be made is equal to tries.
- Generator.warehouse_fill(Cell wall_cell, Area fill_area, integer box_size, integer amount)
- Generates wall_cell tiles in the shape of a square within fill_area. boxsize sets the size of the side of a box, and amount sets the number of tries for boxes to be added.
- Generator.warehouse_dungeon()
- Generates a map-wide warehouse setting. Warehouse dungeons are divided into three large rooms, each attempting 50 tries with boxes of side length 3.
- Generator.add_room(Area room)
- Adds room to the Generator.room_list and Generator.room_meta lists. This is used in conjunction with room generation functions.
- Generator.add_rooms() → boolean
- As Generator.add_room, but locates all rooms on the map and adds them to Generator.room_list and Generator.room_meta instead.
- Generator.get_room(integer min_size, integer max_x, integer max_y) → Room
- Finds a room that contains at least min_size in both height and width, and has a width and height no bigger than max_x and max_y, respectively.
- Generator.generate_tiled()
- Generates a "normal" map. Normal levels are divided randomly into rectangular rooms.
- Generator.generate_warehouse_dungeon()
- Builds a "warehouse" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_tiled_arena_dungeon()
- Builds a "single-monster" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_city_dungeon()
- Builds a "city" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_maze_dungeon()
- Builds a "maze" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_archi_dungeon()
- Builds an "archi" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_caves_dungeon()
- Builds a "cave" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_arena_dungeon()
- Builds an "arena" level. This includes everything necessary to be played as a typical random level.
- Generator.generate_fluids(Area drunk_area)
- Generates all non-river fluids on the map using drunken walks, within drunk_area. The fluid type varies with danger level.
- Generator.generate_barrels()
- Generates all barrels on the map, The barrel type varies with danger level.
- Generator.generate_stairs()
- Generates stairs on the map.
- Generator.generate_special_stairs()
- Generates special stairs on the map, if a special level exists at the current map depth.
- Generator.generate_lever_room()
- Finds a room of appropriate size and adjusts it into a lever room.
- Generator.generate_teleport_room()
- Finds a room of appropriate size and adjusts it into a teleporter room.
- Generator.generate_ammo_room()
- Finds a room of appropriate size and adjusts it into an ammo room. The type of ammo varies with danger level.
- Generator.generate_basain()
- Finds a room of appropriate size and adjusts it into a room filled with fluid.
- Generator.generate_warehouse_room()
- Finds a room of appropriate size and adjusts it into a room with boxes (as Generator.warehouse_fill).
- Generator.generate_vault()
- Finds a room of appropriate size and adjust it into a vault. The monsters, items, and type of vault vary with danger level.
- Generator.add_room_feature(boolean no_monsters)
- Randomly selects a room generation function to be added to the map. no_monsters set to true excludes the possibility of a vault room being generated.
- Generator.handle_rooms(boolean no_monsters)
- Generates up to seven special rooms on the map and restores walls that were otherwise removed as a result of the room generation.
- Generator.place_player()
- Adds to player to the map.
- Generator.roll_event()
- Randomly select a level event function to be added to the map.
- Generator.reset()
- Clears all generation properties and hooks, and changes the map into one bordered with the level style's walls and otherwise filled with the level style's floors.