more formatting

Mostly tab replacement, plus the last of the cast spacing.
This commit is contained in:
PatR
2015-11-08 01:37:55 -08:00
parent 47938fc339
commit 62193be46a
12 changed files with 397 additions and 387 deletions
+3 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 allmain.c $NHDT-Date: 1445215016 2015/10/19 00:36:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */ /* NetHack 3.6 allmain.c $NHDT-Date: 1446975459 2015/11/08 09:37:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -58,8 +58,7 @@ boolean resuming;
if (!resuming) { /* new game */ if (!resuming) { /* new game */
context.rndencode = rnd(9000); context.rndencode = rnd(9000);
set_wear( set_wear((struct obj *) 0); /* for side-effects of starting gear */
(struct obj *) 0); /* for side-effects of worn starting gear */
(void) pickup(1); /* autopickup at initial location */ (void) pickup(1); /* autopickup at initial location */
} else { /* restore old game */ } else { /* restore old game */
#ifndef WIN32 #ifndef WIN32
@@ -569,7 +568,7 @@ newgame()
display_file(NEWS, FALSE); display_file(NEWS, FALSE);
#endif #endif
load_qtlist(); /* load up the quest text info */ load_qtlist(); /* load up the quest text info */
/* quest_init();*/ /* Now part of role_init() */ /* quest_init(); -- Now part of role_init() */
mklev(); mklev();
u_on_upstairs(); u_on_upstairs();
+5 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 alloc.c $NHDT-Date: 1432512771 2015/05/25 00:12:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.6 alloc.c $NHDT-Date: 1446975460 2015/11/08 09:37:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -27,7 +27,8 @@ extern void
VDECL(panic, (const char *, ...)) VDECL(panic, (const char *, ...))
PRINTF_F(1, 2); PRINTF_F(1, 2);
long *alloc(lth) register unsigned int lth; long *alloc(lth)
register unsigned int lth;
{ {
#ifdef LINT #ifdef LINT
/* /*
@@ -39,7 +40,7 @@ long *alloc(lth) register unsigned int lth;
if (lth) if (lth)
dummy = 0; /* make sure arg is used */ dummy = 0; /* make sure arg is used */
return (&dummy); return &dummy;
#else #else
register genericptr_t ptr; register genericptr_t ptr;
@@ -48,7 +49,7 @@ long *alloc(lth) register unsigned int lth;
if (!ptr) if (!ptr)
panic("Memory allocation failure; cannot get %u bytes", lth); panic("Memory allocation failure; cannot get %u bytes", lth);
#endif #endif
return ((long *) ptr); return (long *) ptr;
#endif #endif
} }
+17 -18
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 attrib.c $NHDT-Date: 1432512774 2015/05/25 00:12:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.46 $ */ /* NetHack 3.6 attrib.c $NHDT-Date: 1446975460 2015/11/08 09:37:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -8,7 +8,8 @@
#include <ctype.h> #include <ctype.h>
/* part of the output on gain or loss of attribute */ /* part of the output on gain or loss of attribute */
static const char *const plusattr[] = { "strong", "smart", "wise", static const char
*const plusattr[] = { "strong", "smart", "wise",
"agile", "tough", "charismatic" }, "agile", "tough", "charismatic" },
*const minusattr[] = { "weak", "stupid", *const minusattr[] = { "weak", "stupid",
"foolish", "clumsy", "foolish", "clumsy",
@@ -971,31 +972,30 @@ int x;
register int tmp = (u.abon.a[x] + u.atemp.a[x] + u.acurr.a[x]); register int tmp = (u.abon.a[x] + u.atemp.a[x] + u.acurr.a[x]);
if (x == A_STR) { if (x == A_STR) {
if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER) if (tmp >= 125 || (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER))
return (125); return (schar) 125;
else
#ifdef WIN32_BUG #ifdef WIN32_BUG
else return (x = ((tmp <= 3) ? 3 : tmp));
return (x = ((tmp >= 125) ? 125 : (tmp <= 3) ? 3 : tmp));
#else #else
else return (schar) ((tmp <= 3) ? 3 : tmp);
return ((schar)((tmp >= 125) ? 125 : (tmp <= 3) ? 3 : tmp));
#endif #endif
} else if (x == A_CHA) { } else if (x == A_CHA) {
if (tmp < 18 if (tmp < 18
&& (youmonst.data->mlet == S_NYMPH || u.umonnum == PM_SUCCUBUS && (youmonst.data->mlet == S_NYMPH || u.umonnum == PM_SUCCUBUS
|| u.umonnum == PM_INCUBUS)) || u.umonnum == PM_INCUBUS))
return 18; return (schar) 18;
} else if (x == A_INT || x == A_WIS) { } else if (x == A_INT || x == A_WIS) {
/* yes, this may raise int/wis if player is sufficiently /* yes, this may raise int/wis if player is sufficiently
* stupid. there are lower levels of cognition than "dunce". * stupid. there are lower levels of cognition than "dunce".
*/ */
if (uarmh && uarmh->otyp == DUNCE_CAP) if (uarmh && uarmh->otyp == DUNCE_CAP)
return (6); return (schar) 6;
} }
#ifdef WIN32_BUG #ifdef WIN32_BUG
return (x = ((tmp >= 25) ? 25 : (tmp <= 3) ? 3 : tmp)); return (x = ((tmp >= 25) ? 25 : (tmp <= 3) ? 3 : tmp));
#else #else
return ((schar)((tmp >= 25) ? 25 : (tmp <= 3) ? 3 : tmp)); return (schar) ((tmp >= 25) ? 25 : (tmp <= 3) ? 3 : tmp);
#endif #endif
} }
@@ -1007,11 +1007,11 @@ acurrstr()
register int str = ACURR(A_STR); register int str = ACURR(A_STR);
if (str <= 18) if (str <= 18)
return ((schar) str); return (schar) str;
if (str <= 121) if (str <= 121)
return ((schar)(19 + str / 50)); /* map to 19-21 */ return (schar) (19 + str / 50); /* map to 19..21 */
else else
return ((schar)(str - 100)); return (schar) (min(str, 125) - 100); /* 22..25 */
} }
/* when wearing (or taking off) an unID'd item, this routine is used /* when wearing (or taking off) an unID'd item, this routine is used
@@ -1043,13 +1043,12 @@ int attrindx;
} }
/* avoid possible problems with alignment overflow, and provide a centralized /* avoid possible problems with alignment overflow, and provide a centralized
* location for any future alignment limits location for any future alignment limits */
*/
void void
adjalign(n) adjalign(n)
register int n; int n;
{ {
register int newalign = u.ualign.record + n; int newalign = u.ualign.record + n;
if (n < 0) { if (n < 0) {
if (newalign < u.ualign.record) if (newalign < u.ualign.record)
+42 -37
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 botl.c $NHDT-Date: 1435002677 2015/06/22 19:51:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.64 $ */ /* NetHack 3.6 botl.c $NHDT-Date: 1446975461 2015/11/08 09:37:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.67 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -24,6 +24,7 @@ bot1()
char newbot1[MAXCO]; char newbot1[MAXCO];
register char *nb; register char *nb;
register int i, j; register int i, j;
Strcpy(newbot1, plname); Strcpy(newbot1, plname);
if ('a' <= newbot1[0] && newbot1[0] <= 'z') if ('a' <= newbot1[0] && newbot1[0] <= 'z')
newbot1[0] += 'A' - 'a'; newbot1[0] += 'A' - 'a';
@@ -73,6 +74,7 @@ bot1()
curs(WIN_STATUS, 1, 0); curs(WIN_STATUS, 1, 0);
putstr(WIN_STATUS, 0, newbot1); putstr(WIN_STATUS, 0, newbot1);
} }
STATIC_OVL void STATIC_OVL void
bot2() bot2()
{ {
@@ -175,23 +177,23 @@ boolean female;
/* Find the rank */ /* Find the rank */
for (i = xlev_to_rank((int) lev); i >= 0; i--) { for (i = xlev_to_rank((int) lev); i >= 0; i--) {
if (female && role->rank[i].f) if (female && role->rank[i].f)
return (role->rank[i].f); return role->rank[i].f;
if (role->rank[i].m) if (role->rank[i].m)
return (role->rank[i].m); return role->rank[i].m;
} }
/* Try the role name, instead */ /* Try the role name, instead */
if (female && role->name.f) if (female && role->name.f)
return (role->name.f); return role->name.f;
else if (role->name.m) else if (role->name.m)
return (role->name.m); return role->name.m;
return ("Player"); return "Player";
} }
STATIC_OVL const char * STATIC_OVL const char *
rank() rank()
{ {
return (rank_of(u.ulevel, Role_switch, flags.female)); return rank_of(u.ulevel, Role_switch, flags.female);
} }
int int
@@ -220,8 +222,8 @@ int *rank_indx, *title_length;
*rank_indx = j; *rank_indx = j;
if (title_length) if (title_length)
*title_length = strlen(roles[i].rank[j].f); *title_length = strlen(roles[i].rank[j].f);
return ((roles[i].femalenum != NON_PM) ? roles[i].femalenum return (roles[i].femalenum != NON_PM) ? roles[i].femalenum
: roles[i].malenum); : roles[i].malenum;
} }
} }
return NON_PM; return NON_PM;
@@ -251,14 +253,13 @@ botl_score()
utotal = money_cnt(invent) + hidden_gold(); utotal = money_cnt(invent) + hidden_gold();
if ((utotal -= u.umoney0) < 0L) if ((utotal -= u.umoney0) < 0L)
utotal = 0L; utotal = 0L;
utotal += utotal += u.urexp + (50 * (deepest - 1))
u.urexp + (50 * (deepest - 1))
+ (deepest > 30 ? 10000 : deepest > 20 ? 1000 * (deepest - 20) : 0); + (deepest > 30 ? 10000 : deepest > 20 ? 1000 * (deepest - 20) : 0);
if (utotal < u.urexp) if (utotal < u.urexp)
utotal = LONG_MAX; /* wrap around */ utotal = LONG_MAX; /* wrap around */
return utotal; return utotal;
} }
#endif #endif /* SCORE_ON_BOTL */
/* provide the name of the current level for display by various ports */ /* provide the name of the current level for display by various ports */
int int
@@ -304,35 +305,37 @@ STATIC_OVL int FDECL(percentage, (struct istat_s *, struct istat_s *));
STATIC_OVL int FDECL(compare_blstats, (struct istat_s *, struct istat_s *)); STATIC_OVL int FDECL(compare_blstats, (struct istat_s *, struct istat_s *));
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
STATIC_DCL boolean FDECL(assign_hilite, (char *, char *, char *, char *, BOOLEAN_P)); STATIC_DCL boolean FDECL(assign_hilite, (char *, char *, char *, char *,
BOOLEAN_P));
STATIC_DCL const char *FDECL(clridx_to_s, (char *, int)); STATIC_DCL const char *FDECL(clridx_to_s, (char *, int));
#endif #endif
/* If entries are added to this, botl.h will require updating too */ /* If entries are added to this, botl.h will require updating too */
STATIC_DCL struct istat_s initblstats[MAXBLSTATS] = { STATIC_DCL struct istat_s initblstats[MAXBLSTATS] = {
{ 0L, ANY_STR, {(genericptr_t)0L}, (char *)0, 80, 0, BL_TITLE}, { 0L, ANY_STR, { (genericptr_t) 0 }, (char *) 0, 80, 0, BL_TITLE},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_STR}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_STR},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_DX}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_DX},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_CO}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_CO},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_IN}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_IN},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_WI}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_WI},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_CH}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_CH},
{ 0L, ANY_STR, {(genericptr_t)0L}, (char *)0, 40, 0, BL_ALIGN}, { 0L, ANY_STR, { (genericptr_t) 0 }, (char *) 0, 40, 0, BL_ALIGN},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 20, 0, BL_SCORE}, { 0L, ANY_LONG, { (genericptr_t) 0 }, (char *) 0, 20, 0, BL_SCORE},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 20, 0, BL_CAP}, { 0L, ANY_LONG, { (genericptr_t) 0 }, (char *) 0, 20, 0, BL_CAP},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 30, 0, BL_GOLD}, { 0L, ANY_LONG, { (genericptr_t) 0 }, (char *) 0, 30, 0, BL_GOLD},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, BL_ENEMAX, BL_ENE}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, BL_ENEMAX, BL_ENE},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_ENEMAX}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_ENEMAX},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 10, 0, BL_XP}, { 0L, ANY_LONG, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_XP},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_AC}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_AC},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_HD}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_HD},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 20, 0, BL_TIME}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 20, 0, BL_TIME},
{ 0L, ANY_UINT, {(genericptr_t)0L}, (char *)0, 40, 0, BL_HUNGER}, { 0L, ANY_UINT, { (genericptr_t) 0 }, (char *) 0, 40, 0, BL_HUNGER},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, BL_HPMAX, BL_HP}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, BL_HPMAX, BL_HP},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_HPMAX}, { 0L, ANY_INT, { (genericptr_t) 0 }, (char *) 0, 10, 0, BL_HPMAX},
{ 0L, ANY_STR, {(genericptr_t)0L}, (char *)0, 80, 0, BL_LEVELDESC}, { 0L, ANY_STR, { (genericptr_t) 0 }, (char *) 0, 80, 0, BL_LEVELDESC},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 20, 0, BL_EXP}, { 0L, ANY_LONG, { (genericptr_t) 0 }, (char *) 0, 20, 0, BL_EXP},
{ 0L, ANY_MASK32,{(genericptr_t)0L},(char *)0, 0, 0, BL_CONDITION} { 0L, ANY_MASK32,
{ (genericptr_t) 0 }, (char *) 0, 0, 0, BL_CONDITION}
}; };
static struct fieldid_t { static struct fieldid_t {
@@ -576,7 +579,8 @@ bot()
for (i = 0; i < MAXBLSTATS; i++) { for (i = 0; i < MAXBLSTATS; i++) {
if (((i == BL_SCORE) && !flags.showscore) if (((i == BL_SCORE) && !flags.showscore)
|| ((i == BL_EXP) && !flags.showexp) || ((i == BL_EXP) && !flags.showexp)
|| ((i == BL_TIME) && !flags.time) || ((i == BL_HD) && !Upolyd) || ((i == BL_TIME) && !flags.time)
|| ((i == BL_HD) && !Upolyd)
|| ((i == BL_XP || i == BL_EXP) && Upolyd)) || ((i == BL_XP || i == BL_EXP) && Upolyd))
continue; continue;
anytype = blstats[idx][i].anytype; anytype = blstats[idx][i].anytype;
@@ -1505,6 +1509,7 @@ status_hilite_menu()
char prompt[QBUFSZ]; char prompt[QBUFSZ];
/* j == 0 below, j == 1 above */ /* j == 0 below, j == 1 above */
menu_item *pick2 = (menu_item *) 0; menu_item *pick2 = (menu_item *) 0;
Sprintf(prompt, "Display how when %s?", j ? above : below); Sprintf(prompt, "Display how when %s?", j ? above : below);
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
+21 -16
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1446369464 2015/11/01 09:17:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.205 $ */ /* NetHack 3.6 cmd.c $NHDT-Date: 1446975462 2015/11/08 09:37:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.206 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -145,14 +145,14 @@ STATIC_PTR int NDECL(wiz_migrate_mons);
#endif #endif
STATIC_DCL int FDECL(size_monst, (struct monst *)); STATIC_DCL int FDECL(size_monst, (struct monst *));
STATIC_DCL int FDECL(size_obj, (struct obj *)); STATIC_DCL int FDECL(size_obj, (struct obj *));
STATIC_DCL void FDECL(count_obj, STATIC_DCL void FDECL(count_obj, (struct obj *, long *, long *,
(struct obj *, long *, long *, BOOLEAN_P, BOOLEAN_P)); BOOLEAN_P, BOOLEAN_P));
STATIC_DCL void FDECL(obj_chain, STATIC_DCL void FDECL(obj_chain, (winid, const char *, struct obj *,
(winid, const char *, struct obj *, long *, long *)); long *, long *));
STATIC_DCL void FDECL(mon_invent_chain, STATIC_DCL void FDECL(mon_invent_chain, (winid, const char *, struct monst *,
(winid, const char *, struct monst *, long *, long *)); long *, long *));
STATIC_DCL void FDECL(mon_chain, STATIC_DCL void FDECL(mon_chain, (winid, const char *, struct monst *,
(winid, const char *, struct monst *, long *, long *)); long *, long *));
STATIC_DCL void FDECL(contained, (winid, const char *, long *, long *)); STATIC_DCL void FDECL(contained, (winid, const char *, long *, long *));
STATIC_PTR int NDECL(wiz_show_stats); STATIC_PTR int NDECL(wiz_show_stats);
STATIC_DCL boolean FDECL(accept_menu_prefix, (int NDECL((*)))); STATIC_DCL boolean FDECL(accept_menu_prefix, (int NDECL((*))));
@@ -269,13 +269,13 @@ popch()
} }
char char
pgetchar() pgetchar() /* courtesy of aeb@cwi.nl */
{ /* courtesy of aeb@cwi.nl */ {
register int ch; register int ch;
if (!(ch = popch())) if (!(ch = popch()))
ch = nhgetch(); ch = nhgetch();
return ((char) ch); return (char) ch;
} }
/* A ch == 0 resets the pushq */ /* A ch == 0 resets the pushq */
@@ -306,8 +306,9 @@ char ch;
return; return;
} }
/* here after # - now read a full-word command */
STATIC_PTR int STATIC_PTR int
doextcmd(VOID_ARGS) /* here after # - now read a full-word command */ doextcmd(VOID_ARGS)
{ {
int idx, retval; int idx, retval;
int NDECL((*func)); int NDECL((*func));
@@ -361,9 +362,11 @@ doextlist(VOID_ARGS)
* controlled via runtime option 'extmenu'. * controlled via runtime option 'extmenu'.
* ``# ?'' is counted towards the limit of the number of commands, * ``# ?'' is counted towards the limit of the number of commands,
* so we actually support MAX_EXT_CMD-1 "real" extended commands. * so we actually support MAX_EXT_CMD-1 "real" extended commands.
*
* Here after # - now show pick-list of possible commands.
*/ */
int int
extcmd_via_menu() /* here after # - now show pick-list of possible commands */ extcmd_via_menu()
{ {
const struct ext_func_tab *efp; const struct ext_func_tab *efp;
menu_item *pick_list = (menu_item *) 0; menu_item *pick_list = (menu_item *) 0;
@@ -1169,8 +1172,10 @@ doterrain(VOID_ARGS)
* n == 2: another entry was explicitly chosen, so skip preselected one. * n == 2: another entry was explicitly chosen, so skip preselected one.
*/ */
which = (n < 0) ? -1 : (n == 0) ? 1 : sel[0].item.a_int; which = (n < 0) ? -1 : (n == 0) ? 1 : sel[0].item.a_int;
if (n > 1 && which == 1) which = sel[1].item.a_int; if (n > 1 && which == 1)
if (n > 0) free((genericptr_t)sel); which = sel[1].item.a_int;
if (n > 0)
free((genericptr_t) sel);
switch (which) { switch (which) {
case 1: reveal_terrain(0, 0); break; /* known map */ case 1: reveal_terrain(0, 0); break; /* known map */
+4 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 decl.c $NHDT-Date: 1432512771 2015/05/25 00:12:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */ /* NetHack 3.6 decl.c $NHDT-Date: 1446975463 2015/11/08 09:37:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -156,7 +156,8 @@ NEARDATA struct obj
*ublindf = (struct obj *) 0, *uchain = (struct obj *) 0, *ublindf = (struct obj *) 0, *uchain = (struct obj *) 0,
*uball = (struct obj *) 0; *uball = (struct obj *) 0;
/* some objects need special handling during destruction or placement */ /* some objects need special handling during destruction or placement */
NEARDATA struct obj *current_wand = 0, /* wand currently zapped/applied */ NEARDATA struct obj
*current_wand = 0, /* wand currently zapped/applied */
*thrownobj = 0, /* object in flight due to throwing */ *thrownobj = 0, /* object in flight due to throwing */
*kickedobj = 0; /* object in flight due to kicking */ *kickedobj = 0; /* object in flight due to kicking */
@@ -328,7 +329,7 @@ NEARDATA struct savefile_info sfrestinfo, sfsaveinfo = {
#endif #endif
}; };
struct plinemsg_type *plinemsg_types = NULL; struct plinemsg_type *plinemsg_types = (struct plinemsg_type *) 0;
#ifdef PANICTRACE #ifdef PANICTRACE
char *ARGV0; char *ARGV0;
+1 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dlb.c $NHDT-Date: 1432512767 2015/05/25 00:12:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */ /* NetHack 3.6 dlb.c $NHDT-Date: 1446975464 2015/11/08 09:37:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
+44 -39
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1437877173 2015/07/26 02:19:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.147 $ */ /* NetHack 3.6 do.c $NHDT-Date: 1446975464 2015/11/08 09:37:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.149 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -223,7 +223,7 @@ const char *verb;
* obj to null. */ * obj to null. */
(void) obj_meld(&obj, &otmp); (void) obj_meld(&obj, &otmp);
} }
return (obj == NULL); return (boolean) (obj == NULL);
} }
return FALSE; return FALSE;
} }
@@ -265,8 +265,8 @@ register struct obj *obj;
docall(obj); docall(obj);
} }
/** Transforms the sink at the player's position into /* Transforms the sink at the player's position into
* a fountain, throne, altar or grave. */ a fountain, throne, altar or grave. */
STATIC_DCL void STATIC_DCL void
polymorph_sink() polymorph_sink()
{ {
@@ -299,8 +299,8 @@ polymorph_sink()
newsym(u.ux, u.uy); newsym(u.ux, u.uy);
} }
/** Teleports the sink at the player's position. /* Teleports the sink at the player's position;
* @return TRUE if sink teleported */ return True if sink teleported. */
STATIC_DCL boolean STATIC_DCL boolean
teleport_sink() teleport_sink()
{ {
@@ -308,14 +308,16 @@ teleport_sink()
int cnt = 0; int cnt = 0;
struct trap *trp; struct trap *trp;
struct engr *eng; struct engr *eng;
do { do {
cx = rnd(COLNO - 1); cx = rnd(COLNO - 1);
cy = rn2(ROWNO); cy = rn2(ROWNO);
trp = t_at(cx, cy); trp = t_at(cx, cy);
eng = engr_at(cx, cy); eng = engr_at(cx, cy);
} while ((levl[cx][cy].typ != ROOM || trp || eng || cansee(cx, cy)) } while ((levl[cx][cy].typ != ROOM || trp || eng || cansee(cx, cy))
&& (cnt++ < 200)); && cnt++ < 200);
if ((levl[cx][cy].typ == ROOM) && !trp && !eng) {
if (levl[cx][cy].typ == ROOM && !trp && !eng) {
/* create sink at new position */ /* create sink at new position */
levl[cx][cy].typ = SINK; levl[cx][cy].typ = SINK;
levl[cx][cy].looted = levl[u.ux][u.uy].looted; levl[cx][cy].looted = levl[u.ux][u.uy].looted;
@@ -468,6 +470,7 @@ register struct obj *obj;
trycall(obj); trycall(obj);
else if (!nosink) else if (!nosink)
You_hear("the ring bouncing down the drainpipe."); You_hear("the ring bouncing down the drainpipe.");
if (!rn2(20) && !nosink) { if (!rn2(20) && !nosink) {
pline_The("sink backs up, leaving %s.", doname(obj)); pline_The("sink backs up, leaving %s.", doname(obj));
obj->in_use = FALSE; obj->in_use = FALSE;
@@ -485,7 +488,7 @@ const char *word;
if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) { if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
if (*word) if (*word)
Norep("You cannot %s %s you are wearing.", word, something); Norep("You cannot %s %s you are wearing.", word, something);
return (FALSE); return FALSE;
} }
if (obj->otyp == LOADSTONE && obj->cursed) { if (obj->otyp == LOADSTONE && obj->cursed) {
/* getobj() kludge sets corpsenm to user's specified count /* getobj() kludge sets corpsenm to user's specified count
@@ -500,19 +503,19 @@ const char *word;
} }
obj->corpsenm = 0; /* reset */ obj->corpsenm = 0; /* reset */
obj->bknown = 1; obj->bknown = 1;
return (FALSE); return FALSE;
} }
if (obj->otyp == LEASH && obj->leashmon != 0) { if (obj->otyp == LEASH && obj->leashmon != 0) {
if (*word) if (*word)
pline_The("leash is tied around your %s.", body_part(HAND)); pline_The("leash is tied around your %s.", body_part(HAND));
return (FALSE); return FALSE;
} }
if (obj->owornmask & W_SADDLE) { if (obj->owornmask & W_SADDLE) {
if (*word) if (*word)
You("cannot %s %s you are sitting on.", word, something); You("cannot %s %s you are sitting on.", word, something);
return (FALSE); return FALSE;
} }
return (TRUE); return TRUE;
} }
STATIC_PTR int STATIC_PTR int
@@ -520,13 +523,13 @@ drop(obj)
register struct obj *obj; register struct obj *obj;
{ {
if (!obj) if (!obj)
return (0); return 0;
if (!canletgo(obj, "drop")) if (!canletgo(obj, "drop"))
return (0); return 0;
if (obj == uwep) { if (obj == uwep) {
if (welded(uwep)) { if (welded(uwep)) {
weldmsg(obj); weldmsg(obj);
return (0); return 0;
} }
setuwep((struct obj *) 0); setuwep((struct obj *) 0);
} }
@@ -551,7 +554,7 @@ register struct obj *obj;
if ((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING) if ((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING)
&& IS_SINK(levl[u.ux][u.uy].typ)) { && IS_SINK(levl[u.ux][u.uy].typ)) {
dosinkring(obj); dosinkring(obj);
return (1); return 1;
} }
if (!can_reach_floor(TRUE)) { if (!can_reach_floor(TRUE)) {
/* we might be levitating due to #invoke Heart of Ahriman; /* we might be levitating due to #invoke Heart of Ahriman;
@@ -570,13 +573,13 @@ register struct obj *obj;
hitfloor(obj); hitfloor(obj);
if (levhack) if (levhack)
float_down(I_SPECIAL | TIMEOUT, W_ARTI | W_ART); float_down(I_SPECIAL | TIMEOUT, W_ARTI | W_ART);
return (1); return 1;
} }
if (!IS_ALTAR(levl[u.ux][u.uy].typ) && flags.verbose) if (!IS_ALTAR(levl[u.ux][u.uy].typ) && flags.verbose)
You("drop %s.", doname(obj)); You("drop %s.", doname(obj));
} }
dropx(obj); dropx(obj);
return (1); return 1;
} }
/* dropx - take dropped item out of inventory; /* dropx - take dropped item out of inventory;
@@ -844,6 +847,7 @@ drop_done:
/* on a ladder, used in goto_level */ /* on a ladder, used in goto_level */
static NEARDATA boolean at_ladder = FALSE; static NEARDATA boolean at_ladder = FALSE;
/* the '>' command */
int int
dodown() dodown()
{ {
@@ -900,20 +904,20 @@ dodown()
floating_above(stairs_down ? "stairs" : ladder_down floating_above(stairs_down ? "stairs" : ladder_down
? "ladder" ? "ladder"
: surface(u.ux, u.uy)); : surface(u.ux, u.uy));
return (0); /* didn't move */ return 0; /* didn't move */
} }
if (!stairs_down && !ladder_down) { if (!stairs_down && !ladder_down) {
trap = t_at(u.ux, u.uy); trap = t_at(u.ux, u.uy);
if (trap && uteetering_at_seen_pit(trap)) { if (trap && uteetering_at_seen_pit(trap)) {
dotrap(trap, TOOKPLUNGE); dotrap(trap, TOOKPLUNGE);
return (1); return 1;
} else if (!trap || (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE) } else if (!trap || (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
|| !Can_fall_thru(&u.uz) || !trap->tseen) { || !Can_fall_thru(&u.uz) || !trap->tseen) {
if (flags.autodig && !context.nopick && uwep && is_pick(uwep)) { if (flags.autodig && !context.nopick && uwep && is_pick(uwep)) {
return use_pick_axe2(uwep); return use_pick_axe2(uwep);
} else { } else {
You_cant("go down here."); You_cant("go down here.");
return (0); return 0;
} }
} }
} }
@@ -922,13 +926,13 @@ dodown()
!u.uswallow ? "being held" : is_animal(u.ustuck->data) !u.uswallow ? "being held" : is_animal(u.ustuck->data)
? "swallowed" ? "swallowed"
: "engulfed"); : "engulfed");
return (1); return 1;
} }
if (on_level(&valley_level, &u.uz) && !u.uevent.gehennom_entered) { if (on_level(&valley_level, &u.uz) && !u.uevent.gehennom_entered) {
You("are standing at the gate to Gehennom."); You("are standing at the gate to Gehennom.");
pline("Unspeakable cruelty and harm lurk down there."); pline("Unspeakable cruelty and harm lurk down there.");
if (yn("Are you sure you want to enter?") != 'y') if (yn("Are you sure you want to enter?") != 'y')
return (0); return 0;
else else
pline("So be it."); pline("So be it.");
u.uevent.gehennom_entered = 1; /* don't ask again */ u.uevent.gehennom_entered = 1; /* don't ask again */
@@ -936,7 +940,7 @@ dodown()
if (!next_to_u()) { if (!next_to_u()) {
You("are held back by your pet!"); You("are held back by your pet!");
return (0); return 0;
} }
if (trap) if (trap)
@@ -950,9 +954,10 @@ dodown()
next_level(!trap); next_level(!trap);
at_ladder = FALSE; at_ladder = FALSE;
} }
return (1); return 1;
} }
/* the '<' command */
int int
doup() doup()
{ {
@@ -970,36 +975,36 @@ doup()
&& (!sstairs.sx || u.ux != sstairs.sx || u.uy != sstairs.sy && (!sstairs.sx || u.ux != sstairs.sx || u.uy != sstairs.sy
|| !sstairs.up)) { || !sstairs.up)) {
You_cant("go up here."); You_cant("go up here.");
return (0); return 0;
} }
if (stucksteed(TRUE)) { if (stucksteed(TRUE)) {
return (0); return 0;
} }
if (u.ustuck) { if (u.ustuck) {
You("are %s, and cannot go up.", You("are %s, and cannot go up.",
!u.uswallow ? "being held" : is_animal(u.ustuck->data) !u.uswallow ? "being held" : is_animal(u.ustuck->data)
? "swallowed" ? "swallowed"
: "engulfed"); : "engulfed");
return (1); return 1;
} }
if (near_capacity() > SLT_ENCUMBER) { if (near_capacity() > SLT_ENCUMBER) {
/* No levitation check; inv_weight() already allows for it */ /* No levitation check; inv_weight() already allows for it */
Your("load is too heavy to climb the %s.", Your("load is too heavy to climb the %s.",
levl[u.ux][u.uy].typ == STAIRS ? "stairs" : "ladder"); levl[u.ux][u.uy].typ == STAIRS ? "stairs" : "ladder");
return (1); return 1;
} }
if (ledger_no(&u.uz) == 1) { if (ledger_no(&u.uz) == 1) {
if (yn("Beware, there will be no return! Still climb?") != 'y') if (yn("Beware, there will be no return! Still climb?") != 'y')
return (0); return 0;
} }
if (!next_to_u()) { if (!next_to_u()) {
You("are held back by your pet!"); You("are held back by your pet!");
return (0); return 0;
} }
at_ladder = (boolean) (levl[u.ux][u.uy].typ == LADDER); at_ladder = (boolean) (levl[u.ux][u.uy].typ == LADDER);
prev_level(TRUE); prev_level(TRUE);
at_ladder = FALSE; at_ladder = FALSE;
return (1); return 1;
} }
d_level save_dlevel = { 0, 0 }; d_level save_dlevel = { 0, 0 };
@@ -1728,7 +1733,7 @@ long timeout UNUSED;
int int
donull() donull()
{ {
return (1); /* Do nothing, but let other things happen */ return 1; /* Do nothing, but let other things happen */
} }
STATIC_PTR int STATIC_PTR int
@@ -1749,12 +1754,12 @@ wipeoff(VOID_ARGS)
Blinded = 1; Blinded = 1;
make_blinded(0L, TRUE); make_blinded(0L, TRUE);
} }
return (0); return 0;
} else if (!u.ucreamed) { } else if (!u.ucreamed) {
Your("%s feels clean now.", body_part(FACE)); Your("%s feels clean now.", body_part(FACE));
return (0); return 0;
} }
return (1); /* still busy */ return 1; /* still busy */
} }
int int
@@ -1768,10 +1773,10 @@ dowipe()
/* Not totally correct; what if they change back after now /* Not totally correct; what if they change back after now
* but before they're finished wiping? * but before they're finished wiping?
*/ */
return (1); return 1;
} }
Your("%s is already clean.", body_part(FACE)); Your("%s is already clean.", body_part(FACE));
return (1); return 1;
} }
void void
+14 -14
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dothrow.c $NHDT-Date: 1445301122 2015/10/20 00:32:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.111 $ */ /* NetHack 3.6 dothrow.c $NHDT-Date: 1446975465 2015/11/08 09:37:45 $ $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -12,8 +12,8 @@ STATIC_DCL void NDECL(autoquiver);
STATIC_DCL int FDECL(gem_accept, (struct monst *, struct obj *)); STATIC_DCL int FDECL(gem_accept, (struct monst *, struct obj *));
STATIC_DCL void FDECL(tmiss, (struct obj *, struct monst *, BOOLEAN_P)); STATIC_DCL void FDECL(tmiss, (struct obj *, struct monst *, BOOLEAN_P));
STATIC_DCL int FDECL(throw_gold, (struct obj *)); STATIC_DCL int FDECL(throw_gold, (struct obj *));
STATIC_DCL void FDECL(check_shop_obj, STATIC_DCL void FDECL(check_shop_obj, (struct obj *, XCHAR_P, XCHAR_P,
(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P)); BOOLEAN_P));
STATIC_DCL void FDECL(breakmsg, (struct obj *, BOOLEAN_P)); STATIC_DCL void FDECL(breakmsg, (struct obj *, BOOLEAN_P));
STATIC_DCL boolean FDECL(toss_up, (struct obj *, BOOLEAN_P)); STATIC_DCL boolean FDECL(toss_up, (struct obj *, BOOLEAN_P));
STATIC_DCL boolean FDECL(throwing_weapon, (struct obj *)); STATIC_DCL boolean FDECL(throwing_weapon, (struct obj *));
@@ -66,22 +66,22 @@ int shotlimit;
* possibly using a sling. * possibly using a sling.
*/ */
if (obj->oclass == COIN_CLASS && obj != uquiver) if (obj->oclass == COIN_CLASS && obj != uquiver)
return (throw_gold(obj)); return throw_gold(obj);
if (!canletgo(obj, "throw")) if (!canletgo(obj, "throw"))
return (0); return 0;
if (obj->oartifact == ART_MJOLLNIR && obj != uwep) { if (obj->oartifact == ART_MJOLLNIR && obj != uwep) {
pline("%s must be wielded before it can be thrown.", The(xname(obj))); pline("%s must be wielded before it can be thrown.", The(xname(obj)));
return (0); return 0;
} }
if ((obj->oartifact == ART_MJOLLNIR && ACURR(A_STR) < STR19(25)) if ((obj->oartifact == ART_MJOLLNIR && ACURR(A_STR) < STR19(25))
|| (obj->otyp == BOULDER && !throws_rocks(youmonst.data))) { || (obj->otyp == BOULDER && !throws_rocks(youmonst.data))) {
pline("It's too heavy."); pline("It's too heavy.");
return (1); return 1;
} }
if (!u.dx && !u.dy && !u.dz) { if (!u.dx && !u.dy && !u.dz) {
You("cannot throw an object at yourself."); You("cannot throw an object at yourself.");
return (0); return 0;
} }
u_wipe_engr(2); u_wipe_engr(2);
if (!uarmg && obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm]) if (!uarmg && obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm])
@@ -1449,7 +1449,7 @@ register struct obj *obj; /* thrownobj or kickedobj or uwep */
} }
return 1; /* caller doesn't need to place it */ return 1; /* caller doesn't need to place it */
} }
return (0); return 0;
} }
if (obj->oclass == WEAPON_CLASS || is_weptool(obj) if (obj->oclass == WEAPON_CLASS || is_weptool(obj)
@@ -1675,7 +1675,7 @@ nopick:
pline1(buf); pline1(buf);
if (!tele_restrict(mon)) if (!tele_restrict(mon))
(void) rloc(mon, TRUE); (void) rloc(mon, TRUE);
return (ret); return ret;
} }
/* /*
@@ -1927,7 +1927,7 @@ struct obj *obj;
if (!u.dx && !u.dy && !u.dz) { if (!u.dx && !u.dy && !u.dz) {
You("cannot throw gold at yourself."); You("cannot throw gold at yourself.");
return (0); return 0;
} }
freeinv(obj); freeinv(obj);
if (u.uswallow) { if (u.uswallow) {
@@ -1935,7 +1935,7 @@ struct obj *obj;
: "%s into %s.", : "%s into %s.",
"The money disappears", mon_nam(u.ustuck)); "The money disappears", mon_nam(u.ustuck));
add_to_minv(u.ustuck, obj); add_to_minv(u.ustuck, obj);
return (1); return 1;
} }
if (u.dz) { if (u.dz) {
@@ -1977,7 +1977,7 @@ struct obj *obj;
} }
if (flooreffects(obj, bhitpos.x, bhitpos.y, "fall")) if (flooreffects(obj, bhitpos.x, bhitpos.y, "fall"))
return (1); return 1;
if (u.dz > 0) if (u.dz > 0)
pline_The("gold hits the %s.", surface(bhitpos.x, bhitpos.y)); pline_The("gold hits the %s.", surface(bhitpos.x, bhitpos.y));
place_object(obj, bhitpos.x, bhitpos.y); place_object(obj, bhitpos.x, bhitpos.y);
@@ -1985,7 +1985,7 @@ struct obj *obj;
sellobj(obj, bhitpos.x, bhitpos.y); sellobj(obj, bhitpos.x, bhitpos.y);
stackobj(obj); stackobj(obj);
newsym(bhitpos.x, bhitpos.y); newsym(bhitpos.x, bhitpos.y);
return (1); return 1;
} }
/*dothrow.c*/ /*dothrow.c*/
+27 -34
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 drawing.c $NHDT-Date: 1432512765 2015/05/25 00:12:45 $ $NHDT-Branch: master $:$NHDT-Revision: 1.45 $ */ /* NetHack 3.6 drawing.c $NHDT-Date: 1446975466 2015/11/08 09:37:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */
/* Copyright (c) NetHack Development Team 1992. */ /* Copyright (c) NetHack Development Team 1992. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -120,18 +120,18 @@ const struct class_sym def_monsyms[MAXMCLASSES] = {
}; };
const struct symdef def_warnsyms[WARNCOUNT] = { const struct symdef def_warnsyms[WARNCOUNT] = {
{ '0', "unknown creature causing you worry", /* white warning */
C(CLR_WHITE) }, /* white warning */ { '0', "unknown creature causing you worry", C(CLR_WHITE) },
{ '1', "unknown creature causing you concern", /* pink warning */
C(CLR_RED) }, /* pink warning */ { '1', "unknown creature causing you concern", C(CLR_RED) },
{ '2', "unknown creature causing you anxiety", /* red warning */
C(CLR_RED) }, /* red warning */ { '2', "unknown creature causing you anxiety", C(CLR_RED) },
{ '3', "unknown creature causing you disquiet", /* ruby warning */
C(CLR_RED) }, /* ruby warning */ { '3', "unknown creature causing you disquiet", C(CLR_RED) },
{ '4', "unknown creature causing you alarm", /* purple warning */
C(CLR_MAGENTA) }, /* purple warning */ { '4', "unknown creature causing you alarm", C(CLR_MAGENTA) },
{ '5', "unknown creature causing you dread", /* black warning */
C(CLR_BRIGHT_MAGENTA) } /* black warning */ { '5', "unknown creature causing you dread", C(CLR_BRIGHT_MAGENTA) },
}; };
/* /*
@@ -215,10 +215,8 @@ const struct symdef defsyms[MAXPCHARS] = {
{ '#', "", C(HI_ZAP) }, { '#', "", C(HI_ZAP) },
{ '@', "", C(HI_ZAP) }, { '@', "", C(HI_ZAP) },
{ '*', "", C(HI_ZAP) }, { '*', "", C(HI_ZAP) },
{ '#', "poison cloud", { '#', "poison cloud", C(CLR_BRIGHT_GREEN) }, /* part of a cloud */
C(CLR_BRIGHT_GREEN) }, /* [part of] a poison cloud */ { '?', "valid position", C(CLR_BRIGHT_GREEN) }, /* target position */
{ '?', "valid position",
C(CLR_BRIGHT_GREEN) }, /* valid position for targeting */
{ '/', "", C(CLR_GREEN) }, /* swallow top left */ { '/', "", C(CLR_GREEN) }, /* swallow top left */
{ '-', "", C(CLR_GREEN) }, /* swallow top center */ { '-', "", C(CLR_GREEN) }, /* swallow top center */
{ '\\', "", C(CLR_GREEN) }, /* swallow top right */ { '\\', "", C(CLR_GREEN) }, /* swallow top right */
@@ -363,19 +361,17 @@ init_showsyms()
for (i = 0; i < MAXPCHARS; i++) for (i = 0; i < MAXPCHARS; i++)
showsyms[i + SYM_OFF_P] = defsyms[i].sym; showsyms[i + SYM_OFF_P] = defsyms[i].sym;
for (i = 0; i < MAXOCLASSES; i++) for (i = 0; i < MAXOCLASSES; i++)
showsyms[i + SYM_OFF_O] = def_oc_syms[i].sym; showsyms[i + SYM_OFF_O] = def_oc_syms[i].sym;
for (i = 0; i < MAXMCLASSES; i++) for (i = 0; i < MAXMCLASSES; i++)
showsyms[i + SYM_OFF_M] = def_monsyms[i].sym; showsyms[i + SYM_OFF_M] = def_monsyms[i].sym;
for (i = 0; i < WARNCOUNT; i++) for (i = 0; i < WARNCOUNT; i++)
showsyms[i + SYM_OFF_W] = def_warnsyms[i].sym; showsyms[i + SYM_OFF_W] = def_warnsyms[i].sym;
for (i = 0; i < MAXOTHER; i++) { for (i = 0; i < MAXOTHER; i++) {
if (i == SYM_BOULDER) if (i == SYM_BOULDER)
showsyms[i + SYM_OFF_X] = iflags.bouldersym ? iflags.bouldersym : def_oc_syms[ROCK_CLASS].sym; showsyms[i + SYM_OFF_X] = iflags.bouldersym
? iflags.bouldersym
: def_oc_syms[ROCK_CLASS].sym;
else if (i == SYM_INVISIBLE) else if (i == SYM_INVISIBLE)
showsyms[i + SYM_OFF_X] = DEF_INVISIBLE; showsyms[i + SYM_OFF_X] = DEF_INVISIBLE;
} }
@@ -389,19 +385,17 @@ init_l_symbols()
for (i = 0; i < MAXPCHARS; i++) for (i = 0; i < MAXPCHARS; i++)
l_syms[i + SYM_OFF_P] = defsyms[i].sym; l_syms[i + SYM_OFF_P] = defsyms[i].sym;
for (i = 0; i < MAXOCLASSES; i++) for (i = 0; i < MAXOCLASSES; i++)
l_syms[i + SYM_OFF_O] = def_oc_syms[i].sym; l_syms[i + SYM_OFF_O] = def_oc_syms[i].sym;
for (i = 0; i < MAXMCLASSES; i++) for (i = 0; i < MAXMCLASSES; i++)
l_syms[i + SYM_OFF_M] = def_monsyms[i].sym; l_syms[i + SYM_OFF_M] = def_monsyms[i].sym;
for (i = 0; i < WARNCOUNT; i++) for (i = 0; i < WARNCOUNT; i++)
l_syms[i + SYM_OFF_W] = def_warnsyms[i].sym; l_syms[i + SYM_OFF_W] = def_warnsyms[i].sym;
for (i = 0; i < MAXOTHER; i++) { for (i = 0; i < MAXOTHER; i++) {
if (i == SYM_BOULDER) if (i == SYM_BOULDER)
l_syms[i + SYM_OFF_X] = iflags.bouldersym ? iflags.bouldersym : def_oc_syms[ROCK_CLASS].sym; l_syms[i + SYM_OFF_X] = iflags.bouldersym
? iflags.bouldersym
: def_oc_syms[ROCK_CLASS].sym;
else if (i == SYM_INVISIBLE) else if (i == SYM_INVISIBLE)
l_syms[i + SYM_OFF_X] = DEF_INVISIBLE; l_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
} }
@@ -424,25 +418,24 @@ init_r_symbols()
for (i = 0; i < MAXOCLASSES; i++) for (i = 0; i < MAXOCLASSES; i++)
r_syms[i + SYM_OFF_O] = def_r_oc_syms[i]; r_syms[i + SYM_OFF_O] = def_r_oc_syms[i];
for (i = 0; i < MAXMCLASSES; i++) for (i = 0; i < MAXMCLASSES; i++)
r_syms[i + SYM_OFF_M] = def_monsyms[i].sym; r_syms[i + SYM_OFF_M] = def_monsyms[i].sym;
for (i = 0; i < WARNCOUNT; i++) for (i = 0; i < WARNCOUNT; i++)
r_syms[i + SYM_OFF_W] = def_warnsyms[i].sym; r_syms[i + SYM_OFF_W] = def_warnsyms[i].sym;
for (i = 0; i < MAXOTHER; i++) { for (i = 0; i < MAXOTHER; i++) {
if (i == SYM_BOULDER) if (i == SYM_BOULDER)
r_syms[i + SYM_OFF_X] = iflags.bouldersym ? iflags.bouldersym : def_oc_syms[ROCK_CLASS].sym; r_syms[i + SYM_OFF_X] = iflags.bouldersym
? iflags.bouldersym
: def_oc_syms[ROCK_CLASS].sym;
else if (i == SYM_INVISIBLE) else if (i == SYM_INVISIBLE)
r_syms[i + SYM_OFF_X] = DEF_INVISIBLE; r_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
} }
clear_symsetentry(ROGUESET, FALSE); clear_symsetentry(ROGUESET, FALSE);
symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color /* default on Rogue level is no color
* but some symbol sets can * but some symbol sets can override that
* override that
*/ */
symset[ROGUESET].nocolor = 1;
} }
void void
+5 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 exper.c $NHDT-Date: 1432512770 2015/05/25 00:12:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */ /* NetHack 3.6 exper.c $NHDT-Date: 1446975467 2015/11/08 09:37:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -34,7 +34,7 @@ int en;
case PM_VALKYRIE: case PM_VALKYRIE:
return ((3 * en) / 4); return ((3 * en) / 4);
default: default:
return (en); return en;
} }
} }
@@ -68,7 +68,9 @@ newpw()
return en; return en;
} }
int experience(mtmp, nk) /* return # of exp points for mtmp after nk killed */ /* return # of exp points for mtmp after nk killed */
int
experience(mtmp, nk)
register struct monst *mtmp; register struct monst *mtmp;
register int nk; register int nk;
{ {
+2 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 extralev.c $NHDT-Date: 1432512765 2015/05/25 00:12:45 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ /* NetHack 3.6 extralev.c $NHDT-Date: 1446975468 2015/11/08 09:37:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
/* Copyright 1988, 1989 by Ken Arromdee */ /* Copyright 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -220,7 +220,7 @@ makeroguerooms()
* by adding 1+28*x to the column, and 7*y to the row. (The 1 * by adding 1+28*x to the column, and 7*y to the row. (The 1
* is because column 0 isn't used [we only use 1-78]). * is because column 0 isn't used [we only use 1-78]).
* Room height may be 2-4 (2-5 on last row), length 2-23 (not * Room height may be 2-4 (2-5 on last row), length 2-23 (not
* counting walls) * counting walls).
*/ */
#define here r[x][y] #define here r[x][y]