hats vs horns
Some recent newsgroup discussion claiming that a pet ki-rin was wearing a helmet (I think poster was hallucinating) caused me to look at some of the hat handling code. There were a couple of noticeable problems and one latent one in code added for 3.4.1. Polymorphing into a minotaur pushes hard helmets off hero's head, but nothing prevented you from putting one right back on. Helmet wearing monsters who polymorphed into minotaurs weren't affected at all. And message handling always assumed multiple horns even though we have some singled horned monsters, but since all those have no hands they can't wear any armor and that potential pluralization issue wasn't noticeable.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)polyself.c 3.4 2002/07/11 */
|
||||
/* SCCS Id: @(#)polyself.c 3.4 2003/01/08 */
|
||||
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -617,18 +617,20 @@ break_armor()
|
||||
#endif
|
||||
}
|
||||
if (has_horns(youmonst.data)) {
|
||||
if ((otmp = uarmh) != 0) {
|
||||
if (is_flimsy(otmp) && !donning(otmp)) {
|
||||
char yourbuf[BUFSZ];
|
||||
/* Future possiblities: This could damage/destroy helmet*/
|
||||
Your("horns pierce through %s %s.", shk_your(yourbuf, otmp),
|
||||
xname(otmp));
|
||||
} else {
|
||||
if (donning(otmp)) cancel_don();
|
||||
Your("helmet falls to the %s!", surface(u.ux, u.uy));
|
||||
(void) Helmet_off();
|
||||
dropx(otmp);
|
||||
}
|
||||
if ((otmp = uarmh) != 0) {
|
||||
if (is_flimsy(otmp) && !donning(otmp)) {
|
||||
char hornbuf[BUFSZ], yourbuf[BUFSZ];
|
||||
|
||||
/* Future possiblities: This could damage/destroy helmet */
|
||||
Sprintf(hornbuf, "horn%s", plur(num_horns(youmonst.data)));
|
||||
Your("%s %s through %s %s.", vtense(hornbuf, "pierce"),
|
||||
shk_your(yourbuf, otmp), xname(otmp));
|
||||
} else {
|
||||
if (donning(otmp)) cancel_don();
|
||||
Your("helmet falls to the %s!", surface(u.ux, u.uy));
|
||||
(void) Helmet_off();
|
||||
dropx(otmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nohands(youmonst.data) || verysmall(youmonst.data)) {
|
||||
|
||||
Reference in New Issue
Block a user