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:
52
src/worn.c
52
src/worn.c
@@ -258,10 +258,10 @@ mon_set_minvis(struct monst *mon)
|
||||
}
|
||||
|
||||
void
|
||||
mon_adjust_speed(struct monst *mon,
|
||||
int adjust, /* positive => increase speed, negative =>
|
||||
decrease */
|
||||
struct obj *obj) /* item to make known if effect can be seen */
|
||||
mon_adjust_speed(
|
||||
struct monst *mon,
|
||||
int adjust, /* positive => increase speed, negative => decrease */
|
||||
struct obj *obj) /* item to make known if effect can be seen */
|
||||
{
|
||||
struct obj *otmp;
|
||||
boolean give_msg = !g.in_mklev, petrify = FALSE;
|
||||
@@ -533,6 +533,8 @@ find_mac(struct monst *mon)
|
||||
void
|
||||
m_dowear(struct monst *mon, boolean creation)
|
||||
{
|
||||
boolean can_wear_armor;
|
||||
|
||||
#define RACE_EXCEPTION TRUE
|
||||
/* Note the restrictions here are the same as in dowear in do_wear.c
|
||||
* except for the additional restriction on intelligence. (Players
|
||||
@@ -548,12 +550,15 @@ m_dowear(struct monst *mon, boolean creation)
|
||||
return;
|
||||
|
||||
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 */
|
||||
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);
|
||||
/* treating small as a special case allows
|
||||
hobbits, gnomes, and kobolds to wear cloaks */
|
||||
if (!cantweararm(mon->data) || mon->data->msize == MZ_SMALL)
|
||||
/* WrappingAllowed() makes any size between small and huge eligible;
|
||||
treating small as a special case allows hobbits, gnomes, and
|
||||
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_ARMH, creation, FALSE);
|
||||
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);
|
||||
if (!slithy(mon->data) && mon->data->mlet != S_CENTAUR)
|
||||
m_dowear_type(mon, W_ARMF, creation, FALSE);
|
||||
if (!cantweararm(mon->data))
|
||||
if (can_wear_armor)
|
||||
m_dowear_type(mon, W_ARM, creation, FALSE);
|
||||
else
|
||||
m_dowear_type(mon, W_ARM, creation, RACE_EXCEPTION);
|
||||
}
|
||||
|
||||
static void
|
||||
m_dowear_type(struct monst *mon, long flag, boolean creation,
|
||||
boolean racialexception)
|
||||
m_dowear_type(
|
||||
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;
|
||||
long oldmask = 0L;
|
||||
@@ -615,6 +624,14 @@ m_dowear_type(struct monst *mon, long flag, boolean creation,
|
||||
case W_ARMC:
|
||||
if (!is_cloak(obj))
|
||||
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;
|
||||
case W_ARMH:
|
||||
if (!is_helmet(obj))
|
||||
@@ -738,8 +755,9 @@ m_dowear_type(struct monst *mon, long flag, boolean creation,
|
||||
if (mon->minvis && !See_invisible) {
|
||||
pline("Suddenly you cannot see %s.", nambuf);
|
||||
makeknown(best->otyp);
|
||||
} /* else if (!mon->minvis)
|
||||
* pline("%s suddenly appears!", Amonnam(mon)); */
|
||||
/* } else if (!mon->minvis) {
|
||||
* pline("%s suddenly appears!", Amonnam(mon)); */
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef RACE_EXCEPTION
|
||||
@@ -931,7 +949,9 @@ mon_break_armor(struct monst *mon, boolean polyspot)
|
||||
You_hear("a cracking sound.");
|
||||
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 (vis)
|
||||
pline("%s %s falls off!", s_suffix(Monnam(mon)),
|
||||
@@ -969,7 +989,9 @@ mon_break_armor(struct monst *mon, boolean polyspot)
|
||||
bypass_obj(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 (is_whirly(mon->data))
|
||||
pline("%s %s falls, unsupported!", s_suffix(Monnam(mon)),
|
||||
|
||||
Reference in New Issue
Block a user