]> granicus.if.org Git - nethack/commitdiff
monk strength
authorPatR <rankin@nethack.org>
Wed, 12 Oct 2022 20:47:12 +0000 (13:47 -0700)
committerPatR <rankin@nethack.org>
Wed, 12 Oct 2022 20:47:12 +0000 (13:47 -0700)
Add a stack of 2 tins of spinach near the leader on the monk quest
start level and another stack of 2 blessed tins of spinach at a
random spot on the monk quest locate level, to compensate for the
inability to gain strength from giant corpses if they adhere to
vegan or vegetarian conduct.  paxed supplied the 'tinplace' magic.

4 tins of spinach aren't nearly enough to get to 18/100, but by
uncursing the first pair, if necessary, and waiting until strength
is at least 18, they can be eaten to add 4..40 (average 22) points
of exceptional strength.  (Players choosing either of those conducts
for other roles or foodless for any role are on their own as far as
boosting Str goes, same as before.)

The special level loader needed to be modified to handle tins of
spinach.  It now accepts "spinach" as a fake monster type for an
object of type "tin".  Also added support for empty tins since it
involved the same code, and use of fake monster type "empty" with
object type "egg" to be able to create generic (unhatchable) eggs.
(Wishing for "egg" produces those by default but it also accepts
explicit "empty egg" by coincidence.)

dat/Mon-loca.lua
dat/Mon-strt.lua
doc/fixes3-7-0.txt
src/sp_lev.c

index 75ea76ec9b65372705bb6cbbca31952df6bf51b6..598b364ebd17f0928df73bdae3987441c395a609 100644 (file)
@@ -57,6 +57,14 @@ des.object()
 des.object()
 des.object()
 des.object()
+-- since vegetarian monks shouldn't eat giant corpses, give a chance for
+-- Str boost that isn't throttled by exercise restrictions;
+-- make a modest effort (Elbereth only) to prevent xorns from eating the tins
+local tinplace = selection.negate():filter_mapchar('.')
+local tinloc = tinplace:rndcoord(0)
+des.object({ id="tin", coord=tinloc, quantity=2, buc="blessed",
+             montype="spinach" })
+des.engraving({ coord=tinloc, type="burn", text="Elbereth" })
 -- Random traps
 des.trap()
 des.trap()
index 287e19887c16a13979a47d527b74d60b8366f31c..ffbfec4e23059a5ee7b330c2a794169e7833d662 100644 (file)
@@ -101,3 +101,6 @@ end
 for i = 1, 4 do
    des.monster("xorn", spacelocs:rndcoord(1))
 end
+-- next to leader, so possibly tricky to pick up if not ready for quest yet;
+-- there's no protection against a xorn eating these tins; BUC state is random
+des.object({ id="tin", coord = {29, 9}, quantity=2, montype="spinach" })
index 6f437f3479f0931ddba06baee0011fee3ac4bf1f..bea0aa0bc0403174f9e09102c4786fdd5f99bf09 100644 (file)
@@ -1856,6 +1856,7 @@ rudimentary key rebinding in game options
 experimental #saveoptions command to allow saving configuration settings
 mouse buttons can be bound to extended commands
 hero poly'd into purple worm can gain intrinsics from digesting whole monster
+add some tins of spinach to monk's quest (vegan => no Str from giant corpses)
 
 
 Platform- and/or Interface-Specific New Features
index 73411d4fcf7486c6312e178f1b24dfeb92fb7a9a..191a50c9936508eb37b8723ceab00e4f52eb28b7 100644 (file)
@@ -3551,12 +3551,22 @@ lspo_object(lua_State *L)
         || tmpobj.id == CORPSE || tmpobj.id == TIN
         || tmpobj.id == FIGURINE) {
         struct permonst *pm = NULL;
+        boolean nonpmobj = FALSE;
         int i;
         char *montype = get_table_str_opt(L, "montype", NULL);
 
         if (montype) {
-            if (strlen(montype) == 1
-                && def_char_to_monclass(*montype) != MAXMCLASSES) {
+            if ((tmpobj.id == TIN && (!strcmpi(montype, "spinach")
+                /* id="tin",montype="empty" produces an empty tin */
+                                      || !strcmpi(montype, "empty")))
+                /* id="egg",montype="empty" produces a generic, unhatchable
+                   egg rather than an "empty egg" */
+                || (tmpobj.id == EGG && !strcmpi(montype, "empty"))) {
+                tmpobj.corpsenm = NON_PM;
+                tmpobj.spe = !strcmpi(montype, "spinach") ? 1 : 0;
+                nonpmobj = TRUE;
+            } else if (strlen(montype) == 1
+                       && def_char_to_monclass(*montype) != MAXMCLASSES) {
                 pm = mkclass(def_char_to_monclass(*montype),
                              G_NOGEN | G_IGNORE);
             } else {
@@ -3573,7 +3583,7 @@ lspo_object(lua_State *L)
             free((genericptr_t) montype);
             if (pm)
                 tmpobj.corpsenm = monsndx(pm);
-            else
+            else if (!nonpmobj)
                 nhl_error(L, "Unknown montype");
         }
         if (tmpobj.id == STATUE || tmpobj.id == CORPSE) {
@@ -3588,7 +3598,7 @@ lspo_object(lua_State *L)
             tmpobj.spe = lflags;
         } else if (tmpobj.id == EGG) {
             tmpobj.spe = get_table_boolean_opt(L, "laid_by_you", 0) ? 1 : 0;
-        } else {
+        } else if (!nonpmobj) { /* tmpobj.spe is already set for nonpmobj */
             tmpobj.spe = 0;
         }
     }