hack.read.c revision 1.1 1 1.1 cgd /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 1.1 cgd /* hack.read.c - version 1.0.3 */
3 1.1 cgd
4 1.1 cgd #include "hack.h"
5 1.1 cgd
6 1.1 cgd extern struct monst *makemon();
7 1.1 cgd extern struct obj *mkobj_at();
8 1.1 cgd int identify();
9 1.1 cgd
10 1.1 cgd doread() {
11 1.1 cgd register struct obj *scroll;
12 1.1 cgd register boolean confused = (Confusion != 0);
13 1.1 cgd register boolean known = FALSE;
14 1.1 cgd extern struct obj *some_armor();
15 1.1 cgd
16 1.1 cgd scroll = getobj("?", "read");
17 1.1 cgd if(!scroll) return(0);
18 1.1 cgd if(!scroll->dknown && Blind) {
19 1.1 cgd pline("Being blind, you cannot read the formula on the scroll.");
20 1.1 cgd return(0);
21 1.1 cgd }
22 1.1 cgd if(Blind)
23 1.1 cgd pline("As you pronounce the formula on it, the scroll disappears.");
24 1.1 cgd else
25 1.1 cgd pline("As you read the scroll, it disappears.");
26 1.1 cgd if(confused)
27 1.1 cgd pline("Being confused, you mispronounce the magic words ... ");
28 1.1 cgd
29 1.1 cgd switch(scroll->otyp) {
30 1.1 cgd #ifdef MAIL
31 1.1 cgd case SCR_MAIL:
32 1.1 cgd readmail(/* scroll */);
33 1.1 cgd break;
34 1.1 cgd #endif MAIL
35 1.1 cgd case SCR_ENCHANT_ARMOR:
36 1.1 cgd { register struct obj *otmp = some_armor();
37 1.1 cgd if(!otmp) {
38 1.1 cgd strange_feeling(scroll,"Your skin glows then fades.");
39 1.1 cgd return(1);
40 1.1 cgd }
41 1.1 cgd if(confused) {
42 1.1 cgd pline("Your %s glows silver for a moment.",
43 1.1 cgd objects[otmp->otyp].oc_name);
44 1.1 cgd otmp->rustfree = 1;
45 1.1 cgd break;
46 1.1 cgd }
47 1.1 cgd if(otmp->spe > 3 && rn2(otmp->spe)) {
48 1.1 cgd pline("Your %s glows violently green for a while, then evaporates.",
49 1.1 cgd objects[otmp->otyp].oc_name);
50 1.1 cgd useup(otmp);
51 1.1 cgd break;
52 1.1 cgd }
53 1.1 cgd pline("Your %s glows green for a moment.",
54 1.1 cgd objects[otmp->otyp].oc_name);
55 1.1 cgd otmp->cursed = 0;
56 1.1 cgd otmp->spe++;
57 1.1 cgd break;
58 1.1 cgd }
59 1.1 cgd case SCR_DESTROY_ARMOR:
60 1.1 cgd if(confused) {
61 1.1 cgd register struct obj *otmp = some_armor();
62 1.1 cgd if(!otmp) {
63 1.1 cgd strange_feeling(scroll,"Your bones itch.");
64 1.1 cgd return(1);
65 1.1 cgd }
66 1.1 cgd pline("Your %s glows purple for a moment.",
67 1.1 cgd objects[otmp->otyp].oc_name);
68 1.1 cgd otmp->rustfree = 0;
69 1.1 cgd break;
70 1.1 cgd }
71 1.1 cgd if(uarm) {
72 1.1 cgd pline("Your armor turns to dust and falls to the floor!");
73 1.1 cgd useup(uarm);
74 1.1 cgd } else if(uarmh) {
75 1.1 cgd pline("Your helmet turns to dust and is blown away!");
76 1.1 cgd useup(uarmh);
77 1.1 cgd } else if(uarmg) {
78 1.1 cgd pline("Your gloves vanish!");
79 1.1 cgd useup(uarmg);
80 1.1 cgd selftouch("You");
81 1.1 cgd } else {
82 1.1 cgd strange_feeling(scroll,"Your skin itches.");
83 1.1 cgd return(1);
84 1.1 cgd }
85 1.1 cgd break;
86 1.1 cgd case SCR_CONFUSE_MONSTER:
87 1.1 cgd if(confused) {
88 1.1 cgd pline("Your hands begin to glow purple.");
89 1.1 cgd Confusion += rnd(100);
90 1.1 cgd } else {
91 1.1 cgd pline("Your hands begin to glow blue.");
92 1.1 cgd u.umconf = 1;
93 1.1 cgd }
94 1.1 cgd break;
95 1.1 cgd case SCR_SCARE_MONSTER:
96 1.1 cgd { register int ct = 0;
97 1.1 cgd register struct monst *mtmp;
98 1.1 cgd
99 1.1 cgd for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
100 1.1 cgd if(cansee(mtmp->mx,mtmp->my)) {
101 1.1 cgd if(confused)
102 1.1 cgd mtmp->mflee = mtmp->mfroz =
103 1.1 cgd mtmp->msleep = 0;
104 1.1 cgd else
105 1.1 cgd mtmp->mflee = 1;
106 1.1 cgd ct++;
107 1.1 cgd }
108 1.1 cgd if(!ct) {
109 1.1 cgd if(confused)
110 1.1 cgd pline("You hear sad wailing in the distance.");
111 1.1 cgd else
112 1.1 cgd pline("You hear maniacal laughter in the distance.");
113 1.1 cgd }
114 1.1 cgd break;
115 1.1 cgd }
116 1.1 cgd case SCR_BLANK_PAPER:
117 1.1 cgd if(confused)
118 1.1 cgd pline("You see strange patterns on this scroll.");
119 1.1 cgd else
120 1.1 cgd pline("This scroll seems to be blank.");
121 1.1 cgd break;
122 1.1 cgd case SCR_REMOVE_CURSE:
123 1.1 cgd { register struct obj *obj;
124 1.1 cgd if(confused)
125 1.1 cgd pline("You feel like you need some help.");
126 1.1 cgd else
127 1.1 cgd pline("You feel like someone is helping you.");
128 1.1 cgd for(obj = invent; obj ; obj = obj->nobj)
129 1.1 cgd if(obj->owornmask)
130 1.1 cgd obj->cursed = confused;
131 1.1 cgd if(Punished && !confused) {
132 1.1 cgd Punished = 0;
133 1.1 cgd freeobj(uchain);
134 1.1 cgd unpobj(uchain);
135 1.1 cgd free((char *) uchain);
136 1.1 cgd uball->spe = 0;
137 1.1 cgd uball->owornmask &= ~W_BALL;
138 1.1 cgd uchain = uball = (struct obj *) 0;
139 1.1 cgd }
140 1.1 cgd break;
141 1.1 cgd }
142 1.1 cgd case SCR_CREATE_MONSTER:
143 1.1 cgd { register int cnt = 1;
144 1.1 cgd
145 1.1 cgd if(!rn2(73)) cnt += rnd(4);
146 1.1 cgd if(confused) cnt += 12;
147 1.1 cgd while(cnt--)
148 1.1 cgd (void) makemon(confused ? PM_ACID_BLOB :
149 1.1 cgd (struct permonst *) 0, u.ux, u.uy);
150 1.1 cgd break;
151 1.1 cgd }
152 1.1 cgd case SCR_ENCHANT_WEAPON:
153 1.1 cgd if(uwep && confused) {
154 1.1 cgd pline("Your %s glows silver for a moment.",
155 1.1 cgd objects[uwep->otyp].oc_name);
156 1.1 cgd uwep->rustfree = 1;
157 1.1 cgd } else
158 1.1 cgd if(!chwepon(scroll, 1)) /* tests for !uwep */
159 1.1 cgd return(1);
160 1.1 cgd break;
161 1.1 cgd case SCR_DAMAGE_WEAPON:
162 1.1 cgd if(uwep && confused) {
163 1.1 cgd pline("Your %s glows purple for a moment.",
164 1.1 cgd objects[uwep->otyp].oc_name);
165 1.1 cgd uwep->rustfree = 0;
166 1.1 cgd } else
167 1.1 cgd if(!chwepon(scroll, -1)) /* tests for !uwep */
168 1.1 cgd return(1);
169 1.1 cgd break;
170 1.1 cgd case SCR_TAMING:
171 1.1 cgd { register int i,j;
172 1.1 cgd register int bd = confused ? 5 : 1;
173 1.1 cgd register struct monst *mtmp;
174 1.1 cgd
175 1.1 cgd for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++)
176 1.1 cgd if(mtmp = m_at(u.ux+i, u.uy+j))
177 1.1 cgd (void) tamedog(mtmp, (struct obj *) 0);
178 1.1 cgd break;
179 1.1 cgd }
180 1.1 cgd case SCR_GENOCIDE:
181 1.1 cgd { extern char genocided[], fut_geno[];
182 1.1 cgd char buf[BUFSZ];
183 1.1 cgd register struct monst *mtmp, *mtmp2;
184 1.1 cgd
185 1.1 cgd pline("You have found a scroll of genocide!");
186 1.1 cgd known = TRUE;
187 1.1 cgd if(confused)
188 1.1 cgd *buf = u.usym;
189 1.1 cgd else do {
190 1.1 cgd pline("What monster do you want to genocide (Type the letter)? ");
191 1.1 cgd getlin(buf);
192 1.1 cgd } while(strlen(buf) != 1 || !monstersym(*buf));
193 1.1 cgd if(!index(fut_geno, *buf))
194 1.1 cgd charcat(fut_geno, *buf);
195 1.1 cgd if(!index(genocided, *buf))
196 1.1 cgd charcat(genocided, *buf);
197 1.1 cgd else {
198 1.1 cgd pline("Such monsters do not exist in this world.");
199 1.1 cgd break;
200 1.1 cgd }
201 1.1 cgd for(mtmp = fmon; mtmp; mtmp = mtmp2){
202 1.1 cgd mtmp2 = mtmp->nmon;
203 1.1 cgd if(mtmp->data->mlet == *buf)
204 1.1 cgd mondead(mtmp);
205 1.1 cgd }
206 1.1 cgd pline("Wiped out all %c's.", *buf);
207 1.1 cgd if(*buf == u.usym) {
208 1.1 cgd killer = "scroll of genocide";
209 1.1 cgd u.uhp = -1;
210 1.1 cgd }
211 1.1 cgd break;
212 1.1 cgd }
213 1.1 cgd case SCR_LIGHT:
214 1.1 cgd if(!Blind) known = TRUE;
215 1.1 cgd litroom(!confused);
216 1.1 cgd break;
217 1.1 cgd case SCR_TELEPORTATION:
218 1.1 cgd if(confused)
219 1.1 cgd level_tele();
220 1.1 cgd else {
221 1.1 cgd #ifdef QUEST
222 1.1 cgd register int oux = u.ux, ouy = u.uy;
223 1.1 cgd tele();
224 1.1 cgd if(dist(oux, ouy) > 100) known = TRUE;
225 1.1 cgd #else QUEST
226 1.1 cgd register int uroom = inroom(u.ux, u.uy);
227 1.1 cgd tele();
228 1.1 cgd if(uroom != inroom(u.ux, u.uy)) known = TRUE;
229 1.1 cgd #endif QUEST
230 1.1 cgd }
231 1.1 cgd break;
232 1.1 cgd case SCR_GOLD_DETECTION:
233 1.1 cgd /* Unfortunately this code has become slightly less elegant,
234 1.1 cgd now that gold and traps no longer are of the same type. */
235 1.1 cgd if(confused) {
236 1.1 cgd register struct trap *ttmp;
237 1.1 cgd
238 1.1 cgd if(!ftrap) {
239 1.1 cgd strange_feeling(scroll, "Your toes stop itching.");
240 1.1 cgd return(1);
241 1.1 cgd } else {
242 1.1 cgd for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap)
243 1.1 cgd if(ttmp->tx != u.ux || ttmp->ty != u.uy)
244 1.1 cgd goto outtrapmap;
245 1.1 cgd /* only under me - no separate display required */
246 1.1 cgd pline("Your toes itch!");
247 1.1 cgd break;
248 1.1 cgd outtrapmap:
249 1.1 cgd cls();
250 1.1 cgd for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap)
251 1.1 cgd at(ttmp->tx, ttmp->ty, '$');
252 1.1 cgd prme();
253 1.1 cgd pline("You feel very greedy!");
254 1.1 cgd }
255 1.1 cgd } else {
256 1.1 cgd register struct gold *gtmp;
257 1.1 cgd
258 1.1 cgd if(!fgold) {
259 1.1 cgd strange_feeling(scroll, "You feel materially poor.");
260 1.1 cgd return(1);
261 1.1 cgd } else {
262 1.1 cgd known = TRUE;
263 1.1 cgd for(gtmp = fgold; gtmp; gtmp = gtmp->ngold)
264 1.1 cgd if(gtmp->gx != u.ux || gtmp->gy != u.uy)
265 1.1 cgd goto outgoldmap;
266 1.1 cgd /* only under me - no separate display required */
267 1.1 cgd pline("You notice some gold between your feet.");
268 1.1 cgd break;
269 1.1 cgd outgoldmap:
270 1.1 cgd cls();
271 1.1 cgd for(gtmp = fgold; gtmp; gtmp = gtmp->ngold)
272 1.1 cgd at(gtmp->gx, gtmp->gy, '$');
273 1.1 cgd prme();
274 1.1 cgd pline("You feel very greedy, and sense gold!");
275 1.1 cgd }
276 1.1 cgd }
277 1.1 cgd /* common sequel */
278 1.1 cgd more();
279 1.1 cgd docrt();
280 1.1 cgd break;
281 1.1 cgd case SCR_FOOD_DETECTION:
282 1.1 cgd { register ct = 0, ctu = 0;
283 1.1 cgd register struct obj *obj;
284 1.1 cgd register char foodsym = confused ? POTION_SYM : FOOD_SYM;
285 1.1 cgd
286 1.1 cgd for(obj = fobj; obj; obj = obj->nobj)
287 1.1 cgd if(obj->olet == FOOD_SYM) {
288 1.1 cgd if(obj->ox == u.ux && obj->oy == u.uy) ctu++;
289 1.1 cgd else ct++;
290 1.1 cgd }
291 1.1 cgd if(!ct && !ctu) {
292 1.1 cgd strange_feeling(scroll,"Your nose twitches.");
293 1.1 cgd return(1);
294 1.1 cgd } else if(!ct) {
295 1.1 cgd known = TRUE;
296 1.1 cgd pline("You smell %s close nearby.",
297 1.1 cgd confused ? "something" : "food");
298 1.1 cgd
299 1.1 cgd } else {
300 1.1 cgd known = TRUE;
301 1.1 cgd cls();
302 1.1 cgd for(obj = fobj; obj; obj = obj->nobj)
303 1.1 cgd if(obj->olet == foodsym)
304 1.1 cgd at(obj->ox, obj->oy, FOOD_SYM);
305 1.1 cgd prme();
306 1.1 cgd pline("Your nose tingles and you smell %s!",
307 1.1 cgd confused ? "something" : "food");
308 1.1 cgd more();
309 1.1 cgd docrt();
310 1.1 cgd }
311 1.1 cgd break;
312 1.1 cgd }
313 1.1 cgd case SCR_IDENTIFY:
314 1.1 cgd /* known = TRUE; */
315 1.1 cgd if(confused)
316 1.1 cgd pline("You identify this as an identify scroll.");
317 1.1 cgd else
318 1.1 cgd pline("This is an identify scroll.");
319 1.1 cgd useup(scroll);
320 1.1 cgd objects[SCR_IDENTIFY].oc_name_known = 1;
321 1.1 cgd if(!confused)
322 1.1 cgd while(
323 1.1 cgd !ggetobj("identify", identify, rn2(5) ? 1 : rn2(5))
324 1.1 cgd && invent
325 1.1 cgd );
326 1.1 cgd return(1);
327 1.1 cgd case SCR_MAGIC_MAPPING:
328 1.1 cgd { register struct rm *lev;
329 1.1 cgd register int num, zx, zy;
330 1.1 cgd
331 1.1 cgd known = TRUE;
332 1.1 cgd pline("On this scroll %s a map!",
333 1.1 cgd confused ? "was" : "is");
334 1.1 cgd for(zy = 0; zy < ROWNO; zy++)
335 1.1 cgd for(zx = 0; zx < COLNO; zx++) {
336 1.1 cgd if(confused && rn2(7)) continue;
337 1.1 cgd lev = &(levl[zx][zy]);
338 1.1 cgd if((num = lev->typ) == 0)
339 1.1 cgd continue;
340 1.1 cgd if(num == SCORR) {
341 1.1 cgd lev->typ = CORR;
342 1.1 cgd lev->scrsym = CORR_SYM;
343 1.1 cgd } else
344 1.1 cgd if(num == SDOOR) {
345 1.1 cgd lev->typ = DOOR;
346 1.1 cgd lev->scrsym = '+';
347 1.1 cgd /* do sth in doors ? */
348 1.1 cgd } else if(lev->seen) continue;
349 1.1 cgd #ifndef QUEST
350 1.1 cgd if(num != ROOM)
351 1.1 cgd #endif QUEST
352 1.1 cgd {
353 1.1 cgd lev->seen = lev->new = 1;
354 1.1 cgd if(lev->scrsym == ' ' || !lev->scrsym)
355 1.1 cgd newsym(zx,zy);
356 1.1 cgd else
357 1.1 cgd on_scr(zx,zy);
358 1.1 cgd }
359 1.1 cgd }
360 1.1 cgd break;
361 1.1 cgd }
362 1.1 cgd case SCR_AMNESIA:
363 1.1 cgd { register int zx, zy;
364 1.1 cgd
365 1.1 cgd known = TRUE;
366 1.1 cgd for(zx = 0; zx < COLNO; zx++) for(zy = 0; zy < ROWNO; zy++)
367 1.1 cgd if(!confused || rn2(7))
368 1.1 cgd if(!cansee(zx,zy))
369 1.1 cgd levl[zx][zy].seen = 0;
370 1.1 cgd docrt();
371 1.1 cgd pline("Thinking of Maud you forget everything else.");
372 1.1 cgd break;
373 1.1 cgd }
374 1.1 cgd case SCR_FIRE:
375 1.1 cgd { register int num;
376 1.1 cgd register struct monst *mtmp;
377 1.1 cgd
378 1.1 cgd known = TRUE;
379 1.1 cgd if(confused) {
380 1.1 cgd pline("The scroll catches fire and you burn your hands.");
381 1.1 cgd losehp(1, "scroll of fire");
382 1.1 cgd } else {
383 1.1 cgd pline("The scroll erupts in a tower of flame!");
384 1.1 cgd if(Fire_resistance)
385 1.1 cgd pline("You are uninjured.");
386 1.1 cgd else {
387 1.1 cgd num = rnd(6);
388 1.1 cgd u.uhpmax -= num;
389 1.1 cgd losehp(num, "scroll of fire");
390 1.1 cgd }
391 1.1 cgd }
392 1.1 cgd num = (2*num + 1)/3;
393 1.1 cgd for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
394 1.1 cgd if(dist(mtmp->mx,mtmp->my) < 3) {
395 1.1 cgd mtmp->mhp -= num;
396 1.1 cgd if(index("FY", mtmp->data->mlet))
397 1.1 cgd mtmp->mhp -= 3*num; /* this might well kill 'F's */
398 1.1 cgd if(mtmp->mhp < 1) {
399 1.1 cgd killed(mtmp);
400 1.1 cgd break; /* primitive */
401 1.1 cgd }
402 1.1 cgd }
403 1.1 cgd }
404 1.1 cgd break;
405 1.1 cgd }
406 1.1 cgd case SCR_PUNISHMENT:
407 1.1 cgd known = TRUE;
408 1.1 cgd if(confused) {
409 1.1 cgd pline("You feel guilty.");
410 1.1 cgd break;
411 1.1 cgd }
412 1.1 cgd pline("You are being punished for your misbehaviour!");
413 1.1 cgd if(Punished){
414 1.1 cgd pline("Your iron ball gets heavier.");
415 1.1 cgd uball->owt += 15;
416 1.1 cgd break;
417 1.1 cgd }
418 1.1 cgd Punished = INTRINSIC;
419 1.1 cgd setworn(mkobj_at(CHAIN_SYM, u.ux, u.uy), W_CHAIN);
420 1.1 cgd setworn(mkobj_at(BALL_SYM, u.ux, u.uy), W_BALL);
421 1.1 cgd uball->spe = 1; /* special ball (see save) */
422 1.1 cgd break;
423 1.1 cgd default:
424 1.1 cgd impossible("What weird language is this written in? (%u)",
425 1.1 cgd scroll->otyp);
426 1.1 cgd }
427 1.1 cgd if(!objects[scroll->otyp].oc_name_known) {
428 1.1 cgd if(known && !confused) {
429 1.1 cgd objects[scroll->otyp].oc_name_known = 1;
430 1.1 cgd more_experienced(0,10);
431 1.1 cgd } else if(!objects[scroll->otyp].oc_uname)
432 1.1 cgd docall(scroll);
433 1.1 cgd }
434 1.1 cgd useup(scroll);
435 1.1 cgd return(1);
436 1.1 cgd }
437 1.1 cgd
438 1.1 cgd identify(otmp) /* also called by newmail() */
439 1.1 cgd register struct obj *otmp;
440 1.1 cgd {
441 1.1 cgd objects[otmp->otyp].oc_name_known = 1;
442 1.1 cgd otmp->known = otmp->dknown = 1;
443 1.1 cgd prinv(otmp);
444 1.1 cgd return(1);
445 1.1 cgd }
446 1.1 cgd
447 1.1 cgd litroom(on)
448 1.1 cgd register boolean on;
449 1.1 cgd {
450 1.1 cgd register num,zx,zy;
451 1.1 cgd
452 1.1 cgd /* first produce the text (provided he is not blind) */
453 1.1 cgd if(Blind) goto do_it;
454 1.1 cgd if(!on) {
455 1.1 cgd if(u.uswallow || !xdnstair || levl[u.ux][u.uy].typ == CORR ||
456 1.1 cgd !levl[u.ux][u.uy].lit) {
457 1.1 cgd pline("It seems even darker in here than before.");
458 1.1 cgd return;
459 1.1 cgd } else
460 1.1 cgd pline("It suddenly becomes dark in here.");
461 1.1 cgd } else {
462 1.1 cgd if(u.uswallow){
463 1.1 cgd pline("%s's stomach is lit.", Monnam(u.ustuck));
464 1.1 cgd return;
465 1.1 cgd }
466 1.1 cgd if(!xdnstair){
467 1.1 cgd pline("Nothing Happens.");
468 1.1 cgd return;
469 1.1 cgd }
470 1.1 cgd #ifdef QUEST
471 1.1 cgd pline("The cave lights up around you, then fades.");
472 1.1 cgd return;
473 1.1 cgd #else QUEST
474 1.1 cgd if(levl[u.ux][u.uy].typ == CORR) {
475 1.1 cgd pline("The corridor lights up around you, then fades.");
476 1.1 cgd return;
477 1.1 cgd } else if(levl[u.ux][u.uy].lit) {
478 1.1 cgd pline("The light here seems better now.");
479 1.1 cgd return;
480 1.1 cgd } else
481 1.1 cgd pline("The room is lit.");
482 1.1 cgd #endif QUEST
483 1.1 cgd }
484 1.1 cgd
485 1.1 cgd do_it:
486 1.1 cgd #ifdef QUEST
487 1.1 cgd return;
488 1.1 cgd #else QUEST
489 1.1 cgd if(levl[u.ux][u.uy].lit == on)
490 1.1 cgd return;
491 1.1 cgd if(levl[u.ux][u.uy].typ == DOOR) {
492 1.1 cgd if(IS_ROOM(levl[u.ux][u.uy+1].typ)) zy = u.uy+1;
493 1.1 cgd else if(IS_ROOM(levl[u.ux][u.uy-1].typ)) zy = u.uy-1;
494 1.1 cgd else zy = u.uy;
495 1.1 cgd if(IS_ROOM(levl[u.ux+1][u.uy].typ)) zx = u.ux+1;
496 1.1 cgd else if(IS_ROOM(levl[u.ux-1][u.uy].typ)) zx = u.ux-1;
497 1.1 cgd else zx = u.ux;
498 1.1 cgd } else {
499 1.1 cgd zx = u.ux;
500 1.1 cgd zy = u.uy;
501 1.1 cgd }
502 1.1 cgd for(seelx = u.ux; (num = levl[seelx-1][zy].typ) != CORR && num != 0;
503 1.1 cgd seelx--);
504 1.1 cgd for(seehx = u.ux; (num = levl[seehx+1][zy].typ) != CORR && num != 0;
505 1.1 cgd seehx++);
506 1.1 cgd for(seely = u.uy; (num = levl[zx][seely-1].typ) != CORR && num != 0;
507 1.1 cgd seely--);
508 1.1 cgd for(seehy = u.uy; (num = levl[zx][seehy+1].typ) != CORR && num != 0;
509 1.1 cgd seehy++);
510 1.1 cgd for(zy = seely; zy <= seehy; zy++)
511 1.1 cgd for(zx = seelx; zx <= seehx; zx++) {
512 1.1 cgd levl[zx][zy].lit = on;
513 1.1 cgd if(!Blind && dist(zx,zy) > 2)
514 1.1 cgd if(on) prl(zx,zy); else nosee(zx,zy);
515 1.1 cgd }
516 1.1 cgd if(!on) seehx = 0;
517 1.1 cgd #endif QUEST
518 1.1 cgd }
519 1.1 cgd
520 1.1 cgd /* Test whether we may genocide all monsters with symbol ch */
521 1.1 cgd monstersym(ch) /* arnold@ucsfcgl */
522 1.1 cgd register char ch;
523 1.1 cgd {
524 1.1 cgd register struct permonst *mp;
525 1.1 cgd extern struct permonst pm_eel;
526 1.1 cgd
527 1.1 cgd /*
528 1.1 cgd * can't genocide certain monsters
529 1.1 cgd */
530 1.1 cgd if (index("12 &:", ch))
531 1.1 cgd return FALSE;
532 1.1 cgd
533 1.1 cgd if (ch == pm_eel.mlet)
534 1.1 cgd return TRUE;
535 1.1 cgd for (mp = mons; mp < &mons[CMNUM+2]; mp++)
536 1.1 cgd if (mp->mlet == ch)
537 1.1 cgd return TRUE;
538 1.1 cgd return FALSE;
539 1.1 cgd }
540