[comp.sources.games] v07i031: omega3 - rogue like dungeon exploration

billr@saab.CNA.TEK.COM (Bill Randle) (07/14/89)

Submitted-by: "Laurence R. Brothers"   <brothers@paul.rutgers.edu>
Posting-number: Volume 7, Issue 31
Archive-name: omega3/Part12
Supersedes: omega2: Volume 5, Issue 12-29,38-40



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 12 (of 20)."
# Contents:  oeffect1.c oglob.h omegahi.bak osite2.c
# Wrapped by billr@saab on Thu Jun 29 08:14:07 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'oeffect1.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oeffect1.c'\"
else
echo shar: Extracting \"'oeffect1.c'\" \(17957 characters\)
sed "s/^X//" >'oeffect1.c' <<'END_OF_FILE'
X
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
X/* oeffect1.c */
X
X#include "oglob.h"
X
X
X/* enchant */
Xvoid enchant(delta)
Xint delta;
X{
X  int i,used = FALSE;
X  float mult;
X
X  if (delta < 0) {
X    i = random_item();
X    if (i == ABORT) {
X      print1("You feel fortunate.");
X      morewait();
X    }
X    else {
X      if (Player.possessions[i]->blessing < 0) {
X	print1("The item glows, but the glow flickers out...");
X	morewait();
X      }
X      else {
X	used = (Player.possessions[i]->used);
X	if (used) {
X	  Player.possessions[i]->used = FALSE;
X	  item_use(Player.possessions[i]);
X	} 
X	print1("Your ");
X	nprint1(itemid(Player.possessions[i]));
X	nprint1(" radiates an aura of mundanity!");
X	morewait();
X	Player.possessions[i]->plus = 0;
X	Player.possessions[i]->charge = -1;
X	Player.possessions[i]->usef = I_NOTHING;
X	if (used) {
X	  Player.possessions[i]->used = TRUE;
X	  item_use(Player.possessions[i]);      
X	}
X      }
X    }
X  }
X  else {
X    i = getitem(NULL);
X    if (i == ABORT) {
X      print1("You feel unlucky.");
X      morewait();
X    }
X    else if (i == CASHVALUE) {
X      print1("You enchant your money.... What a concept!");
X      mult = 1 + (random_range(7)-3)/6.0;
X      if (mult > 1.0) print2("Seems to have been a good idea!");
X      else print2("Maybe it wasn't such a good idea....");
X#ifndef MSDOS
X      Player.cash = ((int) (mult*Player.cash));
X#else
X      Player.cash = ((long) (mult*Player.cash));
X#endif
X      morewait();
X    }
X    else {
X      if (Player.possessions[i]->plus > random_range(20)+1) {
X	print1("Uh-oh, the force of the enchantment was too much!");
X	print2("There is a loud explosion!");
X	morewait();
X	manastorm(Player.x,Player.y,Player.possessions[i]->plus*5);
X	dispose_lost_objects(1,Player.possessions[i]);
X      }
X      else {
X	used = (Player.possessions[i]->used);
X	if (used) {
X	  setgamestatus(SUPPRESS_PRINTING);
X	  Player.possessions[i]->used = FALSE;
X	  item_use(Player.possessions[i]);
X	  resetgamestatus(SUPPRESS_PRINTING);
X	}
X	print1("The item shines!");
X	morewait();
X	Player.possessions[i]->plus += delta+1;
X	if (Player.possessions[i]->charge > -1)
X	  Player.possessions[i]->charge += 
X	    ((delta+1) * (random_range(10) + 1));
X	if (used) {
X	  setgamestatus(SUPPRESS_PRINTING);
X	  Player.possessions[i]->used = TRUE;
X	  item_use(Player.possessions[i]);      
X	  resetgamestatus(SUPPRESS_PRINTING);
X	}
X      }
X    }
X    calc_melee();
X  }
X}
X
X/* bless */
Xvoid bless(blessing)
Xint blessing;
X{
X  int index,used;
X
X  if (blessing < 0) {
X    index = random_item();
X    if (index == ABORT) {
X      print1("You feel fortunate.");
X      morewait();
X    }
X    else {
X      print1("A foul odor arises from your ");
X      nprint1(itemid(Player.possessions[index]));
X      morewait();
X      used = (Player.possessions[index]->used);
X      if (used) {
X	setgamestatus(SUPPRESS_PRINTING);
X	Player.possessions[index]->used = FALSE;
X	item_use(Player.possessions[index]);
X	resetgamestatus(SUPPRESS_PRINTING);
X      }
X      Player.possessions[index]->blessing -= 2;
X      if (Player.possessions[index]->blessing < 0) 
X	Player.possessions[index]->plus =
X	  abs(Player.possessions[index]->plus) - 1;
X      if (used) {
X	setgamestatus(SUPPRESS_PRINTING);
X	Player.possessions[index]->used = TRUE;
X	item_use(Player.possessions[index]);      
X	resetgamestatus(SUPPRESS_PRINTING);
X      }
X    }
X  }
X  else {
X    index = getitem(NULL);
X    if (index == CASHVALUE) {
X      print1("Blessing your money has no effect.");
X      morewait();
X    }
X    else if (index != ABORT) {
X      used = (Player.possessions[index]->used == TRUE);
X      if (used) {
X	setgamestatus(SUPPRESS_PRINTING);
X	Player.possessions[index]->used = FALSE;
X	item_use(Player.possessions[index]);      
X	resetgamestatus(SUPPRESS_PRINTING);
X      }
X      print1("A pure white light surrounds the item... ");
X      if (Player.possessions[index]->blessing < 0-(blessing+1)) {
X	print2("which is evil enough to resist the effect of the blessing!");
X        morewait();
X      }
X      else if (Player.possessions[index]->blessing < -1) {
X	print2("which disintegrates under the influence of the holy aura!");
X        morewait();
X	Player.itemweight -=  Player.possessions[index]->weight;
X	dispose_lost_objects(1,Player.possessions[index]);
X      }
X      else if (Player.possessions[index]->blessing < blessing+1) {
X	print2("which now seems affected by afflatus!");
X	morewait();
X	Player.possessions[index]->blessing++;
X	Player.possessions[index]->plus =
X	  abs(Player.possessions[index]->plus)+1;
X      }
X      else {
X        print2("The hierolux fades without any appreciable effect....");
X        morewait();
X      }
X      if (used && (Player.possessions[index] != NULL)) {
X	setgamestatus(SUPPRESS_PRINTING);
X	Player.possessions[index]->used = TRUE;
X	item_use(Player.possessions[index]);     
X	resetgamestatus(SUPPRESS_PRINTING);
X      } 
X    }
X  }
X  calc_melee();
X}
X
X
X
Xvoid heal(amount)
Xint amount;
X{
X  if (amount > -1) {
X    mprint("You feel better.");
X    Player.hp += random_range(10*amount)+1;
X    Player.status[BLINDED] = 0;
X    if (Player.hp > Player.maxhp)
X      Player.hp = Player.maxhp + amount;
X  }
X  else {
X    mprint("You feel unwell.");
X    Player.hp -= random_range(10*abs(amount)+1);
X    if (Player.hp < 0)
X      p_death("magical disruption");
X  }
X  dataprint();
X}
X
X
Xvoid fbolt(fx,fy,tx,ty,hit,dmg)
Xint fx,fy,tx,ty,hit,dmg;
X{
X  bolt(fx,fy,tx,ty,hit,dmg,FLAME);
X}
X
Xvoid lbolt(fx,fy,tx,ty,hit,dmg)
Xint fx,fy,tx,ty,hit,dmg;
X{
X  bolt(fx,fy,tx,ty,hit,dmg,ELECTRICITY);
X}
X
Xvoid nbolt(fx,fy,tx,ty,hit,dmg)
Xint fx,fy,tx,ty,hit,dmg;
X{
X  bolt(fx,fy,tx,ty,hit,dmg,NORMAL_DAMAGE);
X}
X
X
X/* from f to t */
Xvoid bolt(fx,fy,tx,ty,hit,dmg,dtype)
Xint fx,fy,tx,ty,hit,dmg,dtype;
X{
X  int xx,yy;
X  struct monster *target;
X  char boltchar;
X  xx = fx; yy = fy;
X  
X  switch(dtype) {
X    case FLAME:boltchar='*';break;
X    case ELECTRICITY:boltchar = '^';break;
X    case NORMAL_DAMAGE:boltchar = '!';break;
X  }
X
X  do_los(boltchar,&xx,&yy,tx,ty);
X
X  if ((xx == Player.x) && (yy == Player.y)) {
X    if (Player.status[DEFLECTION] > 0) 
X      mprint("The bolt just missed you!");
X    else {
X      switch (dtype) {
X      case FLAME:
X	mprint("You were blasted by a firebolt!");
X	p_damage(random_range(dmg),dtype,"a firebolt");
X	break;
X      case ELECTRICITY:
X	mprint("You were zapped by lightning!");
X	p_damage(random_range(dmg),dtype,"a bolt of lightning");
X	break;
X      case NORMAL_DAMAGE:
X	mprint("You were hit by a missile!");
X	p_damage(random_range(dmg),dtype,"a missile");
X	break;
X      }
X    }
X  }
X  else if (NULL != (target = Level->site[xx][yy].creature)) {
X    if (hitp(hit,target->ac)) {
X      if (target->uniqueness == COMMON) {
X	strcpy(Str1,"The ");
X	strcat(Str1,target->monstring);
X      }
X      else strcpy(Str1,target->monstring);
X      switch (dtype) {
X      case FLAME:strcat(Str1," was blasted by a firebolt!");break;
X      case ELECTRICITY:strcat(Str1," was zapped by lightning!");break;
X      case NORMAL_DAMAGE:strcat(Str1," was hit by a missile!"); break;
X      }
X      mprint(Str1);
X      m_status_set(target,HOSTILE);
X      m_damage(target,random_range(dmg),dtype);
X    }
X    else {
X      if (target->uniqueness == COMMON) {
X	strcpy(Str1,"The ");
X	strcat(Str1,target->monstring);
X      }
X      else strcpy(Str1,target->monstring);
X      switch (dtype) {
X      case FLAME:strcat(Str1," was missed by a firebolt!");break;
X      case ELECTRICITY:strcat(Str1," was missed by lightning!");break;
X      case NORMAL_DAMAGE:strcat(Str1," was missed by a missile!"); break;
X      }
X      mprint(Str1);
X    }
X  }
X  else if (Level->site[xx][yy].locchar == HEDGE)
X    if (Level->site[xx][yy].p_locf == L_HEDGE) {
X      if ((dtype == FLAME)||(dtype == ELECTRICITY)) {
X	mprint("The hedge is blasted away!");
X	Level->site[xx][yy].p_locf = L_NO_OP;
X	Level->site[xx][yy].locchar = FLOOR;
X      }
X      else mprint("The hedge is unaffected.");
X    }
X    else mprint("The trifid absorbs the energy and laughs!");
X  else if (Level->site[xx][yy].locchar == WATER)
X    if (dtype == FLAME) {
X      mprint("The water is vaporised!");
X      Level->site[xx][yy].p_locf = L_NO_OP;
X      Level->site[xx][yy].locchar = FLOOR;
X    }
X}
X
X
Xvoid lball(fx,fy,tx,ty,dmg)
Xint fx,fy,tx,ty,dmg;
X{
X  ball(fx,fy,tx,ty,dmg,ELECTRICITY);
X}
X
Xvoid manastorm(x,y,dmg)
Xint x,y,dmg;
X{
X  ball(x,y,x,y,dmg,UNSTOPPABLE);
X}
X
Xvoid snowball(fx,fy,tx,ty,dmg)
Xint fx,fy,tx,ty,dmg;
X{
X  ball(fx,fy,tx,ty,dmg,COLD);
X}
X
Xvoid fball(fx,fy,tx,ty,dmg)
Xint fx,fy,tx,ty,dmg;
X{
X  ball(fx,fy,tx,ty,dmg,FLAME);
X}
X
X
X/* from f to t */
Xvoid ball(fx,fy,tx,ty,dmg,dtype)
Xint fx,fy,tx,ty,dmg,dtype;
X{
X  int xx,yy,ex,ey,i;
X  struct monster *target;
X  char expchar='@';
X
X  xx = fx; yy = fy;
X
X  switch(dtype){
X    case FLAME:expchar='*';break;
X    case COLD:expchar='o';break;
X    case ELECTRICITY:expchar='^';break;
X  }
X
X  do_los(expchar,&xx,&yy,tx,ty);
X  draw_explosion(expchar,xx,yy);
X  for(i=0;i<9;i++) {
X    ex = xx + Dirs[0][i];
X    ey = yy + Dirs[1][i];
X    
X    if ((ex == Player.x) && (ey == Player.y)) {
X      switch(dtype) {
X	case FLAME:mprint("You were blasted by a fireball!");
X	  p_damage(random_range(dmg),FLAME,"a fireball");
X	  break;
X	case COLD:mprint("You were blasted by a snowball!");
X	  p_damage(random_range(dmg),COLD,"a snowball");
X	  break;
X	case ELECTRICITY:mprint("You were blasted by ball lightning!");
X	  p_damage(random_range(dmg),ELECTRICITY,"ball lightning");
X	  break;
X	case UNSTOPPABLE:mprint("Oh No! Manastorm!");
X	  p_damage(random_range(dmg),UNSTOPPABLE,"a manastorm!");
X	  break;
X      }
X    }
X    else if (NULL != (target = Level->site[ex][ey].creature)) {
X      if (los_p(Player.x,Player.y,target->x,target->y)) {
X      if (target->uniqueness == COMMON) {
X	strcpy(Str1,"The ");
X	strcat(Str1,target->monstring);
X      }
X      else strcpy(Str1,target->monstring);
X	switch(dtype) {
X	  case FLAME:strcat(Str1," was zorched by a fireball!"); break;
X	  case COLD:strcat(Str1," was blasted by a snowball!"); break;
X	  case ELECTRICITY:strcat(Str1," was zapped by ball lightning!");break;
X	  case UNSTOPPABLE:strcat(Str1," was nuked by a manastorm!");break;
X	}
X	mprint(Str1);
X      }
X      m_status_set(target,HOSTILE);
X      m_damage(target,random_range(dmg),dtype);
X    }
X    else if (Level->site[ex][ey].locchar == HEDGE)
X      if (Level->site[ex][ey].p_locf == L_HEDGE) {
X	if ((dtype == FLAME)||(dtype == ELECTRICITY)) {
X	  mprint("The hedge is blasted away!");
X	  Level->site[ex][ey].p_locf = L_NO_OP;
X	  Level->site[ex][ey].locchar = FLOOR;
X	}
X	else mprint("The hedge is unaffected.");
X      }
X      else mprint("The trifid absorbs the energy and laughs!");
X    else if (Level->site[xx][yy].locchar == WATER)
X      if (dtype == FLAME) {
X	mprint("The water is vaporised!");
X	Level->site[xx][yy].p_locf = L_NO_OP;
X	Level->site[xx][yy].locchar = FLOOR;
X      }
X  }
X}
X
X
X
X
Xvoid mondet(blessing)
Xint blessing;    
X{
X  pml ml;
X  for (ml=Level->mlist;ml!=NULL;ml=ml->next) 
X    if (ml->m->hp > 0)
X      plotmon(blessing > -1 ? ml->m : &(Monsters[random_range(NUMMONSTERS)]));
X  levelrefresh();
X  morewait();
X  erase_level();
X  show_screen();
X}
X
X
Xvoid objdet(blessing)
Xint blessing;     
X{
X  int i,j;
X  for (i=0;i<WIDTH;i++)
X    for (j=0;j<LENGTH;j++) 
X      if (Level->site[i][j].things != NULL) {
X	if (blessing < 0)
X	  putspot(random_range(WIDTH),
X		  random_range(LENGTH),
X		  Level->site[i][j].things->thing->objchar);
X	else putspot(i,j,Level->site[i][j].things->thing->objchar);
X      }
X  levelrefresh();
X  morewait();
X  erase_level();
X  show_screen();
X}
X
Xvoid identify(blessing)
X{
X  int index;
X
X  clearmsg();
X
X  if (blessing == 0) {
X    print1("Identify:");
X    index = getitem(NULL);
X    if (index == CASHVALUE) print3("Your money is really money.");
X    else if (index == ABORT)
X      setgamestatus(SKIP_MONSTERS);
X    else {
X      if (Player.possessions[index]->objchar == FOOD)
X	Player.possessions[index]->known = 1;
X      else {
X	Player.possessions[index]->known = 2;
X	Objects[Player.possessions[index]->id].known = 1;
X      }
X      print1("Identified: ");
X      mprint(itemid(Player.possessions[index]));
X    }
X  }
X  else if (blessing < 0) {
X    print2("You feel forgetful.");
X    for (index=0;index<MAXITEMS;index++) 
X      if (Player.possessions[index] != NULL) {
X	Player.possessions[index]->known = 0;
X	Objects[Player.possessions[index]->id].known = 0;
X      }
X  }
X  else {
X    print2("You feel encyclopaedic.");
X    for (index=0;index<MAXITEMS;index++)
X      if (Player.possessions[index] != NULL) {
X	if (Player.possessions[index]->objchar == FOOD)
X	  Player.possessions[index]->known = 1;
X	else {
X	  Player.possessions[index]->known = 2;
X	  Objects[Player.possessions[index]->id].known = 1;
X	}
X      }
X    for (index=0;index<Player.packptr;index++)
X      if (Player.pack[index] != NULL) {
X	if (Player.pack[index]->objchar == FOOD)
X	  Player.pack[index]->known = 1;
X	else {
X	  Player.pack[index]->known = 2;
X	  Objects[Player.pack[index]->id].known = 1;
X	}
X      }
X  }
X  calc_melee();
X}
X
X
X
X
X/* returns index of random item, ABORT if player carrying none */
Xint random_item()
X{
X  int item,tries=0;
X  int done = FALSE;
X
X  for(tries=0;((tries<MAXITEMS)&&(!done));tries++) {
X    item = random_range(MAXITEMS);
X    done = (Player.possessions[item] != NULL);
X  }
X  return(done ? item : ABORT);
X}
X
X  
X/* various kinds of wishes */
Xvoid wish(blessing)
Xint blessing;
X{
X  int i;
X  char wishstr[80];
X  clearmsg();
X  print1("What do you wish for? ");
X  if (blessing < 0) deathprint();
X  strcpy(wishstr,msgscanstring());
X  if (strcmp(wishstr,"Death")==0) {
X    print2("As you wish, so shall it be.");
X    p_death("a deathwish");
X  }
X  if (strcmp(wishstr,"Power")==0) {
X    print2("You feel a sudden surge of energy");
X    Player.mana=calcmana()*10;
X  }
X  else if (strcmp(wishstr,"Skill")==0) {
X    print2("You feel more competent.");
X    gain_experience(min(10000,Player.xp));
X  }
X  else if (strcmp(wishstr,"Wealth")==0) {
X    print2("You are submerged in shower of gold pieces!");
X    Player.cash += 10000;
X  }
X  else if (strcmp(wishstr,"Balance")==0) {
X    print2("You feel neutral.");
X    Player.alignment = 0;
X  }
X  else if (strcmp(wishstr,"Chaos")==0) {
X    print2("You feel chaotic.");
X    Player.alignment -= 25;
X  }
X  else if (strcmp(wishstr,"Law")==0) {
X    print2("You feel lawful.");
X    Player.alignment += 25;
X  }
X  else if (strcmp(wishstr,"Location")==0)
X    strategic_teleport(1);
X  else if (strcmp(wishstr,"Knowledge")==0) {
X    print2("You feel more knowledgeable.");
X    i = random_range(NUMSPELLS);
X    if (Spells[i].known) 
X      Spells[i].powerdrain =
X	(max(1,Spells[i].powerdrain/2));
X    else Spells[i].known = TRUE;
X  }
X  else if (strcmp(wishstr,"Health")==0) {
X    print2("You feel vigorous");
X    Player.hp = Player.maxhp;
X    Player.status[DISEASED] = 0;
X    Player.status[POISONED] = 0;
X  }
X  else if (strcmp(wishstr,"Destruction")==0)
X#ifndef MSDOS
X    annihilate(gamestatusp(CHEATED));
X#else
X    annihilate(gamestatusp(CHEATED) != 0);
X#endif
X  else if (strcmp(wishstr,"Acquisition")==0)
X#ifndef MSDOS
X    acquire(gamestatusp(CHEATED));
X#else
X    acquire(gamestatusp(CHEATED) != 0);
X#endif
X  else if (strcmp(wishstr,"Summoning")==0)
X#ifndef MSDOS
X    summon(gamestatusp(CHEATED),-1);
X#else
X    summon((gamestatusp(CHEATED) != 0),-1);
X#endif
X  else print2("You feel stupid.");
X  dataprint();
X  showflags();
X}
X
X/* gain for an item */
Xvoid acquire(blessing)
Xint blessing;
X{
X  char otype;
X  int index,id = ABORT;
X  pob newthing;
X
X  if (blessing < 0) {
X    index = random_item();
X    if (index == ABORT)
X      mprint("You feel fortunate.");
X    else {
X      print1("Smoke drifts out of your pack.... ");
X      print2("Destroyed: ");
X      nprint2(itemid(Player.possessions[index]));
X      morewait();
X      dispose_lost_objects(1,Player.possessions[index]);
X    }
X  }
X  else if (blessing == 0) {
X    print1("You magically acquire an object!");
X    morewait();
X    newthing = ((pob) malloc(sizeof(objtype)));
X    *newthing = Objects[random_range(TOTALITEMS)];
X    newthing->used = FALSE;
X    gain_item(newthing);
X  }
X  else {
X    newthing = ((pob) malloc(sizeof(objtype)));
X    newthing->id = -1;
X    
X    print1("Acquire which kind of item: !?][}{)/=%%\\ ");
X    otype = mgetc();
X    nprint1("Item ID? ");
X    switch (otype) {
X    case POTION: 
X      id = itemlist(POTIONID,NUMPOTIONS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_potion(newthing,id); 
X      break;
X    case SCROLL:
X      id = itemlist(SCROLLID,NUMSCROLLS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_scroll(newthing,id); 
X      break;
X    case RING: 
X      id = itemlist(RINGID,NUMRINGS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_ring(newthing,id); 
X      break;
X    case STICK:
X      id = itemlist(STICKID,NUMSTICKS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_stick(newthing,id); 
X      break;
X    case ARMOR: 
X      id = itemlist(ARMORID,NUMARMOR);
X      if (id < 0) print2("You feel stupid."); 
X      else make_armor(newthing,id); 
X      break;
X    case SHIELD:
X      id = itemlist(SHIELDID,NUMSHIELDS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_shield(newthing,id); 
X      break;
X    case WEAPON:
X      id = itemlist(WEAPONID,NUMWEAPONS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_weapon(newthing,id); 
X      break;
X    case BOOTS:
X      id = itemlist(BOOTID,NUMBOOTS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_boots(newthing,id); 
X      break;
X    case CLOAK: 
X      id = itemlist(CLOAKID,NUMCLOAKS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_cloak(newthing,id); 
X      break;
X    case FOOD: 
X      id = itemlist(FOODID,NUMFOODS);
X      if (id < 0) print2("You feel stupid."); 
X      else make_food(newthing,id); 
X      break;
X    case THING:
X      id = itemlist(THINGID,10); /* crock to avoid grot*/
X      if (id < 0) print2("You feel stupid."); 
X      else make_thing(newthing,id); 
X      break;
X    }
X    xredraw();
X    if (id != ABORT) {
X      newthing->known = 2;
X      Objects[id].known = 1;
X      gain_item(newthing);
X    }
X  }
X}
END_OF_FILE
if test 17957 -ne `wc -c <'oeffect1.c'`; then
    echo shar: \"'oeffect1.c'\" unpacked with wrong size!
fi
# end of 'oeffect1.c'
fi
if test -f 'oglob.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oglob.h'\"
else
echo shar: Extracting \"'oglob.h'\" \(5702 characters\)
sed "s/^X//" >'oglob.h' <<'END_OF_FILE'
X/* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */
X
X/* this file contains extern declarations of global variables used
X   throughout the program */
X/* it includes the other header files, so every program module 
X(except o.c) can just include this file. */
X
X/* oglob.h */
X
X#include "odefs.h"
X
X#include "oextern.h"
X
X/* one of each monster */
Xextern struct monster Monsters[NUMMONSTERS];
X
X/* one of each spell */
Xextern struct spell Spells[NUMSPELLS+1];
X
X/* one of each item */
Xextern struct object Objects[TOTALITEMS];
X
X/* locations of city sites [0] - found, [1] - x, [2] - y */
Xextern int CitySiteList[NUMCITYSITES][3];
X
Xextern struct player Player;                 
X/* the player */
X
Xextern int LENGTH;
X/* level y dimension */
X
Xextern int WIDTH;
X/* level x dimension */
X
X#ifndef MSDOS
Xextern int GameStatus;
X#else
Xextern long GameStatus;
X#endif
X/* Game Status bit vector */
X
Xextern int ScreenLength;
X/* How large is level window */
X
Xextern struct terrain Country[MAXWIDTH][MAXLENGTH];
X/* The countryside */
X
X#ifdef MSDOS
Xextern struct level TheLevel;
X#endif
X
Xextern struct level *City;
X/* The city of Rampart */
X
Xextern struct level *TempLevel;
X/* Place holder */
X
Xextern struct level *Dungeon;
X/* Pointer to current Dungeon */
X
Xextern struct level *Level;
X/* Pointer to current Level */
X
Xextern int Current_Dungeon;
X/* What is Dungeon now (an E_ constant) */
X
Xextern int Villagenum;
X/* Current Village number */ 
X
Xextern int ScreenOffset;
X/* Offset of displayed screen to level */
X
Xextern int MaxDungeonLevels;
X/*Deepest level allowed in dungeon */
X
Xextern int Current_Environment;
X/* Which environment are we in (an E_ constant) */
X
Xextern int Last_Environment;
X/* Which environment were we in last (an E_ constant) */
X
Xextern int Dirs[2][9];                       
X/* 9 xy directions */
X
Xextern char Cmd;                         
X/* last player command */
X
Xextern int Command_Duration;
X/* how long does current command take */
X
Xextern struct monster *Arena_Monster;
X/* Opponent in arena */
X
Xextern int Arena_Opponent;
X/* case label of opponent in l_arena()*/
X
Xextern int Arena_Victory;
X/* did player win in arena? */
X
Xextern int Imprisonment;
X/* amount of time spent in jail */
X
Xextern int Precipitation;
X/* Hours of rain, snow, etc */
X
Xextern int Phase;
X/* Phase of the moon */
X
Xextern int Lunarity;
X/* How player is affected by moon */
X
Xextern int Date;
X/* day of the year */
X
Xextern int Pawndate;
X/* Pawn Shop item generation date */
X
Xextern pob Pawnitems[PAWNITEMS];
X/* items in pawn shop */
X
Xextern int ViewHour;
X/* crystal ball use marker */
X
Xextern int ZapHour;
X/* staff of enchantment use marker */
X
Xint HelmHour;
X/* helm of teleportation use marker*/
X
Xextern int SymbolUseHour;                
X/* holy symbol use marker */
X
Xextern int Constriction;
X/* Dragonlord Attack State */
X
Xextern int Blessing;
X/* Altar Blessing State */
X
Xextern int LastDay;
X/* DPW date of dole */
X
Xextern int RitualHour;
X/* last use of ritual magic */
X
Xextern int RitualRoom;
X/* last room use of ritual magic */
X
Xextern int Lawstone;
X/* magic stone counter */
X
Xextern int Chaostone;
X/* magic stone counter */
X
Xextern int Mindstone;
X/* magic stone counter */
X
Xextern int Searchnum;                    
X/* number of times to search on 's' */
X
Xextern int Verbosity;
X/* verbosity level */
X
Xextern char Seed;                            
X/* random seed */
X
X#ifndef MSDOS
Xextern int Time;
X#else
Xextern long Time;
X#endif
X/* turn number */
X
Xextern int Tick;
X/* current second in minute; action coordinator */
X
Xextern char Stringbuffer[10][80];
X/* the last printed strings */
X
X#ifndef MSDOS
Xextern int Gymcredit;
X#else
Xextern long Gymcredit;
X#endif
X/* credit at rampart gym */
X
Xextern int Spellsleft;
X/* research allowance at college */
X
Xextern int StarGemUse;
X/* last date of star gem use */
X
Xextern int HiMagicUse;
X/* last date of high magic use */
X
Xextern int HiMagic;
X/* current level for l_throne */ 
X
X#ifndef MSDOS
Xextern int Balance;
X#else
Xextern long Balance;
X#endif
X/* bank account */
X
X#ifndef MSDOS
Xextern int FixedPoints;
X#else
Xextern long FixedPoints;
X#endif
X/* points are frozen after adepthood*/
X
Xextern int LastCountryLocX;
X/* previous position in countryside */
X
Xextern int LastCountryLocY;
X/* previous position in countryside */
X
Xextern int LastTownLocX;
X/* previous position in village or city */
X
Xextern int LastTownLocY;
X/* previous position in village or city */
X
Xextern char Password[64];
X/* autoteller password */
X
Xpol Condoitems;
X/* items in condo */
X
Xextern char Str1[100],Str2[100],Str3[100],Str4[100];
X/* Some string space, random uses */
X
X
X
X/* high score names, levels, behavior */
X
Xextern int Shadowlordbehavior,Archmagebehavior,Primebehavior,Justiciarbehavior;
Xextern int Commandantbehavior,Chaoslordbehavior,Lawlordbehavior;
Xextern int Championbehavior,Priestbehavior[7],Hibehavior,Dukebehavior;
Xextern char Shadowlord[80],Archmage[80],Prime[80],Commandant[80],Duke[80];
Xextern char Champion[80],Priest[7][80],Hiscorer[80],Hidescrip[80];
Xextern char Chaoslord[80],Lawlord[80],Justiciar[80];
Xextern int Shadowlordlevel,Archmagelevel,Primelevel,Commandantlevel,Dukelevel;
X#ifndef MSDOS
Xextern int Championlevel,Priestlevel[7],Hiscore,Hilevel,Justiciarlevel;
X#else
Xextern int Championlevel,Priestlevel[7],Hilevel,Justiciarlevel;
Xextern long Hiscore;
X#endif
Xextern int Chaoslordlevel,Lawlordlevel,Chaos,Law;
X
X/* New globals which used to be statics */
Xextern int twiddle;
Xextern int saved;
Xextern int onewithchaos;
Xextern int club_hinthour;
Xextern int winnings;
Xextern int tavern_hinthour;
Xextern int scroll_ids[30];
Xextern int potion_ids[30];
Xextern int stick_ids[30];
Xextern int ring_ids[30];
Xextern int cloak_ids[30];
Xextern int boot_ids[30];
X
Xextern int deepest[E_MAX + 1];
END_OF_FILE
if test 5702 -ne `wc -c <'oglob.h'`; then
    echo shar: \"'oglob.h'\" unpacked with wrong size!
fi
# end of 'oglob.h'
fi
if test -f 'omegahi.bak' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'omegahi.bak'\"
else
echo shar: Extracting \"'omegahi.bak'\" \(283 characters\)
sed "s/^X//" >'omegahi.bak' <<'END_OF_FILE'
XZippy
XKilled by a pun
X0
X0
X2713
XArioch
X10
X-100
X2712
XAriel
X10
X100
X2711
XCormorant
X10
X2718
XMorgon
X10
X2718
XSonders
X10
X2713
XSpartacus
X10
X2713
XOz
X10
X2933
XBlackskull
X10
X2932
XShadowspawn
X10
X2712
XGallow
X10
X2711
XKharst
X10
X2712
XAllana
X10
X2931
XDara
X10
X2932
XThistleman
X10
X2933
XHumperdinck
X10
X5718
END_OF_FILE
if test 283 -ne `wc -c <'omegahi.bak'`; then
    echo shar: \"'omegahi.bak'\" unpacked with wrong size!
fi
# end of 'omegahi.bak'
fi
if test -f 'osite2.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'osite2.c'\"
else
echo shar: Extracting \"'osite2.c'\" \(27051 characters\)
sed "s/^X//" >'osite2.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
X/* osite2.c */
X/* 2nd half of site functions and aux functions to them */
X
X#include "oglob.h"
X
X
X
Xvoid l_condo()
X{
X  pol ol,prev=NULL;
X  int i,done=FALSE,over=FALSE,weeksleep=FALSE;
X  char response;
X
X  if (! gamestatusp(SOLD_CONDO)) {
X    print1("Rampart Arms. Weekly Rentals and Purchases");
X    print2("Which are you interested in [r,p, or ESCAPE] ");
X    response = mgetc();
X    if (response == 'p') {
X      print2("Only 50,000Au. Buy it? [yn] ");
X      if (ynq2()=='y') {
X	if (Player.cash < 50000) 
X	  print3("No mortgages, buddy.");
X	else {
X	  setgamestatus(SOLD_CONDO);
X	  Player.cash-=50000;
X	  dataprint();
X	  print2("You are the proud owner of a luxurious condo penthouse.");
X	  Condoitems = NULL;
X	}
X      }
X    }
X    else if (response == 'r') {
X      print2("Weekly Rental, 1000Au. Pay for it? [yn] ");
X      if (ynq2()=='y') {
X	if (Player.cash < 1000)
X	  print2("Hey, pay the rent or out you go....");
X	else {
X	  weeksleep = TRUE;
X	  Player.cash -=1000;
X	  dataprint();
X	}
X      }
X    }
X    else print2("Please keep us in mind for your housing needs.");
X  }
X  else {
X    while (! done) {
X      menuclear();
X      menuprint("Home Sweet Home");
X      menuprint("a: Leave items in your safe.\n");
X      menuprint("b: Retrieve items.\n");
X      menuprint("c: Take a week off to rest.\n");
X      menuprint("d: Retire permanently.\n");
X      menuprint("ESCAPE: Leave this place.\n");
X      response = mcigetc();
X      if (response == 'a') {
X	i = getitem(NULL);
X	if (i != ABORT) {
X	  if (Player.possessions[i]->blessing < 0) 
X	    print2("The item just doesn't want to be stored away...");
X	  else {
X	    ol = ((pol) malloc(sizeof(oltype)));
X	    ol->thing = Player.possessions[i];
X	    ol->next = Condoitems;
X	    Condoitems = ol;
X	    conform_lost_objects(Player.possessions[i]->number,
X				 Player.possessions[i]);
X	  }
X	}
X      }
X      else if (response == 'b') {
X	ol = Condoitems;
X	while ((ol != NULL) && (! over)) {
X	  print1("Retrieve ");
X	  nprint1(itemid(ol->thing));
X	  nprint1(" [ynq] ");
X	  response = mcigetc();
X	  if (response == 'y') {
X	    gain_item(ol->thing);
X	    if (ol == Condoitems)
X	      Condoitems = Condoitems->next;
X	    else if (prev != NULL) prev->next = ol->next;
X	  }
X	  else if (response == 'q')
X	    over = TRUE;
X	  prev = ol;
X	  ol = ol->next;
X	}
X      }
X      else if (response == 'c') weeksleep = TRUE;
X      else if (response == 'd') {
X	clearmsg();
X	print1("You sure you want to retire, now? [yn] ");
X	if (ynq1() == 'y') {
X	  p_win();
X	}
X      }
X      else if (response == ESCAPE) done = TRUE;
X    }
X    xredraw();
X  }
X  if (weeksleep) {
X    clearmsg();
X    print1("Taking a week off to rest...");
X    morewait();
X    toggle_item_use(TRUE);
X    Player.hp = Player.maxhp;
X    Player.str = Player.maxstr;
X    Player.agi = Player.maxagi;
X    Player.con = Player.maxcon;
X    Player.dex = Player.maxdex;
X    Player.iq = Player.maxiq;
X    Player.pow = Player.maxpow;
X    toggle_item_use(FALSE);
X    Player.food = 36;
X    for (i=0;i<NUMSTATI;i++)
X      if (Player.status[i]<1000) Player.status[i]=0;
X    print2("You're once again fit and ready to continue your adventure.");
X    Time += 60*24*7;
X    Date += 7;
X    moon_check();
X    timeprint();
X  }
X}
X
X
X
X
Xvoid gymtrain(maxstat,stat)
Xint *maxstat,*stat;
X{
X  if (Gymcredit + Player.cash < 2000)
X    print2("You can't afford our training!");
X  else {
X    if (Gymcredit > 2000) Gymcredit -= 2000;
X    else {
X      Player.cash -= (2000-Gymcredit);
X      Gymcredit = 0;
X    }
X    print2("Sweat. Sweat. ");
X    if ((*maxstat < 30) && 
X	((*maxstat < random_range(30)) || (random_range(3)==1))){
X      nprint2("The training pays off!");
X      (*maxstat)++;
X      (*stat)++;
X    }
X    else {
X      nprint2("You feel the healthy glow of a good workout.");
X      if (*stat < *maxstat) {
X	(*stat)++;
X	print3("A feeling of rehabilitation washes through you.");
X      }
X    }
X  }
X  dataprint();
X}
X
Xvoid healforpay()
X{
X  if (Player.cash < 50)
X    print2("You can't afford to be healed!");
X  else {
X    Player.cash -= 50;
X    Player.hp += 20+random_range(20);
X    if (Player.hp > Player.maxhp) 
X      Player.hp = Player.maxhp;
X    print2("Another medical marvel....");
X  }
X  calc_melee();
X}
X
Xvoid cureforpay()
X{
X  if (Player.cash < 250)
X    print2("You can't afford to be cured!");
X  else {
X    Player.cash -= 250;
X    Player.status[DISEASED] = 0;
X    print2("Quarantine lifted....");
X  }
X}  
X
X
X
Xvoid send_to_jail()
X{
X  if (Player.rank[ORDER] > 0) {
X    print1("A member of the Order of Paladins sent to jail!");
X    print2("It cannot be!");
X    morewait();
X    print1("You are immediately expelled permanently from the Order!");
X    print2("Your name is expunged from the records....");
X    Player.rank[ORDER] = -1;
X  }
X  else if (gamestatusp(DESTROYED_ORDER)) 
X    print1("The destruction of the Order of Paladins has negated the law!");
X  else if ((Current_Environment != E_CITY) &&
X	   (Last_Environment != E_CITY)) 
X    print1("Fortunately, there is no jail around here, so you are freed!");
X  else {
X    if (((Current_Environment == E_HOUSE) || 
X	 (Current_Environment == E_MANSION) ||
X	 (Current_Environment == E_HOVEL)) &&
X	(Last_Environment == E_CITY))
X      change_environment(E_CITY);
X    if (Current_Environment == E_CITY) {
X      if (gamestatusp(UNDEAD_GUARDS)) {
X	print1("You are taken to a weirdly deserted chamber where an undead");
X	print2("Magistrate presides over a court of ghosts and haunts.");
X	morewait();
X	print1("'Mr. Foreman, what is the verdict?'");
X	print2("'Guilty as charged, your lordship.'");
X	morewait();
X	clearmsg();
X	print1("'Guilty...");
X	morewait();
X	nprint1("Guilty...");
X	morewait();
X	nprint1("Guilty...");
X	morewait();
X	nprint1("Guilty...'");
X	clearmsg();
X	print1("The members of the court close in around, fingers pointing.");
X	print2("You feel insubstantial hands closing around your throat....");
X	print3("You feel your life draining away!");
X	while(Player.level > 0) {
X	  Player.level--;
X	  Player.xp /= 2;
X	  Player.hp /= 2;
X	  dataprint();
X	}
X	Player.maxhp = Player.maxcon;
X	morewait();
X	print1("You are finally released, a husk of your former self....");
X	Player.x = 58;
X	Player.y = 40;
X	screencheck(58);
X      }
X      else if (Player.alignment + random_range(200) < 0) {
X	print1("Luckily for you, a smooth-tongued advocate from the");
X	print2("Rampart Chaotic Liberties Union gets you off!");
X	Player.x = 58;
X	Player.y = 40;
X	screencheck(58);
X      }
X      else switch(Imprisonment++) {
X      case 0:
X	print1("The Magistrate sternly reprimands you.");
X	print2("As a first-time offender, you are given probation.");
X	Player.y = 58;
X	Player.x = 40;
X	screencheck(58);
X	break;
X      case 1:
X	print1("The Magistrate expresses shame for your conduct.");
X	print2("You are thrown in jail!");
X	morewait();	
X	repair_jail();
X	Player.y = 54;
X	Player.x = 37 + (2*random_range(4));
X	screencheck(54);
X	l_portcullis_trap();
X	break;
X      default:
X	print1("The Magistrate renders summary judgement.");
X	print2("You are sentenced to prison!");
X	morewait();
X	print1("The guards recognize you as a 'three-time-loser'"); 
X	print2("...and beat you up a little to teach you a lesson.");
X	p_damage(random_range(Imprisonment * 10),
X		 UNSTOPPABLE,
X		 "police brutality");
X	morewait();
X	repair_jail();
X	Player.y = 54;
X	Player.x = 37 + (2*random_range(4));
X	screencheck(54);
X	l_portcullis_trap();
X      }
X    }
X  }
X}
X
X
X
X
X
X
Xvoid l_adept()
X{
X  print1("You see a giant shimmering gate in the form of an omega.");
X  if (! gamestatusp(ATTACKED_ORACLE)) {
X    if (Player.str+Player.con+Player.iq+Player.pow < 100)
X      print2("A familiar female voice says: I would not advise this now....");
X    else print2("A familiar female voice says: Go for it!");
X    morewait();
X    clearmsg();
X  }
X  print2("Enter the mystic portal? [yn] ");
X  if (ynq2()!='y') {
X    if (Player.level > 100) {
X      print1("The Lords of Destiny spurn your cowardice....");
X      Player.xp = 0;
X      Player.level = 0;
X      Player.hp = Player.maxhp = Player.con;
X      Player.mana = calcmana();
X      print2("You suddenly feel very inexperienced.");
X      dataprint();
X    }	
X  }
X  else {
X    clearmsg();
X    print1("You pass through the portal.");
X    morewait();
X    drawomega();
X    print1("Like wow man! Colors! ");
X    if (Player.patron != DESTINY) {
X      print2("Strange forces try to tear you apart!");
X      p_damage(random_range(200),UNSTOPPABLE,"a vortex of chaos");
X    }
X    else print2("Some strange force shields you from a chaos vortex!");
X    morewait();
X    print1("Your head spins for a moment....");
X    print2("and clears....");
X    morewait();
X    print1("You hear a voice boom:");
X    print2("Welcome to the Adept's Challenge!");
X    morewait();
X    Player.hp = Player.maxhp;
X    Player.mana = calcmana();
X    change_environment(E_ABYSS);
X  }
X}
X
X
X
X
Xvoid l_trifid()
X{
X  int damage=0,stuck=TRUE;
X  print1("The hedge comes alive with a surge of alien growth!");
X  while (stuck) {
X    dataprint();
X    damage += Level->depth/2+1;
X    print2("Razor-edged vines covered in suckers attach themselves to you.");
X    morewait();
X    if (find_and_remove_item(THINGID+6,-1)) {
X      print1("Thinking fast, you toss salt water on the trifid...");
X      print2("The trifid disintegrates with a frustrated sigh.");
X      Level->site[Player.x][Player.y].locchar = FLOOR;
X      Level->site[Player.x][Player.y].p_locf = L_NO_OP;
X      gain_experience(1000);
X      stuck = FALSE;
X    }
X    else {
X      p_damage(damage,UNSTOPPABLE,"a trifid");
X      morewait();
X      print1("You are entangled in tendrils...");
X      menuclear();
X      menuprint("a: Try to break free.\n");
X      menuprint("b: Hang limp and hope the tendrils uncoil.\n");
X      menuprint("c: Pray for assistance.\n");
X      menuprint("d: Attempt to bargain with the hedge.\n");
X      menuprint("e: Click your heels together and wish for escape.\n");
X      menuprint("ANYTHING ELSE: writhe and scream hopelessly.\n");
X      switch(menugetc()) {
X      case 'a': 
X	if (Player.str > random_range(200)) {
X	  print1("Amazing! You're now free.");
X	  print2("The trifid writhes hungrily at you.");
X	  stuck = FALSE;
X	}
X	else print1("Well, THAT didn't work.");
X	break;
X      case 'b': 
X	print1("Well, at least you're facing your fate with dignity.");
X	break;
X      case 'c': 
X	if ((Player.patron == DRUID) && 
X	    (Player.rank[PRIESTHOOD] > random_range(5))) {
X	    print1("A shaft of golden light bathes the alien plant");
X	    print2("which grudginly lets you go....");
X	    stuck = FALSE;
X	  }
X	else print1("You receive no divine aid as yet.");
X	break;
X      case 'd':
X	print1("The hedge doesn't answer your entreaties.");
X	break;
X      case 'e':
X	print1("You forgot your ruby slippers, stupid.");
X	break;
X      default:
X	print1("The hedge enjoys your camp play-acting....");
X	break;
X      }
X    }
X  }
X  xredraw();
X}
X
X
X
X
Xvoid l_vault()
X{
X  print1("You come to a thick vault door with a complex time lock.");
X  if ((hour()==23)) {
X    print2("The door is open.");
X    Level->site[Player.x][Player.y+1].locchar = FLOOR;
X  }
X  else {
X    print2("The door is closed.");
X    Level->site[Player.x][Player.y+1].locchar = WALL;
X    morewait();
X    clearmsg();
X    print1("Try to crack it? [yn] ");
X    if (ynq1()=='y') {
X      if (random_range(100) < Player.rank[THIEVES]*Player.rank[THIEVES]) {
X	print2("The lock clicks open!!!");
X	gain_experience(5000);
X	Level->site[Player.x][Player.y+1].locchar = FLOOR;
X      }	
X      else {
X	print2("Uh, oh, set off the alarm.... The castle guard arrives....");
X	morewait();
X	send_to_jail();
X      }
X    }
X    else print2("Good move.");
X  }
X}
X
X
Xvoid l_brothel()
X{
X  char response;
X  print1("You come to a heavily reinforced inner door.");
X  print2("A sign reads `The House of the Eclipse'");
X  morewait();
X  clearmsg();
X  print1("Try to enter? [yn] ");
X  if (ynq1()=='y') {
X    menuclear();
X    menuprint("a:knock on the door.\n");
X    menuprint("b:try to pick the lock.\n");
X    menuprint("c:bash down the door.\n");
X    menuprint("ESCAPE: Leave this house of ill repute.\n");
X    do 
X      response = menugetc();
X    while ((response != 'a') &&
X	   (response != 'b') &&
X	   (response != 'c') &&
X	   (response != ESCAPE));
X    xredraw();
X    if (response == 'a') {
X      if (!nighttime())
X	print2("There is no reponse.");
X      else {
X	print1("A window opens in the door.");
X	print2("`500Au, buddy. For the night.' pay it? [yn] ");
X	if (ynq2()=='y') {
X	  if (Player.cash < 500) {
X	    print1("`What, no roll?!'");
X	    print2("The bouncer bounces you a little and lets you go.");
X	    p_damage(25,UNSTOPPABLE,"da bouncer");
X	  }
X	  else {
X	    Player.cash -= 500;
X	    print1("You are ushered into an opulently appointed hall.");
X	    print2("After an expensive dinner (takeout from Les Crapuleux)");
X	    morewait();
X	    print1("you spend an enjoyable and educational evening with");
X	    if (Player.preference == 'm') 
X	      switch(random_range(4)) {
X	      case 0: 
X		print2("Skarn the Insatiable, a satyr.");
X		break;
X	      case 1: 
X		print2("Dryden the Defanged, an incubus.");
X		break;
X	      case 2: 
X		print2("Gorgar the Equipped, a centaur.");
X		break;
X	      case 3: 
X		print2("Hieronymus, the mendicant priest of Eros.");
X		break;
X	      }	
X	    else switch(random_range(4)) {
X	    case 0: 
X	      print2("Noreen the Nymph (omaniac)");
X	      break;
X	    case 1: 
X	      print2("Angelface, a recanted succubus.");
X	      break;
X	    case 2: 
X	      print2("Corporal Sue of the City Guard (moonlighting).");
X	      break;
X	    case 3: 
X	      print2("Sheena the Queena the Jungle, a wereleopard.");
X	      break;
X	    }	
X	    morewait();
X	    if (hour() > 12) Time += ((24-hour())+8) * 60;
X	    else {
X	      Time += ((9-hour())*60);
X	      Date++;
X	    }
X	    Player.food = 40;
X	    Player.status[DISEASED] = 0;
X	    Player.status[POISONED] = 0;
X	    Player.hp = Player.maxhp;
X	    /* reduce temporary stat gains to max stat levels */
X	    toggle_item_use(TRUE);
X	    Player.str = min(Player.str,Player.maxstr);
X	    Player.con = min(Player.con,Player.maxcon);
X	    Player.agi = min(Player.agi,Player.maxagi);
X	    Player.dex = min(Player.dex,Player.maxdex);
X	    Player.iq = min(Player.iq,Player.maxiq);
X	    Player.pow = min(Player.pow,Player.maxpow);
X	    toggle_item_use(FALSE);
X	    Player.con++;
X	    gain_experience(100);
X	    timeprint();
X	    dataprint();
X	    showflags();
X	    morewait();
X	    clearmsg();
X	    print1("You arise, tired but happy, the next morning...");
X	  }
X	}
X	else print2("What are you, some kinda prude?");
X      }
X    }
X    else if (response == 'b') {
X      if (nighttime()) {
X	print1("As you fumble at the lock, the door opens....");
X	print2("The bouncer tosses you into the street.");
X      }
X      else print1("The door appears to be bolted and barred from behind.");
X    }
X    else if (response == 'c') {
X      if (nighttime()) {
X	print1("As you charge toward the door it opens....");
X	print2("Yaaaaah! Thud!");
X	morewait();
X	print1("You run past the startled bouncer into a wall.");
X	p_damage(20,UNSTOPPABLE,"a move worthy of Clouseau");
X	print2("The bouncer tosses you into the street.");
X      }
X      else {
X	print1("Ouch! The door resists your efforts.");
X	p_damage(1,UNSTOPPABLE,"a sturdy door");
X	morewait();
X	print1("You hear an irritated voice from inside:");
X	print2("'Keep it down out there! Some of us are trying to sleep!'");
X      }
X    }
X  }
X}
X
X
X
X#ifndef MSDOS
X/* if sign is true, always print message, otherwise do so only sometimes */
Xvoid sign_print(x,y,sign)
Xint x,y,sign;
X{
X  if ((Level->site[x][y].p_locf >= CITYSITEBASE) &&
X      (Level->site[x][y].p_locf < CITYSITEBASE+NUMCITYSITES))
X    CitySiteList[Level->site[x][y].p_locf - CITYSITEBASE][0] = TRUE;
X  switch(Level->site[x][y].p_locf) {
X  case L_CHARITY:
X    print1("You notice a sign: The Rampart Orphanage And Hospice For The Needy.");
X    break;
X  case L_MANSION:
X    print1("You notice a sign:");
X    print2("This edifice protected by DeathWatch Devices, Ltd.");
X    morewait();
X    break;
X  case L_GRANARY:  
X    print1("You notice a sign:");
X    print2("Public Granary: Entrance Strictly Forbidden.");
X    break;
X  case L_PORTCULLIS:
X    if (Level->site[x][y].locchar == FLOOR)
X      print1("You see a groove in the floor and slots above you.");
X    break;
X  case L_STABLES:
X    print1("You notice a sign:");
X    print2("Village Stables");
X    break;
X  case L_COMMONS:
X    print1("You notice a sign:");
X    print2("Village Commons: No wolves allowed.");
X    break;
X  case L_MAZE:
X    print1("You notice a sign:");
X    print2("Hedge maze closed for trifid extermination.");
X    break;
X  case L_BANK:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("First Bank of Omega: Autoteller Carrel.");
X    }
X    break;
X  case L_TEMPLE:
X    print1("You see the ornate portico of the Rampart Pantheon");
X    break;
X  case L_ARMORER:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("Julie's Armor of Proof and Weapons of Quality");
X    }
X    break;
X  case L_CLUB:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("Rampart Explorers' Club.");
X    }
X    break;
X  case L_GYM:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("The Rampart Gymnasium, (affil. Rampart Coliseum).");
X    }
X    break;
X  case L_HEALER:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("Rampart Healers. Member RMA.");
X    }
X    break;
X  case L_CASINO:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("Rampart Mithril Nugget Casino.");
X    }
X    break;
X  case L_SEWER:
X    print1("A sewer entrance. You don't want to go down THERE, do you?");
X    break;
X  case L_COMMANDANT:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("Commandant Sonder's Rampart-fried Lyzzard partes. Open 24 hrs.");
X    }
X    break;
X  case L_DINER:
X    if (sign) {
X      print1("You notice a sign:");
X      print2("The Rampart Diner. All you can eat, 25Au.");
X    }
X    break;
X  case L_CRAP:
X    if (sign) {
X      print1("You notice a sign:"); 
X      print2("Les Crapeuleaux. (****)");
X    }
X    break;
X  case L_TAVERN:
X    if (sign) {
X      print1("You notice a sign:"); 
X      print2("The Centaur and Nymph -- J. Riley, prop.");
X    }
X    break;
X  case L_ALCHEMIST:
X    if (sign) {
X      print1("You notice a sign:"); 
X      print2("Ambrosias' Potions et cie.");
X    }
X    break;
X  case L_DPW:
X    if (sign) {
X      print1("You notice a sign:"); 
X      print2("Rampart Department of Public Works.");
X    }
X    break;
X  case L_LIBRARY:
X    if (sign) {
X      print1("You notice a sign:"); 
X      print2("Rampart Public Library.");
X    }
X    break;
X  case L_CONDO:
X    if (sign) {
X      print1("You notice a sign:"); 
X      if (gamestatusp(SOLD_CONDO)) 
X	print2("Home Sweet Home");
X      else print2("Luxury Condominium For Sale; Inquire Within");
X    }
X    break;
X  case L_PAWN_SHOP:
X    if (sign) {
X      print1("You notice a sign:"); 
X      print2("Knight's Pawn Shop.");
X    }
X    break;
X  case L_CEMETARY:
X    print1("You notice a sign:"); 
X    print2("Rampart City Cemetary. Closed -- Full.");
X    break;
X  case L_GARDEN:
X    print1("You notice a sign:"); 
X    print2("Rampart Botanical Gardens---Do not deface statues.");
X    break;
X  case L_JAIL:
X    print1("You notice a sign:"); 
X    print2("Rampart City Gaol -- always room for more.");
X    break;
X  case L_ORACLE:
X    print1("You notice a sign:");
X    print2("The Oracle of the Cyan Flames");
X    morewait();
X    break;
X  }
X}
X#endif
X  
X
X
Xvoid l_countryside()
X{
X  change_environment(E_COUNTRYSIDE);
X}
X
X
X
Xvoid l_oracle()
X{
X  char response;
X  if (gamestatusp(ATTACKED_ORACLE) && (! gamestatusp(COMPLETED_ASTRAL))) {
X    print1("You come before a blue crystal dais. You see a broken mirror.");
X    print2("Look in the mirror? [yn] ");
X    if (ynq2()=='y') {
X      print1("A strange force rips you from your place....");
X      Player.hp = 1;
X      print2("You feel drained....");
X      dataprint();
X      print3("You find yourself in a weird flickery maze.");
X      change_environment(E_ASTRAL);
X    }
X  }
X  else {
X    print1("You come before a blue crystal dais. There is a bell and a mirror.");
X    print2("Ring the bell [b], look in the mirror [m], or leave [ESCAPE] ");
X    do response = mcigetc();
X    while ((response != 'b') && (response != 'm') && (response != ESCAPE));
X    if (response == 'b') {
X      print1("The ringing note seems to last forever.");
X      print2("You notice a robed figure in front of you....");
X      morewait();
X      print1("The oracle doffs her cowl. Her eyes glitter with blue fire!");
X      print2("Attack her? [yn] ");
X      if (ynq2() == 'y') {
X	setgamestatus(ATTACKED_ORACLE);
X	print1("The oracle deftly avoids your attack.");
X	print2("She sneers at you and vanishes.");
X      }
X      else {
X	print2("She stares at you...and speaks:");
X	if (!gamestatusp(SPOKE_TO_DRUID)) {
X	  print3("'The ArchDruid speaks wisdom in his forest shrine.'");
X	}
X	else if (!gamestatusp(COMPLETED_CAVES)) {
X	  print3("'Thou mayest find aught of interest in the caves to the South.'");
X	}
X	else if (!gamestatusp(COMPLETED_SEWERS)) {
X	  print3("'Turn thy attention to the abyssal depths of the city.'");
X	}
X	else if (!gamestatusp(COMPLETED_CASTLE)) {
X	  print3("'Explorest thou the depths of the Castle of the ArchMage.'");
X	}
X	else if (!gamestatusp(COMPLETED_ASTRAL)) {
X	  morewait();
X	  print1("'Journey to the Astral Plane and meet the Gods' servants.'");
X	  print2("The oracle holds out her hand. Do you take it? [yn] ");
X	  if (ynq2()=='y') {
X	    print1("'Beware: Only the Star Gem can escape the Astral Plane.'");
X	    print2("A magic portal opens behind the oracle. She leads you");
X	    morewait();
X	    print1("through a sequence of special effects that would have");
X	    print2("IL&M technicians cursing in awe and deposits you in an");
X	    morewait();
X	    clearmsg();
X	    print1("odd looking room whose walls seem strangely insubstantial.");
X	    gain_experience(5000);
X	    change_environment(E_ASTRAL);
X	  }
X	  else print3("You detect the hint of a sneer from the oracle.");
X	}
X	else if (!gamestatusp(COMPLETED_VOLCANO)) {
X	  print3("'The infernal maw may yield its secrets to thee now.'");
X	}
X	else if (!gamestatusp(COMPLETED_CHALLENGE)) {
X	  print3("'The challenge of adepthood yet awaits thee.'");
X	}
X	else {
X	  morewait();
X	  print1("'My lord: Thou hast surpassed my tutelage forever.");
X	  print2("Fare thee well.'");
X	  print3("The oracle replaces her hood and seems to fade away....");
X	}
X      }
X    }
X    else if (response == 'm') {
X      print1("You seem to see yourself. Odd....");
X      knowledge(1);
X    }
X    else print2("You leave this immanent place.");
X  }
X}
X
Xvoid l_mansion()
X{
X  print1("Enter the mansion? [yn] ");
X  if (ynq1()=='y')
X    change_environment(E_MANSION);
X}
X
Xvoid l_house()
X{
X  print1("Enter the house? [yn] ");
X  if (ynq1()=='y')
X    change_environment(E_HOUSE);
X}
X
Xvoid l_hovel()
X{
X  print1("Enter the hovel? [yn] ");
X  if (ynq1()=='y')
X    change_environment(E_HOVEL);
X}
X
Xvoid l_safe()
X{
X  char response;
X  pob newitem;
X  int attempt = 0;
X  print1("You have discovered a safe!");
X  print2("Pick the lock [p], Force the door [f], or ignore [ESCAPE]");
X  do response = mcigetc();
X  while ((response != 'p') && (response != 'f') && (response != ESCAPE));
X  if (response == 'p')
X    attempt = (2*Player.dex + Player.rank[THIEVES]*10 - random_range(100))/10;
X  else if (response == 'f')
X    attempt = (Player.dmg - random_range(100))/10;
X  if (attempt > 0) {
X    Player.alignment -= 4;
X    gain_experience(50);
X    print2("The door springs open!");
X    Level->site[Player.x][Player.y].locchar = FLOOR;
X    Level->site[Player.x][Player.y].p_locf = L_NO_OP;
X    if (random_range(2) == 1) {
X      print1("You find:");
X      do {
X	newitem = NULL;
X	while (newitem == NULL)
X	  newitem = create_object(difficulty());
X	print2(itemid(newitem));
X	morewait();
X	gain_item(newitem);
X      } while (random_range(3) == 1);
X    }
X    else print2("The safe was empty (awwwww....)");
X  }
X  else {
X    print3("Your attempt at burglary failed!");
X    if (attempt == -1) {
X      print1("A siren goes off! You see flashing red lights everywhere!");
X      if (Last_Environment == E_CITY) {
X	print2("The city guard shows up! They collar you in no time flat!");
X	change_environment(E_CITY);
X	morewait();
X	send_to_jail();
X      }
X    }
X    else if (attempt == -2) {
X      print1("There is a sudden flash!");
X      p_damage(random_range(25),FLAME,"a safe");
X      print2("The safe has self-destructed.");
X      Level->site[Player.x][Player.y].locchar = RUBBLE;
X      Level->site[Player.x][Player.y].p_locf = L_RUBBLE;
X    }
X    else if (attempt == -3) {
X      print1("The safe jolts you with electricity!");
X      lball(Player.x,Player.y,Player.x,Player.y,30);
X    }
X    else if (attempt < -3) {
X      print1("You are hit by an acid spray!");
X      if (Player.possessions[O_CLOAK] != NULL) {
X	print2("Your cloak is destroyed!");
X	conform_lost_object(Player.possessions[O_CLOAK]);
X	p_damage(10,ACID,"a safe");
X      }
X      else if (Player.possessions[O_ARMOR] != NULL) {
X	print2("Your armor corrodes!");
X	Player.possessions[O_ARMOR]->dmg-=3;
X	Player.possessions[O_ARMOR]->hit-=3;
X	Player.possessions[O_ARMOR]->aux-=3;
X	p_damage(10,ACID,"a safe");
X      }
X      else {
X	print2("The acid hits your bare flesh!");
X	p_damage(random_range(100),ACID,"a safe");
X      }
X    }
X  }
X}
X
X
Xvoid l_cartographer()
X{
X  int i,j,x,y;
X  print1("Ye Olde Mappe Shoppe.");
X  print2("Map of the local area: 500Au. Buy it? [yn] ");
X  if (ynq2()=='y') {
X    if (Player.cash < 500) 
X      print3("Cursed be cheapskates! May you never find an aid station....");
X    else {
X      print3("You now have the local area mapped.");
X      Player.cash -= 500;
X      dataprint();
X      switch(Villagenum) {
X      case 1: x = 56; y = 5; break;
X      default: case 2: x = 35; y = 11; break;
X      case 3: x = 10; y = 40; break;
X      case 4: x = 7; y = 6; break;
X      case 5: x = 40; y = 43; break;
X      case 6: x = 20; y = 41; break;
X      }	
X      for(i=x-15;i<=x+15;i++)
X	for(j=y-15;j<=y+15;j++)
X	  if ((i>=0)&&(i<64)&&(j>=0)&&(j<64)) {
X	    Country[i][j].current_terrain_type =
X	      Country[i][j].base_terrain_type;
X	    Country[i][j].explored = TRUE;
X	  }
X    }
X  }
X  else print3("Don't blame me if you get lost....");
X}
X	    
Xvoid l_charity()
X{
X  int donation;
X  print2("'Greetings, friend. Do you wish to make a donation?' [yn] ");
X  if (ynq2()!='y') 
X    print3("'Pinchpurse!'");
X  else {
X    clearmsg();
X    print1("How much can you give? ");
X    donation = parsenum();
X    if (donation < 1)
X      print2("'Go stick your head in a pig.'");
X    else if (donation > Player.cash)
X      print2("'I'm afraid you're charity is bigger than your purse!'");
X    else if (donation < max(100,Player.level*Player.level*100)) {
X      print2("'Oh, can't you do better than that?'");
X      print3("'Well, I guess we'll take it....'");
X      if (Player.alignment < 10) Player.alignment++;
X      Player.cash -= donation;
X    }
X    else {
X      print2("'Oh thank you kindly, friend, and bless you!'");
X      Player.cash -= donation;
X      Player.alignment += 5;
X    }
X  }
X  dataprint();
X} 
X
END_OF_FILE
if test 27051 -ne `wc -c <'osite2.c'`; then
    echo shar: \"'osite2.c'\" unpacked with wrong size!
fi
# end of 'osite2.c'
fi
echo shar: End of archive 12 \(of 20\).
cp /dev/null ark12isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 20 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0