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

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

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



#! /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 4 (of 19)."
# Contents:  oeffect3.c ohelp8.txt omtalk.c
# Wrapped by billr@saab on Wed Jul 13 10:46:42 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'oeffect3.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oeffect3.c'\"
else
echo shar: Extracting \"'oeffect3.c'\" \(30481 characters\)
sed "s/^X//" >'oeffect3.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* oeffect3.c */
X
X#include "oglob.h"
X
X/* if know id, then summon that monster; else (if < 0) get one. */
Xvoid summon(blessing,id)
Xint blessing,id;
X{
X  int i,looking=TRUE,x,y;
X  pml tml;
X
X  if (id < 0) {
X    if (blessing > 0) {
X      id = monsterlist();
X      xredraw();
X    }
X    /* for (id ==0) case, see below -- get a "fair" monster */
X    else if (blessing < 0) id = random_range(NUMMONSTERS);
X  }
X  for(i=0;((i<8) && looking);i++) {
X    x = Player.x+Dirs[0][i];
X    y = Player.y+Dirs[1][i];
X    looking = ((! inbounds(x,y)) ||
X	       (Level->site[x][y].locchar != FLOOR) ||
X	       (Level->site[x][y].creature != NULL));
X  }
X
X  if (! looking) {
X    if ((blessing == 0) && (id < 0))
X      Level->site[x][y].creature = m_create(x,y,WANDERING,difficulty());
X    else Level->site[x][y].creature = make_creature(id);
X    Level->site[x][y].creature->x = x;
X    Level->site[x][y].creature->y = y;
X    tml = ((pml) malloc(sizeof(mltype)));
X    tml->m = Level->site[x][y].creature;
X    if (blessing > 0)
X      m_status_reset(tml->m,HOSTILE);
X    else if (blessing < 0)
X      m_status_set(tml->m,HOSTILE);
X    tml->next = Level->mlist;
X    Level->mlist = tml;
X  }
X}
X
X
X
Xint itemlist(itemindex,num)
Xint itemindex,num;
X{
X  int i,itemno;
X
X  menuclear();
X  for(i=0;i<num;i++) {
X    menunumprint(i+1);
X    menuprint(":");
X    menuprint(Objects[i+itemindex].truename);
X    menuprint("\n");
X  }
X  itemno = parsenum()-1;
X  if ((itemno > num)||(itemno<0)) itemno = ABORT;
X  return(itemno);
X}
X
Xint monsterlist()
X{
X  int i,itemno;
X  do {
X    clearmsg();
X    print1("Summon monster: ");
X    menuclear();
X    for(i=0;i<NUMMONSTERS;i++) {
X      menunumprint(i+1);
X      menuprint(":");
X      menuprint(Monsters[i].monstring);
X      menuprint("\n");
X    }
X    itemno = parsenum()-1;
X    if ((itemno < 0) || (itemno > NUMMONSTERS-1)) {
X      print3("How about trying a real monster?");
X      morewait();
X    }
X  } while ((itemno < 0) || (itemno > NUMMONSTERS-1));
X  return(itemno);
X}
X      
X
X
X/* uncurse all items, cure diseases, and neutralize poison */
Xvoid cleanse(blessing)
X{
X  int i;
X
X  if (blessing > -1) {
X    if (blessing > 0)
X      for(i=0;i<MAXITEMS;i++) 
X	if (Player.possessions[i] != NULL) {
X	  if ((Player.possessions[i]->used) &&
X	      (Player.possessions[i]->blessing < 0)) {
X	    Player.possessions[i]->used = FALSE;
X	    item_use(Player.possessions[i]);
X	    Player.possessions[i]->blessing = 0;
X	    Player.possessions[i]->used = TRUE;
X	    item_use(Player.possessions[i]);
X	  }
X	}
X    
X    if (Player.status[POISONED] > 0) {
X      Player.status[POISONED] = 0;
X    }
X    if (Player.status[DISEASED] > 0) {
X      Player.status[DISEASED] = 0;
X    }
X    showflags();
X    mprint("You feel radiant!");
X  }
X  else {
X    Player.status[POISONED] += 10;
X    Player.status[DISEASED] += 10;
X    mprint("You feel besmirched!");
X    showflags();
X  }
X}
X
Xvoid annihilate(blessing)
Xint blessing;
X{
X  pml ml;
X  int i;
X
X  if (blessing == 0) {
X    mprint("Lightning strikes flash all around you!!!");
X    for(i=0;i<9;i++)
X      if (Level->site[Player.x+Dirs[0][i]][Player.y+Dirs[1][i]].creature !=
X	  NULL)
X	m_death(Level->site[Player.x+Dirs[0][i]][Player.y+Dirs[1][i]].creature);
X  }
X  if (blessing > 0) {
X    mprint("A thousand bolts of lightning flash throughout the level!!!");
X    for(ml=Level->mlist;ml!=NULL;ml=ml->next)
X      if (ml->m != NULL)
X	m_death(ml->m);
X  }
X  else {
X    mprint("You are hit by a bolt of mystic lightning!");
X    p_death("self-annihilation");
X  }
X}
X
X
X
X
Xvoid sleep_monster(blessing)
Xint blessing;
X{
X  pml ml;
X  int x=Player.x,y=Player.y;
X  struct monster *target;
X
X  if (blessing == 0) setspot(&x,&y);
X
X  if (blessing < 0)
X    sleep_player(abs(blessing)+2);
X  else if (blessing > 0) {
X    mprint("A silence pervades the area.");
X    for (ml=Level->mlist;ml!=NULL;ml=ml->next) {
X      m_status_reset(ml->m,AWAKE);
X      ml->m->wakeup = 0;
X    }
X  }
X  else {
X    target = Level->site[x][y].creature;
X    if (target != NULL) {
X      if (target->uniqueness == COMMON) {
X	strcpy(Str1,"The ");
X	strcat(Str1,target->monstring);
X      }
X      else strcpy(Str1,target->monstring);
X      if (! m_immunityp(target,SLEEP)) {
X	strcat(Str1," seems to have fallen asleep.");
X	m_status_reset(target,AWAKE);
X	target->wakeup = 0;
X      }
X      else strcat(Str1," is bright eyed, and bushy tailed!");
X      mprint(Str1);
X    }
X    else mprint("Nothing to sleep there!");
X  }
X}
X  
Xvoid sleep_player(amount)
Xint amount;
X{
X  if (Player.status[SLEPT] == 0) { /* prevent player from sleeping forever */
X    mprint("You feel sleepy...");
X    if (! p_immune(SLEEP)) {
X      Player.status[SLEPT] += random_range(amount*2)+2;
X    }
X    else mprint("but you shrug off the momentary lassitude.");
X  }
X}
X
X
Xvoid hide(x,y)
Xint x,y;
X{
X  if (inbounds(x,y)) {
X    lset(x,y,SECRET);
X    mprint("You feel knowledgeable.");
X  }
X}
X
Xvoid clairvoyance(vision)
Xint vision;
X{
X  int i,j;
X  int x = Player.x, y = Player.y;
X  mprint("Clairvoyance... ");
X  setspot(&x,&y);
X  for(i=x-vision;i<x+vision+1;i++)
X    for(j=y-vision;j<y+vision+1;j++) {
X      if (inbounds(i,j)) {
X	Level->site[i][j].showchar = ' ';
X	lreset(i,j,SECRET);
X	dodrawspot(i,j);
X      }
X    }
X  levelrefresh();
X}
X
Xvoid aggravate()
X{
X  pml tm;
X
X  for (tm=Level->mlist;tm!=NULL;tm=tm->next){
X    m_status_set(tm->m,AWAKE);
X    m_status_set(tm->m,HOSTILE);
X  }
X}
X
X
X
X
Xvoid learnspell(blessing)
Xint blessing;
X{
X  int i,spell,done=FALSE;
X  if (blessing < 0) {
X    for(i=NUMSPELLS;((i>-1) && (! done));i--)
X      if (Spells[i].known) {
X	done = TRUE;
X	Objects[SCROLLID+1].known = TRUE;
X	mprint("You feel forgetful.");
X	Spells[i].known = FALSE;
X      }
X    if (i == ABORT)
X      mprint("You feel fortunate.");
X  }
X  else {
X    Objects[SCROLLID+1].known = TRUE;
X    spell = random_range(NUMSPELLS);
X    print1("Spell Research");
X    if ((random_range(4*Spells[spell].powerdrain)+
X	 Spells[spell].powerdrain) <
X	(4*Player.iq+8*Player.level)) {
X      nprint1(" -- Research successful: ");
X      nprint1(spellid(spell));
X      if (Spells[spell].known) {
X	print2("...is now easier to cast.");
X	Spells[spell].powerdrain = ((int) ((Spells[spell].powerdrain+1)/2));
X      }
X      else {
X	print2("...is added to your repertoire");
X	Spells[spell].known = TRUE;
X	gain_experience(Spells[spell].powerdrain*10);
X      }
X    }
X    else nprint1(" -- Research unsuccessful.");
X  }
X}
X
X
Xvoid amnesia()
X{
X  int i,j;
X  for (j=0;j<LENGTH;j++)
X    for (i=0;i<WIDTH;i++)
X      lreset(i,j,SEEN);
X
X  erase_level();
X  drawvision(Player.x,Player.y);
X}
X
X
X/*affects player only */
Xvoid level_drain(levels,source)
Xint levels;
Xchar *source;
X{
X  int decrement = ((int) (Player.maxhp / (Player.level+1)));
X
X  Player.level -= levels;
X
X  Player.maxhp -= (levels * decrement);
X  Player.hp -= (levels * decrement);
X
X  if ((Player.hp < 1) || (Player.level < 0))
X    p_death(source);
X}
X
X
X
X
Xvoid disrupt(x,y,amount)
Xint x,y,amount;
X{
X  struct monster *target;
X
X  if ((x ==Player.x) && (y==Player.y)) {
X    mprint("You feel disrupted!");
X    p_damage(amount,NORMAL_DAMAGE,"magical disruption");
X  }
X  else {
X    target = Level->site[x][y].creature;
X    if (target != NULL) {
X      if (target->uniqueness == COMMON) {
X	strcpy(Str1,"The ");
X	strcat(Str1,target->monstring);
X      }
X      else strcpy(Str1,target->monstring);
X      if (! m_immunityp(target,NORMAL_DAMAGE)) {
X	strcat(Str1," was blasted!");
X	mprint(Str1);
X	m_damage(target,amount,NORMAL_DAMAGE);
X	target->wakeup = 0;
X      }
X      else {
X	strcat(Str1," does not seem affected.");
X	mprint(Str1);
X      }
X    }
X  }
X}
X
X
X
X
Xvoid disintegrate(x,y)
Xint x,y;
X{
X  struct monster *target;
X  if (! inbounds(x,y)) mprint("You feel a sense of wastage.");
X  else if ((x==Player.x)&&(y==Player.y)) {
X    if (Player.possessions[O_CLOAK] != NULL) {
X      mprint("Your cloak disintegrates!");
X      dispose_lost_objects(1,Player.possessions[O_CLOAK]);
X    }
X    else if (Player.possessions[O_ARMOR] != NULL) {
X      mprint("Your armor disintegrates!");
X      dispose_lost_objects(1,Player.possessions[O_ARMOR]);
X    }
X    else {
X      mprint("Uh, oh....");
X      mprint("Zzzap! You've been disintegrated!");
X      p_damage(250,UNSTOPPABLE,"disintegration");
X    }
X  }
X  else if ((target = Level->site[x][y].creature) != NULL) {
X    if (target->uniqueness == COMMON) {
X      strcpy(Str1,"The ");
X      strcat(Str1,target->monstring);
X    }
X    else strcpy(Str1,target->monstring);
X    strcat(Str1," disintegrates!");
X    mprint(Str1);
X    m_damage(target,100,UNSTOPPABLE);
X    if (target->hp > 0) mprint("It was partially protected by its armor.");
X  }
X  else if (Level->site[x][y].locchar == ALTAR) {
X    mprint("Zzzzap! the altar seems unaffected...");
X    mprint("But an angry deity retaliates....");
X    disintegrate(Player.x,Player.y);
X  }
X  else if (Level->site[x][y].p_locf == L_TRAP_PIT) {
X    if (Current_Environment == Current_Dungeon) {
X      mprint("A hole is blasted in the base of the pit!");
X      Level->site[x][y].locchar = '^';
X      Level->site[x][y].p_locf = L_TRAP_DOOR;
X      Level->site[x][y].aux = S_DISINTEGRATE;
X    }
X    else mprint("The hole just gets deeper....");
X  }
X  else if (Level->site[x][y].locchar == FLOOR) {
X    mprint("You zap a hole in the floor!");
X    Level->site[x][y].locchar = '^';
X    Level->site[x][y].p_locf = L_TRAP_PIT;
X  }
X  else if ((Level->site[x][y].locchar == WALL) ||
X	   (Level->site[x][y].locchar == OPEN_DOOR) ||
X	   (Level->site[x][y].locchar == CLOSED_DOOR) ||
X	   (Level->site[x][y].locchar == PORTCULLIS) ||
X	   (Level->site[x][y].locchar == STATUE)) {
X    mprint("The site is reduced to rubble!");
X    if (Level->site[x][y].locchar == WALL)
X      tunnelcheck();
X    Level->site[x][y].p_locf = L_RUBBLE;
X    Level->site[x][y].locchar = RUBBLE;
X    lreset(x,y,SECRET);
X  }
X  else if ((Level->site[x][y].locchar == RUBBLE) ||
X	   (Level->site[x][y].locchar == TRAP)) {
X    mprint("The site is blasted clear!");
X    Level->site[x][y].p_locf = L_NO_OP;
X    Level->site[x][y].locchar = FLOOR;
X    lreset(x,y,SECRET);
X  }
X  else if (Level->site[x][y].locchar == HEDGE) {
X    if (Level->site[x][y].p_locf == L_TRIFID) {
X      mprint("The trifid screams as it disintgrates!");
X      gain_experience(50);
X      Level->site[x][y].p_locf = L_NO_OP;
X      Level->site[x][y].locchar = FLOOR;
X      lreset(x,y,SECRET);
X    }
X    else if (Level->site[x][y].p_locf == L_HEDGE) {
X      mprint("The hedge is blasted away!");
X      Level->site[x][y].p_locf = L_NO_OP;
X      Level->site[x][y].locchar = FLOOR;
X      lreset(x,y,SECRET);
X    }
X    else mprint("The blast has no effect.");
X  }
X  else mprint("The blast has no effect.");
X}
X
Xvoid acid_cloud()
X{
X  mprint("You are caught in an acid cloud!");
X  if (Player.possessions[O_CLOAK] != NULL) {
X    damage_item(Player.possessions[O_CLOAK]);
X    mprint("You are burned by acid.");
X    p_damage(3,ACID,"an acid cloud");
X  }
X  else if (Player.possessions[O_ARMOR] != NULL) {
X    mprint("You are burned by acid.");
X    p_damage(3,ACID,"an acid cloud");
X    damage_item(Player.possessions[O_ARMOR]);
X  }
X  else {
X    mprint("The acid eats away at your bare skin!");
X    p_damage(25,ACID,"an acid cloud");
X  }
X}
X
X
X
X/* teleport player */
Xvoid p_teleport(type)
Xint type;
X{
X  int x=Player.x,y=Player.y;
X  drawspot(x,y);
X  if (type < 0) {
X    x = random_range(WIDTH);
X    y = random_range(LENGTH);
X    if ((Level->site[x][y].locchar != FLOOR) &&
X	(Level->site[x][y].locchar != OPEN_DOOR)) {
X      mprint("You teleported into a solid object....");
X      mprint("You are dead!");
X      p_death("teleportation into a solid object");
X    }
X    else {
X      Player.x = x;
X      Player.y = y;
X    }
X  }
X  else if (type == 0)
X    findspace(&(Player.x),&(Player.y),-1);
X  else {
X    setspot(&Player.x,&Player.y);
X    if ((Level->site[Player.x][Player.y].locchar != FLOOR) ||
X	(Level->site[Player.x][Player.y].creature != NULL)) {
X      mprint("You feel deflected.");
X      p_teleport(0);
X    }
X  }
X  screencheck(Player.y);
X  roomcheck();
X}
X
X
Xvoid p_poison(toxicity)
Xint toxicity;
X{
X  mprint("You feel sick.");
X  if (! p_immune(POISON))
X    Player.status[POISONED]+=toxicity;
X  else mprint("The sickness fades!");
X  showflags();
X}
X
Xvoid apport(blessing)
Xint blessing;
X{
X  int i,index,x=Player.x,y=Player.y;
X  if (blessing > -1) {
X    mprint("Apport from:");
X    setspot(&x,&y);
X    if (Level->site[x][y].things != NULL)
X      pickup_at(x,y);
X    else mprint("There's nothing there to apport!");
X  }
X  else {
X    mprint("You have a sense of loss.");
X    for(i=0;i<abs(blessing);i++) {
X      index = random_item();
X      if (index != ABORT) {
X	conform_unused_object(Player.possessions[index]);
X	drop_at(x,y,Player.possessions[index]);
X      }
X    }
X  }
X}
X
X
Xvoid strategic_teleport(blessing)
Xint blessing;
X{
X  mprint("Magic portals open up all around you!");
X  if (blessing < 0) {
X    mprint("You are dragged into one!");
X    change_environment(E_COUNTRYSIDE);
X    do {
X      Player.x = random_range(WIDTH);
X      Player.y = random_range(LENGTH);
X    } while(Country[Player.x][Player.y].base_terrain_type == CHAOS_SEA);
X  }
X  else {
X    mprint("Below each portal is a caption. Enter which one:");
X    menuclear();
X    menuprint("a: Rampart\n");
X    menuprint("b: Village of Star View\n");
X    menuprint("c: Village of Woodmere\n");
X    menuprint("d: Village of Stormwatch\n");
X    menuprint("e: Village of Thaumaris\n");
X    menuprint("f: Village of Skorch\n");
X    menuprint("g: Village of Whorfen\n");
X    menuprint("h: Temple of the Noose\n");
X    menuprint("i: The Parthenon\n");
X    menuprint("j: Temple of the Black Hand\n");
X    menuprint("k: Temple of the Hidden Moon\n");
X    menuprint("l: WoodHenge\n");
X    menuprint("m: Temple of Destiny\n");
X    menuprint("n: HellWell Volcano\n");
X    menuprint("ANYTHING ELSE: Avoid entering a portal.");
X    switch(mcigetc()) {
X    case 'a': 
X      change_environment(E_COUNTRYSIDE); 
X      locprint("City of Rampart.");
X      Player.x = 27;
X      Player.y = 19;
X      break;
X    case 'b':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Village of Star View.");
X      Player.x = 56;
X      Player.y = 5;
X      break;
X    case 'c':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Village of Woodmere.");
X      Player.x = 35;
X      Player.y = 11;
X      break;
X    case 'd':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The village of Stormwatch.");
X      Player.x = 10;
X      Player.y = 40;
X      break;
X    case 'e':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Village of Thaumaris.");
X      Player.x = 7;
X      Player.y = 6;
X      break;
X    case 'f':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The village of Skorch.");
X      Player.x = 41;
X      Player.y = 43;
X      break;
X    case 'g':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The village of Whorfen.");
X      Player.x = 20;
X      Player.y = 41;
X      break;
X    case 'h':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Temple of the Noose.");
X      Player.x = 22;
X      Player.y = 30;
X      break;
X    case 'i':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Parthenon.");
X      Player.x = 51;
X      Player.y = 11;
X      break;
X    case 'j':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Temple of the Black Hand.");
X      Player.x = 45;
X      Player.y = 45;
X      break;
X    case 'k':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Temple of the Hidden Moon.");
X      Player.x = 19;
X      Player.y = 46;
X      break;
X    case 'l':
X      change_environment(E_COUNTRYSIDE);
X      locprint("WoodHenge.");
X      Player.x = 32;
X      Player.y = 5;
X      break;
X    case 'm':
X      change_environment(E_COUNTRYSIDE);
X      locprint("The Temple of Destiny.");
X      Player.x = 49;
X      Player.y = 59;
X      break;
X    case 'n':
X      change_environment(E_COUNTRYSIDE);
X      locprint("HellWell Volcano.");
X      Player.x = 30;
X      Player.y = 58;
X      break;
X    }
X    xredraw();
X    if (gamestatusp(LOST)) {
X      print1("You know where you are now.");
X      resetgamestatus(LOST);
X      Precipitation = 0;
X    }
X  }
X  screencheck(Player.y);
X  drawvision(Player.x,Player.y);
X}
X
X
X
Xvoid hero(blessing)
Xint blessing;
X{
X  if (blessing > -1) {
X      mprint("You feel super!");
X      Player.status[HERO] += random_range(5)+1+blessing;
X      calc_melee();
X    }
X  else {
X    Player.status[HERO]=0;
X    calc_melee();
X    mprint("You feel cowardly.");
X    level_drain(abs(blessing),"a potion of cowardice");
X  }
X}
X
X
Xvoid levitate(blessing)
Xint blessing;
X{
X  if (blessing > -1) {
X    if (gamestatusp(MOUNTED)) 
X      mprint("You have a strange feeling of lightness in your saddle.");
X    else {
X      mprint("You start to float a few inches above the floor.");
X      mprint("You discover you can easily control your altitude...");
X      mprint("(Note use of '@' command may be useful while levitating)");
X      Player.status[LEVITATING] += random_range(5)+1+blessing;
X    }
X  }
X  else mprint("Nothing much happens.");
X}
X
X
X/* has effect of switching between 1st level and deepest level attained */
Xvoid level_return()
X{
X  if (Current_Environment == Current_Dungeon) {
X    if (Level->depth > 1)
X      change_level(Level->depth,1,FALSE);
X    else change_level(Level->depth,Dungeon->deepest,FALSE);
X  }
X  else if (Current_Environment == E_COUNTRYSIDE) {
X    mprint("A mysterious force wafts you back home!");
X    Player.x = 27;
X    Player.y = 19;
X    screencheck(Player.y);
X    drawvision(Player.x,Player.y);
X    locprint("Back Outside Rampart.");
X  }
X  else mprint("A feeble vortex of magic swirls by and has no further effect.");
X}
X
X
Xvoid cure(blessing)
Xint blessing;
X{
X  int happened = FALSE;
X  if (blessing > -1) {
X    if (Player.status[DISEASED]) {
X      Player.status[DISEASED]=0;
X      mprint("You feel hygienic!");
X      happened = TRUE;
X    }
X    if (Player.status[POISONED]) {
X      Player.status[POISONED] -= 5+blessing*10;
X      if (Player.status[POISONED] > 0)
X	mprint("The effect of the poison has been reduced.");
X      else {
X	Player.status[POISONED] = 0;
X	mprint("The poison has been purged from your system.");
X      }
X      happened = TRUE;
X    }
X    if (Player.status[BLINDED]) {
X      Player.status[BLINDED]=0;
X      happened = TRUE;
X      mprint("Cobwebs clear from before your eyes.");
X    }
X    if (! happened) mprint("Nothing much happens.");
X  }
X  else disease(12);
X  showflags();
X}
X
Xvoid disease(amount)
Xint amount;
X{
X  mprint("You feel ill.");
X  if (! Player.immunity[INFECTION]) {
X    mprint("You begin to shiver with ague.");
X    Player.status[DISEASED]+=random_range(amount*2)+1;
X  }
X  else mprint("The illness fades.");
X}
X
Xvoid truesight(blessing)
Xint blessing;
X{
X  if (blessing > -1) {
X    Player.status[TRUESIGHT]+=random_range(10)+1;
X    mprint("You feel sharp.");
X  }
X  else {
X    Player.status[BLINDED]+=random_range(10)+1;
X    mprint("You've been blinded!");
X  }
X}
X
X
X
Xvoid dispel(blessing)
Xint blessing;     
X{
X  int i,x=Player.x,y=Player.y;
X  if (blessing > -1) {
X    setspot(&x,&y);
X    if ((x==Player.x)&&(y==Player.y)) {
X      for(i=0;i<MAXITEMS;i++) {
X	if (Player.possessions[i]!=NULL)
X	  if ((Player.possessions[i]->used) &&
X	      (Player.possessions[i]->blessing < 0)) {
X	    if (blessing+1 + Player.possessions[i]->blessing >=0) {
X	      mprint("You hear a sighing sound from");
X	      mprint(itemid(Player.possessions[i]));
X	      Player.possessions[i]->blessing = 0;
X	    }
X	    else {
X	      mprint("You hear dark laughter from");
X	      mprint(itemid(Player.possessions[i]));
X	    }
X	  }
X      }
X    }
X    else if (Level->site[x][y].creature != NULL) {
X      if (Level->site[x][y].creature->level < blessing * 3) {
X	Level->site[x][y].creature->specialf = M_NO_OP;
X	if (Level->site[x][y].creature->meleef != M_NO_OP)
X	  Level->site[x][y].creature->meleef = M_MELEE_NORMAL;
X	Level->site[x][y].creature->strikef = M_NO_OP;
X	Level->site[x][y].creature->immunity=0;
X	m_status_reset(Level->site[x][y].creature,M_INVISIBLE);	
X	m_status_reset(Level->site[x][y].creature,INTANGIBLE);
X      }
X      else mprint("The monster ignores the effect!");
X    }
X    else if ((Level->site[x][y].p_locf == L_TRAP_FIRE) ||
X	     (Level->site[x][y].p_locf == L_STATUE_WAKE) ||
X	     (Level->site[x][y].p_locf == L_TRAP_TELEPORT) ||
X	     (Level->site[x][y].p_locf == L_TRAP_DISINTEGRATE)) {
X      Level->site[x][y].p_locf = L_NO_OP;
X      if (Level->site[x][y].locchar == TRAP)
X	Level->site[x][y].locchar = FLOOR;
X    }
X    else if (Level->site[x][y].p_locf == L_MAGIC_POOL)
X      Level->site[x][y].p_locf = L_WATER;
X    else mprint("Nothing much seems to happen.");
X  }
X  else {
X    mprint("A smell of ozone and positive ions fills the air..");
X    if (Player.status[ACCURACY] && (Player.status[ACCURACY] < 1000))
X      Player.status[ACCURACY]=1;
X    if (Player.status[DISPLACED]&&(Player.status[DISPLACED] < 1000))
X	Player.status[DISPLACED]=1;
X    if (Player.status[HASTED]&&(Player.status[HASTED] < 1000))
X      Player.status[HASTED]=1;
X    if (Player.status[BREATHING]&&(Player.status[BREATHING] < 1000))
X      Player.status[BREATHING]=1;
X    if (Player.status[INVISIBLE]&&(Player.status[INVISIBLE] < 1000))
X	Player.status[INVISIBLE]=1;
X    if (Player.status[REGENERATING]&&(Player.status[REGENERATING] < 1000))
X      Player.status[REGENERATING]=1;
X    if (Player.status[ALERT]&&(Player.status[ALERT] < 1000))
X	Player.status[ALERT]=1;
X    if (Player.status[HERO]&&(Player.status[HERO] < 1000))
X	Player.status[HERO]=1;
X    if (Player.status[LEVITATING]&&(Player.status[LEVITATING] < 1000))
X	Player.status[LEVITATING]=1;
X    if (Player.status[ACCURATE]&&(Player.status[ACCURATE] < 1000))
X	Player.status[ACCURATE]=1;
X    if (Player.status[TRUESIGHT]&&(Player.status[TRUESIGHT] < 1000))
X	Player.status[TRUESIGHT]=1;
X    tenminute_status_check();
X  }
X}
X
X
Xvoid polymorph(blessing)
Xint blessing;     
X{
X  int x=Player.x,y=Player.y,newmonster;
X  struct monster *m;
X  setspot(&x,&y);
X  if ((x==Player.x)&&(y==Player.y)) {
X    mprint("You enjoy your new life as a");
X    mprint(Monsters[random_range(NUMMONSTERS)].monstring);
X    mprint("But your game is over....");
X    p_death("polymorphing oneself");
X  }
X  else if ((m=Level->site[x][y].creature) == NULL)
X    mprint("Nothing happens.");
X  else {
X    if (m_immunityp(m,OTHER_MAGIC) || (m->level > random_range(12))) {
X      strcpy(Str1,"The ");
X      strcat(Str1,m->monstring);
X      strcat(Str1," resists the change!");
X      m_status_set(m,HOSTILE);
X    }
X    else {
X      if (blessing < 0) {
X	do newmonster = random_range(NUMMONSTERS);
X	while ((newmonster == ML0+4) ||
X	       (newmonster == ML7+3) ||
X	       (Monsters[newmonster].level <= m->level) ||
X	       (Monsters[newmonster].uniqueness != COMMON));
X      }
X      else {
X	do newmonster = random_range(NUMMONSTERS);
X	while ((newmonster == ML0+4) ||
X	       (newmonster == ML7+3) ||
X	       (Monsters[newmonster].uniqueness != COMMON));
X      }
X      m->id = Monsters[newmonster].id;
X      m->hp = max(m->hp,Monsters[newmonster].id);
X      m->speed = Monsters[newmonster].speed;
X      m->hit = Monsters[newmonster].hit;
X      m->ac = Monsters[newmonster].ac;
X      m->dmg = Monsters[newmonster].dmg;
X      m->sense = Monsters[newmonster].sense;
X      m->wakeup = Monsters[newmonster].wakeup;
X      m->level = max(m->level,Monsters[newmonster].level);
X      m->status = Monsters[newmonster].status;
X      m->immunity = (m->immunity | Monsters[newmonster].immunity);
X      m->xpv = max(m->xpv,Monsters[newmonster].wakeup);
X      m->transformid = Monsters[newmonster].transformid;
X      m->corpsevalue = Monsters[newmonster].corpsevalue;
X      m->corpseweight = Monsters[newmonster].corpseweight;
X      m->monchar = Monsters[newmonster].monchar;
X      m->meleestr = Monsters[newmonster].meleestr;
X      m->monstring = Monsters[newmonster].monstring;
X      m->corpsestr = Monsters[newmonster].corpsestr;
X      m->talkf = Monsters[newmonster].talkf;
X      m->movef = Monsters[newmonster].movef;
X      m->meleef = Monsters[newmonster].meleef;
X      m->strikef = Monsters[newmonster].strikef;
X      m->specialf = Monsters[newmonster].specialf;
X      m_status_set(m,HOSTILE);
X    }
X  }
X}
X
X
X
X
Xvoid hellfire(x,y,blessing)
Xint x,y,blessing;
X{
X  struct monster *m;
X  if ((x==Player.x)&&(y==Player.y)) {
X    mprint("You have been completely annihilated. Congratulations.");
X    p_death("hellfire");
X  }
X  else if ((m=Level->site[x][y].creature) == NULL) {
X    mprint("The gods are angry over your waste of power...");
X    level_drain(5,"indiscriminate use of hellfire");
X  }
X  else {
X    mprint("The monster writhes in the flames...");
X    if (blessing < 0) {
X      mprint("...and appears stronger.");
X      morewait();
X      mprint("Much stronger.");
X      m->hp += 1000;
X      m->hit +=20;
X      m->dmg += 100;
X      m_status_set(m,HOSTILE);
X    }
X    else {
X      if (m->uniqueness == COMMON) {
X	mprint("and is utterly annihilated. Only a greasy spot remains...");
X	m->corpsestr = salloc("a greasy spot");
X	m->id = 0;
X	if (m->possessions != NULL)
X	  free((char *) m->possessions);
X	m->possessions = NULL; /* it happens that that transformid is -1 */
X      }
X      else mprint("and dies, cursing your name and the uncaring gods....");
X      m_death(m);
X    }
X  }
X}
X
X
Xvoid drain(blessing)
Xint blessing;
X{
X  int x=Player.x,y=Player.y;
X  struct monster *m;
X  setspot(&x,&y);
X  mprint("You begin to drain energy...");
X  if ((x==Player.x)&&(y==Player.y)) {
X    mprint("You drain your own energy....");
X    mprint("Uh, oh, positive feedback....");
X    level_drain(Player.level,"self-vampirism");
X  }
X  else if ((m=Level->site[x][y].creature) != NULL) {
X    if ((blessing > -1) && (! m_immunityp(m,NEGENERGY))) {
X      mprint("The monster seems weaker...");
X      m_damage(m,m->level*m->level,NEGENERGY);
X      m->hit -= m->level;
X      m->dmg -= m->level*m->level;
X      m->ac -= m->level;
X      m->level = (max(0,m->level-1));
X      mprint("You feel stronger...");
X      gain_experience(m->level*5);
X      Player.hp+=(m->level*m->level / 2);
X    }
X    else {
X      mprint("The effect reverses itself!");
X      mprint("The monster seems stronger...");
X      m->hp+=Player.level*Player.level;
X      m->hit += Player.level;
X      m->dmg += Player.level*Player.level;
X      m->ac += Player.level;
X      m->level++;
X      mprint("You feel weaker...");
X      Player.mana = min(0,Player.level*Player.level);
X      level_drain(m->level,"negative energy conflict.");
X    }
X  }
X  else if (blessing < 0) {
X    mprint("You seem to lose energy, instead of gaining it!");
X    level_drain(3,"reversed energy drain");
X  }
X  else if (Level->site[x][y].locchar == ALTAR) {
X    mprint("The altar collapses in on itself....");
X    Level->site[x][y].locchar = ABYSS;
X    Level->site[x][y].p_locf = L_ABYSS;
X    if (! Player.patron) {
X      mprint("You drain some theurgic energy from the altar....");
X      gain_experience(40);
X      Player.hp += 20;
X      Player.pow+=2;
X    }
X    if (Level->site[x][y].aux == Player.patron) {
X      mprint("Your deity is enraged.");
X      mprint("You are struck by godsfire.");
X      p_damage(Player.hp-1,UNSTOPPABLE,"godsfire");
X      mprint("You feel atheistic.");
X      Player.patron = -1;
X      Player.rank[PRIESTHOOD] = 0;
X    }
X    else {
X      mprint("You feel the wrath of a god....");
X      p_damage(random_range(Player.level*10),UNSTOPPABLE,"divine wrath");
X      mprint("Your deity doesn't seem to mind your action, though.");
X      gain_experience(100);
X    }
X  }
X  else {
X    mprint("You drain some energy from the ambient megaflow.");
X    Player.hp++;
X  }
X}
X
Xvoid sanctuary()
X{
X  if (Level->environment == E_TEMPLE) 
X    mprint("Odd, the spell has no effect. I wonder why.");
X  else {
X    mprint("You're standing on sacred ground!");
X    Player.sx = Player.x;
X    Player.sy = Player.y;
X  }
X}
X
Xvoid shadowform()
X{
X  mprint("You feel like a shadow.");
X  Player.immunity[NORMAL_DAMAGE]++;
X  Player.immunity[ACID]++;
X  Player.immunity[THEFT]++;
X  Player.immunity[INFECTION]++;
X  Player.status[SHADOWFORM]+=Player.level;
X}
X
Xvoid illuminate(blessing)
Xint blessing;
X{
X  int r=Level->site[Player.x][Player.y].roomnumber;
X  if (blessing > -1) {
X    if (r > ROOMBASE) {
X      if (loc_statusp(Player.x,Player.y,LIT))
X	mprint("A glow surrounds you.");
X      else {
X	mprint("The room lights up!");
X	Player.status[ILLUMINATION]+=blessing+3;
X	spreadroomlight(Player.x,
X			Player.y,
X			Level->site[Player.x][Player.y].roomnumber);
X      }
X    }
X    else mprint("You see a faint glimmer of light which quickly fades.");
X  }
X  else {
X    if (r > ROOMBASE) {
X      if (! loc_statusp(Player.x,Player.y,LIT))
X	mprint("Nothing much happens.");
X      else {
X	mprint("The room darkens!");
X	spreadroomdark(Player.x,
X		       Player.y,
X		       Level->site[Player.x][Player.y].roomnumber);
X      }
X    }
X    else mprint("The gloom thickens for a moment.");
X  }
X}
X
X
Xvoid drain_life(amount)
Xint amount;
X{
X  amount = abs(amount);
X  mprint("You feel cold!");
X  if (p_immune(NEGENERGY))
X    mprint("... but the feeling quickly fades.");
X  else {
X    if (random_range(2)) {
X      mprint("The coldness spreads throughout your body...");
X      Player.str-=amount;
X      Player.con-=amount;
X      if ((Player.str < 3) || (Player.con < 3)) {
X	mprint("You suffer a fatal heart attack!!!");
X	Player.hp = 0;
X	strcpy(Str2,"a coronary");
X	p_death(Str2);
X      }
X    }
X    else {
X      mprint("The coldness saps your very soul...");
X      strcpy(Str2,"soul destruction");
X      level_drain(amount,Str2);
X    }
X  }
X}
X
X
Xvoid inflict_fear(x,y)
Xint x,y;
X{
X  struct monster *m;
X  if ((Player.x == x) && (Player.y == y)) {
X    mprint("You shudder with otherworldly dread.");
X    if (Player.immunity[FEAR] > 0)
X      mprint("You brace up and face your fear like a hero!");
X    else {
X      mprint("You panic!");
X      Player.status[AFRAID]+=10;
X    }
X  }
X  else if ((m = Level->site[x][y].creature) != NULL) {
X    if (m->uniqueness == COMMON) {
X      strcpy(Str2,"The ");
X      strcat(Str2,m->monstring);
X    }
X    else strcpy(Str2,m->monstring);
X    m->speed = max(2,m->speed-1);
X    if (m_immunityp(m,FEAR)) 
X      strcat(Str2,"seems enraged!");
X    else {
X      strcat(Str2,"is terrorized!");
X      m_dropstuff(m);
X      if (m_statusp(m,MOBILE))
X	m->movef = M_MOVE_SCAREDY;
X    }
X  }
X  else mprint("A thrill of fear tickles your spine ... and passes.");
X}
X
X
X
X
X/*Turns on deflection status for the player */
Xvoid deflection(blessing)
Xint blessing;
X{
X  if (blessing > -1) {
X      mprint("You feel buffered.");
X      Player.status[DEFLECTION] = blessing + random_range(6);
X    }
X  else {
X    mprint("You feel vulnerable");
X    Player.status[VULNERABLE] += random_range(6) - blessing;
X  }
X}
END_OF_FILE
if test 30481 -ne `wc -c <'oeffect3.c'`; then
    echo shar: \"'oeffect3.c'\" unpacked with wrong size!
