[comp.sources.games] v05i019: omega2 - rogue like dungeon exploration

games@tekred.TEK.COM (07/26/88)

Submitted by: "Laurence R. Brothers" <brothers@paul.rutgers.edu>
Comp.sources.games: Volume 5, Issue 19
Archive-name: omega2/Part09



#! /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 9 (of 19)."
# Contents:  oitemf1.c omaze3.dat omovef.c osite2.c
# Wrapped by billr@saab on Wed Jul 13 10:46:48 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'oitemf1.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oitemf1.c'\"
else
echo shar: Extracting \"'oitemf1.c'\" \(18112 characters\)
sed "s/^X//" >'oitemf1.c' <<'END_OF_FILE'
X/* omega copyright (C) 1987,1988 by Laurence Raphael Brothers */
X/* oitemf1.c */
X
X/* various item functions: potions,scrolls,boots,cloaks,things,food */
X
X#include "oglob.h"
X
X
X/* general item functions */
X
Xvoid i_no_op(o)
Xpob o;
X{
X}
X
Xvoid i_nothing(o)
Xpob o;
X{
X}
X
X
X
X
X
X/*  scroll functions */
X
Xvoid i_knowledge(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  knowledge(o->blessing);
X}
X
Xvoid i_jane_t(o)
Xpob o;
X{
X  int volume = random_range(6);
X  int i,j,k;
X
X  print1("Jane's Guide to the World's Treasures: ");
X  
X  switch(volume) {
X    case 0:nprint1("SCROLLS");j = SCROLLID; k = POTIONID; break;
X    case 1:nprint1("POTIONS");j = POTIONID; k = WEAPONID; break;
X    case 2:nprint1("CLOAKS");j = CLOAKID; k = BOOTID; break;
X    case 3:nprint1("BOOTS");j = BOOTID; k = RINGID; break;
X    case 4:nprint1("RINGS");j = RINGID; k = STICKID; break;
X    case 5:nprint1("STICKS");j = STICKID; k = ARTIFACTID; break;
X  }
X  for(i=j;i<k;i++)
X    Objects[i].known = 1;
X}
X
X   
Xvoid i_flux(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  flux(o->blessing);
X}
X
X
X/* enchantment */
Xvoid i_enchant(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  enchant(o->blessing < 0 ? -1-o->plus : o->plus+1);
X}
X
X/* scroll of clairvoyance */
Xvoid i_clairvoyance(o)
Xstruct object *o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  if (o->blessing < 0)
X    amnesia();
X  else clairvoyance(5+o->blessing*5);
X}
X
X
X
Xvoid i_acquire(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  acquire(o->blessing);
X  *o = Objects[SCROLLID+0]; /* blank out the scroll */
X}
X
Xvoid i_teleport(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  p_teleport(o->blessing);
X}
X
X
Xvoid i_spells(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  mprint("A scroll of spells.");
X  learnspell(o->blessing);
X}
X
X
X
X/* scroll of blessing */
Xvoid i_bless(o)
Xpob o;
X{
X  Objects[o->id].known = 1;
X  bless(o->blessing);
X}
X
X/* scroll of wishing */
Xvoid i_wish(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  wish(o->blessing);
X  *o = Objects[SCROLLID+0]; /* blank out the scroll */
X}
X
X/* scroll of displacement */
Xvoid i_displace(o)
Xpob o;
X{
X  if (o->blessing > -1) 
X      Objects[o->id].known = 1;
X  displace(o->blessing);
X}
X
X
X/* scroll of deflection */
Xvoid i_deflect(o)
Xpob o;
X{
X  if (o->blessing > -1) 
X    Objects[o->id].known = 1;
X  deflection(o->blessing);
X}
X
X/* scroll of identification */
Xvoid i_id(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  identify(o->blessing);
X}
X
X/* potion functions */
X
X/* potion of healing */
Xvoid i_heal(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    Objects[o->id].known = 1;
X    heal(1+o->plus);
X  }
X  else heal(-1-abs(o->plus));
X}
X
X/* potion of monster detection */
Xvoid i_mondet(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  mondet(o->blessing);
X}
X
X
X/* potion of object detection */
Xvoid i_objdet(o)
Xpob o;
X{
X
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  objdet(o->blessing);
X}
X
X/* potion of neutralize poison */
Xvoid i_neutralize_poison(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    Objects[o->id].known = 1;
X    mprint("You feel vital!");
X    Player.status[POISONED] = 0;
X  }
X  else p_poison(random_range(20)+5);
X}
X
X
X/* potion of sleep */
Xvoid i_sleep_self(o)
Xpob o;
X{
X  sleep_player(6);
X  Objects[o->id].known = 1;
X}
X
X
X
X
X/* potion of speed */
Xvoid i_speed(o)
Xpob o;
X{
X  if (o->blessing > -1) 
X    Objects[o->id].known = 1;
X  haste(o->blessing);
X}
X
X
X/* potion of restoration */
Xvoid i_restore(o)
Xpob o;
X{
X  if (o->blessing > -1) 
X    Objects[o->id].known = 1;
X  recover_stat(o->blessing);
X}
X
Xvoid i_augment(o)
Xpob o;
X{
X  if (o->blessing > -1) 
X    Objects[o->id].known = 1;
X  augment(o->blessing);
X}  
X
Xvoid i_azoth(o)
Xpob o;
X{
X  if (o->plus < 0) {
X    mprint("The mercury was poisonous!");
X    p_poison(25);
X  }
X  else if (o->plus == 0) {
X    mprint("The partially enchanted azoth makes you sick!");
X    Player.con = ((int) (Player.con / 2));
X    calc_melee();
X  }
X  else if (o->blessing < 1) {
X    mprint("The unblessed azoth warps your soul!");
X    Player.pow = Player.maxpow = ((int) (Player.maxpow / 2));
X    level_drain(random_range(10),"cursed azoth");
X  }
X  else {
X    mprint("The azoth fills you with cosmic power!");
X    if (Player.str > Player.maxstr*2) {
X      mprint("The power rages out of control!");
X      p_death("overdose of azoth");
X    }
X    else {
X      heal(10);
X      cleanse(1);
X      Player.mana = calcmana()*3;
X      Player.str = (Player.maxstr++)*3;
X    }
X  }
X}
X
Xvoid i_regenerate(o)
Xpob o;
X{
X  regenerate(o->blessing);
X}
X
X
X
X
X
X/* boots functions */
Xvoid i_perm_speed(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    if (o->used) {
X      o->known = 2;
X      Objects[o->id].known = 1;
X      if (Player.status[SLOWED] > 0) {
X	Player.status[SLOWED] = 0;
X      }
X      mprint("The world slows down!"); 
X      Player.status[HASTED] += 1500;
X    }
X    else {
X      Player.status[HASTED] -= 1500;
X      if (Player.status[HASTED] < 1) 
X	mprint("The world speeds up again.");
X    }
X  }
X  else {
X    if (o->used) {
X      if (Player.status[HASTED] > 0) {
X	Player.status[HASTED] = 0;
X      }
X      mprint("You feel slower.");
X      Player.status[SLOWED] += 1500;
X    }
X    else  {
X      Player.status[SLOWED] -= 1500;
X      if (Player.status[SLOWED] < 1) 
X	mprint("You feel quicker again.");
X    }  
X  }
X}
X
X/* cloak functions */
Xvoid i_perm_displace(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    if (o->used) {
X      mprint("You feel dislocated.");
X      Player.status[DISPLACED] += 1500;
X    }
X    else {
X      Player.status[DISPLACED] -= 1500;
X      if (Player.status[DISPLACED] < 1) {
X	mprint("You feel a sense of position.");
X	Player.status[DISPLACED] = 0;
X      }
X    }
X  }
X  else {
X    if (o->used) {
X      mprint("You have a forboding of bodily harm!");
X      Player.status[VULNERABLE] += 1500;
X    }
X    else {
X      Player.status[VULNERABLE] -= 1500;
X      if (Player.status[VULNERABLE] < 1) {
X	mprint("You feel less endangered.");
X	Player.status[VULNERABLE] = 0;
X      }
X    }
X  }
X}
X
Xvoid i_perm_negimmune(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    if (o->used) {
X      Player.immunity[NEGENERGY]++;
X    }
X    else Player.immunity[NEGENERGY]--;
X  }
X  else if (o->used)
X    level_drain(abs(o->blessing),"cursed cloak of level drain");
X}
X
X/* food functions */
X
X
Xvoid i_food(o)
Xpob o;
X{
X  switch(random_range(5)) {
X    case 0: mprint("That tasted horrible!"); break;
X    case 1: mprint("Yum!"); break;
X    case 2: mprint("How nauseous!"); break;
X    case 3: mprint("Can I have some more? Please?"); break;
X    case 4: mprint("Your mouth feels like it is growing hair!"); break;
X  }
X}
X
Xvoid i_stim(o)
Xpob o;
X{
X  mprint("You feel Hyper!");
X  i_speed(o);
X  Player.str +=3;
X  Player.con -=1;
X  calc_melee();
X}
X
Xvoid i_pow(o)
Xpob o;
X{
X  mprint("You feel a surge of mystic power!");
X  Player.mana = 2 * calcmana();
X}
X
Xvoid i_poison_food(o)
Xpob o;
X{
X  mprint("This food was contaminated with cyanide!");
X  p_poison(random_range(20)+5);
X}
X
Xvoid i_pepper_food(o)
Xpob o;
X{
X  mprint("You innocently start to chew the szechuan pepper.....");
X  morewait();
X  mprint("hot.");
X  morewait();
X  mprint("Hot.");
X  morewait();
X  mprint("Hot!");
X  morewait();
X  mprint("HOT!!!!!!");
X  morewait();
X  p_damage(1,UNSTOPPABLE,"a szechuan pepper");
X  mprint("Your sinuses melt and run out your ears.");
X  mprint("Your mouth and throat seem to be permanently on fire.");
X  mprint("You feel much more awake now....");
X  Player.immunity[SLEEP]++;
X}
X
Xvoid i_lembas(o)
Xpob o;
X{
X  heal(10);
X  cleanse(0);
X  Player.food = 40;
X}
X
X
Xvoid i_cure(o)
Xpob o;
X{
X  cure(o->blessing);
X}
X
Xvoid i_immune(o)
Xpob o;
X{
X  if (o->blessing > 0) {
X    mprint("You feel a sense of innoculation");
X    Player.immunity[INFECTION]++;
X    cure(o->blessing);
X  }
X}
X
X
X
Xvoid i_breathing(o)
Xpob o;
X{
X  
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  breathe(o->blessing);
X}
X
X      
Xvoid i_invisible(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  invisible(o->blessing);
X}
X
X
Xvoid i_perm_invisible(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  if (o->used) {
X    if (o->blessing > -1) {
X      mprint("You feel transparent!");
X      Player.status[INVISIBLE] += 1500;
X    }
X    else {
X      mprint("You feel a forboding of bodily harm!");
X      Player.status[VULNERABLE] += 1500;
X    }
X  }
X  else {
X    if (o->blessing > -1) {
X      Player.status[INVISIBLE]-=1500;
X      if (Player.status[INVISIBLE] < 1) {
X	mprint("You feel opaque again.");
X	Player.status[INVISIBLE] = 0;
X      }
X    }
X    else {
X      Player.status[VULNERABLE] -= 1500;
X      if (Player.status[VULNERABLE] < 1) {
X	mprint("You feel less endangered now.");
X	Player.status[VULNERABLE] = 0;
X      }
X    }
X  }
X}
X
X
Xvoid i_warp(o)
Xpob o;
X{
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  warp(o->blessing);
X}
X
X
Xvoid i_alert(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    Objects[o->id].known = 1;
X    alert(o->blessing);
X  }
X}
X
Xvoid i_charge(o)
Xpob o;
X{
X  int i;
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  mprint("A scroll of charging.");
X  mprint("Charge: ");
X  i = getitem(STICK);
X  if (i != ABORT) {
X    if (o->blessing < 0) {
X      mprint("The stick glows black!");
X      Player.possessions[i]->charge = 0;
X    }
X    else {
X      mprint("The stick glows blue!");
X      Player.possessions[i]->charge += (random_range(10)+1)*(o->blessing+1);
X      if (Player.possessions[i]->charge > 99)
X	Player.possessions[i]->charge = 99;
X    }
X  }
X}
X
X
Xvoid i_fear_resist(o)
Xpob o;
X{
X  if (o->blessing > -1) {
X    Objects[o->id].known = 1;
X    if (Player.status[AFRAID] > 0) {
X      mprint("You feel stauncher now.");
X      Player.status[AFRAID] = 0;
X    }
X  }
X  else if (! p_immune(FEAR)) {
X    mprint("You panic!");
X    Player.status[AFRAID]+=random_range(100);
X  }
X}
X
X
X
X/* use a thieves pick */
Xvoid i_pick(o)
Xpob o;
X{
X  int dir;
X  int ox,oy;
X  o->used = FALSE;
X  if ((! o->known) && (! Player.rank[THIEVES]))
X    mprint("You have no idea what do with a piece of twisted metal.");
X  else {
X    o->known = 1;
X    Objects[o->id].known = 1;
X    mprint("Pick lock:");
X    dir = getdir();
X    if (dir == ABORT)
X      resetgamestatus(SKIP_MONSTERS);
X    else {
X      ox = Player.x + Dirs[0][dir];
X      oy = Player.y + Dirs[1][dir];
X      if ((Level->site[ox][oy].locchar != CLOSED_DOOR) || 
X	  loc_statusp(ox,oy,SECRET)) {
X	mprint("You can't unlock that!");
X	resetgamestatus(SKIP_MONSTERS);
X      }
X      else if (Level->site[ox][oy].aux == LOCKED) {
X	if (Level->depth == MaxDungeonLevels-1) 
X	  mprint("The lock is too complicated for you!!!");
X	else if (Level->depth*2 + random_range(50) <
X	    Player.dex+Player.level+Player.rank[THIEVES]*10) {
X	  mprint("You picked the lock!");
X	  Level->site[ox][oy].aux = UNLOCKED;
X	  gain_experience(max(3,Level->depth));
X	}
X	else mprint("You failed to pick the lock.");
X      }
X      else mprint("That door is already unlocked!");
X    }
X  }
X}
X
X/* use a magic key*/
Xvoid i_key(o)
Xpob o;
X{
X  int dir;
X  int ox,oy;
X  o->used = FALSE;
X  mprint("Unlock door: ");
X  dir = getdir();
X  if (dir == ABORT)
X    resetgamestatus(SKIP_MONSTERS);
X  else {
X    ox = Player.x + Dirs[0][dir];
X    oy = Player.y + Dirs[1][dir];
X    if ((Level->site[ox][oy].locchar != CLOSED_DOOR) || 
X	loc_statusp(ox,oy,SECRET)) {
X	  mprint("You can't unlock that!");
X	  resetgamestatus(SKIP_MONSTERS);
X	}
X    else if (Level->site[ox][oy].aux == LOCKED) {
X	mprint("The lock clicks open!");
X	Level->site[ox][oy].aux = UNLOCKED;
X	o->blessing--;
X	if ((o->blessing<0)||(Level->depth == MaxDungeonLevels-1)) {
X	  mprint("The key disintegrates!");
X	  conform_lost_objects(1,o);
X	}
X	else {
X	  mprint("Your key glows faintly.");
X	  o->blessing--;
X	}
X      }
X    else mprint("That door is already unlocked!");
X  }
X}
X
Xvoid i_corpse(o)
Xpob o;
X{
X  switch (o->aux) {
X  case ML0+1: 
X  case ML0+2:
X  case ML0+3:
X  case ML0+4:
X  case ML2+0:
X  case ML2+2:
X  case ML7+3:
X  case ML10+0: /* cannibalism */
X    mprint("Yechh! How could you! You didn't even cook him, first!");
X    if (Player.alignment > 0) Player.food = 25;
X    Player.food += 8;
X    Player.alignment -=10;
X    foodcheck();
X    break;
X  case ML1+2: /* fnord */
X    mprint("You feel illuminated!");
X    Player.iq++;
X    break;
X  case ML4+3: /* denebian slime devil */
X    mprint("I don't believe this. You ate Denebian Slime?");
X    mprint("You deserve a horrible wasting death, uncurable by any means!");
X    break;
X  case ML5+0:
X    mprint("Those dragon-steaks were fantastic!");
X    Player.food=24;
X    foodcheck();
X    break;
X  case ML7+0:
X    mprint("You feel infinitely more virile now.");
X    Player.str = max(Player.str,Player.maxstr+10);
X    Player.food = 24;
X    foodcheck();
X    break;
X  case ML9+1:
X    mprint("Guess what? You're invisible.");
X    if (Player.status[INVISIBLE] < 1000) Player.status[INVISIBLE] = 666;
X    Player.food+=6;
X    foodcheck();
X    break;
X  case ML7+2:  
X    mprint("You ATE a unicorn's horn?!?!?");
X    Player.immunity[POISON]=1000;
X    break;
X  case ML0+0:
X  case ML1+0:
X  case ML1+1:
X  case ML1+4:
X  case ML1+5:
X  case ML1+6:
X  case ML1+10:
X  case ML2+1:
X  case ML2+4:
X  case ML4+1:
X  case ML4+4:
X  case ML5+3:
X    mprint("Well, you forced it down. Not much nutrition, though.");
X    Player.food++;
X    foodcheck();
X    break;
X  case ML1+3:
X  case ML1+7:
X  case ML2+3:
X  case ML2+5:
X  case ML3+1:
X  case ML4+5:
X  case ML9+3:
X  case ML10+1:
X    mprint("Oh, yuck. The 'food' seems to be tainted.");
X    mprint("You feel very sick. You throw up.");
X    Player.food = min(Player.food, 4);
X    if (! Player.immunity[INFECTION])
X      Player.status[DISEASED]+=24;
X    p_poison(10);
X    break;
X  default: mprint("It proved completely inedible, but you tried anyhow.");
X  }
X}
X
Xvoid i_accuracy(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  accuracy(o->blessing);
X}
X
Xvoid i_perm_accuracy(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  if ((o->used) && (o->blessing > -1)) {
X    Player.status[ACCURATE] += 1500;
X    mprint("You feel skillful and see bulls' eyes everywhere.");
X  }
X  else {
X    Player.status[ACCURATE] -= 1500;
X    if (Player.status[ACCURATE] < 1) {
X      Player.status[ACCURATE] = 0;
X      calc_melee();
X      mprint("Your vision blurs....");
X    }
X  }
X}
X
Xvoid i_hero(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  hero(o->blessing);
X}
X
Xvoid i_perm_hero(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  if (o->used){
X    if (o->blessing > -1) {
X      Player.status[HERO] += 1500;
X      calc_melee();
X      mprint("You feel super!");
X    }
X    else {
X      Player.status[HERO] = 0;
X      calc_melee();
X      if (! Player.immunity[FEAR]) {
X	Player.status[AFRAID]+=1500;
X	mprint("You feel cowardly....");
X      }
X    }
X  }
X  else {
X    if (o->blessing > -1) {
X      Player.status[HERO] -= 1500;
X      if (Player.status[HERO] < 1) {
X	calc_melee();
X	mprint("You feel less super now.");
X	Player.status[HERO] = 0;
X      }
X    }
X    else {
X      Player.status[AFRAID] -= 1500;
X      if (Player.status[AFRAID] < 1) {
X	mprint("You finally conquer your fear.");
X	Player.status[AFRAID] = 0;
X      }
X    }
X  } 
X}
X
Xvoid i_levitate(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  levitate(o->blessing);
X}
X
Xvoid i_perm_levitate(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  if (o->blessing > -1) {
X    if (o->used) {
X      Player.status[LEVITATING] += 1400;
X      mprint("You start to float a few inches above the floor");
X      mprint("You find you can easily control your altitude");
X    }
X    else {
X      Player.status[LEVITATING] -= 1500;
X      if (Player.status[LEVITATING] < 1) {
X	Player.status[LEVITATING] = 0;
X	mprint("You sink to the floor.");
X      }
X    }
X  }
X  else i_perm_burden(o);
X}
X
Xvoid i_perm_protection(o)
Xpob o;
X{
X  if (o->used){
X    if (o->blessing > -1)
X      Player.status[PROTECTION] += abs(o->plus)+1;
X    else
X      Player.status[PROTECTION] -= abs(o->plus)+1;
X  }
X  else {
X    if (o->blessing > -1)
X      Player.status[PROTECTION] -= abs(o->plus)+1;
X    else
X      Player.status[PROTECTION] += abs(o->plus)+1;
X  }
X  calc_melee();
X}
X
Xvoid i_perm_agility(o)
Xpob o;
X{
X  o->known = 2;
X  Objects[o->id].known = 1;
X  if (o->used){
X    if (o->blessing > -1)
X      Player.agi += abs(o->plus)+1;
X    else
X      Player.agi -= abs(o->plus)+1;
X  }
X  else {
X    if (o->blessing > -1)
X      Player.agi -= abs(o->plus)+1;
X    else
X      Player.agi += abs(o->plus)+1;
X  }
X  calc_melee();
X}
X
Xvoid i_truesight(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  truesight(o->blessing);
X}
X
Xvoid i_perm_truesight(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  if (o->used){
X    if (o->blessing > -1) {
X      Player.status[TRUESIGHT] += 1500;
X      mprint("You feel sharp!");
X    }
X    else {
X      Player.status[BLINDED] += 1500;
X      mprint("You've been blinded!");
X    }
X  }
X  else {
X    if (o->blessing > -1) {
X      Player.status[TRUESIGHT] -= 1500;
X      if (Player.status[TRUESIGHT] < 1) {
X	mprint("You feel less keen now.");
X	Player.status[TRUESIGHT] = 0;
X      }
X    }
X    else {
X      Player.status[BLINDED] -= 1500;
X      if (Player.status[BLINDED] < 1) {
X	mprint("You can see again!"); 
X	Player.status[BLINDED] = 0;
X      }
X    }
X  } 
X}
X
Xvoid i_illuminate(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  illuminate(o->blessing);
X}
X
Xvoid i_perm_illuminate(o)
Xpob o;
X{
X  o->known = 1;
X  Objects[o->id].known = 1;
X  if (o->used) 
X    Player.status[ILLUMINATION]+=1500;
X  else
X    Player.status[ILLUMINATION]=max(0,Player.status[ILLUMINATION]-1500);
X}
X
X
X
X
Xvoid i_trap(o)
Xpob o;
X{
X  Objects[o->id].known = 1;
X  
X  if ((Level->site[Player.x][Player.y].locchar != FLOOR) ||
X      (Level->site[Player.x][Player.y].p_locf != L_NO_OP))
X    mprint("Your attempt fails.");
X  else  if (! o->known) {
X    mprint("Fiddling with the thing, you have a small accident....");
X    p_movefunction(o->aux);
X  }
X  else {
X    mprint("You successfully set a trap at your location.");
X    Level->site[Player.x][Player.y].p_locf = o->aux;
X  }
X  dispose_lost_objects(1,o);
X}
X
X
Xvoid i_raise_portcullis(o)
Xpob o;
X{
X  l_raise_portcullis();
X  mprint("The box beeps once and explodes in your hands!");
X  conform_lost_objects(1,o);
X}
X
END_OF_FILE
if test 18112 -ne `wc -c <'oitemf1.c'`; then
    echo shar: \"'oitemf1.c'\" unpacked with wrong size!
