B04008 Minetown fountain warnings prevent fountain gem/gold discovery
<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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user