fi
# end of 'oeffect3.c'
fi
if test -f 'ohelp8.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp8.txt'\"
else
echo shar: Extracting \"'ohelp8.txt'\" \(2033 characters\)
sed "s/^X//" >'ohelp8.txt' <<'END_OF_FILE'
X
XTHE COUNTRYSIDE
X===============
XRampart is set in a strange landscape of different terrain types. The
Xland is surrounded in part by a mystic sea of chaos which it is
Xprobably a good idea to avoid. Screen characters have a different
Xmeaning in the countryside than they do elsewhere, by the way, and
Xthere is a different command set (accessible by '?' when out of the
Xcity). Time passes much more quickly in countryside movement; you will
Xhave to bring a lot of food with you, though you may wish to
Xhunt ('H' command) to supplement your food reserves; many of the
Xanimals that you may encounter, for example, are edible.
X
XSince each countryside site is quite a large area, you may have
Xto search ('s' command) to learn of interesting sites nearby.
X
XCountryside Map Example:
X
X++----.--- The @ as usual is the player; the +'s are an arm of the Sea of
X+++++O--^^ Chaos; the O is the city of Rampart; the ^'s are mountains;
X----@----^ the .'s are a road; the -'s are plains and meadows;
X---.-^^^^^ and the * is a dungeon entrance.
X...-^*^^^^
X
XThe countryside can be rather dangerous for low level characters to
Xexplore at random. However, maps of the surrounding areas can be
Xpurchased at the villages which can be found mostly at the ends
Xof the roads. Each village has a "special" magical site somewhere
Xinside its borders. These sites may be beneficial or harmful
Xdepending how they are approached and the circumstances of their
Xactivation.
X
XThere are a number of "special" locations in the countryside; these
Xare basically one-level screens of various sorts, or they may be
Xmulti-level dungeons. If you follow the advice of the oracle
Xwho may be found somewhere in Rampart, you will wind up visiting most
Xof these sites.
X
XA special site or dungeon may be entered from the Countryside
Xenvironment by means of the '>' command. Depending whether or not it
Xis a multilevel or single level site, it may be exited simply by
Xmoving off the edge of the screen, or by ascending or descending a
Xstairway from the first level of the dungeon.
X
END_OF_FILE
if test 2033 -ne `wc -c <'ohelp8.txt'`; then
    echo shar: \"'ohelp8.txt'\" unpacked with wrong size!