fi
# end of 'oitemf1.c'
fi
if test -f 'omaze3.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'omaze3.dat'\"
else
echo shar: Extracting \"'omaze3.dat'\" \(287 characters\)
sed "s/^X//" >'omaze3.dat' <<'END_OF_FILE'
X"z"""""""""""""""""""""...................."""."""-""".""""-"""."""...".?."..."........""".""""""".""""""""""""........"..........."""-"""".""""""-""""."""...."..."......"....""-""-"-"-""-"""-""-""-"?"..?.".".."..."..."?""""""""."""""."""."""">?-?-?-.-."?-.?"O.-??""""""""""""""""""""""
END_OF_FILE
if test 287 -ne `wc -c <'omaze3.dat'`; then
    echo shar: \"'omaze3.dat'\" unpacked with wrong size!
fi
# end of 'omaze3.dat'
fi
if test -f 'omovef.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'omovef.c'\"
else
echo shar: Extracting \"'omovef.c'\" \(5543 characters\)
sed "s/^X//" >'omovef.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* omovef.c */
X/* the movefunctions switch functions, for player and monster*/
X
X#include "oglob.h"
X
X
X
Xvoid p_movefunction(movef)
Xint movef;
X{
X  /* loc functs above traps should be activated whether levitating or not */
X  if (movef != L_NO_OP) clearmsg();
X  sign_print(Player.x,Player.y,FALSE);
X  if ((! Player.status[LEVITATING]) || 
X      gamestatusp(MOUNTED) ||
X      (Cmd == '@') || /* @ command activates all effects under player */
X      (movef < LEVITATION_AVOIDANCE)) {
X
X    switch(movef) {
X      
X      /* miscellaneous */
X    case L_NO_OP:l_no_op(); break;
X    case L_HEDGE:l_hedge(); break;
X    case L_WATER:l_water(); break;
X    case L_LIFT:l_lift(); break;
X    case L_LAVA:l_lava(); break;
X    case L_FIRE:l_fire(); break;
X    case L_WHIRLWIND:l_whirlwind(); break;
X    case L_RUBBLE:l_rubble(); break;
X    case L_MAGIC_POOL:l_magic_pool(); break;
X    case L_ABYSS:l_abyss(); break;
X      
X    case L_PORTCULLIS_TRAP:l_portcullis_trap(); break;
X    case L_RAISE_PORTCULLIS:l_raise_portcullis(); break;
X    case L_DROP_EVERY_PORTCULLIS:l_drop_every_portcullis(); break;
X    case L_ARENA_EXIT:l_arena_exit(); break;
X    case L_TRIFID:l_trifid(); break;
X    case L_ENTER_COURT:l_enter_court(); break;
X    case L_ESCALATOR:l_escalator(); break;
X    case L_THRONE:l_throne(); break;
X
X    case L_TRAP_DART:l_trap_dart(); break;
X    case L_TRAP_SIREN:l_trap_siren(); break;
X    case L_TRAP_PIT:l_trap_pit(); break;
X    case L_TRAP_DOOR:l_trap_door(); break;
X    case L_TRAP_SNARE:l_trap_snare(); break;
X    case L_TRAP_BLADE:l_trap_blade(); break;
X    case L_TRAP_FIRE:l_trap_fire(); break;
X    case L_TRAP_TELEPORT:l_trap_teleport(); break;
X    case L_TRAP_DISINTEGRATE:l_trap_disintegrate(); break;
X    case L_TRAP_SLEEP_GAS:l_trap_sleepgas(); break;
X    case L_TRAP_MANADRAIN:l_trap_manadrain(); break;
X    case L_TRAP_ACID:l_trap_acid(); break;
X    case L_TRAP_ABYSS:l_trap_abyss(); break;
X
X   /*door functions */
X    case L_BANK:l_bank(); break;
X    case L_ARMORER:l_armorer(); break;
X    case L_CLUB:l_club(); break;
X    case L_GYM:l_gym(); break;
X    case L_BROTHEL:l_brothel(); break;
X    case L_THIEVES_GUILD:l_thieves_guild(); break;
X    case L_COLLEGE:l_college(); break;
X    case L_HEALER:l_healer(); break;
X    case L_STATUE_WAKE:l_statue_wake(); break;
X    case L_CASINO:l_casino(); break;
X    case L_COMMANDANT:l_commandant(); break;
X    case L_DINER:l_diner(); break;
X    case L_CRAP:l_crap(); break;
X    case L_TAVERN:l_tavern(); break;
X    case L_MERC_GUILD:l_merc_guild(); break;
X    case L_ALCHEMIST:l_alchemist(); break;
X    case L_SORCERORS:l_sorcerors(); break;
X    case L_CASTLE:l_castle(); break;
X    case L_ARENA:l_arena(); break;
X    case L_VAULT:l_vault(); break;
X    case L_DPW:l_dpw(); break;
X    case L_LIBRARY:l_library(); break;
X    case L_PAWN_SHOP:l_pawn_shop(); break;
X    case L_CONDO:l_condo(); break;
X    case L_ALTAR:l_altar(); break;
X    case L_TACTICAL_EXIT:l_tactical_exit(); break;
X    case L_HOUSE_EXIT:l_house_exit(); break;
X    case L_SAFE: l_safe(); break;
X    case L_HOUSE: l_house(); break;
X    case L_HOVEL: l_hovel(); break;
X    case L_MANSION: l_mansion(); break;
X    case L_COUNTRYSIDE:l_countryside(); break;
X    case L_ORACLE:l_oracle(); break;
X    case L_ORDER:l_order(); break;
X    case L_CARTOGRAPHER:l_cartographer(); break;
X
X    case L_TEMPLE_WARNING:l_temple_warning(); break;
X    case L_ENTER_CIRCLE:l_enter_circle(); break;
X    case L_CIRCLE_LIBRARY:l_circle_library(); break;
X    case L_TOME1: l_tome1(); break;
X    case L_TOME2: l_tome2(); break;
X
X    case L_CHARITY: l_charity(); break;
X
X    case L_CHAOSTONE:l_chaostone();break;
X    case L_VOIDSTONE:l_voidstone();break;
X    case L_BALANCESTONE:l_balancestone();break;
X    case L_LAWSTONE:l_lawstone();break;
X    case L_SACRIFICESTONE:l_sacrificestone(); break;
X    case L_MINDSTONE:l_mindstone(); break;
X
X    /* challenge functions */
X    case L_ADEPT:l_adept(); break;
X    case L_VOICE1:l_voice1();break;
X    case L_VOICE2:l_voice2();break;
X    case L_VOICE3:l_voice3();break;
X    case L_VOID:l_void();break;
X    case L_FIRE_STATION:l_fire_station();break;
X    case L_EARTH_STATION:l_earth_station();break;
X    case L_WATER_STATION:l_water_station();break;
X    case L_AIR_STATION:l_air_station();break;
X    case L_VOID_STATION:l_void_station();break;
X    }
X    if (movef != L_NO_OP) {
X      resetgamestatus(FAST_MOVE);
X      dataprint();
X    }
X  }
X}
X
X
X
X
X
X/* execute some move function for a monster */
Xvoid m_movefunction(m,movef)
Xstruct monster *m;
Xint movef;
X{
X  /* loc functs above traps should be activated whether levitating or not */
X  if (! m_statusp(m,FLYING))
X    switch(movef) {
X
X    /* miscellaneous */
X    case L_NO_OP:m_no_op(m); break;
X    case L_WATER:m_water(m); break;
X    case L_LAVA:m_lava(m); break;
X    case L_FIRE:m_fire(m); break;
X    case L_MAGIC_POOL:m_water(m); break;
X    case L_ABYSS: m_abyss(m); break;
X
X    case L_TRAP_DART:m_trap_dart(m); break;
X    case L_TRAP_PIT:m_trap_pit(m); break;
X    case L_TRAP_DOOR:m_trap_door(m); break;
X    case L_TRAP_SNARE:m_trap_snare(m); break;
X    case L_TRAP_BLADE:m_trap_blade(m); break;
X    case L_TRAP_FIRE:m_trap_fire(m); break;
X    case L_TRAP_TELEPORT:m_trap_teleport(m); break;
X    case L_TRAP_DISINTEGRATE:m_trap_disintegrate(m); break;
X    case L_TRAP_MANADRAIN:m_trap_manadrain(m); break;
X    case L_TRAP_SLEEP_GAS:m_trap_sleepgas(m); break;
X    case L_TRAP_ACID:m_trap_acid(m); break;
X    case L_TRAP_ABYSS:m_trap_abyss(m);break;
X
X    case L_ALTAR:m_altar(m); break;
X    }
X}
END_OF_FILE
if test 5543 -ne `wc -c <'omovef.c'`; then
    echo shar: \"'omovef.c'\" unpacked with wrong size!
fi
# end of 'omovef.c'
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'\" \(27025 characters\)
sed "s/^X//" >'osite2.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
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/* 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  
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 27025 -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 9 \(of 19\).
cp /dev/null ark9isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 19 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