- case 32: if ((rnd(23)==5) && (wizard==0)) /* sphere of annihilation */
- {
- beep(); lprcat("\nYou have been enveloped by the zone of nothingness!\n");
- nap(4000); died(258); return;
- }
- xl=playerx; yl=playery;
- loseint();
- i=dirsub(&xl,&yl); /* get direction of sphere */
- newsphere(xl,yl,i,rnd(20)+11); /* make a sphere */
- return;
-
- case 33: genmonst(); spelknow[33]=0; /* genocide */
- loseint();
- return;
-
- case 34: /* summon demon */
- if (rnd(100) > 30) { direct(x,150," The demon strikes at the %s",0); return; }
- if (rnd(100) > 15) { lprcat(" Nothing seems to have happened"); return; }
- lprcat(" The demon turned on you and vanished!"); beep();
- i=rnd(40)+30; lastnum=277;
- losehp(i); /* must say killed by a demon */ return;
-
- case 35: /* walk through walls */
- c[WTW] += rnd(10)+5; return;
-
- case 36: /* alter reality */
- {
- struct isave *save; /* pointer to item save structure */
- int sc; sc=0; /* # items saved */
- save = (struct isave *)malloc(sizeof(struct isave)*MAXX*MAXY*2);
- for (j=0; j<MAXY; j++)
- for (i=0; i<MAXX; i++) /* save all items and monsters */
- {
- xl = item[i][j];
- if (xl && xl!=OWALL && xl!=OANNIHILATION)
- {
- save[sc].type=0; save[sc].id=item[i][j];
- save[sc++].arg=iarg[i][j];
- }
- if (mitem[i][j])
- {
- save[sc].type=1; save[sc].id=mitem[i][j];
- save[sc++].arg=hitp[i][j];
- }
- item[i][j]=OWALL; mitem[i][j]=0;
- if (wizard) know[i][j]=1; else know[i][j]=0;
- }
- eat(1,1); if (level==1) item[33][MAXY-1]=0;
- for (j=rnd(MAXY-2), i=1; i<MAXX-1; i++) item[i][j]=0;
- while (sc>0) /* put objects back in level */
- {
- --sc;
- if (save[sc].type == 0)
- {
- int trys;
- for (trys=100, i=j=1; --trys>0 && item[i][j]; i=rnd(MAXX-1), j=rnd(MAXY-1));
- if (trys) { item[i][j]=save[sc].id; iarg[i][j]=save[sc].arg; }
- }
- else
- { /* put monsters back in */
- int trys;
- for (trys=100, i=j=1; --trys>0 && (item[i][j]==OWALL || mitem[i][j]); i=rnd(MAXX-1), j=rnd(MAXY-1));
- if (trys) { mitem[i][j]=save[sc].id; hitp[i][j]=save[sc].arg; }
- }
- }
- loseint();
- draws(0,MAXX,0,MAXY); if (wizard==0) spelknow[36]=0;
- free((char*)save); positionplayer(); return;
+ case 32:
+ if ((rnd(23) == 5) && (wizard == 0)) { /* sphere of
+ * annihilation */
+ beep();
+ lprcat("\nYou have been enveloped by the zone of nothingness!\n");
+ nap(4000);
+ died(258);
+ return;
+ }
+ xl = playerx;
+ yl = playery;
+ loseint();
+ i = dirsub(&xl, &yl); /* get direction of sphere */
+ newsphere(xl, yl, i, rnd(20) + 11); /* make a sphere */
+ return;
+
+ case 33:
+ genmonst();
+ spelknow[33] = 0; /* genocide */
+ loseint();
+ return;
+
+ case 34: /* summon demon */
+ if (rnd(100) > 30) {
+ direct(x, 150, " The demon strikes at the %s", 0);
+ return;
+ }
+ if (rnd(100) > 15) {
+ lprcat(" Nothing seems to have happened");
+ return;
+ }
+ lprcat(" The demon turned on you and vanished!");
+ beep();
+ i = rnd(40) + 30;
+ lastnum = 277;
+ losehp(i); /* must say killed by a demon */
+ return;
+
+ case 35: /* walk through walls */
+ c[WTW] += rnd(10) + 5;
+ return;
+
+ case 36: /* alter reality */
+ {
+ struct isave *save; /* pointer to item save
+ * structure */
+ int sc;
+ sc = 0; /* # items saved */
+ save = (struct isave *) malloc(sizeof(struct isave) * MAXX * MAXY * 2);
+ for (j = 0; j < MAXY; j++)
+ for (i = 0; i < MAXX; i++) { /* save all items and
+ * monsters */
+ xl = item[i][j];
+ if (xl && xl != OWALL && xl != OANNIHILATION) {
+ save[sc].type = 0;
+ save[sc].id = item[i][j];
+ save[sc++].arg = iarg[i][j];
+ }
+ if (mitem[i][j]) {
+ save[sc].type = 1;
+ save[sc].id = mitem[i][j];
+ save[sc++].arg = hitp[i][j];