Merge branch 'master' into win32-x64-working
* master: (354 commits) Add missing protos a warning bout lc_error Add S_poisoncloud to Guidebooks ... Conflicts: .gitattributes dat/.gitattributes doc/.gitattributes doc/Guidebook.mn include/config.h include/decl.h include/extern.h include/flag.h include/hack.h include/ntconf.h include/sys.h include/wceconf.h src/apply.c src/attrib.c src/bones.c src/botl.c src/dbridge.c src/dig.c src/do.c src/do_name.c src/dog.c src/dungeon.c src/eat.c src/end.c src/files.c src/fountain.c src/hack.c src/invent.c src/light.c src/makemon.c src/mhitu.c src/mklev.c src/mkmaze.c src/mkobj.c src/mkroom.c src/mon.c src/objnam.c src/options.c src/pager.c src/pickup.c src/potion.c src/pray.c src/questpgr.c src/read.c src/restore.c src/rnd.c src/role.c src/rumors.c src/save.c src/shk.c src/sit.c src/sp_lev.c src/sys.c src/teleport.c src/trap.c src/u_init.c src/uhitm.c src/wield.c src/worn.c src/zap.c sys/amiga/.gitattributes sys/mac/.gitattributes sys/msdos/.gitattributes sys/msdos/pctiles.c sys/msdos/vidvga.c sys/os2/.gitattributes sys/share/.gitattributes sys/share/pcmain.c sys/unix/.gitattributes sys/unix/hints/.gitattributes sys/unix/sysconf sys/unix/unixmain.c sys/vms/.gitattributes sys/wince/.gitattributes sys/wince/mhstatus.c sys/winnt/.gitattributes sys/winnt/Makefile.msc sys/winnt/nhsetup.bat util/lev_comp.l util/makedefs.c win/X11/winmenu.c win/X11/winstat.c win/gnome/gnstatus.c win/share/tilemap.c win/tty/termcap.c win/tty/topl.c win/tty/wintty.c
This commit is contained in:
51
src/mklev.c
51
src/mklev.c
@@ -1,5 +1,4 @@
|
||||
/* NetHack 3.5 mklev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 mklev.c $Date: 2012/02/15 01:55:33 $ $Revision: 1.20 $ */
|
||||
/* NetHack 3.5 mklev.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -17,7 +16,6 @@ STATIC_DCL void FDECL(mkgrave,(struct mkroom *));
|
||||
STATIC_DCL void NDECL(makevtele);
|
||||
STATIC_DCL void NDECL(clear_level_structures);
|
||||
STATIC_DCL void NDECL(makelevel);
|
||||
STATIC_DCL void NDECL(mineralize);
|
||||
STATIC_DCL boolean FDECL(bydoor,(XCHAR_P,XCHAR_P));
|
||||
STATIC_DCL struct mkroom *FDECL(find_branch_room, (coord *));
|
||||
STATIC_DCL struct mkroom *FDECL(pos_to_room, (XCHAR_P, XCHAR_P));
|
||||
@@ -538,7 +536,7 @@ STATIC_OVL void
|
||||
clear_level_structures()
|
||||
{
|
||||
static struct rm zerorm = { cmap_to_glyph(S_stone),
|
||||
0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
register int x,y;
|
||||
register struct rm *lev;
|
||||
|
||||
@@ -684,7 +682,7 @@ makelevel()
|
||||
/* make a secret treasure vault, not connected to the rest */
|
||||
if(do_vault()) {
|
||||
xchar w,h;
|
||||
debugpline("trying to make a vault...");
|
||||
debugpline0("trying to make a vault...");
|
||||
w = 1;
|
||||
h = 1;
|
||||
if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) {
|
||||
@@ -814,43 +812,50 @@ skip0:
|
||||
* Place deposits of minerals (gold and misc gems) in the stone
|
||||
* surrounding the rooms on the map.
|
||||
* Also place kelp in water.
|
||||
* mineralize(-1, -1, -1, -1, FALSE); => "default" behaviour
|
||||
*/
|
||||
STATIC_OVL void
|
||||
mineralize()
|
||||
void
|
||||
mineralize(kelp_pool, kelp_moat, goldprob, gemprob, skip_lvl_checks)
|
||||
int kelp_pool, kelp_moat, goldprob, gemprob;
|
||||
boolean skip_lvl_checks;
|
||||
{
|
||||
s_level *sp;
|
||||
struct obj *otmp;
|
||||
int goldprob, gemprob, x, y, cnt;
|
||||
int x, y, cnt;
|
||||
|
||||
if (kelp_pool < 0) kelp_pool = 10;
|
||||
if (kelp_moat < 0) kelp_moat = 30;
|
||||
|
||||
/* Place kelp, except on the plane of water */
|
||||
if (In_endgame(&u.uz)) return;
|
||||
if (!skip_lvl_checks && In_endgame(&u.uz)) return;
|
||||
for (x = 2; x < (COLNO - 2); x++)
|
||||
for (y = 1; y < (ROWNO - 1); y++)
|
||||
if ((levl[x][y].typ == POOL && !rn2(10)) ||
|
||||
(levl[x][y].typ == MOAT && !rn2(30)))
|
||||
if ((kelp_pool && levl[x][y].typ == POOL && !rn2(kelp_pool)) ||
|
||||
(kelp_moat && levl[x][y].typ == MOAT && !rn2(kelp_moat)))
|
||||
(void) mksobj_at(KELP_FROND, x, y, TRUE, FALSE);
|
||||
|
||||
/* determine if it is even allowed;
|
||||
almost all special levels are excluded */
|
||||
if (In_hell(&u.uz) || In_V_tower(&u.uz) ||
|
||||
if (!skip_lvl_checks && (In_hell(&u.uz) || In_V_tower(&u.uz) ||
|
||||
Is_rogue_level(&u.uz) ||
|
||||
level.flags.arboreal ||
|
||||
((sp = Is_special(&u.uz)) != 0 && !Is_oracle_level(&u.uz)
|
||||
&& (!In_mines(&u.uz) || sp->flags.town)
|
||||
)) return;
|
||||
))) return;
|
||||
|
||||
/* basic level-related probabilities */
|
||||
goldprob = 20 + depth(&u.uz) / 3;
|
||||
gemprob = goldprob / 4;
|
||||
if (goldprob < 0) goldprob = 20 + depth(&u.uz) / 3;
|
||||
if (gemprob < 0) gemprob = goldprob / 4;
|
||||
|
||||
/* mines have ***MORE*** goodies - otherwise why mine? */
|
||||
if (In_mines(&u.uz)) {
|
||||
goldprob *= 2;
|
||||
gemprob *= 3;
|
||||
} else if (In_quest(&u.uz)) {
|
||||
goldprob /= 4;
|
||||
gemprob /= 6;
|
||||
if (!skip_lvl_checks) {
|
||||
if (In_mines(&u.uz)) {
|
||||
goldprob *= 2;
|
||||
gemprob *= 3;
|
||||
} else if (In_quest(&u.uz)) {
|
||||
goldprob /= 4;
|
||||
gemprob /= 6;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -905,7 +910,7 @@ mklev()
|
||||
in_mklev = TRUE;
|
||||
makelevel();
|
||||
bound_digging();
|
||||
mineralize();
|
||||
mineralize(-1, -1, -1, -1, FALSE);
|
||||
in_mklev = FALSE;
|
||||
/* has_morgue gets cleared once morgue is entered; graveyard stays
|
||||
set (graveyard might already be set even when has_morgue is clear
|
||||
@@ -1560,7 +1565,7 @@ xchar x, y;
|
||||
*source = u.uz;
|
||||
insert_branch(br, TRUE);
|
||||
|
||||
debugpline("Made knox portal.");
|
||||
debugpline0("Made knox portal.");
|
||||
place_branch(br, x, y);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user