1 /* NetHack 3.6 were.c $NHDT-Date: 1550524568 2019/02/18 21:16:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.23 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2011. */
4 /* NetHack may be freely redistributed. See license for details. */
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2021 */
9 /* JNetHack may be freely redistributed. See license for details. */
14 STATIC_DCL char *FDECL(beastname, (const char *));
16 /*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· */
21 static char werebuf[BUFSZ];
22 strcpy(werebuf, name);
23 werebuf[strlen(werebuf) - 4] = '\0';
30 register struct monst *mon;
32 if (!is_were(mon->data))
35 if (is_human(mon->data)) {
36 if (!Protection_from_shape_changers
37 && !rn2(night() ? (flags.moonphase == FULL_MOON ? 3 : 30)
38 : (flags.moonphase == FULL_MOON ? 10 : 50))) {
39 new_were(mon); /* change into animal form */
40 if (!Deaf && !canseemon(mon)) {
43 switch (monsndx(mon->data)) {
54 howler = "
\83W
\83\83\83b
\83J
\83\8b";
62 You_hear("a %s howling at the moon.", howler);
64 You_hear("
\8c\8e\96é
\82É%s
\82ª
\96i
\82¦
\82é
\90º
\82ð
\95·
\82¢
\82½
\81D", howler);
67 } else if (!rn2(30) || Protection_from_shape_changers) {
68 new_were(mon); /* change back into human form */
70 /* update innate intrinsics (mainly Drain_resistance) */
71 set_uasmon(); /* new_were() doesn't do this */
80 return PM_HUMAN_WEREWOLF;
81 case PM_HUMAN_WEREWOLF:
84 return PM_HUMAN_WEREJACKAL;
85 case PM_HUMAN_WEREJACKAL:
88 return PM_HUMAN_WERERAT;
89 case PM_HUMAN_WERERAT:
96 /* convert monsters similar to werecritters into appropriate werebeast */
111 return PM_WEREJACKAL;
125 register struct monst *mon;
129 pm = counter_were(monsndx(mon->data));
131 impossible("unknown lycanthrope %s.", mon->data->mname);
135 if (canseemon(mon) && !Hallucination)
137 pline("%s changes into a %s.", Monnam(mon),
138 is_human(&mons[pm]) ? "human" : mons[pm].mname + 4);
140 pline("%s
\82Í%s
\82Ì
\8ep
\82É
\82È
\82Á
\82½
\81D", Monnam(mon),
141 is_human(&mons[pm]) ? "
\90l
\8aÔ" : beastname(mons[pm].mname));
144 set_mon_data(mon, &mons[pm]);
145 if (mon->msleeping || !mon->mcanmove) {
146 /* transformation wakens and/or revitalizes */
148 mon->mfrozen = 0; /* not asleep or paralyzed */
151 /* regenerate by 1/4 of the lost hit points */
152 mon->mhp += (mon->mhpmax - mon->mhp) / 4;
153 newsym(mon->mx, mon->my);
154 mon_break_armor(mon, FALSE);
155 possibly_unwield(mon, FALSE);
158 /* were-creature (even you) summons a horde */
160 were_summon(ptr, yours, visible, genbuf)
161 struct permonst *ptr;
163 int *visible; /* number of visible helpers created */
166 int i, typ, pm = monsndx(ptr);
171 if (Protection_from_shape_changers && !yours)
173 for (i = rnd(5); i > 0; i--) {
176 case PM_HUMAN_WERERAT:
177 typ = rn2(3) ? PM_SEWER_RAT
178 : rn2(3) ? PM_GIANT_RAT : PM_RABID_RAT;
181 Strcpy(genbuf, "rat");
183 Strcpy(genbuf, "
\83l
\83Y
\83~");
186 case PM_HUMAN_WEREJACKAL:
187 typ = rn2(7) ? PM_JACKAL : rn2(3) ? PM_COYOTE : PM_FOX;
190 Strcpy(genbuf, "jackal");
192 Strcpy(genbuf, "
\83W
\83\83\83b
\83J
\83\8b");
195 case PM_HUMAN_WEREWOLF:
196 typ = rn2(5) ? PM_WOLF : rn2(2) ? PM_WARG : PM_WINTER_WOLF;
199 Strcpy(genbuf, "wolf");
201 Strcpy(genbuf, "
\98T");
206 mtmp = makemon(&mons[typ], u.ux, u.uy, NO_MM_FLAGS);
213 (void) tamedog(mtmp, (struct obj *) 0);
222 boolean controllable_poly = Polymorph_control && !(Stunned || Unaware);
224 if (Unchanging || u.umonnum == u.ulycn)
226 if (controllable_poly) {
228 /* `+4' => skip "were" prefix to get name of beast */
229 Sprintf(qbuf, "Do you want to change into %s?",
230 an(mons[u.ulycn].mname + 4));
231 #else /*
\93ú
\96{
\8cê
\82Å
\82Í
\90ê
\97p
\8aÖ
\90\94\82ð
\8eg
\82¤ */
232 Sprintf(qbuf, "%s
\82É
\95Ï
\89»
\82µ
\82Ü
\82·
\82©
\81H",
233 beastname(mons[u.ulycn].mname));
235 if (!paranoid_query(ParanoidWerechange, qbuf))
238 (void) polymon(u.ulycn);
245 boolean controllable_poly = Polymorph_control && !(Stunned || Unaware);
249 You_feel("purified.");
251 You("
\8fò
\82ß
\82ç
\82ê
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
252 set_ulycn(NON_PM); /* cure lycanthropy */
254 if (!Unchanging && is_were(youmonst.data)
255 && (!controllable_poly
257 || !paranoid_query(ParanoidWerechange, "Remain in beast form?")))
259 || !paranoid_query(ParanoidWerechange, "
\8fb
\82Ì
\8ep
\82Ì
\82Ü
\82Ü
\82Å
\82¢
\82é
\81H")))
261 else if (is_were(youmonst.data) && !u.mtimedone)
262 u.mtimedone = rn1(200, 200); /* 40% of initial were change */
265 /* lycanthropy is being caught or cured, but no shape change is involved */
271 /* add or remove lycanthrope's innate intrinsics (Drain_resistance) */