mklev.c formatting and comments
I made these to 3.7.0- and decided to bring them back to 3.6.2+ because of the 'TODO'.
This commit is contained in:
27
src/mklev.c
27
src/mklev.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mklev.c $NHDT-Date: 1550800390 2019/02/22 01:53:10 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */
|
/* NetHack 3.6 mklev.c $NHDT-Date: 1560304468 2019/06/12 01:54:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.61 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Alex Smith, 2017. */
|
/*-Copyright (c) Alex Smith, 2017. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -735,8 +735,8 @@ makelevel()
|
|||||||
h = 1;
|
h = 1;
|
||||||
if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) {
|
if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) {
|
||||||
fill_vault:
|
fill_vault:
|
||||||
add_room(vault_x, vault_y, vault_x + w, vault_y + h, TRUE, VAULT,
|
add_room(vault_x, vault_y, vault_x + w, vault_y + h,
|
||||||
FALSE);
|
TRUE, VAULT, FALSE);
|
||||||
level.flags.has_vault = 1;
|
level.flags.has_vault = 1;
|
||||||
++room_threshold;
|
++room_threshold;
|
||||||
fill_room(&rooms[nroom - 1], FALSE);
|
fill_room(&rooms[nroom - 1], FALSE);
|
||||||
@@ -1681,22 +1681,30 @@ struct mkroom *croom;
|
|||||||
#define y_maze_min 2
|
#define y_maze_min 2
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Major level transmutation: add a set of stairs (to the Sanctum) after
|
* Major level transmutation: add a set of stairs (to the Sanctum) after
|
||||||
* an earthquake that leaves behind a a new topology, centered at inv_pos.
|
* an earthquake that leaves behind a new topology, centered at inv_pos.
|
||||||
* Assumes there are no rooms within the invocation area and that inv_pos
|
* Assumes there are no rooms within the invocation area and that inv_pos
|
||||||
* is not too close to the edge of the map. Also assume the hero can see,
|
* is not too close to the edge of the map. Also assume the hero can see,
|
||||||
* which is guaranteed for normal play due to the fact that sight is needed
|
* which is guaranteed for normal play due to the fact that sight is needed
|
||||||
* to read the Book of the Dead.
|
* to read the Book of the Dead. [That assumption is not valid; it is
|
||||||
|
* possible that "the Book reads the hero" rather than vice versa if
|
||||||
|
* attempted while blind (in order to make blind-from-birth conduct viable).]
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mkinvokearea()
|
mkinvokearea()
|
||||||
{
|
{
|
||||||
int dist;
|
int dist;
|
||||||
xchar xmin = inv_pos.x, xmax = inv_pos.x;
|
xchar xmin = inv_pos.x, xmax = inv_pos.x,
|
||||||
xchar ymin = inv_pos.y, ymax = inv_pos.y;
|
ymin = inv_pos.y, ymax = inv_pos.y;
|
||||||
register xchar i;
|
register xchar i;
|
||||||
|
|
||||||
|
/* slightly odd if levitating, but not wrong */
|
||||||
pline_The("floor shakes violently under you!");
|
pline_The("floor shakes violently under you!");
|
||||||
|
/*
|
||||||
|
* TODO:
|
||||||
|
* Suppress this message if player has dug out all the walls
|
||||||
|
* that would otherwise be affected.
|
||||||
|
*/
|
||||||
pline_The("walls around you begin to bend and crumble!");
|
pline_The("walls around you begin to bend and crumble!");
|
||||||
display_nhwindow(WIN_MESSAGE, TRUE);
|
display_nhwindow(WIN_MESSAGE, TRUE);
|
||||||
|
|
||||||
@@ -1755,8 +1763,7 @@ int dist;
|
|||||||
/* clip at existing map borders if necessary */
|
/* clip at existing map borders if necessary */
|
||||||
if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1,
|
if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1,
|
||||||
x_maze_max - 1, y_maze_max - 1)) {
|
x_maze_max - 1, y_maze_max - 1)) {
|
||||||
/* only outermost 2 columns and/or rows may be truncated due to edge
|
/* outermost 2 columns and/or rows may be truncated due to edge */
|
||||||
*/
|
|
||||||
if (dist < (7 - 2))
|
if (dist < (7 - 2))
|
||||||
panic("mkinvpos: <%d,%d> (%d) off map edge!", x, y, dist);
|
panic("mkinvpos: <%d,%d> (%d) off map edge!", x, y, dist);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user