From: nethack.rankin Date: Fri, 11 May 2012 22:36:33 +0000 (+0000) Subject: oracle tidbit X-Git-Tag: MOVE2GIT~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18dfc82175af3e481e9a9daec6abe1349dadb42a;p=nethack oracle tidbit From the newsgroup, while rehashing our bug page entries someone mentioned that buying a minor consultation from the oracle exercizes wisdom twice. First when getrumor() chooses one, then again when outrumor(BY_ORACLE) delivers it. This also simplifies some #if GOLDOBJ conditional code. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4cfeab1f0..1d52652e6 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -361,6 +361,7 @@ properly handle destruction of equipment carried by monsters hit by disintegration breath; life-saving retained conferred properties of formerly worn items (loss of steed's saddle caused much confusion) don't exercize or abuse wisdom when rumors get used for random graffiti +don't exercize wisdom twice for each minor oracle consultation don't welcome the hero to Delphi if the Oracle was angered before first entry create_object() created lizard corpses without timers and troll corpses with their revive timers, then changed the corpsenm field diff --git a/src/rumors.c b/src/rumors.c index 62ff2c8b3..5993a8ead 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -300,7 +300,7 @@ int mechanism; (!rn2(4) ? "offhandedly " : (!rn2(3) ? "casually " : (rn2(2) ? "nonchalantly " : "")))); verbalize1(line); - exercise(A_WIS, TRUE); + /* [WIS exercized by getrumor()] */ return; case BY_COOKIE: pline(fortune_msg); @@ -422,14 +422,17 @@ int doconsult(oracl) register struct monst *oracl; { -#ifdef GOLDOBJ - long umoney = money_cnt(invent); -#endif + long umoney; int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel; int add_xpts; char qbuf[QBUFSZ]; multi = 0; +#ifndef GOLDOBJ + umoney = u.ugold; +#else + umoney = money_cnt(invent); +#endif if (!oracl) { There("is no one here to consult."); @@ -437,11 +440,7 @@ register struct monst *oracl; } else if (!oracl->mpeaceful) { pline("%s is in no mood for consultations.", Monnam(oracl)); return 0; -#ifndef GOLDOBJ - } else if (!u.ugold) { -#else } else if (!umoney) { -#endif You("have no money."); return 0; } @@ -454,41 +453,27 @@ register struct monst *oracl; case 'q': return 0; case 'y': -#ifndef GOLDOBJ - if (u.ugold < (long)minor_cost) { -#else if (umoney < (long)minor_cost) { -#endif You("don't even have enough money for that!"); return 0; } u_pay = minor_cost; break; case 'n': -#ifndef GOLDOBJ - if (u.ugold <= (long)minor_cost || /* don't even ask */ -#else if (umoney <= (long)minor_cost || /* don't even ask */ -#endif (oracle_cnt == 1 || oracle_flg < 0)) return 0; Sprintf(qbuf, "\"Then dost thou desire a major one?\" (%d %s)", major_cost, currency((long)major_cost)); if (yn(qbuf) != 'y') return 0; -#ifndef GOLDOBJ - u_pay = (u.ugold < (long)major_cost ? (int)u.ugold - : major_cost); -#else - u_pay = (umoney < (long)major_cost ? (int)umoney - : major_cost); -#endif + u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost; break; } #ifndef GOLDOBJ u.ugold -= (long)u_pay; oracl->mgold += (long)u_pay; #else - money2mon(oracl, (long)u_pay); + money2mon(oracl, (long)u_pay); #endif context.botl = 1; add_xpts = 0; /* first oracle of each type gives experience points */