diff --git a/dat/Mon-loca.lua b/dat/Mon-loca.lua index 75ea76ec9..598b364eb 100644 --- a/dat/Mon-loca.lua +++ b/dat/Mon-loca.lua @@ -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() diff --git a/dat/Mon-strt.lua b/dat/Mon-strt.lua index 287e19887..ffbfec4e2 100644 --- a/dat/Mon-strt.lua +++ b/dat/Mon-strt.lua @@ -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" }) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 6f437f347..bea0aa0bc 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 diff --git a/src/sp_lev.c b/src/sp_lev.c index 73411d4fc..191a50c99 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -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; } }