1 /* NetHack 3.6 read.c $NHDT-Date: 1561485713 2019/06/25 18:01:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.172 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2012. */
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-2020 */
9 /* JNetHack may be freely redistributed. See license for details. */
13 #define Your_Own_Role(mndx) \
14 ((mndx) == urole.malenum \
15 || (urole.femalenum != NON_PM && (mndx) == urole.femalenum))
16 #define Your_Own_Race(mndx) \
17 ((mndx) == urace.malenum \
18 || (urace.femalenum != NON_PM && (mndx) == urace.femalenum))
22 static NEARDATA const char readable[] = { ALL_CLASSES, SCROLL_CLASS,
24 static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
26 STATIC_DCL boolean FDECL(learnscrolltyp, (SHORT_P));
27 STATIC_DCL char *FDECL(erode_obj_text, (struct obj *, char *));
28 STATIC_DCL char *FDECL(apron_text, (struct obj *, char *buf));
29 STATIC_DCL void FDECL(stripspe, (struct obj *));
30 STATIC_DCL void FDECL(p_glow1, (struct obj *));
31 STATIC_DCL void FDECL(p_glow2, (struct obj *, const char *));
32 STATIC_DCL void FDECL(forget_single_object, (int));
34 STATIC_DCL void FDECL(forget_objclass, (int));
36 STATIC_DCL void FDECL(randomize, (int *, int));
37 STATIC_DCL void FDECL(forget, (int));
38 STATIC_DCL int FDECL(maybe_tame, (struct monst *, struct obj *));
39 STATIC_DCL boolean FDECL(get_valid_stinking_cloud_pos, (int, int));
40 STATIC_DCL boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P));
41 STATIC_PTR void FDECL(display_stinking_cloud_positions, (int));
42 STATIC_PTR void FDECL(set_lit, (int, int, genericptr));
43 STATIC_DCL void NDECL(do_class_genocide);
46 learnscrolltyp(scrolltyp)
49 if (!objects[scrolltyp].oc_name_known) {
51 more_experienced(0, 10);
57 /* also called from teleport.c for scroll of teleportation */
62 /* it's implied that sobj->dknown is set;
63 we couldn't be reading this scroll otherwise */
64 if (sobj->oclass != SPBOOK_CLASS)
65 (void) learnscrolltyp(sobj->otyp);
69 erode_obj_text(otmp, buf)
73 int erosion = greatest_erosion(otmp);
76 wipeout_text(buf, (int) (strlen(buf) * erosion / (2 * MAX_ERODE)),
77 otmp->o_id ^ (unsigned) ubirthday);
82 tshirt_text(tshirt, buf)
86 static const char *shirt_msgs[] = {
89 "I explored the Dungeons of Doom and all I got was this lousy T-shirt!",
90 "Is that Mjollnir in your pocket or are you just happy to see me?",
91 "It's not the size of your sword, it's how #enhance'd you are with it.",
92 "Madame Elvira's House O' Succubi Lifetime Customer",
93 "Madame Elvira's House O' Succubi Employee of the Month",
94 "Ludios Vault Guards Do It In Small, Dark Rooms",
95 "Yendor Military Soldiers Do It In Large Groups",
96 "I survived Yendor Military Boot Camp",
97 "Ludios Accounting School Intra-Mural Lacrosse Team",
98 "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest",
99 "Hey, black dragon! Disintegrate THIS!",
100 "I'm With Stupid -->",
101 "Don't blame me, I voted for Izchak!",
102 "Don't Panic", /* HHGTTG */
103 "Furinkan High School Athletic Dept.", /* Ranma 1/2 */
104 "Hel-LOOO, Nurse!", /* Animaniacs */
106 "
\8e\84\82Í
\89^
\96½
\82Ì
\96À
\8b{
\82ð
\92²
\8d¸
\82µ
\82Ä
\82¢
\82½
\82ª
\81C
\8eè
\82É
\93ü
\82ê
\82½
\82Ì
\82Í
\82«
\82½
\82È
\82¢
\82s
\83V
\83\83\83c
\82¾
\82¯
\82¾
\82Á
\82½
\81I",
107 "
\83|
\83P
\83b
\83g
\82É
\83~
\83\85\83\8b\83j
\81[
\83\8b\82ª
\93ü
\82Á
\82Ä
\82¢
\82é
\82Ì
\81H
\82»
\82ê
\82Æ
\82à
\8e\84\82É
\89ï
\82¦
\82Ä
\82¤
\82ê
\82µ
\82¢
\81H",
108 "
\8c\95\82Ì
\91å
\82«
\82³
\82ª
\96â
\91è
\82È
\82Ì
\82Å
\82Í
\82È
\82¢
\81D
\82»
\82ê
\82ª
\94@
\89½
\82É#enhance
\82³
\82ê
\82Ä
\82¢
\82é
\82©
\82È
\82Ì
\82¾
\81D",
109 "
\83}
\83_
\83\80\81E
\83G
\83\8b\83o
\83C
\83\89\82Ì
\83T
\83L
\83\85\83o
\83X
\8aÙ
\89i
\8bv
\8cÚ
\8bq",
110 "
\83}
\83_
\83\80\81E
\83G
\83\8b\83o
\83C
\83\89\82Ì
\83T
\83L
\83\85\83o
\83X
\8aÙ
\8d¡
\8c\8e\82Ì
\8dÅ
\97D
\8fG
\8c÷
\98J
\8eÒ",
111 "
\83\8d\81[
\83f
\83B
\83I
\83X
\8bà
\8cÉ
\82Ì
\94Ô
\90l
\81C
\82»
\82ê
\82Í
\88Ã
\82
\8f¬
\82³
\82¢
\95\94\89®
\82Ì
\92\86",
112 "
\83C
\83F
\83\93\83_
\81[
\8cR
\95º
\8em
\81C
\82»
\82ê
\82Í
\8b\90\91å
\82È
\92c
\91Ì
\82Ì
\92\86",
113 "
\8e\84\82Í
\83C
\83F
\83\93\83_
\81[
\8cR
\82Ì
\90V
\95º
\8cP
\97û
\8f\8a\82ð
\8fæ
\82è
\89z
\82¦
\82Ü
\82µ
\82½",
114 "
\83\8d\81[
\83f
\83B
\83I
\83X
\89ï
\8cv
\8aw
\8dZ
\8eº
\93à
\83\89\83N
\83\8d\83X
\83`
\81[
\83\80",
115 "Oracle(TM)
\82Ì
\90ò
\91æ
\82P
\82O
\89ñ
\94G
\82ê
\82s
\83V
\83\83\83c
\83R
\83\93\83e
\83X
\83g",
116 "
\82¨
\82¢
\81C
\8d\95\83h
\83\89\83S
\83\93\81I
\82±
\82¢
\82Â
\82ð
\95ª
\89ð
\82µ
\82ë
\81I",
117 "
\94n
\8e
\82Æ
\88ê
\8f\8f\82É
\82¢
\82Ü
\82·
\81¨ ",
118 "
\8e\84\82Í
\88«
\82
\82È
\82¢
\81IIzchak
\82É
\93\8a\95[
\82µ
\82½
\82à
\82Ì
\81I",
119 "
\82 \82í
\82Ä
\82é
\82È", /*
\8bâ
\89Í
\83q
\83b
\83`
\83n
\83C
\83N
\83K
\83C
\83h */
120 "
\95\97\97Ñ
\8aÙ
\8d\82\8dZ
\97¤
\8fã
\95\94", /* Ranma 1/2 */
121 "
\82g
\82\85\82\8c\81|
\82k
\82n
\82n
\82n
\81C
\82m
\82\95\82\92\82\93\82\85\81I", /* Animaniacs */
125 "100% goblin hair - do not wash",
126 "Aberzombie and Fitch",
127 "cK -- Cockatrice touches the Kop",
128 "Don't ask me, I only adventure here",
130 "d, your dog or a killer?",
131 "FREE PUG AND NEWT!",
134 "Hello, my darlings!", /* Charlie Drake */
135 "Hey! Nymphs! Steal This T-Shirt!",
136 "I <3 Dungeon of Doom",
138 "I am a Valkyrie. If you see me running, try to keep up.",
139 "I am not a pack rat - I am a collector",
140 "I bounced off a rubber tree", /* Monkey Island */
141 "Plunder Island Brimstone Beach Club", /* Monkey Island */
143 "
\83S
\83u
\83\8a\83\93\96Ñ100% -
\90ô
\82¦
\82Ü
\82¹
\82ñ",
144 "
\83A
\83o
\83]
\83\93\83r&
\83t
\83B
\83b
\83`",
145 "cK --
\83R
\83J
\83g
\83\8a\83X
\82ª
\8cx
\8a¯
\82É
\83^
\83b
\83`",
146 "
\8e¿
\96â
\82µ
\82È
\82¢
\82Å;
\8e\84\82Í
\82±
\82±
\82ð
\92T
\8c\9f\82µ
\82Ä
\82¢
\82é
\82¾
\82¯",
148 "d
\82Í
\82 \82È
\82½
\82Ì
\8c¢
\82©
\8eE
\90l
\8eÒ
\82©
\81H",
149 "FREE PUG AND NEWT!",
152 "
\82±
\82ñ
\82É
\82¿
\82Í
\83_
\81[
\83\8a\83\93\81I", /* Charlie Drake */
153 "
\82â
\82 \81I
\83j
\83\93\83t
\81I
\82±
\82Ì
\82s
\83V
\83\83\83c
\82ð
\93\90\82ñ
\82Å
\81I",
154 "I <3 Dungeon of Doom",
156 "
\8e\84\82Í
\83o
\83\8b\83L
\83\8a\81[
\82¾
\81D
\8e\84\82ª
\91\96\82Á
\82Ä
\82¢
\82é
\82Ì
\82ð
\8c©
\82½
\82ç
\81C
\82Â
\82¢
\82Ä
\82±
\82¢
\81D",
157 "
\8e\84\82Í
\83S
\83~
\8fW
\82ß
\82Å
\82Í
\82È
\82¢
\81D
\8e\84\82Í
\8eû
\8fW
\89Æ
\82¾",
158 "
\8e\84\82Í
\83S
\83\80\82Ì
\96Ø
\82É
\92µ
\82Ë
\95Ô
\82Á
\82½", /* Monkey Island */
159 "
\97ª
\92D
\93\87\97°
\89©
\8aC
\8aÝ
\83N
\83\89\83u", /* Monkey Island */
162 "If you can read this, I can hit you with my polearm",
164 "I scored with the princess",
165 "I want to live forever or die in the attempt.",
167 "LOST IN THOUGHT - please send search party",
169 "Minetown Better Business Bureau",
171 "Ms. Palm's House of Negotiable Affection -- A Very Reputable House Of Disrepute",
172 "Protection Racketeer",
173 "Real men love Crom",
174 "Somebody stole my Mojo!",
175 "The Hellhound Gang",
178 "
\82±
\82ê
\82ª
\93Ç
\82ß
\82é
\82È
\82ç
\81A
\8e\84\82Ì
\92·
\95\80\82ª
\93Í
\82
\82Æ
\82¢
\82¤
\82±
\82Æ
\82¾",
179 "
\8e\84\82Í
\8d¬
\97\90\82µ
\82Ä
\82¢
\82Ü
\82·
\81I",
180 "I scored with the princess",
181 "
\8e\84\82Í
\89i
\89\93\82É
\90¶
\82«
\82é
\82©
\81A
\82»
\82Ì
\82½
\82ß
\82É
\8e\80\82É
\82½
\82¢
\81D",
183 "
\8dl
\82¦
\8d\9e\82ñ
\82Å
\82¢
\82Ü
\82· -
\91{
\8dõ
\91à
\82ð
\8fo
\82µ
\82Ä
\82
\82¾
\82³
\82¢",
184 "
\93÷
\82Í
\83\82\83\8b\83h
\81[
\83\8b",
185 "
\8dz
\8eR
\8aX
\8f¤
\8bÆ
\89ü
\91P
\8b¦
\89ï",
186 "
\8dz
\8eR
\8aX
\82Ì
\8c©
\92£
\82è",
187 "
\83p
\81[
\83\80\8f\97\8ej
\82Ì
\8cð
\8fÂ
\8bZ
\8fp
\82Ì
\89Æ --
\82Æ
\82Ä
\82à
\95]
\94»
\82Ì
\88«
\95]
\82Ì
\89Æ",
188 "
\8dz
\8eR
\83_
\83b
\83V
\83\85\92\86",
189 "
\96{
\95¨
\82Ì
\92j
\82Í
\83N
\83\8d\83\80\82ð
\88¤
\82·
\82é",
190 "
\92N
\82©
\82ª
\89´
\82Ì
\83A
\83\8c\82ð
\93\90\82ñ
\82¾
\81I",
191 "The Hellhound Gang",
195 "They Might Be Storm Giants",
196 "Weapons don't kill people, I kill people",
198 "You're killing me!",
199 "Anhur State University - Home of the Fighting Fire Ants!",
202 "Real men are valkyries",
203 "Young Men's Cavedigging Association",
204 "Occupy Fort Ludios",
205 "I couldn't afford this T-shirt so I stole it!",
207 "I'm not wearing any pants",
208 "Down with the living!",
212 "It is better to light a candle than to curse the darkness",
213 "It is easier to curse the darkness than to light a candle",
214 /* expanded "rock--paper--scissors" featured in TV show "Big Bang
215 Theory" although they didn't create it (and an actual T-shirt
216 with pentagonal diagram showing which choices defeat which) */
217 "rock--paper--scissors--lizard--Spock!",
218 /* "All men must die -- all men must serve" challange and response
219 from book series _A_Song_of_Ice_and_Fire_ by George R.R. Martin,
220 TV show "Game of Thrones" (probably an actual T-shirt too...) */
221 "/Valar morghulis/ -- /Valar dohaeris/",
223 "
\83[
\83C
\81E
\83}
\83C
\83g
\81E
\83r
\81[
\81E
\83X
\83g
\81[
\83\80\81E
\83W
\83\83\83C
\83A
\83\93\83c",
224 "
\95\90\8aí
\82ª
\90l
\82ð
\8eE
\82·
\82Ì
\82Å
\82Í
\82È
\82¢
\81C
\8e\84\82ª
\90l
\82ð
\8eE
\82·
\82Ì
\82¾",
226 "
\82¢
\82¢
\89Á
\8c¸
\82É
\82µ
\82Ä
\81I",
227 "
\83A
\83\93\83t
\83\8b\8fB
\97§
\91å
\8aw -
\89Î
\8ba
\82Æ
\82Ì
\90í
\82¢
\82Ì
\96{
\8b\92\92n
\81I",
229 "
\93Á
\95Ê
\8f¸
\93V
\8eÒ",
230 "
\96{
\93\96\82Ì
\92j
\82Í
\83o
\83\8b\83L
\83\8a\81[
\82¾",
231 "
\90Â
\94N
\93´
\8cA
\8c@
\8dí
\98A
\96¿",
232 "
\83\8d\81[
\83f
\83B
\83I
\83X
\8dÔ
\82ð
\90è
\8b\92\82¹
\82æ",
233 "
\82±
\82Ì
\82s
\83V
\83\83\83c
\82ð
\94\83\82¤
\82¨
\8bà
\82ª
\82È
\82©
\82Á
\82½
\82Ì
\82Å
\82±
\82ê
\82Í
\93\90\82ñ
\82¾
\81I",
234 "
\83}
\83C
\83\93\83h
\83t
\83\8c\83\84\8e\81\82Ë",
235 "
\8e\84\82Í
\83p
\83\93\83c
\82ð
\90ú
\82¢
\82Ä
\82¢
\82Ü
\82¹
\82ñ",
236 "
\90¶
\8a\88\82ð
\82Ô
\82Á
\89ó
\82¹
\81I",
237 "
\83v
\83\8a\83\93\94_
\89Æ",
238 "
\83x
\83W
\83^
\83\8a\83A
\83\93",
239 "
\82â
\82 \81C
\8e\84\82ª
\81w
\90í
\91\88\81x
\82¾
\81I",
240 "
\88Ã
\82¢
\82Æ
\95s
\95½
\82ð
\8c¾
\82¤
\82æ
\82è
\82à
\81C
\82·
\82·
\82ñ
\82Å
\82 \82©
\82è
\82ð
\82Â
\82¯
\82Ü
\82µ
\82å
\82¤",
241 "
\82·
\82·
\82ñ
\82Å
\82 \82©
\82è
\82ð
\82Â
\82¯
\82é
\82æ
\82è
\81C
\88Ã
\82¢
\82Æ
\95s
\95½
\82ð
\8c¾
\82¤
\95û
\82ª
\8aÈ
\92P",
242 /* expanded "rock--paper--scissors" featured in TV show "Big Bang
243 Theory" although they didn't create it (and an actual T-shirt
244 with pentagonal diagram showing which choices defeat which) */
245 "rock--paper--scissors--lizard--Spock!",
246 /* "All men must die -- all men must serve" challange and response
247 from book series _A_Song_of_Ice_and_Fire_ by George R.R. Martin,
248 TV show "Game of Thrones" (probably an actual T-shirt too...) */
249 "/Valar morghulis/ -- /Valar dohaeris/",
253 Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]);
254 return erode_obj_text(tshirt, buf);
258 apron_text(apron, buf)
262 static const char *apron_msgs[] = {
264 "I'm making SCIENCE!",
265 "Don't mess with the chef",
266 "Don't make me poison you",
267 "Gehennom's Kitchen",
268 "Rat: The other white meat",
269 "If you can't stand the heat, get out of Gehennom!",
270 "If we weren't meant to eat animals, why are they made out of meat?",
271 "If you don't like the food, I'll stab you",
274 Strcpy(buf, apron_msgs[apron->o_id % SIZE(apron_msgs)]);
275 return erode_obj_text(apron, buf);
281 register struct obj *scroll;
282 boolean confused, nodisappear;
285 if (check_capacity((char *) 0))
287 scroll = getobj(readable, "read");
291 /* outrumor has its own blindness check */
292 if (scroll->otyp == FORTUNE_COOKIE) {
295 You("break up the cookie and throw away the pieces.");
297 You("
\83N
\83b
\83L
\81[
\82ð
\8a\84\82è
\81C
\82©
\82¯
\82ç
\82ð
\93\8a\82°
\82·
\82Ä
\82½
\81D");
298 outrumor(bcsign(scroll), BY_COOKIE);
300 u.uconduct.literate++;
303 } else if (scroll->otyp == T_SHIRT || scroll->otyp == ALCHEMY_SMOCK) {
304 char buf[BUFSZ], *mesg;
306 const char *endpunct;
311 You_cant("feel any Braille writing.");
313 You("
\93_
\8e\9a\82Í
\82Ç
\82¤
\82à
\8f\91\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
316 /* can't read shirt worn under suit (under cloak is ok though) */
317 if (scroll->otyp == T_SHIRT && uarm && scroll == uarmu) {
319 pline("%s shirt is obscured by %s%s.",
320 scroll->unpaid ? "That" : "Your", shk_your(buf, uarm),
321 suit_simple_name(uarm));
323 pline("
\83V
\83\83\83c
\82Í%s
\82Å
\89B
\82³
\82ê
\82Ä
\82¢
\82é
\81D",
324 suit_simple_name(uarm));
328 u.uconduct.literate++;
329 /* populate 'buf[]' */
330 mesg = (scroll->otyp == T_SHIRT) ? tshirt_text(scroll, buf)
331 : apron_text(scroll, buf);
337 int ln = (int) strlen(mesg);
339 /* we will be displaying a sentence; need ending punctuation */
340 if (ln > 0 && !index(".!?", mesg[ln - 1]))
346 pline("
\82»
\82ê
\82ð
\93Ç
\82ñ
\82¾
\81F");
349 pline("\"%s\"%s", mesg, endpunct);
351 pline("
\81u%s
\81v", mesg);
354 } else if (scroll->otyp == CREDIT_CARD) {
355 static const char *card_msgs[] = {
357 "Leprechaun Gold Tru$t - Shamrock Card",
358 "Magic Memory Vault Charge Card",
359 "Larn National Bank", /* Larn */
360 "First Bank of Omega", /* Omega */
361 "Bank of Zork - Frobozz Magic Card", /* Zork */
362 "Ankh-Morpork Merchant's Guild Barter Card",
363 "Ankh-Morpork Thieves' Guild Unlimited Transaction Card",
364 "Ransmannsby Moneylenders Association",
365 "Bank of Gehennom - 99% Interest Card",
366 "Yendorian Express - Copper Card",
367 "Yendorian Express - Silver Card",
368 "Yendorian Express - Gold Card",
369 "Yendorian Express - Mithril Card",
370 "Yendorian Express - Platinum Card", /* must be last */
372 "
\83\8c\83v
\83\89\83R
\81[
\83\93\90M
\97p
\8bà
\8cÉ -
\83N
\83\8d\81[
\83o
\81[
\83J
\81[
\83h",
373 "
\96\82\96@
\8bL
\94O
\91q
\8cÉ
\83N
\83\8c\83W
\83b
\83g
\83J
\81[
\83h", "
\83\89\81[
\83\93\8d\91\89c
\8bâ
\8ds", /* Larn */
374 "
\83I
\83\81\83K
\91æ
\88ê
\8bâ
\8ds", /* Omega */
375 "
\83]
\81[
\83N
\8bâ
\8ds - Bank of Zork -
\83t
\83\8d\83{
\83Y
\96\82\96@
\83J
\81[
\83h", /* Zork */
376 "
\83A
\83\93\83N
\83\82\83\8b\83|
\81[
\83N
\8f¤
\90l
\83M
\83\8b\83h
\8cð
\88Õ
\83J
\81[
\83h",
377 "
\83A
\83\93\83N
\83\82\83\8b\83|
\81[
\83N
\93\90\91¯
\83M
\83\8b\83h
\96³
\90§
\8cÀ
\8eæ
\88ø
\83J
\81[
\83h",
378 "
\83\89\83\93\83X
\83}
\83\93\83X
\83x
\83C
\91Ý
\8bà
\8bÆ
\8b¦
\89ï",
379 "
\83Q
\83w
\83i
\8bâ
\8ds -
\97\98\8eq99%
\83J
\81[
\83h",
380 "
\83C
\83F
\83\93\83_
\81[
\88ó
\83G
\83L
\83X
\83v
\83\8c\83X
\83J
\81[
\83h -
\83J
\83b
\83p
\81[
\83J
\81[
\83h",
381 "
\83C
\83F
\83\93\83_
\81[
\88ó
\83G
\83L
\83X
\83v
\83\8c\83X
\83J
\81[
\83h -
\83V
\83\8b\83o
\81[
\83J
\81[
\83h",
382 "
\83C
\83F
\83\93\83_
\81[
\88ó
\83G
\83L
\83X
\83v
\83\8c\83X
\83J
\81[
\83h -
\83S
\81[
\83\8b\83h
\83J
\81[
\83h",
383 "
\83C
\83F
\83\93\83_
\81[
\88ó
\83G
\83L
\83X
\83v
\83\8c\83X
\83J
\81[
\83h -
\83~
\83X
\83\8a\83\8b\83J
\81[
\83h",
384 "
\83C
\83F
\83\93\83_
\81[
\88ó
\83G
\83L
\83X
\83v
\83\8c\83X
\83J
\81[
\83h -
\83v
\83\89\83`
\83i
\83J
\81[
\83h", /* must be last */
390 You("feel the embossed numbers:");
392 You("
\95\82\82«
\92¤
\82è
\82É
\82³
\82ê
\82Ä
\82¢
\82é
\94Ô
\8d\86\82ð
\8a´
\82¶
\82½:");
398 pline("
\82»
\82ê
\82ð
\93Ç
\82ñ
\82¾
\81F");
404 ? card_msgs[SIZE(card_msgs) - 1]
405 : card_msgs[scroll->o_id % (SIZE(card_msgs) - 1)]);
407 /* Make a credit card number */
408 pline("\"%d0%d %ld%d1 0%d%d0\"%s",
409 (((int) scroll->o_id % 89) + 10),
410 ((int) scroll->o_id % 4),
411 ((((long) scroll->o_id * 499L) % 899999L) + 100000L),
412 ((int) scroll->o_id % 10),
413 (!((int) scroll->o_id % 3)),
414 (((int) scroll->o_id * 7) % 10),
415 (flags.verbose || Blind) ? "." : "");
416 u.uconduct.literate++;
418 } else if (scroll->otyp == CAN_OF_GREASE) {
420 pline("This %s has no label.", singular(scroll, xname));
422 pline("
\82±
\82Ì%s
\82É
\82Í
\83\89\83x
\83\8b\82ª
\82È
\82¢
\81D", singular(scroll, xname));
424 } else if (scroll->otyp == MAGIC_MARKER) {
427 You_cant("feel any Braille writing.");
429 pline("
\93_
\8e\9a\82Í
\82Ç
\82¤
\82à
\8f\91\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
436 pline("
\82»
\82ê
\82ð
\93Ç
\82ñ
\82¾
\81F");
438 pline("\"Magic Marker(TM) Red Ink Marker Pen. Water Soluble.\"");
440 pline("
\81u
\96\82\96@
\82Ì
\83}
\81[
\83J(TM)
\90Ô
\83C
\83\93\83N
\83}
\81[
\83J
\83y
\83\93\81D
\90\85\90«
\81D
\81v");
441 u.uconduct.literate++;
443 } else if (scroll->oclass == COIN_CLASS) {
446 You("feel the embossed words:");
448 You("
\95\82\82«
\92¤
\82è
\82É
\82³
\82ê
\82Ä
\82¢
\82é
\95¶
\8e\9a\82ð
\8a´
\82¶
\82½:");
449 else if (flags.verbose)
453 pline("
\82»
\82ê
\82ð
\93Ç
\82ñ
\82¾
\81F");
454 pline("\"1 Zorkmid. 857 GUE. In Frobs We Trust.\"");
455 u.uconduct.literate++;
457 } else if (scroll->oartifact == ART_ORB_OF_FATE) {
460 You("feel the engraved signature:");
462 You("
\92¤
\82è
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\83T
\83C
\83\93\82ð
\8a´
\82¶
\82½
\81F");
465 pline("It is signed:");
467 pline("
\83T
\83C
\83\93\82ª
\82 \82é
\81F");
471 pline("
\81u
\83I
\81[
\83f
\83B
\83\93\81v");
472 u.uconduct.literate++;
474 } else if (scroll->otyp == CANDY_BAR) {
475 static const char *wrapper_msgs[] = {
477 "Moon Crunchy", /* South Park */
478 "Snacky Cake", "Chocolate Nuggie", "The Small Bar",
479 "Crispy Yum Yum", "Nilla Crunchie", "Berry Bar",
480 "Choco Nummer", "Om-nom", /* Cat Macro */
481 "Fruity Oaty", /* Serenity */
482 "Wonka Bar" /* Charlie and the Chocolate Factory */
487 You_cant("feel any Braille writing.");
489 pline("
\93_
\8e\9a\82Í
\82Ç
\82¤
\82à
\8f\91\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82¾
\81D");
493 pline("The wrapper reads: \"%s\".",
494 wrapper_msgs[scroll->o_id % SIZE(wrapper_msgs)]);
496 pline("
\95ï
\82Ý
\8e\86\82Ì
\95¶
\8e\9a\82ð
\93Ç
\82ñ
\82¾
\81F
\81u%s
\81v.",
497 wrapper_msgs[scroll->o_id % SIZE(wrapper_msgs)]);
499 u.uconduct.literate++;
501 } else if (scroll->oclass != SCROLL_CLASS
502 && scroll->oclass != SPBOOK_CLASS) {
504 pline(silly_thing_to, "read");
506 pline(silly_thing_to, "
\93Ç
\82Þ");
508 } else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) {
509 const char *what = 0;
511 if (scroll->oclass == SPBOOK_CLASS)
513 what = "mystic runes";
515 what = "
\90_
\94é
\93I
\82È
\83\8b\81[
\83\93\95¶
\8e\9a";
516 else if (!scroll->dknown)
518 what = "formula on the scroll";
520 what = "
\8aª
\95¨
\82Ì
\8eô
\95¶";
523 pline("Being blind, you cannot read the %s.", what);
525 pline("
\96Ú
\82ª
\8c©
\82¦
\82È
\82¢
\82Ì
\82Å
\81C
\82 \82È
\82½
\82Í%s
\82ð
\93Ç
\82Þ
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D", what);
530 confused = (Confusion != 0);
532 if (scroll->otyp == SCR_MAIL) {
533 confused = FALSE; /* override */
534 /* reading mail is a convenience for the player and takes
535 place outside the game, so shouldn't affect gameplay;
536 on the other hand, it starts by explicitly making the
537 hero actively read something, which is pretty hard
538 to simply ignore; as a compromise, if the player has
539 maintained illiterate conduct so far, and this mail
540 scroll didn't come from bones, ask for confirmation */
541 if (!u.uconduct.literate) {
543 if (!scroll->spe && yn(
544 "Reading mail will violate \"illiterate\" conduct. Read anyway?"
547 if (!scroll->spe && yn(
548 "
\83\81\81[
\83\8b\82ð
\93Ç
\82Þ
\82Æ
\81u
\95¶
\8e\9a\82ð
\93Ç
\82Ü
\82È
\82¢
\81v
\92§
\90í
\82É
\88á
\94½
\82·
\82é
\82¯
\82Ç
\81C
\82»
\82ê
\82Å
\82à
\93Ç
\82Þ
\81H"
556 /* Actions required to win the game aren't counted towards conduct */
557 /* Novel conduct is handled in read_tribute so exclude it too*/
558 if (scroll->otyp != SPE_BOOK_OF_THE_DEAD
559 && scroll->otyp != SPE_BLANK_PAPER && scroll->otyp != SCR_BLANK_PAPER
560 && scroll->otyp != SPE_NOVEL)
561 u.uconduct.literate++;
563 if (scroll->oclass == SPBOOK_CLASS) {
564 return study_book(scroll);
566 scroll->in_use = TRUE; /* scroll, not spellbook, now being read */
567 if (scroll->otyp != SCR_BLANK_PAPER) {
568 boolean silently = !can_chant(&youmonst);
570 /* a few scroll feedback messages describe something happening
571 to the scroll itself, so avoid "it disappears" for those */
572 nodisappear = (scroll->otyp == SCR_FIRE
573 || (scroll->otyp == SCR_REMOVE_CURSE
578 ? "You %s the formula on the scroll."
579 : "As you %s the formula on it, the scroll disappears.",
580 silently ? "cogitate" : "pronounce");
583 ? "
\82 \82È
\82½
\82Í
\8eô
\95¶
\82ð%s
\82½
\81D"
584 : "
\8eô
\95¶
\82ð%s
\82é
\82Æ
\81C
\8aª
\95¨
\82Í
\8fÁ
\82¦
\82½
\81D",
585 silently ? "
\94O
\82¶" : "
\8f¥
\82¦");
589 pline(nodisappear ? "You read the scroll."
590 : "As you read the scroll, it disappears.");
592 pline(nodisappear ? "
\82 \82È
\82½
\82Í
\8aª
\95¨
\82ð
\93Ç
\82ñ
\82¾
\81D"
593 : "
\8aª
\95¨
\82ð
\93Ç
\82Þ
\82Æ
\81C
\82»
\82ê
\82Í
\8fÁ
\82¦
\82½
\81D");
598 pline("Being so trippy, you screw up...");
600 pline("
\82Æ
\82Ä
\82à
\82Ö
\82ë
\82Ö
\82ë
\82È
\82Ì
\82Å
\81C
\82
\82µ
\82á
\82
\82µ
\82á
\82É
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D
\81D
\81D");
603 pline("Being confused, you %s the magic words...",
604 silently ? "misunderstand" : "mispronounce");
606 pline("
\8d¬
\97\90\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å
\81C
\8eô
\95¶
\82ð
\8aÔ
\88á
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D
\81D
\81D");
610 if (!seffects(scroll)) {
611 if (!objects[scroll->otyp].oc_name_known) {
614 else if (!objects[scroll->otyp].oc_uname)
617 scroll->in_use = FALSE;
618 if (scroll->otyp != SCR_BLANK_PAPER)
626 register struct obj *obj;
628 if (obj->blessed || obj->spe <= 0) {
629 pline1(nothing_happens);
631 /* order matters: message, shop handling, actual transformation */
633 pline("%s briefly.", Yobjnam2(obj, "vibrate"));
635 Your("%s
\82Í
\8f¬
\8d\8f\82Ý
\82É
\90U
\93®
\82µ
\82½
\81D",xname(obj));
636 costly_alteration(obj, COST_UNCHRG);
638 if (obj->otyp == OIL_LAMP || obj->otyp == BRASS_LANTERN)
645 register struct obj *otmp;
648 pline("%s briefly.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"));
650 Your("%s
\82Í
\8f¬
\8d\8f\82Ý
\82É%s
\81D", xname(otmp), Blind ? "
\90U
\93®
\82µ
\82½" : "
\8bP
\82¢
\82½");
655 register struct obj *otmp;
656 register const char *color;
659 pline("%s%s%s for a moment.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"),
660 Blind ? "" : " ", Blind ? "" : hcolor(color));
662 Your("%s
\82Í
\88ê
\8fu%s%s
\81D", xname(otmp),
663 Blind ? "" : jconj_adj(hcolor(color)),
664 Blind ? "
\90U
\93®
\82µ
\82½" : "
\8bP
\82¢
\82½");
668 /* Is the object chargeable? For purposes of inventory display; it is
669 possible to be able to charge things for which this returns FALSE. */
674 if (obj->oclass == WAND_CLASS)
676 /* known && !oc_name_known is possible after amnesia/mind flayer */
677 if (obj->oclass == RING_CLASS)
678 return (boolean) (objects[obj->otyp].oc_charged
681 && objects[obj->otyp].oc_name_known)));
682 if (is_weptool(obj)) /* specific check before general tools */
684 if (obj->oclass == TOOL_CLASS)
685 return (boolean) objects[obj->otyp].oc_charged;
686 return FALSE; /* why are weapons/armor considered charged anyway? */
689 /* recharge an object; curse_bless is -1 if the recharging implement
690 was cursed, +1 if blessed, 0 otherwise. */
692 recharge(obj, curse_bless)
697 boolean is_cursed, is_blessed;
699 is_cursed = curse_bless < 0;
700 is_blessed = curse_bless > 0;
702 if (obj->oclass == WAND_CLASS) {
703 int lim = (obj->otyp == WAN_WISHING)
705 : (objects[obj->otyp].oc_dir != NODIR) ? 8 : 15;
707 /* undo any prior cancellation, even when is_cursed */
712 * Recharging might cause wands to explode.
713 * v = number of previous recharges
714 * v = percentage chance to explode on this attempt
715 * v = cumulative odds for exploding
725 n = (int) obj->recharged;
726 if (n > 0 && (obj->otyp == WAN_WISHING
727 || (n * n * n > rn2(7 * 7 * 7)))) { /* recharge_limit */
728 wand_explode(obj, rnd(lim));
731 /* didn't explode, so increment the recharge count */
732 obj->recharged = (unsigned) (n + 1);
734 /* now handle the actual recharging */
738 n = (lim == 3) ? 3 : rn1(5, lim + 1 - 5);
746 if (obj->otyp == WAN_WISHING && obj->spe > 3) {
747 wand_explode(obj, 1);
751 p_glow2(obj, NH_BLUE);
754 #if 0 /*[shop price doesn't vary by charge count]*/
755 /* update shop bill to reflect new higher price */
761 } else if (obj->oclass == RING_CLASS && objects[obj->otyp].oc_charged) {
762 /* charging does not affect ring's curse/bless status */
763 int s = is_blessed ? rnd(3) : is_cursed ? -rnd(2) : 1;
764 boolean is_on = (obj == uleft || obj == uright);
766 /* destruction depends on current state, not adjustment */
767 if (obj->spe > rn2(7) || obj->spe <= -5) {
769 pline("%s momentarily, then %s!", Yobjnam2(obj, "pulsate"),
770 otense(obj, "explode"));
772 Your("%s
\82Í
\88ê
\8fu
\96¬
\93®
\82µ
\81C
\94\9a\94
\82µ
\82½
\81I", xname(obj));
776 s = rnd(3 * abs(obj->spe)); /* amount of damage */
779 losehp(Maybe_Half_Phys(s), "exploding ring", KILLED_BY_AN);
781 losehp(Maybe_Half_Phys(s), "
\8ew
\97Ö
\82Ì
\94\9a\94
\82Å", KILLED_BY_AN);
783 long mask = is_on ? (obj == uleft ? LEFT_RING : RIGHT_RING) : 0L;
786 pline("%s spins %sclockwise for a moment.", Yname2(obj),
787 s < 0 ? "counter" : "");
789 Your("%s
\82Í
\88ê
\8fu%s
\8e\9e\8cv
\89ñ
\82è
\82É
\89ñ
\93]
\82µ
\82½
\81D", xname(obj),
790 s < 0 ? "
\94½" : "");
793 costly_alteration(obj, COST_DECHNT);
794 /* cause attributes and/or properties to be updated */
797 obj->spe += s; /* update the ring while it's off */
799 setworn(obj, mask), Ring_on(obj);
800 /* oartifact: if a touch-sensitive artifact ring is
801 ever created the above will need to be revised */
802 /* update shop bill to reflect new higher price */
803 if (s > 0 && obj->unpaid)
807 } else if (obj->oclass == TOOL_CLASS) {
808 int rechrg = (int) obj->recharged;
810 if (objects[obj->otyp].oc_charged) {
811 /* tools don't have a limit, but the counter used does */
812 if (rechrg < 7) /* recharge_limit */
816 case BELL_OF_OPENING:
828 case EXPENSIVE_CAMERA:
833 == MAGIC_MARKER) { /* previously recharged */
834 obj->recharged = 1; /* override increment done above */
837 Your("marker seems permanently dried out.");
839 Your("
\83}
\81[
\83J
\82Í
\8a®
\91S
\82É
\8a£
\82«
\82«
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
841 pline1(nothing_happens);
842 } else if (is_blessed) {
843 n = rn1(16, 15); /* 15..30 */
844 if (obj->spe + n <= 50)
846 else if (obj->spe + n <= 75)
849 int chrg = (int) obj->spe;
850 if ((chrg + n) > 127)
855 p_glow2(obj, NH_BLUE);
857 n = rn1(11, 10); /* 10..20 */
858 if (obj->spe + n <= 50)
861 int chrg = (int) obj->spe;
862 if ((chrg + n) > 127)
867 p_glow2(obj, NH_WHITE);
877 pline("%s out!", Tobjnam(obj, "go"));
879 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81I", xname(obj));
883 } else if (is_blessed) {
886 p_glow2(obj, NH_BLUE);
898 } else if (is_blessed) {
900 p_glow2(obj, NH_BLUE);
906 pline1(nothing_happens);
914 } else if (is_blessed) {
916 obj->spe += rn1(10, 6);
918 obj->spe += rn1(5, 6);
921 p_glow2(obj, NH_BLUE);
933 case DRUM_OF_EARTHQUAKE:
936 } else if (is_blessed) {
940 p_glow2(obj, NH_BLUE);
957 You("have a feeling of loss.");
959 You("
\82È
\82É
\82©
\91¹
\82µ
\82½
\8bC
\95ª
\82É
\82È
\82Á
\82½
\81D");
963 /* Forget known information about this object type. */
965 forget_single_object(obj_id)
968 objects[obj_id].oc_name_known = 0;
969 objects[obj_id].oc_pre_discovered = 0; /* a discovery when relearned */
970 if (objects[obj_id].oc_uname) {
971 free((genericptr_t) objects[obj_id].oc_uname);
972 objects[obj_id].oc_uname = 0;
974 undiscover_object(obj_id); /* after clearing oc_name_known */
976 /* clear & free object names from matching inventory items too? */
979 #if 0 /* here if anyone wants it.... */
980 /* Forget everything known about a particular object class. */
982 forget_objclass(oclass)
987 for (i = bases[oclass];
988 i < NUM_OBJECTS && objects[i].oc_class == oclass; i++)
989 forget_single_object(i);
993 /* randomize the given list of numbers 0 <= i < count */
995 randomize(indices, count)
1001 for (i = count - 1; i > 0; i--) {
1002 if ((iswap = rn2(i + 1)) == i)
1005 indices[i] = indices[iswap];
1006 indices[iswap] = temp;
1010 /* Forget % of known objects. */
1012 forget_objects(percent)
1016 int indices[NUM_OBJECTS];
1020 if (percent <= 0 || percent > 100) {
1021 impossible("forget_objects: bad percent %d", percent);
1025 indices[0] = 0; /* lint suppression */
1026 for (count = 0, i = 1; i < NUM_OBJECTS; i++)
1027 if (OBJ_DESCR(objects[i])
1028 && (objects[i].oc_name_known || objects[i].oc_uname))
1029 indices[count++] = i;
1032 randomize(indices, count);
1034 /* forget first % of randomized indices */
1035 count = ((count * percent) + rn2(100)) / 100;
1036 for (i = 0; i < count; i++)
1037 forget_single_object(indices[i]);
1041 /* Forget some or all of map (depends on parameters). */
1046 register int zx, zy;
1052 for (zx = 0; zx < COLNO; zx++)
1053 for (zy = 0; zy < ROWNO; zy++)
1054 if (howmuch & ALL_MAP || rn2(7)) {
1055 /* Zonk all memory of this location. */
1056 levl[zx][zy].seenv = 0;
1057 levl[zx][zy].waslit = 0;
1058 levl[zx][zy].glyph = cmap_to_glyph(S_stone);
1059 lastseentyp[zx][zy] = STONE;
1061 /* forget overview data for this level */
1062 forget_mapseen(ledger_no(&u.uz));
1065 /* Forget all traps on the level. */
1069 register struct trap *trap;
1071 /* forget all traps (except the one the hero is in :-) */
1072 for (trap = ftrap; trap; trap = trap->ntrap)
1073 if ((trap->tx != u.ux || trap->ty != u.uy) && (trap->ttyp != HOLE))
1078 * Forget given % of all levels that the hero has visited and not forgotten,
1082 forget_levels(percent)
1086 xchar maxl, this_lev;
1087 int indices[MAXLINFO];
1092 if (percent <= 0 || percent > 100) {
1093 impossible("forget_levels: bad percent %d", percent);
1097 this_lev = ledger_no(&u.uz);
1098 maxl = maxledgerno();
1100 /* count & save indices of non-forgotten visited levels */
1101 /* Sokoban levels are pre-mapped for the player, and should stay
1102 * so, or they become nearly impossible to solve. But try to
1103 * shift the forgetting elsewhere by fiddling with percent
1104 * instead of forgetting fewer levels.
1106 indices[0] = 0; /* lint suppression */
1107 for (count = 0, i = 0; i <= maxl; i++)
1108 if ((level_info[i].flags & VISITED)
1109 && !(level_info[i].flags & FORGOTTEN) && i != this_lev) {
1110 if (ledger_to_dnum(i) == sokoban_dnum)
1113 indices[count++] = i;
1120 randomize(indices, count);
1122 /* forget first % of randomized indices */
1123 count = ((count * percent) + 50) / 100;
1124 for (i = 0; i < count; i++) {
1125 level_info[indices[i]].flags |= FORGOTTEN;
1126 forget_mapseen(indices[i]);
1132 * Forget some things (e.g. after reading a scroll of amnesia). When called,
1133 * the following are always forgotten:
1134 * - felt ball & chain
1136 * - part (6 out of 7) of the map
1138 * Other things are subject to flags:
1139 * howmuch & ALL_MAP = forget whole map
1140 * howmuch & ALL_SPELLS = forget all spells
1147 u.bc_felt = 0; /* forget felt ball&chain */
1149 forget_map(howmuch);
1152 /* 1 in 3 chance of forgetting some levels */
1154 forget_levels(rn2(25));
1156 /* 1 in 3 chance of forgetting some objects */
1158 forget_objects(rn2(25));
1160 if (howmuch & ALL_SPELLS)
1163 * Make sure that what was seen is restored correctly. To do this,
1164 * we need to go blind for an instant --- turn off the display,
1165 * then restart it. All this work is needed to correctly handle
1166 * walls which are stone on one side and wall on the other. Turning
1167 * off the seen bits above will make the wall revert to stone, but
1168 * there are cases where we don't want this to happen. The easiest
1169 * thing to do is to run it through the vision system again, which
1170 * is always correct.
1172 docrt(); /* this correctly will reset vision */
1175 /* monster is hit by scroll of taming's effect */
1177 maybe_tame(mtmp, sobj)
1181 int was_tame = mtmp->mtame;
1182 unsigned was_peaceful = mtmp->mpeaceful;
1185 setmangry(mtmp, FALSE);
1186 if (was_peaceful && !mtmp->mpeaceful)
1190 make_happy_shk(mtmp, FALSE);
1191 else if (!resist(mtmp, sobj->oclass, 0, NOTELL))
1192 (void) tamedog(mtmp, (struct obj *) 0);
1193 if ((!was_peaceful && mtmp->mpeaceful) || (!was_tame && mtmp->mtame))
1200 get_valid_stinking_cloud_pos(x,y)
1203 return (!(!isok(x,y) || !cansee(x, y)
1204 || !ACCESSIBLE(levl[x][y].typ)
1205 || distu(x, y) >= 32));
1209 is_valid_stinking_cloud_pos(x, y, showmsg)
1213 if (!get_valid_stinking_cloud_pos(x,y)) {
1216 You("smell rotten eggs.");
1218 pline("
\82
\82³
\82Á
\82½
\97\91\82Ì
\82É
\82¨
\82¢
\82ª
\82µ
\82½
\81D");
1225 display_stinking_cloud_positions(state)
1229 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
1230 } else if (state == 1) {
1234 for (dx = -dist; dx <= dist; dx++)
1235 for (dy = -dist; dy <= dist; dy++) {
1238 if (get_valid_stinking_cloud_pos(x,y))
1242 tmp_at(DISP_END, 0);
1246 /* scroll effects; return 1 if we use up the scroll and possibly make it
1247 become discovered, 0 if caller should take care of those side-effects */
1250 struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
1252 int cval, otyp = sobj->otyp;
1253 boolean confused = (Confusion != 0), sblessed = sobj->blessed,
1254 scursed = sobj->cursed, already_known, old_erodeproof,
1258 if (objects[otyp].oc_magic)
1259 exercise(A_WIS, TRUE); /* just for trying */
1260 already_known = (sobj->oclass == SPBOOK_CLASS /* spell */
1261 || objects[otyp].oc_name_known);
1268 /* "stamped scroll" created via magic marker--without a stamp */
1270 pline("This scroll is marked \"postage due\".");
1272 pline("
\82±
\82Ì
\8aª
\95¨
\82É
\82Í
\81u
\97¿
\8bà
\95s
\91«
\81v
\82Æ
\8f\91\82¢
\82Ä
\82 \82é
\81D");
1274 /* scroll of mail obtained from bones file or from wishing;
1275 * note to the puzzled: the game Larn actually sends you junk
1280 "This seems to be junk mail addressed to the finder of the Eye of Larn.");
1282 "Eye of Larn
\82Ì
\94
\8c©
\8eÒ
\82É
\88¶
\82Ä
\82ç
\82ê
\82½
\83S
\83~
\83\81\83C
\83\8b\82Ì
\82æ
\82¤
\82¾
\81D");
1287 case SCR_ENCHANT_ARMOR: {
1289 boolean special_armor;
1292 otmp = some_armor(&youmonst);
1295 strange_feeling(sobj, !Blind
1296 ? "Your skin glows then fades."
1297 : "Your skin feels warm for a moment.");
1299 strange_feeling(sobj, !Blind
1300 ? "
\82 \82È
\82½
\82Ì
\91Ì
\82Í
\88ê
\8fu
\8bP
\82¢
\82½
\81D"
1301 : "
\82 \82È
\82½
\82Ì
\91Ì
\82Í
\88ê
\8fu
\92g
\82©
\82
\82È
\82Á
\82½
\81D");
1303 sobj = 0; /* useup() in strange_feeling() */
1304 exercise(A_CON, !scursed);
1305 exercise(A_STR, !scursed);
1309 old_erodeproof = (otmp->oerodeproof != 0);
1310 new_erodeproof = !scursed;
1311 otmp->oerodeproof = 0; /* for messages */
1313 otmp->rknown = FALSE;
1315 pline("%s warm for a moment.", Yobjnam2(otmp, "feel"));
1317 Your("%s
\82Í
\88ê
\8fu
\92g
\82©
\82
\82È
\82Á
\82½
\81D", xname(otmp));
1319 otmp->rknown = TRUE;
1321 pline("%s covered by a %s %s %s!", Yobjnam2(otmp, "are"),
1322 scursed ? "mottled" : "shimmering",
1323 hcolor(scursed ? NH_BLACK : NH_GOLDEN),
1325 : (is_shield(otmp) ? "layer" : "shield"));
1327 Your("%s
\82Í%s%s%s
\82Å
\95¢
\82í
\82ê
\82½
\81I", xname(otmp),
1328 jconj_adj(hcolor(scursed ? NH_BLACK : NH_GOLDEN)),
1329 scursed ? "
\8cõ
\82é
\82Ü
\82¾
\82ç
\82Ì" : "
\82ä
\82ç
\82ß
\82",
1330 scursed ? "
\8bP
\82«"
1331 : "
\83o
\83\8a\83A");
1334 if (new_erodeproof && (otmp->oeroded || otmp->oeroded2)) {
1335 otmp->oeroded = otmp->oeroded2 = 0;
1337 pline("%s as good as new!",
1338 Yobjnam2(otmp, Blind ? "feel" : "look"));
1340 Your("%s
\82Í
\90V
\95i
\93¯
\97l
\82É
\82È
\82Á
\82½
\81I",
1344 if (old_erodeproof && !new_erodeproof) {
1345 /* restore old_erodeproof before shop charges */
1346 otmp->oerodeproof = 1;
1347 costly_alteration(otmp, COST_DEGRD);
1349 otmp->oerodeproof = new_erodeproof ? 1 : 0;
1352 /* elven armor vibrates warningly when enchanted beyond a limit */
1353 special_armor = is_elven_armor(otmp)
1354 || (Role_if(PM_WIZARD) && otmp->otyp == CORNUTHAUM);
1356 same_color = (otmp->otyp == BLACK_DRAGON_SCALE_MAIL
1357 || otmp->otyp == BLACK_DRAGON_SCALES);
1359 same_color = (otmp->otyp == SILVER_DRAGON_SCALE_MAIL
1360 || otmp->otyp == SILVER_DRAGON_SCALES
1361 || otmp->otyp == SHIELD_OF_REFLECTION);
1365 /* KMH -- catch underflow */
1366 s = scursed ? -otmp->spe : otmp->spe;
1367 if (s > (special_armor ? 5 : 3) && rn2(s)) {
1368 otmp->in_use = TRUE;
1370 pline("%s violently %s%s%s for a while, then %s.", Yname2(otmp),
1371 otense(otmp, Blind ? "vibrate" : "glow"),
1372 (!Blind && !same_color) ? " " : "",
1373 (Blind || same_color) ? "" : hcolor(scursed ? NH_BLACK
1375 otense(otmp, "evaporate"));
1377 Your("%s
\82Í
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ
\8c\83\82µ
\82%s%s
\81C
\8fö
\94
\82µ
\82½
\81D", xname(otmp),
1378 (Blind || same_color) ? "" : jconj_adj(hcolor(scursed ? NH_BLACK : NH_SILVER)),
1379 Blind ? "
\90U
\93®
\82µ" : "
\8bP
\82«");
1381 remove_worn_item(otmp, FALSE);
1387 ? (rn2(otmp->spe) == 0)
1389 ? rnd(3 - otmp->spe / 3)
1391 if (s >= 0 && Is_dragon_scales(otmp)) {
1392 /* dragon scales get turned into dragon scale mail */
1394 pline("%s merges and hardens!", Yname2(otmp));
1396 Your("%s
\82Í
\97Z
\8d\87\82µ
\8cÅ
\82
\82È
\82Á
\82½
\81I", xname(otmp));
1397 setworn((struct obj *) 0, W_ARM);
1398 /* assumes same order */
1399 otmp->otyp += GRAY_DRAGON_SCALE_MAIL - GRAY_DRAGON_SCALES;
1404 } else if (otmp->cursed)
1407 setworn(otmp, W_ARM);
1409 alter_cost(otmp, 0L); /* shop bill */
1413 pline("%s %s%s%s%s for a %s.", Yname2(otmp),
1414 s == 0 ? "violently " : "",
1415 otense(otmp, Blind ? "vibrate" : "glow"),
1416 (!Blind && !same_color) ? " " : "",
1417 (Blind || same_color)
1418 ? "" : hcolor(scursed ? NH_BLACK : NH_SILVER),
1419 (s * s > 1) ? "while" : "moment");
1421 Your("%s
\82Í%s%s%s%s
\81D", xname(otmp),
1422 (s * s > 1) ? "
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ" : "
\88ê
\8fu",
1423 s == 0 ? "
\8c\83\82µ
\82" : "",
1424 (Blind || same_color) ? ""
1425 : jconj_adj(hcolor(sobj->cursed ? NH_BLACK : NH_SILVER)),
1426 Blind ? "
\90U
\93®
\82µ
\82½" : "
\8bP
\82¢
\82½");
1428 /* [this cost handling will need updating if shop pricing is
1429 ever changed to care about curse/bless status of armor] */
1431 costly_alteration(otmp, COST_DECHNT);
1432 if (scursed && !otmp->cursed)
1434 else if (sblessed && !otmp->blessed)
1436 else if (!scursed && otmp->cursed)
1441 known = otmp->known;
1442 /* update shop bill to reflect new higher price */
1443 if (s > 0 && otmp->unpaid)
1444 alter_cost(otmp, 0L);
1447 if ((otmp->spe > (special_armor ? 5 : 3))
1448 && (special_armor || !rn2(7)))
1450 pline("%s %s.", Yobjnam2(otmp, "suddenly vibrate"),
1451 Blind ? "again" : "unexpectedly");
1453 Your("%s
\82Í
\93Ë
\91R%s
\90U
\93®
\82µ
\82½
\81D", xname(otmp),
1454 Blind ? "
\82Ü
\82½" : "
\8ev
\82¢
\82à
\82æ
\82ç
\82¸");
1458 case SCR_DESTROY_ARMOR: {
1459 otmp = some_armor(&youmonst);
1463 strange_feeling(sobj, "Your bones itch.");
1465 strange_feeling(sobj, "
\8d\9c\82ª
\83\80\83Y
\83\80\83Y
\82·
\82é
\81D");
1466 sobj = 0; /* useup() in strange_feeling() */
1467 exercise(A_STR, FALSE);
1468 exercise(A_CON, FALSE);
1471 old_erodeproof = (otmp->oerodeproof != 0);
1472 new_erodeproof = scursed;
1473 otmp->oerodeproof = 0; /* for messages */
1474 p_glow2(otmp, NH_PURPLE);
1475 if (old_erodeproof && !new_erodeproof) {
1476 /* restore old_erodeproof before shop charges */
1477 otmp->oerodeproof = 1;
1478 costly_alteration(otmp, COST_DEGRD);
1480 otmp->oerodeproof = new_erodeproof ? 1 : 0;
1483 if (!scursed || !otmp || !otmp->cursed) {
1484 if (!destroy_arm(otmp)) {
1486 strange_feeling(sobj, "Your skin itches.");
1488 strange_feeling(sobj,"
\94ç
\95\86\82ª
\83\80\83Y
\83\80\83Y
\82·
\82é
\81D");
1489 sobj = 0; /* useup() in strange_feeling() */
1490 exercise(A_STR, FALSE);
1491 exercise(A_CON, FALSE);
1495 } else { /* armor and scroll both cursed */
1497 pline("%s.", Yobjnam2(otmp, "vibrate"));
1499 Your("%s
\82Í
\90U
\93®
\82µ
\82½
\81D", xname(otmp));
1500 if (otmp->spe >= -6) {
1504 make_stunned((HStun & TIMEOUT) + (long) rn1(10, 10), TRUE);
1507 case SCR_CONFUSE_MONSTER:
1508 case SPE_CONFUSE_MONSTER:
1509 if (youmonst.data->mlet != S_HUMAN || scursed) {
1512 You_feel("confused.");
1514 You_feel("
\8d¬
\97\90\82µ
\82½
\81D");
1515 make_confused(HConfusion + rnd(100), FALSE);
1516 } else if (confused) {
1519 Your("%s begin to %s%s.", makeplural(body_part(HAND)),
1520 Blind ? "tingle" : "glow ",
1521 Blind ? "" : hcolor(NH_PURPLE));
1523 Your("%s
\82Í%s%s
\82Í
\82¶
\82ß
\82½
\81D", makeplural(body_part(HAND)),
1524 Blind ? "" : jconj_adj(hcolor(NH_PURPLE)),
1525 Blind ? "
\83q
\83\8a\83q
\83\8a\82µ" : "
\8bP
\82«");
1527 make_confused(HConfusion + rnd(100), FALSE);
1530 pline("A %s%s surrounds your %s.",
1531 Blind ? "" : hcolor(NH_RED),
1532 Blind ? "faint buzz" : " glow", body_part(HEAD));
1534 pline("%s%s
\82ª
\82 \82È
\82½
\82Ì%s
\82ð
\8eæ
\82è
\8aª
\82¢
\82½
\81D",
1535 Blind ? "" : jconj_adj(hcolor(NH_RED)),
1536 Blind ? "
\82©
\82·
\82©
\82É
\83u
\81[
\83\93\82Æ
\96Â
\82é
\82à
\82Ì" : "
\8bP
\82
\82à
\82Ì",
1539 make_confused(0L, TRUE);
1544 Your("%s%s %s%s.", makeplural(body_part(HAND)),
1545 Blind ? "" : " begin to glow",
1546 Blind ? (const char *) "tingle" : hcolor(NH_RED),
1547 u.umconf ? " even more" : "");
1549 Your("%s
\82Í%s%s%s
\81D", makeplural(body_part(HAND)),
1550 u.umconf ? "
\8f
\82µ" : "",
1551 Blind ? (const char *) "
\83q
\83\8a\83q
\83\8a\82µ
\82½" : jconj_adj(hcolor(NH_RED)),
1552 Blind ? "" : "
\8bP
\82«
\82Í
\82¶
\82ß
\82½");
1558 Your("%s tingle %s sharply.", makeplural(body_part(HAND)),
1559 u.umconf ? "even more" : "very");
1561 Your("%s
\82Í%s
\83s
\83\8a\83s
\83\8a\82·
\82é
\81D", makeplural(body_part(HAND)),
1562 u.umconf ? "
\8f
\82µ" : "
\82Æ
\82Ä
\82à");
1566 Your("%s glow a%s brilliant %s.",
1567 makeplural(body_part(HAND)),
1568 u.umconf ? "n even more" : "", hcolor(NH_RED));
1570 Your("%s
\82Í%s%s
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D",
1571 makeplural(body_part(HAND)),
1572 u.umconf ? "
\8f
\82µ" : "", jconj_adj(hcolor(NH_RED)));
1574 /* after a while, repeated uses become less effective */
1578 u.umconf += rn1(8, 2);
1582 case SCR_SCARE_MONSTER:
1583 case SPE_CAUSE_FEAR: {
1584 register int ct = 0;
1585 register struct monst *mtmp;
1587 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1588 if (DEADMONSTER(mtmp))
1590 if (cansee(mtmp->mx, mtmp->my)) {
1591 if (confused || scursed) {
1592 mtmp->mflee = mtmp->mfrozen = mtmp->msleeping = 0;
1594 } else if (!resist(mtmp, sobj->oclass, 0, NOTELL))
1595 monflee(mtmp, 0, FALSE, FALSE);
1597 ct++; /* pets don't laugh at you */
1600 if (otyp == SCR_SCARE_MONSTER || !ct)
1602 You_hear("%s %s.", (confused || scursed) ? "sad wailing"
1603 : "maniacal laughter",
1604 !ct ? "in the distance" : "close by");
1606 You_hear("
\89\93\82
\82Å%s
\82ð
\95·
\82¢
\82½
\81D",
1607 (confused || sobj->cursed) ? "
\94ß
\82µ
\82
\8b\83\82«
\8b©
\82Ô
\90º"
1608 : "
\8b¶
\82Á
\82½
\82æ
\82¤
\82É
\8fÎ
\82¤
\90º");
1612 case SCR_BLANK_PAPER:
1615 You("don't remember there being any magic words on this scroll.");
1617 You("
\8aª
\95¨
\82É
\8eô
\95¶
\82ª
\8f\91\82¢
\82Ä
\82È
\82©
\82Á
\82½
\82±
\82Æ
\82ð
\8ev
\82¢
\82¾
\82µ
\82½
\81D");
1620 pline("This scroll seems to be blank.");
1622 pline("
\82±
\82Ì
\8aª
\95¨
\82É
\82Í
\89½
\82à
\8f\91\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D");
1625 case SCR_REMOVE_CURSE:
1626 case SPE_REMOVE_CURSE: {
1627 register struct obj *obj;
1630 You_feel(!Hallucination
1631 ? (!confused ? "like someone is helping you."
1632 : "like you need some help.")
1633 : (!confused ? "in touch with the Universal Oneness."
1634 : "the power of the Force against you!"));
1637 ? (!confused ? "
\92N
\82©
\82ª
\82 \82È
\82½
\82ð
\8f\95\82¯
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D"
1638 : "
\8e©
\95ª
\82ª
\8f\95\82¯
\82ð
\95K
\97v
\82Æ
\82µ
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D")
1639 : (!confused ? "
\89F
\92\88\92²
\98a
\82Ì
\8c´
\97\9d\82É
\90G
\82ê
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D"
1640 : "
\83t
\83H
\81[
\83X
\82Ì
\97Í
\82ª
\82 \82È
\82½
\82É
\82Í
\82Þ
\82©
\82Á
\82Ä
\82¢
\82é
\82æ
\82¤
\82É
\8a´
\82¶
\82½
\81I"));
1645 pline_The("scroll disintegrates.");
1647 pline("
\8aª
\95¨
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81D");
1649 for (obj = invent; obj; obj = obj->nobj) {
1652 /* gold isn't subject to cursing and blessing */
1653 if (obj->oclass == COIN_CLASS)
1655 /* hide current scroll from itself so that perm_invent won't
1656 show known blessed scroll losing bknown when confused */
1657 if (obj == sobj && obj->quan == 1L)
1659 wornmask = (obj->owornmask & ~(W_BALL | W_ART | W_ARTI));
1660 if (wornmask && !sblessed) {
1661 /* handle a couple of special cases; we don't
1662 allow auxiliary weapon slots to be used to
1663 artificially increase number of worn items */
1664 if (obj == uswapwep) {
1667 } else if (obj == uquiver) {
1668 if (obj->oclass == WEAPON_CLASS) {
1669 /* mergeable weapon test covers ammo,
1670 missiles, spears, daggers & knives */
1671 if (!objects[obj->otyp].oc_merge)
1673 } else if (obj->oclass == GEM_CLASS) {
1674 /* possibly ought to check whether
1675 alternate weapon is a sling... */
1679 /* weptools don't merge and aren't
1680 reasonable quivered weapons */
1685 if (sblessed || wornmask || obj->otyp == LOADSTONE
1686 || (obj->otyp == LEASH && obj->leashmon)) {
1687 /* water price varies by curse/bless status */
1688 boolean shop_h2o = (obj->unpaid && obj->otyp == POT_WATER);
1691 blessorcurse(obj, 2);
1692 /* lose knowledge of this object's curse/bless
1693 state (even if it didn't actually change) */
1695 /* blessorcurse() only affects uncursed items
1696 so no need to worry about price of water
1697 going down (hence no costly_alteration) */
1698 if (shop_h2o && (obj->cursed || obj->blessed))
1699 alter_cost(obj, 0L); /* price goes up */
1700 } else if (obj->cursed) {
1702 costly_alteration(obj, COST_UNCURS);
1708 if (Punished && !confused)
1710 if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1711 buried_ball_to_freedom();
1713 pline_The("clasp on your %s vanishes.", body_part(LEG));
1715 pline_The("%s
\82Ì
\8bà
\8bï
\82ª
\8fÁ
\82¦
\82½
\81D", body_part(LEG));
1720 case SCR_CREATE_MONSTER:
1721 case SPE_CREATE_MONSTER:
1722 if (create_critters(1 + ((confused || scursed) ? 12 : 0)
1723 + ((sblessed || rn2(73)) ? 0 : rnd(4)),
1724 confused ? &mons[PM_ACID_BLOB]
1725 : (struct permonst *) 0,
1728 /* no need to flush monsters; we ask for identification only if the
1729 * monsters are not visible
1732 case SCR_ENCHANT_WEAPON:
1733 /* [What about twoweapon mode? Proofing/repairing/enchanting both
1734 would be too powerful, but shouldn't we choose randomly between
1735 primary and secondary instead of always acting on primary?] */
1736 if (confused && uwep
1737 && erosion_matters(uwep) && uwep->oclass != ARMOR_CLASS) {
1738 old_erodeproof = (uwep->oerodeproof != 0);
1739 new_erodeproof = !scursed;
1740 uwep->oerodeproof = 0; /* for messages */
1742 uwep->rknown = FALSE;
1744 Your("weapon feels warm for a moment.");
1746 pline("
\95\90\8aí
\82ª
\88ê
\8fu
\92g
\82©
\82
\82È
\82Á
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
1748 uwep->rknown = TRUE;
1750 pline("%s covered by a %s %s %s!", Yobjnam2(uwep, "are"),
1751 scursed ? "mottled" : "shimmering",
1752 hcolor(scursed ? NH_PURPLE : NH_GOLDEN),
1753 scursed ? "glow" : "shield");
1755 Your("%s
\82Í%s%s%s
\82Å
\95¢
\82í
\82ê
\82½
\81I", xname(uwep),
1756 jconj_adj(hcolor(scursed ? NH_PURPLE : NH_GOLDEN)),
1757 scursed ? "
\8cõ
\82é
\82Ü
\82¾
\82ç
\82Ì" : "
\82ä
\82ç
\82ß
\82",
1758 scursed ? "
\8bP
\82«" : "
\83o
\83\8a\83A");
1761 if (new_erodeproof && (uwep->oeroded || uwep->oeroded2)) {
1762 uwep->oeroded = uwep->oeroded2 = 0;
1764 pline("%s as good as new!",
1765 Yobjnam2(uwep, Blind ? "feel" : "look"));
1767 pline("%s
\82Í
\90V
\95i
\93¯
\97l
\82É
\82È
\82Á
\82½
\81I", xname(uwep));
1770 if (old_erodeproof && !new_erodeproof) {
1771 /* restore old_erodeproof before shop charges */
1772 uwep->oerodeproof = 1;
1773 costly_alteration(uwep, COST_DEGRD);
1775 uwep->oerodeproof = new_erodeproof ? 1 : 0;
1778 if (!chwepon(sobj, scursed ? -1
1780 : (uwep->spe >= 9) ? !rn2(uwep->spe)
1781 : sblessed ? rnd(3 - uwep->spe / 3)
1783 sobj = 0; /* nothing enchanted: strange_feeling -> useup */
1786 case SPE_CHARM_MONSTER: {
1787 int candidates, res, results, vis_results;
1791 results = vis_results = maybe_tame(u.ustuck, sobj);
1793 int i, j, bd = confused ? 5 : 1;
1796 /* note: maybe_tame() can return either positive or
1797 negative values, but not both for the same scroll */
1798 candidates = results = vis_results = 0;
1799 for (i = -bd; i <= bd; i++)
1800 for (j = -bd; j <= bd; j++) {
1801 if (!isok(u.ux + i, u.uy + j))
1803 if ((mtmp = m_at(u.ux + i, u.uy + j)) != 0
1804 || (!i && !j && (mtmp = u.usteed) != 0)) {
1806 res = maybe_tame(mtmp, sobj);
1808 if (canspotmon(mtmp))
1815 pline("Nothing interesting %s.",
1816 !candidates ? "happens" : "seems to happen");
1818 pline("
\89½
\82à
\96Ê
\94\92\82¢
\82±
\82Æ
\82Í
\82¨
\82±
\82ç
\82È
\82©
\82Á
\82½%s
\81D",
1819 !candidates ? "" : "
\82æ
\82¤
\82¾");
1823 pline_The("neighborhood %s %sfriendlier.",
1824 vis_results ? "is" : "seems",
1825 (results < 0) ? "un" : "");
1827 pline_The("
\82¨
\97×
\82Æ
\82Ì
\92\87\82ª%s
\82
\82È
\82Á
\82½%s
\81D",
1828 (results < 0) ? "
\88«" : "
\97Ç",
1829 vis_results ? "" : "
\82æ
\82¤
\82¾");
1831 if (vis_results > 0)
1839 You("have found a scroll of genocide!");
1841 pline("
\82±
\82ê
\82Í
\8bs
\8eE
\82Ì
\8aª
\95¨
\82¾
\81I");
1844 do_class_genocide();
1846 do_genocide((!scursed) | (2 * !!Confusion));
1849 if (!confused || rn2(5)) {
1852 litroom(!confused && !scursed, sobj);
1853 if (!confused && !scursed) {
1854 if (lightdamage(sobj, TRUE, 5))
1858 /* could be scroll of create monster, don't set known ...*/
1859 (void) create_critters(1, !scursed ? &mons[PM_YELLOW_LIGHT]
1860 : &mons[PM_BLACK_LIGHT],
1864 case SCR_TELEPORTATION:
1865 if (confused || scursed) {
1868 known = scrolltele(sobj);
1871 case SCR_GOLD_DETECTION:
1872 if ((confused || scursed) ? trap_detect(sobj) : gold_detect(sobj))
1873 sobj = 0; /* failure: strange_feeling() -> useup() */
1875 case SCR_FOOD_DETECTION:
1876 case SPE_DETECT_FOOD:
1877 if (food_detect(sobj))
1878 sobj = 0; /* nothing detected: strange_feeling -> useup */
1881 /* known = TRUE; -- handled inline here */
1882 /* use up the scroll first, before makeknown() performs a
1883 perm_invent update; also simplifies empty invent check */
1885 sobj = 0; /* it's gone */
1888 You("identify this as an identify scroll.");
1890 You("
\82±
\82ê
\82Í
\8e¯
\95Ê
\82Ì
\8aª
\95¨
\82¾
\82Æ
\8e¯
\95Ê
\82µ
\82½
\81D");
1891 else if (!already_known || !invent)
1892 /* force feedback now if invent became
1893 empty after using up this scroll */
1895 pline("This is an identify scroll.");
1897 pline("
\82±
\82ê
\82Í
\8e¯
\95Ê
\82Ì
\8aª
\95¨
\82¾
\81D");
1899 (void) learnscrolltyp(SCR_IDENTIFY);
1903 if (sblessed || (!scursed && !rn2(5))) {
1905 /* note: if cval==0, identify all items */
1906 if (cval == 1 && sblessed && Luck > 0)
1909 if (invent && !confused) {
1910 identify_pack(cval, !already_known);
1911 } else if (otyp == SPE_IDENTIFY) {
1912 /* when casting a spell we know we're not confused,
1913 so inventory must be empty (another message has
1914 already been given above if reading a scroll) */
1916 pline("You're not carrying anything to be identified.");
1918 pline("
\82 \82È
\82½
\82Í
\8e¯
\95Ê
\82Å
\82«
\82é
\82à
\82Ì
\82ð
\82È
\82É
\82à
\8e\9d\82Á
\82Ä
\82¢
\82È
\82¢
\81D");
1925 You_feel("discharged.");
1927 You_feel("
\95ú
\8fo
\82³
\82ê
\82½
\8bC
\82ª
\82·
\82é
\81D");
1931 You_feel("charged up!");
1933 You_feel("
\8f[
\93U
\82³
\82ê
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82·
\82é
\81I");
1934 u.uen += d(sblessed ? 6 : 4, 4);
1935 if (u.uen > u.uenmax) /* if current energy is already at */
1936 u.uenmax = u.uen; /* or near maximum, increase maximum */
1938 u.uen = u.uenmax; /* otherwise restore current to max */
1943 /* known = TRUE; -- handled inline here */
1944 if (!already_known) {
1946 pline("This is a charging scroll.");
1948 pline("
\82±
\82ê
\82Í
\8f[
\93U
\82Ì
\8aª
\95¨
\82¾
\81I");
1951 /* use it up now to prevent it from showing in the
1952 getobj picklist because the "disappears" message
1953 was already delivered */
1955 sobj = 0; /* it's gone */
1956 otmp = getobj(all_count, "charge");
1958 recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
1960 case SCR_MAGIC_MAPPING:
1961 if (level.flags.nommap) {
1963 Your("mind is filled with crazy lines!");
1965 Your("
\90S
\82É
\82½
\82¾
\82È
\82ç
\82Ê
\90ü
\81I
\90ü
\81I
\90ü
\81I
\82ª
\95\82\82Ñ
\82 \82ª
\82Á
\82½
\81I");
1968 pline("Wow! Modern art.");
1970 pline("
\83\8f\83H
\81I
\83\82\83_
\83\93\83A
\81[
\83g
\82¾
\81I");
1973 Your("%s spins in bewilderment.", body_part(HEAD));
1975 You("
\93\96\98f
\82µ
\82Ä
\96Ú
\82ª
\82Ü
\82í
\82Á
\82½
\81D");
1976 make_confused(HConfusion + rnd(30), FALSE);
1982 for (x = 1; x < COLNO; x++)
1983 for (y = 0; y < ROWNO; y++)
1984 if (levl[x][y].typ == SDOOR)
1985 cvt_sdoor_to_door(&levl[x][y]);
1986 /* do_mapping() already reveals secret passages */
1990 case SPE_MAGIC_MAPPING:
1991 if (level.flags.nommap) {
1993 Your("%s spins as %s blocks the spell!", body_part(HEAD),
1996 You("
\89½
\82©
\82ª
\8eô
\95¶
\82ð
\82³
\82¦
\82¬
\82è
\81C
\96Ú
\82ª
\82Ü
\82í
\82Á
\82½
\81I");
1998 make_confused(HConfusion + rnd(30), FALSE);
2002 pline("A map coalesces in your mind!");
2004 pline("
\92n
\90}
\82ª
\82 \82È
\82½
\82Ì
\90S
\82É
\97Z
\8d\87\82µ
\82½
\81I");
2005 cval = (scursed && !confused);
2007 HConfusion = 1; /* to screw up map */
2010 HConfusion = 0; /* restore */
2012 pline("Unfortunately, you can't grasp the details.");
2014 pline("
\8ec
\94O
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Í
\8fÚ
\8d×
\82ð
\93¾
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82©
\82Á
\82½
\81D");
2019 forget((!sblessed ? ALL_SPELLS : 0)
2020 | (!confused || scursed ? ALL_MAP : 0));
2021 if (Hallucination) /* Ommmmmm! */
2023 Your("mind releases itself from mundane concerns.");
2025 Your("
\90S
\82Í
\95½
\96}
\82È
\97\98\8aQ
\8aÖ
\8cW
\82©
\82ç
\89ð
\95ú
\82³
\82ê
\82½
\81D");
2026 else if (!strncmpi(plname, "Maud", 4))
2029 "As your mind turns inward on itself, you forget everything else.");
2031 "
\82 \82È
\82½
\82Ì
\90S
\82Í
\93à
\91¤
\82É
\8cü
\82«
\81C
\91S
\82Ä
\82ð
\96Y
\82ê
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
2034 pline("Who was that Maud person anyway?");
2036 pline("Maud
\82Á
\82Ä
\96º
\82Í
\82¢
\82Á
\82½
\82¢
\92N
\82¾
\82¢
\81H");
2039 pline("Thinking of Maud you forget everything else.");
2041 pline("Maud
\82ð
\8dl
\82¦
\82é
\82±
\82Æ
\88È
\8aO
\81C
\82 \82È
\82½
\82Í
\91S
\82Ä
\82ð
\96Y
\82ê
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
2042 exercise(A_WIS, FALSE);
2050 cval = bcsign(sobj);
2051 dam = (2 * (rn1(3, 3) + 2 * cval) + 1) / 3;
2053 sobj = 0; /* it's gone */
2055 (void) learnscrolltyp(SCR_FIRE);
2057 if (Fire_resistance) {
2058 shieldeff(u.ux, u.uy);
2061 pline("Oh, look, what a pretty fire in your %s.",
2063 pline("
\82í
\82\9f\82²
\82ç
\82ñ
\81D
\8f¬
\82³
\82È
\89Î
\82ª%s
\82É
\82 \82é
\81D",
2064 makeplural(body_part(HAND)));
2067 You_feel("a pleasant warmth in your %s.",
2069 You_feel("%s
\82Ì
\92\86\82É
\89õ
\93K
\82È
\92g
\82©
\82³
\82ð
\8a´
\82¶
\82½
\81D",
2070 makeplural(body_part(HAND)));
2073 pline_The("scroll catches fire and you burn your %s.",
2075 pline("
\8aª
\95¨
\82É
\89Î
\82ª
\94R
\82¦
\82¤
\82Â
\82è
\81C
\82 \82È
\82½
\82Ì%s
\82ð
\8fÄ
\82¢
\82½
\81D",
2076 makeplural(body_part(HAND)));
2078 losehp(1, "scroll of fire", KILLED_BY_AN);
2080 losehp(1, "
\89\8a\82Ì
\8aª
\95¨
\82Å", KILLED_BY_AN);
2086 pline_The("%s around you vaporizes violently!", hliquid("water"));
2088 pline_The("
\82 \82È
\82½
\82Ì
\89ñ
\82è
\82Ì%s
\82Í
\82Í
\82°
\82µ
\82
\95¦
\93«
\82µ
\82½
\81I", hliquid("
\90\85"));
2093 pline("This is a scroll of fire!");
2095 pline("
\82±
\82ê
\82Í
\89Î
\82Ì
\8aª
\95¨
\82¾
\81I");
2098 pline("Where do you want to center the explosion?");
2100 pline("
\82Ç
\82±
\82ð
\94\9a\94
\82Ì
\92\86\90S
\82É
\82µ
\82Ü
\82·
\82©
\81H");
2101 getpos_sethilite(display_stinking_cloud_positions,
2102 get_valid_stinking_cloud_pos);
2104 (void) getpos(&cc, TRUE, "the desired position");
2106 (void) getpos(&cc, TRUE, "
\91_
\82¢
\82Ì
\8fê
\8f\8a");
2107 if (!is_valid_stinking_cloud_pos(cc.x, cc.y, FALSE)) {
2108 /* try to reach too far, get burned */
2113 if (cc.x == u.ux && cc.y == u.uy) {
2115 pline_The("scroll erupts in a tower of flame!");
2117 pline("
\8aª
\95¨
\82©
\82ç
\89Î
\92\8c\82ª
\97§
\82¿
\8f¸
\82Á
\82½
\81I");
2118 iflags.last_msg = PLNMSG_TOWER_OF_FLAME; /* for explode() */
2122 explode(cc.x, cc.y, 11, dam, SCROLL_CLASS, EXPL_FIERY);
2126 /* TODO: handle steeds */
2127 if (!Is_rogue_level(&u.uz) && has_ceiling(&u.uz)
2128 && (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) {
2132 /* Identify the scroll */
2135 You_hear("rumbling.");
2137 You_hear("
\83S
\83\8d\83S
\83\8d\82Æ
\82¢
\82¤
\89¹
\82ð
\95·
\82¢
\82½
\81D");
2140 pline_The("%s rumbles %s you!", ceiling(u.ux, u.uy),
2141 sblessed ? "around" : "above");
2143 pline("
\82 \82È
\82½
\82Ì%s
\82Ì%s
\82©
\82ç
\83S
\83\8d\83S
\83\8d\82Æ
\89¹
\82ª
\95·
\82±
\82¦
\82Ä
\82«
\82½
\81I",
2144 sblessed ? "
\82Ü
\82í
\82è" : "
\90^
\8fã", ceiling(u.ux,u.uy));
2149 /* Loop through the surrounding squares */
2151 for (x = u.ux - 1; x <= u.ux + 1; x++) {
2152 for (y = u.uy - 1; y <= u.uy + 1; y++) {
2153 /* Is this a suitable spot? */
2154 if (isok(x, y) && !closed_door(x, y)
2155 && !IS_ROCK(levl[x][y].typ)
2156 && !IS_AIR(levl[x][y].typ)
2157 && (x != u.ux || y != u.uy)) {
2159 drop_boulder_on_monster(x, y, confused, TRUE);
2163 /* Attack the player */
2165 drop_boulder_on_player(confused, !scursed, TRUE, FALSE);
2166 } else if (!nboulders)
2168 pline("But nothing else happens.");
2170 pline("
\82µ
\82©
\82µ
\91¼
\82É
\89½
\82à
\82¨
\82±
\82ç
\82È
\82©
\82Á
\82½
\81D");
2173 case SCR_PUNISHMENT:
2175 if (confused || sblessed) {
2177 You_feel("guilty.");
2179 You("
\8dß
\82ð
\8a´
\82¶
\82½
\81D");
2184 case SCR_STINKING_CLOUD: {
2189 You("have found a scroll of stinking cloud!");
2191 You("
\88«
\8fL
\89_
\82Ì
\8aª
\95¨
\82ð
\94
\8c©
\82µ
\82½
\81I");
2194 pline("Where do you want to center the %scloud?",
2195 already_known ? "stinking " : "");
2197 pline("
\89_
\82Ì
\92\86\90S
\82ð
\82Ç
\82±
\82É
\82µ
\82Ü
\82·
\82©
\81H");
2201 getpos_sethilite(display_stinking_cloud_positions,
2202 get_valid_stinking_cloud_pos);
2204 if (getpos(&cc, TRUE, "the desired position") < 0) {
2206 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0) {
2210 if (!is_valid_stinking_cloud_pos(cc.x, cc.y, TRUE))
2212 (void) create_gas_cloud(cc.x, cc.y, 3 + bcsign(sobj),
2213 8 + 4 * bcsign(sobj));
2217 impossible("What weird effect is this? (%u)", otyp);
2219 /* if sobj is gone, we've already called useup() above and the
2220 update_inventory() that it performs might have come too soon
2221 (before charging an item, for instance) */
2224 return sobj ? 0 : 1;
2228 drop_boulder_on_player(confused, helmet_protects, byu, skip_uswallow)
2229 boolean confused, helmet_protects, byu, skip_uswallow;
2234 /* hit monster if swallowed */
2235 if (u.uswallow && !skip_uswallow) {
2236 drop_boulder_on_monster(u.ux, u.uy, confused, byu);
2240 otmp2 = mksobj(confused ? ROCK : BOULDER, FALSE, FALSE);
2243 otmp2->quan = confused ? rn1(5, 2) : 1;
2244 otmp2->owt = weight(otmp2);
2245 if (!amorphous(youmonst.data) && !Passes_walls
2246 && !noncorporeal(youmonst.data) && !unsolid(youmonst.data)) {
2248 You("are hit by %s!", doname(otmp2));
2250 pline("%s
\82ª
\96½
\92\86\82µ
\82½
\81I", doname(otmp2));
2251 dmg = dmgval(otmp2, &youmonst) * otmp2->quan;
2252 if (uarmh && helmet_protects) {
2253 if (is_metallic(uarmh)) {
2255 pline("Fortunately, you are wearing a hard helmet.");
2257 pline("
\8dK
\89^
\82É
\82à
\81C
\82 \82È
\82½
\82Í
\8cÅ
\82¢
\8a\95\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D");
2260 } else if (flags.verbose) {
2262 pline("%s does not protect you.", Yname2(uarmh));
2264 Your("%s
\82Å
\82Í
\8eç
\82ê
\82È
\82¢
\81D", xname(uarmh));
2269 wake_nearto(u.ux, u.uy, 4 * 4);
2270 /* Must be before the losehp(), for bones files */
2272 if (!flooreffects(otmp2, u.ux, u.uy, "fall")) {
2274 if (!flooreffects(otmp2, u.ux, u.uy, "
\97\8e\82¿
\82é")) {
2275 place_object(otmp2, u.ux, u.uy);
2281 losehp(Maybe_Half_Phys(dmg), "scroll of earth", KILLED_BY_AN);
2283 losehp(Maybe_Half_Phys(dmg), "
\91å
\92n
\82Ì
\8aª
\95¨
\82Å", KILLED_BY_AN);
2287 drop_boulder_on_monster(x, y, confused, byu)
2289 boolean confused, byu;
2291 register struct obj *otmp2;
2292 register struct monst *mtmp;
2294 /* Make the object(s) */
2295 otmp2 = mksobj(confused ? ROCK : BOULDER, FALSE, FALSE);
2297 return FALSE; /* Shouldn't happen */
2298 otmp2->quan = confused ? rn1(5, 2) : 1;
2299 otmp2->owt = weight(otmp2);
2301 /* Find the monster here (won't be player) */
2303 if (mtmp && !amorphous(mtmp->data) && !passes_walls(mtmp->data)
2304 && !noncorporeal(mtmp->data) && !unsolid(mtmp->data)) {
2305 struct obj *helmet = which_armor(mtmp, W_ARMH);
2308 if (cansee(mtmp->mx, mtmp->my)) {
2310 pline("%s is hit by %s!", Monnam(mtmp), doname(otmp2));
2312 pline("%s
\82ª%s
\82É
\96½
\92\86\82µ
\82½
\81I", doname(otmp2), Monnam(mtmp));
2313 if (mtmp->minvis && !canspotmon(mtmp))
2314 map_invisible(mtmp->mx, mtmp->my);
2315 } else if (u.uswallow && mtmp == u.ustuck)
2317 You_hear("something hit %s %s over your %s!",
2318 s_suffix(mon_nam(mtmp)), mbodypart(mtmp, STOMACH),
2321 You_hear("
\89½
\82©
\82ª
\82 \82È
\82½
\82Ì%s
\82Ì
\8fã
\82Ì%s
\82Ì%s
\82É
\93\96\82½
\82Á
\82½
\89¹
\82ð
\95·
\82¢
\82½
\81I",
2323 mon_nam(mtmp), mbodypart(mtmp, STOMACH));
2326 mdmg = dmgval(otmp2, mtmp) * otmp2->quan;
2328 if (is_metallic(helmet)) {
2329 if (canspotmon(mtmp))
2331 pline("Fortunately, %s is wearing a hard helmet.",
2333 pline("
\8dK
\89^
\82É
\82à
\81C%s
\82Í
\8cÅ
\82¢
\8a\95\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\81D",
2337 You_hear("a clanging sound.");
2339 You_hear("
\83K
\83\89\83\93\83K
\83\89\83\93\82Æ
\82¢
\82¤
\89¹
\82ð
\95·
\82¢
\82½
\81D");
2343 if (canspotmon(mtmp))
2345 pline("%s's %s does not protect %s.", Monnam(mtmp),
2346 xname(helmet), mhim(mtmp));
2348 pline("%s
\82Ì%s
\82Å
\82Í
\8eç
\82ê
\82È
\82¢
\81D", Monnam(mtmp),
2354 if (DEADMONSTER(mtmp)) {
2359 pline("%s is killed.", Monnam(mtmp));
2361 pline("%s
\82Í
\8e\80\82ñ
\82¾
\81D", Monnam(mtmp));
2367 wake_nearto(x, y, 4 * 4);
2368 } else if (u.uswallow && mtmp == u.ustuck) {
2369 obfree(otmp2, (struct obj *) 0);
2370 /* fall through to player */
2371 drop_boulder_on_player(confused, TRUE, FALSE, TRUE);
2374 /* Drop the rock/boulder to the floor */
2376 if (!flooreffects(otmp2, x, y, "fall")) {
2378 if (!flooreffects(otmp2, x, y, "
\97\8e\82¿
\82é")) {
2379 place_object(otmp2, x, y);
2381 newsym(x, y); /* map the rock */
2386 /* overcharging any wand or zapping/engraving cursed wand */
2388 wand_explode(obj, chg)
2390 int chg; /* recharging */
2393 const char *expl = !chg ? "suddenly" : "vibrates violently and";
2395 const char *expl = !chg ? "
\93Ë
\91R" : "
\8c\83\82µ
\82
\90U
\93®
\82µ
\81C";
2398 /* number of damage dice */
2400 chg = 2; /* zap/engrave adjustment */
2403 n = 2; /* arbitrary minimum */
2404 /* size of damage dice */
2405 switch (obj->otyp) {
2409 case WAN_CANCELLATION:
2412 case WAN_UNDEAD_TURNING:
2418 case WAN_MAGIC_MISSILE:
2428 /* inflict damage and destroy the wand */
2430 obj->in_use = TRUE; /* in case losehp() is fatal (or --More--^C) */
2432 pline("%s %s explodes!", Yname2(obj), expl);
2434 pline("%s
\82Í%s
\94\9a\94
\82µ
\82½
\81I", xname(obj), expl);
2437 losehp(Maybe_Half_Phys(dmg), "exploding wand", KILLED_BY_AN);
2439 losehp(Maybe_Half_Phys(dmg), "
\8fñ
\82Ì
\94\9a\94
\82Å", KILLED_BY_AN);
2441 /* obscure side-effect */
2442 exercise(A_STR, FALSE);
2445 /* used to collect gremlins being hit by light so that they can be processed
2446 after vision for the entire lit area has been brought up to date */
2451 STATIC_VAR struct litmon *gremlins = 0;
2454 * Low-level lit-field update routine.
2462 struct litmon *gremlin;
2466 if ((mtmp = m_at(x, y)) != 0 && mtmp->data == &mons[PM_GREMLIN]) {
2467 gremlin = (struct litmon *) alloc(sizeof *gremlin);
2468 gremlin->mon = mtmp;
2469 gremlin->nxt = gremlins;
2474 snuff_light_source(x, y);
2480 register boolean on;
2483 char is_lit; /* value is irrelevant; we use its address
2484 as a `not null' flag for set_lit() */
2486 /* first produce the text (provided you're not blind) */
2488 register struct obj *otmp;
2493 pline("It seems even darker in here than before.");
2495 pline("
\91O
\82æ
\82è
\88Ã
\82
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D");
2497 if (uwep && artifact_light(uwep) && uwep->lamplit)
2499 pline("Suddenly, the only light left comes from %s!",
2501 pline("
\93Ë
\91R
\81C
\96¾
\82©
\82è
\82ª%s
\82¾
\82¯
\82É
\82È
\82Á
\82½
\81I",
2505 You("are surrounded by darkness!");
2507 You("
\88Ã
\88Å
\82É
\95¢
\82í
\82ê
\82½
\81I");
2511 /* the magic douses lamps, et al, too */
2512 for (otmp = invent; otmp; otmp = otmp->nobj)
2514 (void) snuff_lit(otmp);
2519 else if (is_animal(u.ustuck->data))
2521 pline("%s %s is lit.", s_suffix(Monnam(u.ustuck)),
2522 mbodypart(u.ustuck, STOMACH));
2524 pline("%s
\82Ì%s
\82Í
\96¾
\82é
\82
\82È
\82Á
\82½
\81D", Monnam(u.ustuck),
2525 mbodypart(u.ustuck, STOMACH));
2527 else if (is_whirly(u.ustuck->data))
2529 pline("%s shines briefly.", Monnam(u.ustuck));
2531 pline("%s
\82Í
\82¿
\82å
\82Á
\82Æ
\8bP
\82¢
\82½
\81D", Monnam(u.ustuck));
2534 pline("%s glistens.", Monnam(u.ustuck));
2536 pline("%s
\82Í
\82«
\82ç
\82«
\82ç
\8bP
\82¢
\82½
\81D", Monnam(u.ustuck));
2539 pline("A lit field surrounds you!");
2541 pline("
\93\94\82è
\82ª
\82 \82È
\82½
\82ð
\8eæ
\82è
\88Í
\82ñ
\82¾
\81I");
2544 /* No-op when swallowed or in water */
2545 if (u.uswallow || Underwater || Is_waterlevel(&u.uz))
2548 * If we are darkening the room and the hero is punished but not
2549 * blind, then we have to pick up and replace the ball and chain so
2550 * that we don't remember them if they are out of sight.
2552 if (Punished && !on && !Blind)
2553 move_bc(1, 0, uball->ox, uball->oy, uchain->ox, uchain->oy);
2555 if (Is_rogue_level(&u.uz)) {
2556 /* Can't use do_clear_area because MAX_RADIUS is too small */
2557 /* rogue lighting must light the entire room */
2558 int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET;
2562 for (rx = rooms[rnum].lx - 1; rx <= rooms[rnum].hx + 1; rx++)
2563 for (ry = rooms[rnum].ly - 1; ry <= rooms[rnum].hy + 1; ry++)
2565 (genericptr_t) (on ? &is_lit : (char *) 0));
2566 rooms[rnum].rlit = on;
2568 /* hallways remain dark on the rogue level */
2570 do_clear_area(u.ux, u.uy,
2571 (obj && obj->oclass == SCROLL_CLASS && obj->blessed)
2573 set_lit, (genericptr_t) (on ? &is_lit : (char *) 0));
2576 * If we are not blind, then force a redraw on all positions in sight
2577 * by temporarily blinding the hero. The vision recalculation will
2578 * correctly update all previously seen positions *and* correctly
2579 * set the waslit bit [could be messed up from above].
2584 /* replace ball&chain */
2585 if (Punished && !on)
2586 move_bc(0, 0, uball->ox, uball->oy, uchain->ox, uchain->oy);
2589 vision_full_recalc = 1; /* delayed vision recalculation */
2591 struct litmon *gremlin;
2593 /* can't delay vision recalc after all */
2595 /* after vision has been updated, monsters who are affected
2596 when hit by light can now be hit by it */
2599 gremlins = gremlin->nxt;
2600 light_hits_gremlin(gremlin->mon, rnd(5));
2601 free((genericptr_t) gremlin);
2609 int i, j, immunecnt, gonecnt, goodcnt, class, feel_dead = 0;
2610 char buf[BUFSZ] = DUMMY;
2611 boolean gameover = FALSE; /* true iff killed self */
2615 pline1(thats_enough_tries);
2620 getlin("What class of monsters do you wish to genocide?", buf);
2622 getlin("
\82Ç
\82Ì
\83N
\83\89\83X
\82É
\91®
\82·
\82é
\89ö
\95¨
\82ð
\8bs
\8eE
\82µ
\82Ü
\82·
\82©
\81H[
\95¶
\8e\9a\82ð
\93ü
\82ê
\82Ä
\82Ë]", buf);
2623 (void) mungspaces(buf);
2625 /* choosing "none" preserves genocideless conduct */
2627 if (*buf == '\033' || !strcmpi(buf, "none")
2628 || !strcmpi(buf, "nothing"))
2630 if (*buf == '\033' || !strcmpi(buf, "
\82È
\82µ")
2631 || !strcmpi(buf, "
\96³
\82µ"))
2635 class = name_to_monclass(buf, (int *) 0);
2636 if (class == 0 && (i = name_to_mon(buf)) != NON_PM)
2637 class = mons[i].mlet;
2638 immunecnt = gonecnt = goodcnt = 0;
2639 for (i = LOW_PM; i < NUMMONS; i++) {
2640 if (mons[i].mlet == class) {
2641 if (!(mons[i].geno & G_GENO))
2643 else if (mvitals[i].mvflags & G_GENOD)
2649 if (!goodcnt && class != mons[urole.malenum].mlet
2650 && class != mons[urace.malenum].mlet) {
2653 pline("All such monsters are already nonexistent.");
2655 pline("
\82»
\82Ì
\89ö
\95¨
\82Í
\82à
\82¤
\82¢
\82È
\82¢
\81D");
2656 else if (immunecnt || class == S_invisible)
2658 You("aren't permitted to genocide such monsters.");
2660 You("
\82»
\82Ì
\89ö
\95¨
\82ð
\8bs
\8eE
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2661 else if (wizard && buf[0] == '*') {
2662 register struct monst *mtmp, *mtmp2;
2665 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
2667 if (DEADMONSTER(mtmp))
2673 pline("Eliminated %d monster%s.", gonecnt, plur(gonecnt));
2675 pline("%d
\82Ì
\89ö
\95¨
\82ð
\8f\9c\82¢
\82½
\81D", gonecnt);
2679 pline("That %s does not represent any monster.",
2680 strlen(buf) == 1 ? "symbol" : "response");
2682 pline("
\82»
\82Ì
\82æ
\82¤
\82È
\89ö
\95¨
\82Í
\82¢
\82È
\82¢
\81D");
2687 for (i = LOW_PM; i < NUMMONS; i++) {
2688 if (mons[i].mlet == class) {
2691 Strcpy(nam, makeplural(mons[i].mname));
2692 /* Although "genus" is Latin for race, the hero benefits
2693 * from both race and role; thus genocide affects either.
2695 if (Your_Own_Role(i) || Your_Own_Race(i)
2696 || ((mons[i].geno & G_GENO)
2697 && !(mvitals[i].mvflags & G_GENOD))) {
2698 /* This check must be first since player monsters might
2699 * have G_GENOD or !G_GENO.
2701 mvitals[i].mvflags |= (G_GENOD | G_NOCORPSE);
2703 kill_genocided_monsters();
2704 update_inventory(); /* eggs & tins */
2706 pline("Wiped out all %s.", nam);
2708 pline("%s
\82ð
\91S
\82Ä
\94r
\8f\9c\82µ
\82½
\81D", nam);
2709 if (Upolyd && i == u.umonnum) {
2716 You("
\8e\80\82É
\82Ü
\82µ
\82½
\81D
\81D
\81D");
2717 /* finish genociding this class of
2718 monsters before ultimately dying */
2723 /* Self-genocide if it matches either your race
2724 or role. Assumption: male and female forms
2725 share same monster class. */
2726 if (i == urole.malenum || i == urace.malenum) {
2731 You_feel("%s inside.", udeadinside());
2733 You("
\8d°
\82ª%s
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", udeadinside());
2739 You("
\8e\80\82É
\82Ü
\82µ
\82½
\81D
\81D
\81D");
2743 } else if (mvitals[i].mvflags & G_GENOD) {
2746 pline("All %s are already nonexistent.", nam);
2748 pline("%s
\82Í
\8aù
\82É
\82¢
\82È
\82¢
\81D", nam);
2749 } else if (!gameover) {
2750 /* suppress feedback about quest beings except
2751 for those applicable to our own role */
2752 if ((mons[i].msound != MS_LEADER
2753 || quest_info(MS_LEADER) == i)
2754 && (mons[i].msound != MS_NEMESIS
2755 || quest_info(MS_NEMESIS) == i)
2756 && (mons[i].msound != MS_GUARDIAN
2757 || quest_info(MS_GUARDIAN) == i)
2758 /* non-leader/nemesis/guardian role-specific monster
2760 && (i != PM_NINJA /* nuisance */
2761 || Role_if(PM_SAMURAI))) {
2762 boolean named, uniq;
2764 named = type_is_pname(&mons[i]) ? TRUE : FALSE;
2765 uniq = (mons[i].geno & G_UNIQ) ? TRUE : FALSE;
2766 /* one special case */
2767 if (i == PM_HIGH_PRIEST)
2771 You("aren't permitted to genocide %s%s.",
2772 (uniq && !named) ? "the " : "",
2773 (uniq || named) ? mons[i].mname : nam);
2775 You("%s
\82ð
\8bs
\8eE
\82Å
\82«
\82È
\82¢
\81D",
2776 (uniq || named) ? mons[i].mname : nam);
2782 if (gameover || u.uhp == -1) {
2783 killer.format = KILLED_BY_AN;
2785 Strcpy(killer.name, "scroll of genocide");
2787 Strcpy(killer.name, "
\8bs
\8eE
\82Ì
\8aª
\95¨
\82Å");
2801 /* 0 = no genocide; create monsters (cursed scroll) */
2802 /* 1 = normal genocide */
2803 /* 3 = forced genocide of player */
2804 /* 5 (4 | 1) = normal genocide from throne */
2806 char buf[BUFSZ] = DUMMY;
2807 register int i, killplayer = 0;
2809 register struct permonst *ptr;
2813 mndx = u.umonster; /* non-polymorphed mon num */
2815 Strcpy(buf, ptr->mname);
2820 /* cursed effect => no free pass (unless rndmonst() fails) */
2821 if (!(how & REALLY) && (ptr = rndmonst()) != 0)
2824 pline1(thats_enough_tries);
2828 getlin("What monster do you want to genocide? [type the name]",
2830 getlin("
\82Ç
\82Ì
\89ö
\95¨
\82ð
\8bs
\8eE
\82µ
\82Ü
\82·
\82©
\81H[
\96¼
\91O
\82ð
\93ú
\96{
\8cê
\82Å
\93ü
\82ê
\82Ä
\82Ë]",
2832 (void) mungspaces(buf);
2833 /* choosing "none" preserves genocideless conduct */
2835 if (*buf == '\033' || !strcmpi(buf, "none")
2836 || !strcmpi(buf, "nothing")) {
2838 if (*buf == '\033' || !strcmpi(buf, "
\82È
\82µ")
2839 || !strcmpi(buf, "
\96³
\82µ")) {
2841 /* ... but no free pass if cursed */
2842 if (!(how & REALLY) && (ptr = rndmonst()) != 0)
2843 break; /* remaining checks don't apply */
2848 mndx = name_to_mon(buf);
2849 if (mndx == NON_PM || (mvitals[mndx].mvflags & G_GENOD)) {
2851 pline("Such creatures %s exist in this world.",
2852 (mndx == NON_PM) ? "do not" : "no longer");
2854 pline("
\82»
\82Ì
\82æ
\82¤
\82È
\90¶
\82«
\95¨
\82Í%s
\82±
\82Ì
\90¢
\8aE
\82É
\91¶
\8dÝ
\82µ
\82È
\82¢
\81D",
2855 (mndx == NON_PM) ? "" : "
\82à
\82Í
\82â");
2860 /* Although "genus" is Latin for race, the hero benefits
2861 * from both race and role; thus genocide affects either.
2863 if (Your_Own_Role(mndx) || Your_Own_Race(mndx)) {
2868 adjalign(-sgn(u.ualign.type));
2870 adjalign(sgn(u.ualign.type));
2872 if (!(ptr->geno & G_GENO)) {
2874 /* FIXME: unconditional "caverns" will be silly in some
2875 * circumstances. Who's speaking? Divine pronouncements
2876 * aren't supposed to be hampered by deafness....
2880 pline("A thunderous voice booms through the caverns:");
2882 pline("
\97\8b\82Ì
\82æ
\82¤
\82È
\90º
\82ª
\93´
\8cA
\82É
\8b¿
\82¢
\82½
\81F");
2884 verbalize("No, mortal! That will not be done.");
2886 pline("
\81u
\92è
\96½
\82Ì
\8eÒ
\82æ
\81I
\82»
\82Ì
\96]
\82Ý
\82Í
\82©
\82È
\82¤
\82Ü
\82¢
\81D
\81v");
2890 /* KMH -- Unchanging prevents rehumanization */
2891 if (Unchanging && ptr == youmonst.data)
2895 mndx = monsndx(ptr); /* needed for the 'no free pass' cases */
2902 if (Hallucination) {
2904 Strcpy(buf, youmonst.data->mname);
2906 Strcpy(buf, (flags.female && urole.name.f) ? urole.name.f
2908 buf[0] = lowc(buf[0]);
2911 Strcpy(buf, ptr->mname); /* make sure we have standard singular */
2912 if ((ptr->geno & G_UNIQ) && ptr != &mons[PM_HIGH_PRIEST])
2914 which = !type_is_pname(ptr) ? "the " : "";
2920 /* setting no-corpse affects wishing and random tin generation */
2921 mvitals[mndx].mvflags |= (G_GENOD | G_NOCORPSE);
2923 pline("Wiped out %s%s.", which,
2924 (*which != 'a') ? buf : makeplural(buf));
2926 pline("%s
\82ð%s
\88ê
\91|
\82µ
\82½
\81D", buf, which);
2930 /* might need to wipe out dual role */
2931 if (urole.femalenum != NON_PM && mndx == urole.malenum)
2932 mvitals[urole.femalenum].mvflags |= (G_GENOD | G_NOCORPSE);
2933 if (urole.femalenum != NON_PM && mndx == urole.femalenum)
2934 mvitals[urole.malenum].mvflags |= (G_GENOD | G_NOCORPSE);
2935 if (urace.femalenum != NON_PM && mndx == urace.malenum)
2936 mvitals[urace.femalenum].mvflags |= (G_GENOD | G_NOCORPSE);
2937 if (urace.femalenum != NON_PM && mndx == urace.femalenum)
2938 mvitals[urace.malenum].mvflags |= (G_GENOD | G_NOCORPSE);
2942 killer.format = KILLED_BY;
2944 Strcpy(killer.name, "genocidal confusion");
2946 Strcpy(killer.name, "
\8d¬
\97\90\82É
\82æ
\82é
\8e©
\8bs
\93I
\8bs
\8eE
\82Å");
2947 } else if (how & ONTHRONE) {
2948 /* player selected while on a throne */
2949 killer.format = KILLED_BY_AN;
2951 Strcpy(killer.name, "imperious order");
2953 Strcpy(killer.name, "
\98ü
\96\9d\82È
\96½
\97ß
\82Å");
2954 } else { /* selected player deliberately, not confused */
2955 killer.format = KILLED_BY_AN;
2957 Strcpy(killer.name, "scroll of genocide");
2959 Strcpy(killer.name, "
\8bs
\8eE
\82Ì
\8aª
\95¨
\82Å");
2962 /* Polymorphed characters will die as soon as they're rehumanized.
2964 /* KMH -- Unchanging prevents rehumanization */
2965 if (Upolyd && ptr != youmonst.data) {
2966 delayed_killer(POLYMORPH, killer.format, killer.name);
2968 You_feel("%s inside.", udeadinside());
2970 You_feel("
\8d°
\82ª%s
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", udeadinside());
2973 } else if (ptr == youmonst.data) {
2976 reset_rndmonst(mndx);
2977 kill_genocided_monsters();
2978 update_inventory(); /* in case identified eggs were affected */
2980 int cnt = 0, census = monster_census(FALSE);
2982 if (!(mons[mndx].geno & G_UNIQ)
2983 && !(mvitals[mndx].mvflags & (G_GENOD | G_EXTINCT)))
2984 for (i = rn1(3, 4); i > 0; i--) {
2985 if (!makemon(ptr, u.ux, u.uy, NO_MINVENT))
2986 break; /* couldn't make one */
2988 if (mvitals[mndx].mvflags & G_EXTINCT)
2989 break; /* just made last one */
2992 /* accumulated 'cnt' doesn't take groups into account;
2993 assume bringing in new mon(s) didn't remove any old ones */
2994 cnt = monster_census(FALSE) - census;
2996 pline("Sent in %s%s.", (cnt > 1) ? "some " : "",
2997 (cnt > 1) ? makeplural(buf) : an(buf));
2999 pline("%s
\82ª
\91\97\82ç
\82ê
\82Ä
\82«
\82½
\81D", buf);
3002 pline1(nothing_happens);
3010 struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL)
3011 ? sobj : (struct obj *) 0;
3013 /* KMH -- Punishment is still okay when you are riding */
3016 You("are being punished for your misbehavior!");
3018 You("
\95s
\8dì
\96@
\82Ì
\82½
\82ß
\94±
\82ð
\8eó
\82¯
\82½
\81I");
3021 Your("iron ball gets heavier.");
3023 Your("
\93S
\8b\85\82Í
\82³
\82ç
\82É
\8fd
\82
\82È
\82Á
\82½
\81D");
3024 uball->owt += IRON_BALL_W_INCR * (1 + sobj->cursed);
3027 if (amorphous(youmonst.data) || is_whirly(youmonst.data)
3028 || unsolid(youmonst.data)) {
3031 pline("A ball and chain appears, then falls away.");
3033 pline("
\93S
\8b\85\82Æ
\8d½
\82ª
\8c»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82é
\82Á
\82Æ
\94²
\82¯
\82½
\81D");
3034 dropy(mkobj(BALL_CLASS, TRUE));
3040 setworn(mkobj(CHAIN_CLASS, TRUE), W_CHAIN);
3042 setworn(mkobj(BALL_CLASS, TRUE), W_BALL);
3044 setworn(reuse_ball, W_BALL);
3045 uball->spe = 1; /* special ball (see save) */
3048 * Place ball & chain if not swallowed. If swallowed, the ball & chain
3049 * variables will be set at the next call to placebc().
3054 set_bc(1); /* set up ball and chain variables */
3055 newsym(u.ux, u.uy); /* see ball&chain if can't see self */
3059 /* remove the ball and chain */
3063 struct obj *savechain = uchain;
3065 /* chain goes away */
3066 obj_extract_self(uchain);
3067 newsym(uchain->ox, uchain->oy);
3068 setworn((struct obj *) 0, W_CHAIN); /* sets 'uchain' to Null */
3069 dealloc_obj(savechain);
3072 setworn((struct obj *) 0, W_BALL); /* sets 'uball' to Null */
3075 /* some creatures have special data structures that only make sense in their
3076 * normal locations -- if the player tries to create one elsewhere, or to
3077 * revive one, the disoriented creature becomes a zombie
3080 cant_revive(mtype, revival, from_obj)
3083 struct obj *from_obj;
3085 /* SHOPKEEPERS can be revived now */
3086 if (*mtype == PM_GUARD || (*mtype == PM_SHOPKEEPER && !revival)
3087 || *mtype == PM_HIGH_PRIEST || *mtype == PM_ALIGNED_PRIEST
3088 || *mtype == PM_ANGEL) {
3089 *mtype = PM_HUMAN_ZOMBIE;
3091 } else if (*mtype == PM_LONG_WORM_TAIL) { /* for create_particular() */
3092 *mtype = PM_LONG_WORM;
3094 } else if (unique_corpstat(&mons[*mtype])
3095 && (!from_obj || !has_omonst(from_obj))) {
3096 /* unique corpses (from bones or wizard mode wish) or
3097 statues (bones or any wish) end up as shapechangers */
3098 *mtype = PM_DOPPELGANGER;
3104 struct _create_particular_data {
3109 boolean maketame, makepeaceful, makehostile;
3110 boolean sleeping, saddled, invisible, hidden;
3114 create_particular_parse(str, d)
3116 struct _create_particular_data *d;
3121 d->monclass = MAXMCLASSES;
3122 d->which = urole.malenum; /* an arbitrary index into mons[] */
3123 d->fem = -1; /* gender not specified */
3124 d->randmonst = FALSE;
3125 d->maketame = d->makepeaceful = d->makehostile = FALSE;
3126 d->sleeping = d->saddled = d->invisible = d->hidden = FALSE;
3128 if ((tmpp = strstri(bufp, "saddled ")) != 0) {
3130 (void) memset(tmpp, ' ', sizeof "saddled " - 1);
3132 if ((tmpp = strstri(bufp, "sleeping ")) != 0) {
3134 (void) memset(tmpp, ' ', sizeof "sleeping " - 1);
3136 if ((tmpp = strstri(bufp, "invisible ")) != 0) {
3137 d->invisible = TRUE;
3138 (void) memset(tmpp, ' ', sizeof "invisible " - 1);
3140 if ((tmpp = strstri(bufp, "hidden ")) != 0) {
3142 (void) memset(tmpp, ' ', sizeof "hidden " - 1);
3144 /* check "female" before "male" to avoid false hit mid-word */
3145 if ((tmpp = strstri(bufp, "female ")) != 0) {
3147 (void) memset(tmpp, ' ', sizeof "female " - 1);
3149 if ((tmpp = strstri(bufp, "male ")) != 0) {
3151 (void) memset(tmpp, ' ', sizeof "male " - 1);
3153 bufp = mungspaces(bufp); /* after potential memset(' ') */
3154 /* allow the initial disposition to be specified */
3156 if (!strncmpi(bufp, "tame ", 5)) {
3159 if (!strncmpi(bufp, "
\8eè
\82È
\82¸
\82¯
\82ç
\82ê
\82½", 14)) {
3164 } else if (!strncmpi(bufp, "peaceful ", 9)) {
3167 } else if (!strncmpi(bufp, "
\97F
\8dD
\93I
\82È", 8)) {
3170 d->makepeaceful = TRUE;
3172 } else if (!strncmpi(bufp, "hostile ", 8)) {
3175 } else if (!strncmpi(bufp, "
\93G
\91Î
\93I
\82È", 8)) {
3178 d->makehostile = TRUE;
3180 /* decide whether a valid monster was chosen */
3182 if (wizard && (!strcmp(bufp, "*") || !strcmp(bufp, "random"))) {
3184 if (wizard && (!strcmp(bufp, "*") || !strcmp(bufp, "
\83\89\83\93\83_
\83\80"))) {
3185 d->randmonst = TRUE;
3188 d->which = name_to_mon(bufp);
3189 if (d->which >= LOW_PM)
3190 return TRUE; /* got one */
3191 d->monclass = name_to_monclass(bufp, &d->which);
3193 if (d->which >= LOW_PM) {
3194 d->monclass = MAXMCLASSES; /* matters below */
3196 } else if (d->monclass == S_invisible) { /* not an actual monster class */
3197 d->which = PM_STALKER;
3198 d->monclass = MAXMCLASSES;
3200 } else if (d->monclass == S_WORM_TAIL) { /* empty monster class */
3201 d->which = PM_LONG_WORM;
3202 d->monclass = MAXMCLASSES;
3204 } else if (d->monclass > 0) {
3205 d->which = urole.malenum; /* reset from NON_PM */
3212 create_particular_creation(d)
3213 struct _create_particular_data *d;
3215 struct permonst *whichpm = NULL;
3216 int i, mx, my, firstchoice = NON_PM;
3218 boolean madeany = FALSE;
3220 if (!d->randmonst) {
3221 firstchoice = d->which;
3222 if (cant_revive(&d->which, FALSE, (struct obj *) 0)
3223 && firstchoice != PM_LONG_WORM_TAIL) {
3224 /* wizard mode can override handling of special monsters */
3228 Sprintf(buf, "Creating %s instead; force %s?",
3229 mons[d->which].mname, mons[firstchoice].mname);
3231 Sprintf(buf, "
\91ã
\82í
\82è
\82É%s
\82ª
\8dì
\82ç
\82ê
\82Ü
\82·
\81G%s
\82É
\82·
\82é
\81H",
3232 mons[d->which].mname, mons[firstchoice].mname);
3235 d->which = firstchoice;
3237 whichpm = &mons[d->which];
3239 for (i = 0; i <= multi; i++) {
3240 if (d->monclass != MAXMCLASSES)
3241 whichpm = mkclass(d->monclass, 0);
3242 else if (d->randmonst)
3243 whichpm = rndmonst();
3244 mtmp = makemon(whichpm, u.ux, u.uy, NO_MM_FLAGS);
3246 /* quit trying if creation failed and is going to repeat */
3247 if (d->monclass == MAXMCLASSES && !d->randmonst)
3249 /* otherwise try again */
3252 mx = mtmp->mx, my = mtmp->my;
3253 /* 'is_FOO()' ought to be called 'always_FOO()' */
3254 if (d->fem != -1 && !is_male(mtmp->data) && !is_female(mtmp->data))
3255 mtmp->female = d->fem; /* ignored for is_neuter() */
3257 (void) tamedog(mtmp, (struct obj *) 0);
3258 } else if (d->makepeaceful || d->makehostile) {
3259 mtmp->mtame = 0; /* sanity precaution */
3260 mtmp->mpeaceful = d->makepeaceful ? 1 : 0;
3263 if (d->saddled && can_saddle(mtmp) && !which_armor(mtmp, W_SADDLE)) {
3264 struct obj *otmp = mksobj(SADDLE, TRUE, FALSE);
3266 put_saddle_on_mon(otmp, mtmp);
3269 mon_set_minvis(mtmp);
3270 if (does_block(mx, my, &levl[mx][my]))
3271 block_point(mx, my);
3273 unblock_point(mx, my);
3276 && ((is_hider(mtmp->data) && mtmp->data->mlet != S_MIMIC)
3277 || (hides_under(mtmp->data) && OBJ_AT(mx, my))
3278 || (mtmp->data->mlet == S_EEL && is_pool(mx, my))))
3279 mtmp->mundetected = 1;
3281 mtmp->msleeping = 1;
3282 /* iff asking for 'hidden', show locaton of every created monster
3283 that can't be seen--whether that's due to successfully hiding
3284 or vision issues (line-of-sight, invisibility, blindness) */
3285 if (d->hidden && !canspotmon(mtmp)) {
3286 int count = couldsee(mx, my) ? 8 : 4;
3287 char saveviz = viz_array[my][mx];
3291 viz_array[my][mx] |= (IN_SIGHT | COULD_SEE);
3292 flash_glyph_at(mx, my, mon_to_glyph(mtmp, newsym_rn2), count);
3293 viz_array[my][mx] = saveviz;
3297 /* in case we got a doppelganger instead of what was asked
3298 for, make it start out looking like what was asked for */
3299 if (mtmp->cham != NON_PM && firstchoice != NON_PM
3300 && mtmp->cham != firstchoice)
3301 (void) newcham(mtmp, &mons[firstchoice], FALSE, FALSE);
3307 * Make a new monster with the type controlled by the user.
3309 * Note: when creating a monster by class letter, specifying the
3310 * "strange object" (']') symbol produces a random monster rather
3311 * than a mimic. This behavior quirk is useful so don't "fix" it
3312 * (use 'm'--or "mimic"--to create a random mimic).
3314 * Used in wizard mode only (for ^G command and for scroll or spell
3315 * of create monster). Once upon a time, an earlier incarnation of
3316 * this code was also used for the scroll/spell in explore mode.
3321 char buf[BUFSZ] = DUMMY, *bufp;
3323 struct _create_particular_data d;
3327 getlin("Create what kind of monster? [type the name or symbol]", buf);
3329 getlin("
\82Ç
\82Ì
\8eí
\82Ì
\89ö
\95¨
\82ð
\8dì
\82è
\82Ü
\82·
\82©
\81H[
\96¼
\91O
\82ð
\93ü
\82ê
\82Ä
\82Ë]", buf);
3330 bufp = mungspaces(buf);
3331 if (*bufp == '\033')
3334 if (create_particular_parse(bufp, &d))
3337 /* no good; try again... */
3339 pline("I've never heard of such monsters.");
3341 pline("
\82»
\82Ì
\82æ
\82¤
\82È
\89ö
\95¨
\82Í
\95·
\82¢
\82½
\82±
\82Æ
\82ª
\82È
\82¢
\81D");
3342 } while (--tryct > 0);
3345 pline1(thats_enough_tries);
3347 return create_particular_creation(&d);