allow big humanoids to wear mummy wrappings
A giant mummy starts out with a mummy wrapping but couldn't wear it. Allow humanoids who are bigger than human size (including poly'd hero when applicable) to wear such cloaks. They won't do so if they are invisible and the cloak would let hero start seeing them.
This commit is contained in:
@@ -1859,6 +1859,7 @@ experimental #saveoptions command to allow saving configuration settings
|
|||||||
mouse buttons can be bound to extended commands
|
mouse buttons can be bound to extended commands
|
||||||
hero poly'd into purple worm can gain intrinsics from digesting whole monster
|
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)
|
add some tins of spinach to monk's quest (vegan => no Str from giant corpses)
|
||||||
|
very large humanoids can wear mummy wrappings
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific New Features
|
Platform- and/or Interface-Specific New Features
|
||||||
|
|||||||
@@ -411,6 +411,12 @@ struct obj {
|
|||||||
#define is_art(o,art) ((o) && (o)->oartifact == (art))
|
#define is_art(o,art) ((o) && (o)->oartifact == (art))
|
||||||
#define u_wield_art(art) is_art(uwep, art)
|
#define u_wield_art(art) is_art(uwep, art)
|
||||||
|
|
||||||
|
/* mummy wrappings are more versatile sizewise than other cloaks */
|
||||||
|
#define WrappingAllowed(mptr) \
|
||||||
|
(humanoid(mptr) && (mptr)->msize >= MZ_SMALL && (mptr)->msize <= MZ_HUGE \
|
||||||
|
&& !noncorporeal(mptr) && (mptr)->mlet != S_CENTAUR \
|
||||||
|
&& (mptr) != &mons[PM_WINGED_GARGOYLE] && (mptr) != &mons[PM_MARILITH])
|
||||||
|
|
||||||
/* Flags for get_obj_location(). */
|
/* Flags for get_obj_location(). */
|
||||||
#define CONTAINED_TOO 0x1
|
#define CONTAINED_TOO 0x1
|
||||||
#define BURIED_TOO 0x2
|
#define BURIED_TOO 0x2
|
||||||
|
|||||||
+8
-8
@@ -1876,16 +1876,16 @@ canwearobj(struct obj *otmp, long *mask, boolean noisy)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
which = is_cloak(otmp)
|
which = is_cloak(otmp) ? c_cloak
|
||||||
? c_cloak
|
: is_shirt(otmp) ? c_shirt
|
||||||
: is_shirt(otmp)
|
: is_suit(otmp) ? c_suit
|
||||||
? c_shirt
|
: 0;
|
||||||
: is_suit(otmp)
|
|
||||||
? c_suit
|
|
||||||
: 0;
|
|
||||||
if (which && cantweararm(g.youmonst.data)
|
if (which && cantweararm(g.youmonst.data)
|
||||||
/* same exception for cloaks as used in m_dowear() */
|
/* same exception for cloaks as used in m_dowear() */
|
||||||
&& (which != c_cloak || g.youmonst.data->msize != MZ_SMALL)
|
&& (which != c_cloak
|
||||||
|
|| ((otmp->otyp != MUMMY_WRAPPING)
|
||||||
|
? g.youmonst.data->msize != MZ_SMALL
|
||||||
|
: !WrappingAllowed(g.youmonst.data)))
|
||||||
&& (racial_exception(&g.youmonst, otmp) < 1)) {
|
&& (racial_exception(&g.youmonst, otmp) < 1)) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
pline_The("%s will not fit on your body.", which);
|
pline_The("%s will not fit on your body.", which);
|
||||||
|
|||||||
+20
-15
@@ -1042,8 +1042,9 @@ static void
|
|||||||
break_armor(void)
|
break_armor(void)
|
||||||
{
|
{
|
||||||
register struct obj *otmp;
|
register struct obj *otmp;
|
||||||
|
struct permonst *uptr = g.youmonst.data;
|
||||||
|
|
||||||
if (breakarm(g.youmonst.data)) {
|
if (breakarm(uptr)) {
|
||||||
if ((otmp = uarm) != 0) {
|
if ((otmp = uarm) != 0) {
|
||||||
if (donning(otmp))
|
if (donning(otmp))
|
||||||
cancel_don();
|
cancel_don();
|
||||||
@@ -1057,7 +1058,9 @@ break_armor(void)
|
|||||||
(void) Armor_gone();
|
(void) Armor_gone();
|
||||||
useup(otmp);
|
useup(otmp);
|
||||||
}
|
}
|
||||||
if ((otmp = uarmc) != 0) {
|
if ((otmp = uarmc) != 0
|
||||||
|
/* mummy wrapping adapts to small and very big sizes */
|
||||||
|
&& (otmp->otyp != MUMMY_WRAPPING || !WrappingAllowed(uptr))) {
|
||||||
if (otmp->oartifact) {
|
if (otmp->oartifact) {
|
||||||
Your("%s falls off!", cloak_simple_name(otmp));
|
Your("%s falls off!", cloak_simple_name(otmp));
|
||||||
(void) Cloak_off();
|
(void) Cloak_off();
|
||||||
@@ -1072,8 +1075,8 @@ break_armor(void)
|
|||||||
Your("shirt rips to shreds!");
|
Your("shirt rips to shreds!");
|
||||||
useup(uarmu);
|
useup(uarmu);
|
||||||
}
|
}
|
||||||
} else if (sliparm(g.youmonst.data)) {
|
} else if (sliparm(uptr)) {
|
||||||
if ((otmp = uarm) != 0 && racial_exception(&g.youmonst, otmp) < 1) {
|
if ((otmp = uarm) != 0 && racial_exception(uptr, otmp) < 1) {
|
||||||
if (donning(otmp))
|
if (donning(otmp))
|
||||||
cancel_don();
|
cancel_don();
|
||||||
Your("armor falls around you!");
|
Your("armor falls around you!");
|
||||||
@@ -1084,8 +1087,10 @@ break_armor(void)
|
|||||||
(void) Armor_gone();
|
(void) Armor_gone();
|
||||||
dropp(otmp);
|
dropp(otmp);
|
||||||
}
|
}
|
||||||
if ((otmp = uarmc) != 0) {
|
if ((otmp = uarmc) != 0
|
||||||
if (is_whirly(g.youmonst.data))
|
/* mummy wrapping adapts to small and very big sizes */
|
||||||
|
&& (otmp->otyp != MUMMY_WRAPPING || !WrappingAllowed(uptr))) {
|
||||||
|
if (is_whirly(uptr))
|
||||||
Your("%s falls, unsupported!", cloak_simple_name(otmp));
|
Your("%s falls, unsupported!", cloak_simple_name(otmp));
|
||||||
else
|
else
|
||||||
You("shrink out of your %s!", cloak_simple_name(otmp));
|
You("shrink out of your %s!", cloak_simple_name(otmp));
|
||||||
@@ -1093,7 +1098,7 @@ break_armor(void)
|
|||||||
dropp(otmp);
|
dropp(otmp);
|
||||||
}
|
}
|
||||||
if ((otmp = uarmu) != 0) {
|
if ((otmp = uarmu) != 0) {
|
||||||
if (is_whirly(g.youmonst.data))
|
if (is_whirly(uptr))
|
||||||
You("seep right through your shirt!");
|
You("seep right through your shirt!");
|
||||||
else
|
else
|
||||||
You("become much too small for your shirt!");
|
You("become much too small for your shirt!");
|
||||||
@@ -1101,13 +1106,13 @@ break_armor(void)
|
|||||||
dropp(otmp);
|
dropp(otmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (has_horns(g.youmonst.data)) {
|
if (has_horns(uptr)) {
|
||||||
if ((otmp = uarmh) != 0) {
|
if ((otmp = uarmh) != 0) {
|
||||||
if (is_flimsy(otmp) && !donning(otmp)) {
|
if (is_flimsy(otmp) && !donning(otmp)) {
|
||||||
char hornbuf[BUFSZ];
|
char hornbuf[BUFSZ];
|
||||||
|
|
||||||
/* Future possibilities: This could damage/destroy helmet */
|
/* Future possibilities: This could damage/destroy helmet */
|
||||||
Sprintf(hornbuf, "horn%s", plur(num_horns(g.youmonst.data)));
|
Sprintf(hornbuf, "horn%s", plur(num_horns(uptr)));
|
||||||
Your("%s %s through %s.", hornbuf, vtense(hornbuf, "pierce"),
|
Your("%s %s through %s.", hornbuf, vtense(hornbuf, "pierce"),
|
||||||
yname(otmp));
|
yname(otmp));
|
||||||
} else {
|
} else {
|
||||||
@@ -1120,7 +1125,7 @@ break_armor(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nohands(g.youmonst.data) || verysmall(g.youmonst.data)) {
|
if (nohands(uptr) || verysmall(uptr)) {
|
||||||
if ((otmp = uarmg) != 0) {
|
if ((otmp = uarmg) != 0) {
|
||||||
if (donning(otmp))
|
if (donning(otmp))
|
||||||
cancel_don();
|
cancel_don();
|
||||||
@@ -1145,16 +1150,16 @@ break_armor(void)
|
|||||||
dropp(otmp);
|
dropp(otmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nohands(g.youmonst.data) || verysmall(g.youmonst.data)
|
if (nohands(uptr) || verysmall(uptr)
|
||||||
|| slithy(g.youmonst.data) || g.youmonst.data->mlet == S_CENTAUR) {
|
|| slithy(uptr) || uptr->mlet == S_CENTAUR) {
|
||||||
if ((otmp = uarmf) != 0) {
|
if ((otmp = uarmf) != 0) {
|
||||||
if (donning(otmp))
|
if (donning(otmp))
|
||||||
cancel_don();
|
cancel_don();
|
||||||
if (is_whirly(g.youmonst.data))
|
if (is_whirly(uptr))
|
||||||
Your("boots fall away!");
|
Your("boots fall away!");
|
||||||
else
|
else
|
||||||
Your("boots %s off your feet!",
|
Your("boots %s off your feet!",
|
||||||
verysmall(g.youmonst.data) ? "slide" : "are pushed");
|
verysmall(uptr) ? "slide" : "are pushed");
|
||||||
(void) Boots_off();
|
(void) Boots_off();
|
||||||
dropp(otmp);
|
dropp(otmp);
|
||||||
}
|
}
|
||||||
@@ -1163,7 +1168,7 @@ break_armor(void)
|
|||||||
it/them on (should also come off if head is too tiny or too huge,
|
it/them on (should also come off if head is too tiny or too huge,
|
||||||
but putting accessories on doesn't reject those cases [yet?]);
|
but putting accessories on doesn't reject those cases [yet?]);
|
||||||
amulet stays worn */
|
amulet stays worn */
|
||||||
if ((otmp = ublindf) != 0 && !has_head(g.youmonst.data)) {
|
if ((otmp = ublindf) != 0 && !has_head(uptr)) {
|
||||||
int l;
|
int l;
|
||||||
const char *eyewear = simpleonames(otmp); /* blindfold|towel|lenses */
|
const char *eyewear = simpleonames(otmp); /* blindfold|towel|lenses */
|
||||||
|
|
||||||
|
|||||||
+37
-15
@@ -258,10 +258,10 @@ mon_set_minvis(struct monst *mon)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mon_adjust_speed(struct monst *mon,
|
mon_adjust_speed(
|
||||||
int adjust, /* positive => increase speed, negative =>
|
struct monst *mon,
|
||||||
decrease */
|
int adjust, /* positive => increase speed, negative => decrease */
|
||||||
struct obj *obj) /* item to make known if effect can be seen */
|
struct obj *obj) /* item to make known if effect can be seen */
|
||||||
{
|
{
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
boolean give_msg = !g.in_mklev, petrify = FALSE;
|
boolean give_msg = !g.in_mklev, petrify = FALSE;
|
||||||
@@ -533,6 +533,8 @@ find_mac(struct monst *mon)
|
|||||||
void
|
void
|
||||||
m_dowear(struct monst *mon, boolean creation)
|
m_dowear(struct monst *mon, boolean creation)
|
||||||
{
|
{
|
||||||
|
boolean can_wear_armor;
|
||||||
|
|
||||||
#define RACE_EXCEPTION TRUE
|
#define RACE_EXCEPTION TRUE
|
||||||
/* Note the restrictions here are the same as in dowear in do_wear.c
|
/* Note the restrictions here are the same as in dowear in do_wear.c
|
||||||
* except for the additional restriction on intelligence. (Players
|
* except for the additional restriction on intelligence. (Players
|
||||||
@@ -548,12 +550,15 @@ m_dowear(struct monst *mon, boolean creation)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_dowear_type(mon, W_AMUL, creation, FALSE);
|
m_dowear_type(mon, W_AMUL, creation, FALSE);
|
||||||
|
can_wear_armor = !cantweararm(mon->data); /* for suit, cloak, shirt */
|
||||||
/* can't put on shirt if already wearing suit */
|
/* can't put on shirt if already wearing suit */
|
||||||
if (!cantweararm(mon->data) && !(mon->misc_worn_check & W_ARM))
|
if (can_wear_armor && !(mon->misc_worn_check & W_ARM))
|
||||||
m_dowear_type(mon, W_ARMU, creation, FALSE);
|
m_dowear_type(mon, W_ARMU, creation, FALSE);
|
||||||
/* treating small as a special case allows
|
/* WrappingAllowed() makes any size between small and huge eligible;
|
||||||
hobbits, gnomes, and kobolds to wear cloaks */
|
treating small as a special case allows hobbits, gnomes, and
|
||||||
if (!cantweararm(mon->data) || mon->data->msize == MZ_SMALL)
|
kobolds to wear all cloaks; large and huge allows giants and such
|
||||||
|
to wear mummy wrappings but not other cloaks */
|
||||||
|
if (can_wear_armor || WrappingAllowed(mon->data))
|
||||||
m_dowear_type(mon, W_ARMC, creation, FALSE);
|
m_dowear_type(mon, W_ARMC, creation, FALSE);
|
||||||
m_dowear_type(mon, W_ARMH, creation, FALSE);
|
m_dowear_type(mon, W_ARMH, creation, FALSE);
|
||||||
if (!MON_WEP(mon) || !bimanual(MON_WEP(mon)))
|
if (!MON_WEP(mon) || !bimanual(MON_WEP(mon)))
|
||||||
@@ -561,15 +566,19 @@ m_dowear(struct monst *mon, boolean creation)
|
|||||||
m_dowear_type(mon, W_ARMG, creation, FALSE);
|
m_dowear_type(mon, W_ARMG, creation, FALSE);
|
||||||
if (!slithy(mon->data) && mon->data->mlet != S_CENTAUR)
|
if (!slithy(mon->data) && mon->data->mlet != S_CENTAUR)
|
||||||
m_dowear_type(mon, W_ARMF, creation, FALSE);
|
m_dowear_type(mon, W_ARMF, creation, FALSE);
|
||||||
if (!cantweararm(mon->data))
|
if (can_wear_armor)
|
||||||
m_dowear_type(mon, W_ARM, creation, FALSE);
|
m_dowear_type(mon, W_ARM, creation, FALSE);
|
||||||
else
|
else
|
||||||
m_dowear_type(mon, W_ARM, creation, RACE_EXCEPTION);
|
m_dowear_type(mon, W_ARM, creation, RACE_EXCEPTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
m_dowear_type(struct monst *mon, long flag, boolean creation,
|
m_dowear_type(
|
||||||
boolean racialexception)
|
struct monst *mon,
|
||||||
|
long flag, /* wornmask value */
|
||||||
|
boolean creation,
|
||||||
|
boolean racialexception) /* small monsters that are allowed for player
|
||||||
|
* races (gnomes) can wear suits */
|
||||||
{
|
{
|
||||||
struct obj *old, *best, *obj;
|
struct obj *old, *best, *obj;
|
||||||
long oldmask = 0L;
|
long oldmask = 0L;
|
||||||
@@ -615,6 +624,14 @@ m_dowear_type(struct monst *mon, long flag, boolean creation,
|
|||||||
case W_ARMC:
|
case W_ARMC:
|
||||||
if (!is_cloak(obj))
|
if (!is_cloak(obj))
|
||||||
continue;
|
continue;
|
||||||
|
/* mummy wrapping is only cloak allowed when bigger than human */
|
||||||
|
if (mon->data->msize > MZ_HUMAN && obj->otyp != MUMMY_WRAPPING)
|
||||||
|
continue;
|
||||||
|
/* avoid mummy wrapping if it will allow hero to see mon (unless
|
||||||
|
this is a new mummy; an invisible one is feasible via ^G) */
|
||||||
|
if (mon->minvis && w_blocks(obj, W_ARMC) == INVIS
|
||||||
|
&& !See_invisible && !creation)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
case W_ARMH:
|
case W_ARMH:
|
||||||
if (!is_helmet(obj))
|
if (!is_helmet(obj))
|
||||||
@@ -738,8 +755,9 @@ m_dowear_type(struct monst *mon, long flag, boolean creation,
|
|||||||
if (mon->minvis && !See_invisible) {
|
if (mon->minvis && !See_invisible) {
|
||||||
pline("Suddenly you cannot see %s.", nambuf);
|
pline("Suddenly you cannot see %s.", nambuf);
|
||||||
makeknown(best->otyp);
|
makeknown(best->otyp);
|
||||||
} /* else if (!mon->minvis)
|
/* } else if (!mon->minvis) {
|
||||||
* pline("%s suddenly appears!", Amonnam(mon)); */
|
* pline("%s suddenly appears!", Amonnam(mon)); */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#undef RACE_EXCEPTION
|
#undef RACE_EXCEPTION
|
||||||
@@ -931,7 +949,9 @@ mon_break_armor(struct monst *mon, boolean polyspot)
|
|||||||
You_hear("a cracking sound.");
|
You_hear("a cracking sound.");
|
||||||
m_useup(mon, otmp);
|
m_useup(mon, otmp);
|
||||||
}
|
}
|
||||||
if ((otmp = which_armor(mon, W_ARMC)) != 0) {
|
if ((otmp = which_armor(mon, W_ARMC)) != 0
|
||||||
|
/* mummy wrapping adapts to small and very big sizes */
|
||||||
|
&& (otmp->otyp != MUMMY_WRAPPING || !WrappingAllowed(mdat))) {
|
||||||
if (otmp->oartifact) {
|
if (otmp->oartifact) {
|
||||||
if (vis)
|
if (vis)
|
||||||
pline("%s %s falls off!", s_suffix(Monnam(mon)),
|
pline("%s %s falls off!", s_suffix(Monnam(mon)),
|
||||||
@@ -969,7 +989,9 @@ mon_break_armor(struct monst *mon, boolean polyspot)
|
|||||||
bypass_obj(otmp);
|
bypass_obj(otmp);
|
||||||
m_lose_armor(mon, otmp);
|
m_lose_armor(mon, otmp);
|
||||||
}
|
}
|
||||||
if ((otmp = which_armor(mon, W_ARMC)) != 0) {
|
if ((otmp = which_armor(mon, W_ARMC)) != 0
|
||||||
|
/* mummy wrapping adapts to small and very big sizes */
|
||||||
|
&& (otmp->otyp != MUMMY_WRAPPING || !WrappingAllowed(mdat))) {
|
||||||
if (vis) {
|
if (vis) {
|
||||||
if (is_whirly(mon->data))
|
if (is_whirly(mon->data))
|
||||||
pline("%s %s falls, unsupported!", s_suffix(Monnam(mon)),
|
pline("%s %s falls, unsupported!", s_suffix(Monnam(mon)),
|
||||||
|
|||||||
Reference in New Issue
Block a user