monk strength

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.)
This commit is contained in:
PatR
2022-10-12 13:47:12 -07:00
parent e157224edc
commit c2894a422b
4 changed files with 26 additions and 4 deletions

View 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()

View 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" })

View 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

View 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;
}
}