1 /* NetHack 3.6 were.c $NHDT-Date: 1432512763 2015/05/25 00:12:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
8 /* JNetHack may be freely redistributed. See license for details. */
13 STATIC_DCL char *FDECL(beastname, (const char *));
15 /*JP
\81u
\83W
\83\83\83b
\83J
\83\8b\90l
\8aÔ
\81v
\82©
\82ç
\81u
\83W
\83\83\83b
\83J
\83\8b\81v
\82ð
\8eæ
\82è
\8fo
\82· */
20 static char werebuf[BUFSZ];
21 strcpy(werebuf, name);
22 werebuf[strlen(werebuf) - 4] = '\0';
29 register struct monst *mon;
31 if (!is_were(mon->data))
34 if (is_human(mon->data)) {
35 if (!Protection_from_shape_changers
36 && !rn2(night() ? (flags.moonphase == FULL_MOON ? 3 : 30)
37 : (flags.moonphase == FULL_MOON ? 10 : 50))) {
38 new_were(mon); /* change into animal form */
39 if (!Deaf && !canseemon(mon)) {
42 switch (monsndx(mon->data)) {
53 howler = "
\83W
\83\83\83b
\83J
\83\8b";
61 You_hear("a %s howling at the moon.", howler);
63 You_hear("
\8c\8e\96é
\82É%s
\82ª
\96i
\82¦
\82é
\90º
\82ð
\95·
\82¢
\82½
\81D", howler);
66 } else if (!rn2(30) || Protection_from_shape_changers) {
67 new_were(mon); /* change back into human form */
77 return (PM_HUMAN_WEREWOLF);
78 case PM_HUMAN_WEREWOLF:
81 return (PM_HUMAN_WEREJACKAL);
82 case PM_HUMAN_WEREJACKAL:
83 return (PM_WEREJACKAL);
85 return (PM_HUMAN_WERERAT);
86 case PM_HUMAN_WERERAT:
93 /* convert monsters similar to werecritters into appropriate werebeast */
108 return PM_WEREJACKAL;
122 register struct monst *mon;
126 pm = counter_were(monsndx(mon->data));
128 impossible("unknown lycanthrope %s.", mon->data->mname);
132 if (canseemon(mon) && !Hallucination)
134 pline("%s changes into a %s.", Monnam(mon),
135 is_human(&mons[pm]) ? "human" : mons[pm].mname + 4);
137 pline("%s
\82Í%s
\82Ì
\8ep
\82É
\82È
\82Á
\82½
\81D", Monnam(mon),
138 is_human(&mons[pm]) ? "
\90l
\8aÔ" : beastname(mons[pm].mname));
141 set_mon_data(mon, &mons[pm], 0);
142 if (mon->msleeping || !mon->mcanmove) {
143 /* transformation wakens and/or revitalizes */
145 mon->mfrozen = 0; /* not asleep or paralyzed */
148 /* regenerate by 1/4 of the lost hit points */
149 mon->mhp += (mon->mhpmax - mon->mhp) / 4;
150 newsym(mon->mx, mon->my);
151 mon_break_armor(mon, FALSE);
152 possibly_unwield(mon, FALSE);
155 int were_summon(ptr, yours, visible,
156 genbuf) /* were-creature (even you) summons a horde */
157 register struct permonst *ptr;
158 register boolean yours;
159 int *visible; /* number of visible helpers created */
162 register int i, typ, pm = monsndx(ptr);
163 register struct monst *mtmp;
167 if (Protection_from_shape_changers && !yours)
169 for (i = rnd(5); i > 0; i--) {
172 case PM_HUMAN_WERERAT:
174 rn2(3) ? PM_SEWER_RAT : rn2(3) ? PM_GIANT_RAT : PM_RABID_RAT;
177 Strcpy(genbuf, "rat");
179 Strcpy(genbuf, "
\83l
\83Y
\83~");
182 case PM_HUMAN_WEREJACKAL:
186 Strcpy(genbuf, "jackal");
188 Strcpy(genbuf, "
\83W
\83\83\83b
\83J
\83\8b");
191 case PM_HUMAN_WEREWOLF:
192 typ = rn2(5) ? PM_WOLF : PM_WINTER_WOLF;
195 Strcpy(genbuf, "wolf");
197 Strcpy(genbuf, "
\98T");
202 mtmp = makemon(&mons[typ], u.ux, u.uy, NO_MM_FLAGS);
209 (void) tamedog(mtmp, (struct obj *) 0);
218 boolean controllable_poly = Polymorph_control && !(Stunned || Unaware);
220 if (Unchanging || (u.umonnum == u.ulycn))
222 if (controllable_poly) {
224 /* `+4' => skip "were" prefix to get name of beast */
225 Sprintf(qbuf, "Do you want to change into %s?",
226 an(mons[u.ulycn].mname + 4));
228 Sprintf(qbuf, "%s
\82É
\95Ï
\89»
\82µ
\82Ü
\82·
\82©
\81H",
229 beastname(mons[u.ulycn].mname));
234 (void) polymon(u.ulycn);
241 boolean controllable_poly = Polymorph_control && !(Stunned || Unaware);
245 You_feel("purified.");
247 You("
\8fò
\82ß
\82ç
\82ê
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
248 u.ulycn = NON_PM; /* cure lycanthropy */
250 if (!Unchanging && is_were(youmonst.data)
252 && (!controllable_poly || yn("Remain in beast form?") == 'n'))
254 && (!controllable_poly || yn("
\8fb
\82Ì
\8ep
\82Ì
\82Ü
\82Ü
\82Å
\82¢
\82é
\81H") == 'n'))