from <Someone>: #rub touchstone
authornethack.rankin <nethack.rankin>
Sun, 24 Feb 2002 03:19:20 +0000 (03:19 +0000)
committernethack.rankin <nethack.rankin>
Sun, 24 Feb 2002 03:19:20 +0000 (03:19 +0000)
     <Someone>'s message said this was committed, but the cvs repository
didn't reflect his changes.

> Subject: patch: #rub touchstone
> Date: Wed, 20 Feb 2002 23:33:27 -0800
> <email deleted>
>
> Implement <Someone>'s suggestion.
>
> - allow the #rub command to apply to gray stones
> - update various doc & help files to reflect the change
>
> Committed to CVS.

dat/hh
doc/Guidebook.mn
doc/Guidebook.tex
src/apply.c
src/cmd.c
src/invent.c

diff --git a/dat/hh b/dat/hh
index 1bd882f36cc21df68a647fa26dcfc06ceb2fa821..e5ad45e8f97a774df1b7a8f5e04372437557fd8f 100644 (file)
--- a/dat/hh
+++ b/dat/hh
@@ -92,7 +92,7 @@ M-n     name    name an item or type of object
 M-o     offer   offer a sacrifice to the gods
 M-p     pray    pray to the gods for help
 M-q     quit    stop playing
-M-r     rub     rub a lamp
+M-r     rub     rub a lamp or a stone
 M-s     sit     sit down
 M-t     turn    turn undead
 M-u     untrap  untrap something
index ad2c68928357823429e1876410665295a1694dcd..0c0f4627f60633fbd25379b74fe1e7b1ca532831 100644 (file)
@@ -692,7 +692,7 @@ Quit the program without saving your game.
 .lp #ride
 Ride (or stop riding) a monster.
 .lp #rub
-Rub a lamp.
+Rub a lamp or a stone.
 .lp #sit
 Sit down.
 .lp #turn
index 7361049023e89b3e35b097ef4baed62f4db37bb0..78dde0db6469f1c35d26658b9f3db43715259c23 100644 (file)
@@ -923,7 +923,7 @@ Quit the program without saving your game.
 Ride (or stop riding) a monster.
 %.lp
 \item[\tb{\#rub}]
-Rub a lamp.
+Rub a lamp or a stone.
 %.lp
 \item[\tb{\#sit}]
 Sit down.
index 0b301660cb63127bf7ec67d452f606ea2991e6d3..9fff42219747adc633b4f01b80fe2ece09d7ec90 100644 (file)
@@ -1146,13 +1146,24 @@ light_cocktail(obj)
            begin_burn(obj, FALSE);
 }
 
-static NEARDATA const char cuddly[] = { TOOL_CLASS, 0 };
+static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
 
 int
 dorub()
 {
        struct obj *obj = getobj(cuddly, "rub");
 
+       if (obj && obj->oclass == GEM_CLASS) {
+           if (obj->otyp == FLINT || obj->otyp == LUCKSTONE ||
+               obj->otyp == LOADSTONE || obj->otyp == TOUCHSTONE) {
+               use_stone(obj);
+               return 1;
+           } else {
+               pline("Sorry, I don't know how to use that.");
+               return 0;
+           }
+       }
+
        if(!obj || (obj != uwep && !wield_tool(obj))) return 0;
 
        /* now uwep is obj */
index 678bda72d0dbde0f91f2afa7c774bebe31f8c3ab..7de0be410a442ce20be1e508c38d2a3e9c2e1183 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1390,7 +1390,7 @@ struct ext_func_tab extcmdlist[] = {
 #ifdef STEED
        {"ride", "ride (or stop riding) a monster", doride, FALSE},
 #endif
-       {"rub", "rub a lamp", dorub, FALSE},
+       {"rub", "rub a lamp or a stone", dorub, FALSE},
        {"sit", "sit down", dosit, FALSE},
        {"turn", "turn undead", doturn, TRUE},
        {"twoweapon", "toggle two-weapon combat", dotwoweapon, FALSE},
index 92b76e89db4ced3d451dac14811f605f1fde0862..7e45f6e4b2892d08b9e3d33c2968fee2f7266c94 100644 (file)
@@ -817,9 +817,12 @@ register const char *let,*word;
                || (!strcmp(word, "tin") &&
                    (otyp != CORPSE || !tinnable(otmp)))
                || (!strcmp(word, "rub") &&
-                   (otmp->oclass == TOOL_CLASS &&
-                    otyp != OIL_LAMP && otyp != MAGIC_LAMP &&
-                    otyp != BRASS_LANTERN))
+                   ((otmp->oclass == TOOL_CLASS &&
+                     otyp != OIL_LAMP && otyp != MAGIC_LAMP &&
+                     otyp != BRASS_LANTERN) ||
+                    (otmp->oclass == GEM_CLASS &&
+                     otyp != LUCKSTONE && otyp != LOADSTONE &&
+                     otyp != TOUCHSTONE && otyp != FLINT)))
                || ((!strcmp(word, "use or apply") ||
                        !strcmp(word, "untrap with")) &&
                     /* Picks, axes, pole-weapons, bullwhips */