fi
# end of 'ohelp8.txt'
fi
if test -f 'omtalk.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'omtalk.c'\"
else
echo shar: Extracting \"'omtalk.c'\" \(18566 characters\)
sed "s/^X//" >'omtalk.c' <<'END_OF_FILE'
X/* omega copyright (c) 1987,1988 by Laurence Raphael Brothers */
X/* omonf.c */
X/* monster talk functions */
X
X#include "oglob.h"
X
X
X/* The druid's altar is in the northern forest */
Xvoid m_talk_druid(m)
Xstruct monster *m;
X{
X  int i;
X  if (! m_statusp(m,HOSTILE)) {
X    print1("The Archdruid raises a hand in greeting.");
X    if (! gamestatusp(SPOKE_TO_DRUID)) {
X      setgamestatus(SPOKE_TO_DRUID);
X      morewait();
X      print1("The Archdruid congratulates you on reaching his sanctum.");
X      print2("You feel competent.");
X      morewait();
X      gain_experience(300);
X      if (Player.patron == DRUID) {
X	print1("The Archdruid conveys to you the wisdom of nature....");
X	print2("You feel like a sage.");
X	for(i=0;i<NUMRANKS;i++) {
X	  if (Player.guildxp[i] > 0)
X	    Player.guildxp[i] += 300;
X	}
X      }
X    }
X    mprint("Do you wish to request a ritual of neutralization? [yn] ");
X    if (ynq() == 'y') {
X      mprint("The ArchDruid conducts a sacred rite of balance....");
X      Player.alignment = 0;
X      Player.mana = calcmana();
X      dataprint();
X    }
X  }
X  else {
X    mprint("The ArchDruid looks at you and cries: 'Unclean! Unclean!'");
X    disrupt(Player.x,Player.y,100);
X    mprint("This seems to have satiated his desire for vengeance.");
X    mprint("'Have you learned your lesson?' The ArchDruid asks. [yn] ");
X    if (ynq()) {
X      m_status_reset(m,HOSTILE);
X      mprint("'I certainly hope so!' says the ArchDruid.");
X      m_vanish(m);
X    }
X    else {
X      mprint("'Idiot.' mutters the ArchDruid.");
X      p_damage(500,UNSTOPPABLE,"the ArchDruid's Vengeance");
X    }
X  }
X}      
X
X
Xvoid m_talk_silent(m)
Xstruct monster *m;
X{
X
X  int reply = random_range(4);
X  
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (reply) {
X    case 0:strcat(Str2," does not reply. "); break;
X    case 1:strcat(Str2," shrugs silently. "); break;
X    case 2:strcat(Str2," hold a finger to his mouth. "); break;
X    case 3:strcat(Str2," glares at you but says nothing. "); break;
X  }      
X  mprint(Str2);
X}
X
Xvoid m_talk_stupid(m)
Xstruct monster *m;
X{
X
X  int reply = random_range(4);
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (reply) {
X    case 0:strcat(Str2," looks at you with mute incomprehension."); break;
X    case 1:strcat(Str2," growls menacingly and ignores you."); break;
X    case 2:strcat(Str2," does not seem to have heard you."); break;
X    case 3:strcat(Str2," tries to pretend it didn't hear you."); break;
X  }      
X  mprint(Str2);
X}
X
Xvoid m_talk_greedy(m)
Xstruct monster *m;
X{
X
X  int reply = random_range(4);
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (reply) {
X    case 0:strcat(Str2," says: Give me a treasure.... ");break;
X    case 1:strcat(Str2," says: Stand and deliver, knave! "); break;
X    case 2:strcat(Str2," says: Your money or your life! "); break;
X    case 3:strcat(Str2," says: Yield or Die! "); break;
X  }      
X  mprint(Str2);
X}
X
Xvoid m_talk_hungry(m)
Xstruct monster *m;
X{
X
X  int reply = random_range(4);
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (reply) {
X    case 0:strcat(Str2," says: I hunger, foolish adventurer! "); break;
X    case 1:strcat(Str2," drools menacingly at you. "); break;
X    case 2:strcat(Str2," says: You're invited to be lunch! "); break;
X    case 3:strcat(Str2," says: Feeed Meee! "); break;
X  }      
X  mprint(Str2);
X}
X
X
Xvoid m_talk_guard(m)
Xstruct monster *m;
X{
X  pml ml;
X  if (m_statusp(m,HOSTILE)) {
X    print1("'Surrender in the name of the Law!'");
X    print2("Do it? [yn] ");
X    if (ynq2()=='y') {
X      Player.alignment++;
X      for(ml=Level->mlist;ml!=NULL;ml=ml->next)
X	if ((ml->m->id == ML0+3) || /*guard*/
X	    ((ml->m->id == ML0+8) && (ml->m->aux2 == 15))) /* justiciar */
X	  m_status_reset(ml->m,HOSTILE);
X      m_status_reset(m,HOSTILE);
X      if (Current_Environment == E_CITY) {
X	print1("Go directly to jail. Do not pass go, do not collect 200Au.");
X	print2("You are taken to the city gaol.");
X	morewait();
X	send_to_jail();
X	drawvision(Player.x,Player.y);
X      }
X      else {
X	clearmsg();
X	print1("Mollified, the guard disarms you and sends you away.");
X	dispose_lost_objects(1,Player.possessions[O_WEAPON_HAND]);
X      }
X    }
X    else {
X      clearmsg();
X      print1("All right, you criminal scum, you asked for it!");
X    }
X  }
X  else if (Player.rank[ORDER]>0) 
X    print1("'Greetings comrade! May you always tread the paths of Law.'");
X  else print1("Move it right along, stranger!");
X}
X
X
Xvoid m_talk_mp(m)
Xstruct monster *m;
X{
X  mprint("The mendicant priest asks you to spare some treasure for the needy");
X}
X
X
Xvoid m_talk_titter(m)
Xstruct monster *m;
X{
X
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," titters obscenely at you.");
X  mprint(Str2);
X}
X
X
Xvoid m_talk_ninja(m)
Xstruct monster *m;
X{
X  mprint("The black-garbed figure says apologetically:");
X  mprint("'Situree simasita, wakarimasen.'");
X}
X
X
X
X
Xvoid m_talk_thief(m)
Xstruct monster *m;
X{
X  if (Player.rank[THIEVES]) {
X    if (m->level == 2) 
X      m->monstring = salloc("sneak thief");
X    else m->monstring = salloc("master thief");
X    print1("The cloaked figure makes a gesture which you recognize...");
X    print2("...the thieves' guild recognition signal!");
X    print3("'Sorry, mate, thought you were a mark....'");
X    morewait();
X    m_vanish(m);
X  }
X  else m_talk_man(m);
X
X}
X
X
X
Xvoid m_talk_assassin(m)
Xstruct monster *m;
X{
X  m->monstring = salloc("master assassin");
X  print1("The ominous figure does not reply, but hands you an embossed card:");
X  print2("'Guild of Assassins Ops are forbidden to converse with targets.'");
X}
X    
X
Xvoid m_talk_im(m)
Xstruct monster *m;
X{
X  if (strcmp(m->monstring,"itinerant merchant") != 0) {
X    m->monstring = salloc("itinerant merchant");
X  }
X  if (m->possessions == NULL)
X    mprint("The merchant says: Alas! I have nothing to sell!");
X  else {
X    m->possessions->thing->known = 2;
X    mprint("I have a fine");
X    mprint(itemid(m->possessions->thing));
X    mprint("for only");
X    mnumprint(max(10,4*true_item_value(m->possessions->thing)));
X    mprint("Au.");
X    mprint("Want it? [yn] ");
X    if (ynq()=='y') {
X      if (Player.cash < (max(10,4*true_item_value(m->possessions->thing)))) {
X	if (Player.alignment > 10) {
X	  mprint("Well, I'll let you have it for what you've got.");
X	  Player.cash = 0;
X	  gain_item(m->possessions->thing);
X	  m->possessions = NULL;
X	}
X	else mprint("Beat it, you deadbeat!");
X      }
X      else {
X	mprint("Here you are. Have a good day.");
X	Player.cash -= max(10,(4*item_value(m->possessions->thing)));
X	gain_item(m->possessions->thing);
X	m->possessions = NULL;
X      }
X    }
X    else mprint("Well then, I must be off. Good day.");
X    m_vanish(m);
X  }
X}
X
X
Xvoid m_talk_man(m)
Xstruct monster *m;
X{
X
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (random_range(5)) {
X    case 0:strcat(Str2," asks you for the way home."); break;
X    case 1:strcat(Str2," wishes you a pleasant day."); break;
X    case 2:strcat(Str2," sneers at you contemptuously."); break;
X    case 3:strcat(Str2," smiles and nods."); break;
X    case 4:strcat(Str2," tells you a joke."); break;
X  }
X  mprint(Str2);
X}
X
X
Xvoid m_talk_evil(m)
Xstruct monster *m;
X{
X
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (random_range(14)) {
X    case 0:strcat(Str2," says: 'THERE CAN BE ONLY ONE!'"); break;
X    case 1:strcat(Str2," says: 'Prepare to die, Buckwheat!'"); break;
X    case 2:strcat(Str2," says: 'Time to die!'"); break;
X    case 3:strcat(Str2," says: 'There will be no mercy.'"); break;
X    case 4:strcat(Str2," insults your mother-in-law."); break;
X    case 5:strcat(Str2," says: 'Kurav tu ando mul!'");
X    case 6:strcat(Str2," says: '!va al infierno!'"); break;
X    case 7:strcat(Str2," says: 'dame desu, nee.'"); break;
X    case 8:strcat(Str2," spits on your rug and calls your cat a bastard."); 
X      break;
X    case 9:strcat(Str2," snickers malevolently and draws a weapon."); break;
X    case 10:strcat(Str2," sends 'rm -r *' to your shell!"); break;
X    case 11:strcat(Str2," tweaks your nose and cackles evilly."); break;
X    case 12:strcat(Str2," thumbs you in the eyes."); break;
X    case 13:strcat(Str2," kicks you in the groin."); break;
X  }
X  mprint(Str2);
X}
X
X
Xvoid m_talk_robot(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  switch (random_range(4)) {
X    case 0:strcat(Str2," says: 'exterminate...Exterminate...EXTERMINATE!!!'");
X      break;
X    case 1:strcat(Str2," says: 'Kill ... Crush ... Destroy'"); break;
X      break;
X    case 2:strcat(Str2," says: 'Danger -- Danger'"); break;
X      break;
X    case 3:strcat(Str2," says: 'Yo Mama -- core dumped.'"); break;
X      break;
X  }
X  mprint(Str2);
X}
X
Xvoid m_talk_slithy(m)
Xstruct monster *m;
X{
X  mprint("It can't talk -- it's too slithy!");
X}
X
X
Xvoid m_talk_mimsy(m)
Xstruct monster *m;
X{
X  mprint("It can't talk -- it's too mimsy!");
X}
X
X
X
Xvoid m_talk_burble(m)
Xstruct monster *m;
X{
X
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," burbles hatefully at you.");
X  mprint(Str2);
X}
X
X
X
X
Xvoid m_talk_beg(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," asks you for alms.");
X  mprint(Str2);
X}
X
X
Xvoid m_talk_hint(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  if (m_statusp(m,HOSTILE)) {
X    strcat(Str2," only sneers at you. ");
X    mprint(Str2);
X  }
X  else {
X    strcat(Str2," whispers in your ear: ");
X    mprint(Str2);
X    hint();
X    m->talkf = M_TALK_SILENT;
X  }
X}
X
Xvoid m_talk_gf(m)
Xstruct monster *m;
X{
X  mprint("The good fairy glints: Would you like a wish?");
X  if (ynq()=='y') {
X    mprint("The good fairy glows: Are you sure?");
X    if (ynq()=='y') {
X      mprint("The good fairy radiates: Really really sure?");
X      if (ynq()=='y') {
X	mprint("The good fairy beams: I mean, like, sure as sure can be?");
X	if (ynq()=='y') {
X	  mprint("The good fairy dazzles: You don't want a wish, right?");
X	  if (ynq()=='y') mprint("The good fairy laughs: I thought not.");
X	  else wish(0);
X	}
X      }
X    }
X  }
X  mprint("In a flash of sweet-smelling light, the fairy vanishes....");
X  Player.hp = max(Player.hp,Player.maxhp);
X  Player.mana = max(Player.mana,calcmana());
X  mprint("You feel mellow.");
X  m_vanish(m);
X}
X
Xvoid m_talk_ef(m)
Xstruct monster *m;
X{
X  mprint("The evil fairy roils: Eat my pixie dust!");
X  mprint("She waves her black-glowing wand, which screams thinly....");
X  m->movef=M_MOVE_SMART;
X  m->meleef=M_MELEE_POISON;
X  m->specialf=M_SP_THIEF;
X  acquire(-1);
X  bless(-1);
X  sleep_player(m->level/2);
X  summon(-1,-1);
X  summon(-1,-1);
X  summon(-1,-1);
X  summon(-1,-1);
X}
X
X
Xvoid m_talk_seductor(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," beckons seductively...");
X  mprint(Str2);
X  mprint("Flee? [yn] ");
X  if (ynq()=='y') {
X    mprint("You feel stupid.");
X  }
X  else {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X    strcat(Str2," shows you a good time....");
X    mprint(Str2);
X    gain_experience(500);
X    Player.con++;
X  }
X  m_vanish(m);
X}
X
X
Xvoid m_talk_demonlover(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," beckons seductively...");
X  mprint(Str2);
X  mprint("Flee? [yn] ");
X  if (ynq()=='y') 
X    mprint("You feel fortunate....");
X  else {
X    if (m->uniqueness == COMMON) {
X      strcpy(Str2,"The ");
X      strcat(Str2,m->monstring);
X    }
X    else strcpy(Str2,m->monstring);
X    strcat(Str2," shows you a good time....");
X    mprint(Str2);
X    mprint("You feel your life energies draining...");
X    level_drain(random_range(3)+1,"a demon's kiss");
X  }
X  m->talkf = M_TALK_EVIL;
X  m->meleef = M_MELEE_SPIRIT;
X  m->specialf = M_SP_DEMON;
X
X  if (m->monchar == 's') {
X    m->monchar = 'I';
X    m->monstring = salloc("incubus");
X  }
X  else {
X    m->monchar = 'S';
X    m->monstring = salloc("succubus");
X  }
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  strcat(Str2," laughs insanely.");
X  mprint(Str2);
X  mprint("You now notice the fangs, claws, batwings...");
X}
X
X
Xvoid m_talk_horse(m)
Xstruct monster *m;
X{
X  if (m_statusp(m,HOSTILE)) 
X    mprint("The horse neighs angrily at you.");
X  else if (m_statusp(m,HUNGRY))
X    mprint("The horse noses curiously at your pack.");
X  else if (gamestatusp(MOUNTED))
X    mprint("The horse and your steed don't seem to get along.");
X  else if (Current_Environment == Current_Dungeon)
X    mprint("The horse shies; maybe he doesn't like the dungeon air....");
X  else {
X    mprint("The horse lets you pat his nose. Want to ride him? [yn] ");
X    if (ynq()=='y') {
X      m->hp = -1;
X      Level->site[m->x][m->y].creature = NULL;
X      putspot(m->x,m->y,getspot(m->x,m->y,FALSE));
X      setgamestatus(MOUNTED);
X      calc_melee();
X      mprint("You are now equitating!");
X    }
X  }
X}
X
Xvoid m_talk_hyena(m)
Xstruct monster *m;
X{
X  mprint("The hyena only laughs at you...");
X}
X
Xvoid m_talk_parrot(m)
Xstruct monster *m;
X{
X  mprint("Polly wanna cracker?");
X}
X
X
Xvoid m_talk_servant(m)
Xstruct monster *m;
X{
X  int target,x=Player.x,y=Player.y;
X  if (m->id == ML4+12) {
X    target = ML4+13;
X    mprint("The servant of law pauses in thought for a moment.");
X    mprint("You are asked: Are there any servants of chaos hereabouts? [yn] ");
X  }
X  else {
X    target = ML4+12;
X    mprint("The servant of chaos pauses in thought for a moment.");
X    mprint("You are asked: Are there any servants of law hereabouts? [yn] ");
X  }
X  if (ynq()=='y') {
X    mprint("Show me.");
X    setspot(&x,&y);
X    if (Level->site[x][y].creature != NULL) {
X      if (Level->site[x][y].creature->id == target) {
X	mprint("The servant launches itself towards the target you selected.");
X	mprint("In a blaze of combat, the servants annihilate each other!");
X	gain_experience(m->xpv);
X	m_death(Level->site[x][y].creature);
X	m->x = x;
X	m->y = y;
X	Level->site[x][y].creature = m;
X	m_death(Level->site[x][y].creature);
X      }
X      else mprint("Right. Tell me about it. Idiot!");
X    }
X    else mprint("Right. Tell me about it. Idiot!");
X  }
X  else mprint("The servant shrugs and turns away.");
X}
X
X
Xvoid m_talk_animal(m)
Xstruct monster *m;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str2,"The ");
X    strcat(Str2,m->monstring);
X  }
X  else strcpy(Str2,m->monstring);
X  mprint(Str2);
X  mprint("shows you a scholarly paper by Dolittle, D. Vet.");
X  mprint("which demonstrates that animals don't have speech centers");
X  mprint("complex enough to communicate in higher languages.");
X  mprint("It giggles softly to itself and takes back the paper.");
X}
X
X
Xvoid m_talk_scream(m)
Xstruct monster *m;
X{
X  mprint("A thinly echoing scream reaches your ears....");
X  morewait();
X  mprint("You feel doomed....");
X  morewait();
X  mprint("A bird appears and flies three times widdershins around your head.");
X  summon(-1,QUAIL);
X  m->talkf = M_TALK_EVIL;
X}
X
X
Xvoid m_talk_archmage(m)
Xstruct monster *m;
X{
X  if (m_statusp(m,HOSTILE)) {
X    mprint("The Archmage ignores your attempt at conversation");
X    mprint("and concentrates on his spellcasting....");
X  }
X  else if (Current_Environment == E_COURT) {
X    mprint("The Archmage congratulates you on getting this far.");
X    mprint("He invites you to attempt the Throne of High Magic");
X    mprint("but warns you that it is important to wield the Sceptre");
X    mprint("before sitting on the throne.");
X    if (Level->site[m->x][m->y].p_locf == L_THRONE) {
X      mprint("The Archmage smiles and makes an arcane gesture....");
X      m_vanish(m);
X    }
X  }
X  else {
X    mprint("The Archmage tells you to find him again in his");
X    mprint("Magical Court at the base of his castle in the mountains");
X    mprint("of the far North-East; if you do he will give you some");
X    mprint("important information.");
X  }
X}
X
X
Xvoid m_talk_merchant(m)
Xstruct monster *m;
X{
X  if (! m_statusp(m,HOSTILE)) {
X    if (Current_Environment == E_VILLAGE) {
X      mprint("The merchant asks you if you want to buy a horse for 250GP.");
X      mprint("Pay the merchant? [yn] ");
X      if (ynq()=='y') {
X	if (Player.cash < 250) 
X	  mprint("The merchant says: 'Come back when you've got the cash!'");
X	else {
X	  Player.cash -= 250;
X	  mprint("The merchant takes your money and tells you to select");
X	  mprint("any horse you want in the stables.");
X	  mprint("He says: 'You'll want to get to know him before trying to");
X	  mprint("ride him. By the way, food for the horse is not included.'");
X	  mprint("The merchant runs off toward the bank, cackling gleefully.");
X	  m_vanish(m);
X	}
X      }
X      else mprint("The merchant tells you to stop wasting his time.");
X    }
X    else {
X      mprint("The merchant tells you to visit his stables at his village");
X      mprint("for a great deal on a horse.");
X    }
X  }
X  else {
X    mprint("The merchant ignores you and screams:");
X    mprint("'Help! Help! I'm being oppressed!'");
X  }
X}
X  
X
Xvoid m_talk_prime(m)
Xstruct monster *m;
X{
X  if (!m_statusp(m,HOSTILE)) {
X    if (Current_Environment == E_CIRCLE) {
X      print1("The Prime nods brusquely at you, removes a gem from his");
X      print2("sleeve, places it on the floor, and vanishes wordlessly.");
X      morewait();
X      m_vanish(m);
X    }
X    else {
X      print1("The Prime makes an intricate gesture, which leaves behind");
X      print2("glowing blue sparks... He winks mischievously at you....");
X      if (Player.rank[CIRCLE] > 0) {
X	morewait();
X	print1("The blue sparks strike you! You feel enhanced!");
X	print2("You feel more experienced....");
X	Player.pow+=Player.rank[CIRCLE];
X	Player.mana += calcmana();
X	gain_experience(1000);
X	m_vanish(m);
X      }
X    }
X  }
X  else m_talk_evil(m);
X}
END_OF_FILE
if test 18566 -ne `wc -c <'omtalk.c'`; then
    echo shar: \"'omtalk.c'\" unpacked with wrong size!
fi
# end of 'omtalk.c'
fi
echo shar: End of archive 4 \(of 19\).
cp /dev/null ark4isdone
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