]> granicus.if.org Git - nethack/commitdiff
B04008 Minetown fountain warnings prevent fountain gem/gold discovery
authornethack.allison <nethack.allison>
Sun, 14 Jul 2002 17:19:40 +0000 (17:19 +0000)
committernethack.allison <nethack.allison>
Sun, 14 Jul 2002 17:19:40 +0000 (17:19 +0000)
<Someone> writes:
I can accept that losing gold into a fountain recharges it to make it
possible to find a gem in it in future (however weird that is). What
_does_ seem wrong is that receiving a warning about a Minetown
fountain prevents finding gems and gold there.

doc/fixes34.1
include/rm.h
src/dig.c
src/fountain.c

index 1ac07ca3934ec31a665a389fcb410e5aefd9f154..c21d027b88b94cac85e1658de6e5876aab76215e 100644 (file)
@@ -164,6 +164,7 @@ avoid crash when drinking a potion causes the hero to float up over a fire
 in some situations, if hero stood still, a hostile dwarf would switch back
        and forth between weapon and pick-axe and never move
 uncontrolled teleports did not handle leashed pets
+minetown fountain warnings shouldn't prevent finding gems/coins in fountain
 
 
 Platform- and/or Interface-Specific Fixes
index c2da2751ededeece281e210777ecb717a272a22e..7996cac3c60872d9084e4ba7b97c1aae9c440ce3 100644 (file)
@@ -267,6 +267,12 @@ extern const struct symdef def_warnsyms[WARNCOUNT];
  */
 #define F_LOOTED       1
 #define F_WARNED       2
+#define FOUNTAIN_IS_WARNED(x,y)                (levl[x][y].looted & F_WARNED)
+#define FOUNTAIN_IS_LOOTED(x,y)                (levl[x][y].looted & F_LOOTED)
+#define SET_FOUNTAIN_WARNED(x,y)       levl[x][y].looted |= F_WARNED;
+#define SET_FOUNTAIN_LOOTED(x,y)       levl[x][y].looted |= F_LOOTED;
+#define CLEAR_FOUNTAIN_WARNED(x,y)     levl[x][y].looted &= ~F_WARNED;
+#define CLEAR_FOUNTAIN_LOOTED(x,y)     levl[x][y].looted &= ~F_LOOTED;
 
 /*
  * Doors are even worse :-) The special warning has a side effect
index e470abe00a559aaae6dd259010c2ccec08bdfbf3..fc74204c31823e3f8848b58d5f761ab3df8cb483 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -495,7 +495,7 @@ int ttyp;
           breaking bypasses that routine and calls us directly */
        if (IS_FOUNTAIN(lev->typ)) {
            dogushforth(FALSE);
-           lev->looted |= F_WARNED;            /* force dryup */
+           SET_FOUNTAIN_WARNED(x,y);           /* force dryup */
            dryup(x, y, madeby_u);
            return;
 #ifdef SINKS
index baf5e794bd7106500f9e42ecd1f3f732a0e4a390..63effbe7a534dda9967e87ee69366eb0bee83cc4 100644 (file)
@@ -140,7 +140,7 @@ dofindgem() /* Find a gem in the sparkling waters. */
        else You_feel("a gem here!");
        (void) mksobj_at(rnd_class(DILITHIUM_CRYSTAL, LUCKSTONE-1),
                         u.ux, u.uy, FALSE, FALSE);
-       levl[u.ux][u.uy].looted |= F_LOOTED;
+       SET_FOUNTAIN_LOOTED(u.ux,u.uy);
        newsym(u.ux, u.uy);
        exercise(A_WIS, TRUE);                  /* a discovery! */
 }
@@ -151,12 +151,12 @@ xchar x, y;
 boolean isyou;
 {
        if (IS_FOUNTAIN(levl[x][y].typ) &&
-           (!rn2(3) || (levl[x][y].looted & F_WARNED))) {
+           (!rn2(3) || FOUNTAIN_IS_WARNED(x,y))) {
                s_level *slev = Is_special(&u.uz);
                if(isyou && slev && slev->flags.town &&
-                  !(levl[x][y].looted & F_WARNED)) {
+                  !FOUNTAIN_IS_WARNED(x,y)) {
                        struct monst *mtmp;
-                       levl[x][y].looted |= F_WARNED;
+                       SET_FOUNTAIN_WARNED(x,y);
                        /* Warn about future fountain use. */
                        for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
                            if (DEADMONSTER(mtmp)) continue;
@@ -313,7 +313,7 @@ drinkfountain()
 
                case 27: /* Find a gem in the sparkling waters. */
 
-                       if (!levl[u.ux][u.uy].looted) {
+                       if (!FOUNTAIN_IS_LOOTED(u.ux,u.uy)) {
                                dofindgem();
                                break;
                        }
@@ -426,7 +426,7 @@ register struct obj *obj;
                        dowatersnakes();
                        break;
                case 24: /* Find a gem */
-                       if (!levl[u.ux][u.uy].looted) {
+                       if (!FOUNTAIN_IS_LOOTED(u.ux,u.uy)) {
                                dofindgem();
                                break;
                        }
@@ -446,7 +446,7 @@ register struct obj *obj;
                        if (u.ugold > 10) {
                            u.ugold -= somegold() / 10;
                            You("lost some of your gold in the fountain!");
-                           levl[u.ux][u.uy].looted &= ~F_LOOTED;
+                           CLEAR_FOUNTAIN_LOOTED(u.ux,u.uy);
                            exercise(A_WIS, FALSE);
                        }
 #else
@@ -465,7 +465,7 @@ register struct obj *obj;
                                    if (!otmp->quan) delobj(otmp);
                                }
                                You("lost some of your money in the fountain!");
-                               levl[u.ux][u.uy].looted &= ~F_LOOTED;
+                               CLEAR_FOUNTAIN_LOOTED(u.ux,u.uy);
                                exercise(A_WIS, FALSE);
                             }
                        }
@@ -477,8 +477,8 @@ register struct obj *obj;
                 * surface.  After all, there will have been more people going
                 * by.  Just like a shopping mall!  Chris Woodbury  */
 
-                   if (levl[u.ux][u.uy].looted) break;
-                   levl[u.ux][u.uy].looted |= F_LOOTED;
+                   if (FOUNTAIN_IS_LOOTED(u.ux,u.uy)) break;
+                   SET_FOUNTAIN_LOOTED(u.ux,u.uy);
                    (void) mkgold((long)
                        (rnd((dunlevs_in_dungeon(&u.uz)-dunlev(&u.uz)+1)*2)+5),
                        u.ux, u.uy);