[comp.sources.games] v05i027: 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 27
Archive-name: omega2/Part17



#! /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 17 (of 19)."
# Contents:  oenv.c oglob.h ohelp3.txt ohelp5.txt oitemf2.c omaze2.dat
#   ommelee.c otrap.c
# Wrapped by billr@saab on Wed Jul 13 10:47:00 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'oenv.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oenv.c'\"
else
echo shar: Extracting \"'oenv.c'\" \(7791 characters\)
sed "s/^X//" >'oenv.c' <<'END_OF_FILE'
X/* omega copyright (c) 1987,1988 by Laurence Raphael Brothers */
X/* oenv.c */
X/* some load_* routines for special environments */
X
X#include "oglob.h"
X
X/* loads the arena level into Level*/
Xvoid load_arena()
X{
X  int i,j;
X  char site;
X  pob box=((pob)malloc(sizeof(objtype)));
X  FILE *fd;
X
X  *box = Objects[THINGID+0];
X
X  TempLevel = Level;
X  if (ok_to_free(TempLevel)) {
X    free((char *) TempLevel);
X    TempLevel = NULL;
X  }
X  Level = ((plv) malloc(sizeof(levtype)));
X  clear_level(Level);
X  Level->environment = E_ARENA;
X  strcpy(Str3,OMEGALIB);
X  strcat(Str3,"oarena.dat");
X  fd = fopen(Str3,"r");
X  for(j=0;j<LENGTH;j++) {
X    for(i=0;i<WIDTH;i++) {
X      Level->site[i][j].lstatus = SEEN+LIT;
X      Level->site[i][j].roomnumber = RS_ARENA;
X      site = getc(fd);
X      switch(site) {
X      case 'P':
X	Level->site[i][j].locchar = PORTCULLIS;
X	Level->site[i][j].p_locf = L_PORTCULLIS;
X	break;
X      case 'R':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_RAISE_PORTCULLIS;
X	break;
X      case 'p':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_PORTCULLIS;
X	break;
X      case '7':
X	Level->site[i][j].locchar = PORTCULLIS;
X	Level->site[i][j].p_locf = L_PORTCULLIS;
X	break;
X      case 'T':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_DROP_EVERY_PORTCULLIS;
X	break;
X      case 'X':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_ARENA_EXIT;
X	break;
X      default:
X	Level->site[i][j].locchar = site;
X	Level->site[i][j].p_locf = L_NO_OP;
X	break;
X      }
X      Level->site[i][j].showchar = Level->site[i][j].locchar;
X    }
X    fscanf(fd,"\n");
X
X  }
X  Level->site[60][7].creature = Arena_Monster;
X  Arena_Monster->x = 60;
X  Arena_Monster->y = 7;
X  Arena_Monster->sense = 50;
X  m_pickup(Arena_Monster,box);
X  m_status_set(Arena_Monster,AWAKE);
X  Level->mlist = (pml) malloc(sizeof(mltype));
X  Level->mlist->m = Arena_Monster;
X  Level->mlist->next = NULL;
X  /* hehehehe cackled the dungeon master.... */
X  mprint("Your opponent holds the only way you can leave!");
X  Arena_Monster->hp += Arena_Monster->level*10;
X  Arena_Monster->hit += Arena_Monster->hit;
X  Arena_Monster->dmg += Arena_Monster->dmg/2;
X}
X
X/* loads the sorcereror's circle into Level*/
Xvoid load_circle()
X{
X  int i,j;
X  int safe = (Player.rank[CIRCLE] > 0);
X  char site;
X  FILE *fd;
X
X  TempLevel = Level;
X  if (ok_to_free(TempLevel)) {
X    free((char *) TempLevel);
X    TempLevel = NULL;
X  }
X  Level = ((plv) malloc(sizeof(levtype)));
X  clear_level(Level);
X  Level->environment = E_CIRCLE;
X  strcpy(Str3,OMEGALIB);
X  strcat(Str3,"ocircle.dat");
X  fd = fopen(Str3,"r");
X  for(j=0;j<LENGTH;j++) {
X    for(i=0;i<WIDTH;i++) {
X      Level->site[i][j].lstatus = 0;
X      Level->site[i][j].roomnumber = RS_CIRCLE;
X      Level->site[i][j].p_locf = L_NO_OP;
X      site = getc(fd);
X      switch(site) {
X      case 'P':
X	Level->site[i][j].locchar = FLOOR;
X	make_prime(i,j); /* prime sorceror */
X	Level->site[i][j].creature->specialf = M_SP_PRIME;
X	if (! safe) m_status_set(Level->site[i][j].creature,HOSTILE);
X	break;
X      case 'D':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML9+7); /* prime circle demon */
X	if (safe) m_status_reset(Level->site[i][j].creature,HOSTILE);
X	Level->site[i][j].creature->specialf = M_SP_PRIME;
X	break;
X      case 's':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML4+13); /* servant of chaos */
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	if (safe) m_status_reset(Level->site[i][j].creature,HOSTILE);
X	break;
X      case 'e':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML2+7); /* enchanter */
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	if (safe) m_status_reset(Level->site[i][j].creature,HOSTILE);
X	break;
X      case 'n':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML5+6); /* necromancer */
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	if (safe) m_status_reset(Level->site[i][j].creature,HOSTILE);
X	break;
X      case 'T':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML9+4); /* High Thaumaturgist */
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	if (safe) m_status_reset(Level->site[i][j].creature,HOSTILE);
X	break;
X      case '#':
X	Level->site[i][j].locchar = WALL;
X	Level->site[i][j].aux = 1000; 
X	break;
X      case 'L':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_CIRCLE_LIBRARY;
X	break;
X      case '?':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_TOME1;
X	break;
X      case '!':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].p_locf = L_TOME2;
X	break;
X      case 'S':
X	Level->site[i][j].locchar = FLOOR;
X	lset(i,j,SECRET);
X	break;
X      case '.':
X	Level->site[i][j].locchar = FLOOR;
X	break;
X      case '-':
X	Level->site[i][j].locchar = CLOSED_DOOR;
X	break;
X      }
X    }
X    fscanf(fd,"\n");
X  }
X  fclose(fd);
X}
X
X/* make the prime sorceror */
Xvoid make_prime(i,j)
Xint i,j;
X{
X  pml ml = ((pml) malloc(sizeof(mltype)));
X  pmt m = ((pmt) malloc(sizeof(montype)));
X  pol ol;
X  pob o;
X  make_hiscore_npc(m,10); /* 10 is index for prime */
X  m->x = i;
X  m->y = j;
X  Level->site[i][j].creature = m;
X  ml->m = m;
X  ml->next = Level->mlist;
X  Level->mlist = ml;
X  
X  if (! gamestatusp(COMPLETED_ASTRAL)) {
X    ol  = ((pol) malloc(sizeof(oltype)));
X    o  = ((pob) malloc(sizeof(objtype)));
X    *o = Objects[ARTIFACTID+21];
X    ol->thing = o;
X    ol->next = NULL;
X    m->possessions = ol;
X  }
X
X}
X
X
X
X
X
X
X/* loads the court of the archmage into Level*/
Xvoid load_court()
X{
X  int i,j;
X  char site;
X  FILE *fd;
X
X  TempLevel = Level;
X  if (ok_to_free(TempLevel)) {
X    free((char *) TempLevel);
X    TempLevel = NULL;
X  }
X  Level = ((plv) malloc(sizeof(levtype)));
X  clear_level(Level);
X  Level->environment = E_COURT;
X  strcpy(Str3,OMEGALIB);
X  strcat(Str3,"ocourt.dat");
X  fd = fopen(Str3,"r");
X  for(j=0;j<LENGTH;j++) {
X    for(i=0;i<WIDTH;i++) {
X      Level->site[i][j].lstatus = 0;
X      Level->site[i][j].roomnumber = RS_COURT;
X      Level->site[i][j].p_locf = L_NO_OP;
X      site = getc(fd);
X      switch(site) {
X      case '5':
X	Level->site[i][j].locchar = CHAIR;
X	Level->site[i][j].p_locf = L_THRONE;
X	make_specific_treasure(i,j,ARTIFACTID+22);
X	make_archmage(i,j);
X	m_status_reset(Level->site[i][j].creature,HOSTILE);
X	m_status_reset(Level->site[i][j].creature,MOBILE);
X	break;
X      case 'e':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML2+7); /* enchanter */
X	m_status_reset(Level->site[i][j].creature,HOSTILE);
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	break;
X      case 'n':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML5+6); /* necromancer */
X	m_status_reset(Level->site[i][j].creature,HOSTILE);
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	break;
X      case 'T':
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML9+4); /* High Thaumaturgist */
X	m_status_reset(Level->site[i][j].creature,HOSTILE);
X	Level->site[i][j].creature->specialf = M_SP_COURT;
X	break;
X      case '#':
X	Level->site[i][j].locchar = WALL;
X	Level->site[i][j].aux = 1000; 
X	break;
X      case 'G':
X	Level->site[i][j].locchar = FLOOR;
X	Level->site[i][j].locchar = FLOOR;
X	make_site_monster(i,j,ML0+3); /* guard */
X	m_status_reset(Level->site[i][j].creature,HOSTILE);
X	break;
X      case '<':
X	Level->site[i][j].locchar = UP;
X	Level->site[i][j].p_locf = L_ESCALATOR;
X	break;
X      case '.':
X	Level->site[i][j].locchar = FLOOR;
X	break;
X      }
X    }
X    fscanf(fd,"\n");
X  }
X  fclose(fd);
X}
X
X
X
X/* make the archmage */
Xvoid make_archmage(i,j)
Xint i,j;
X{
X  pml ml = ((pml) malloc(sizeof(mltype)));
X  pmt m = ((pmt) malloc(sizeof(montype)));
X  make_hiscore_npc(m,9); /* 10 is index for archmage */
X  m->x = i;
X  m->y = j;
X  Level->site[i][j].creature = m;
X  ml->m = m;
X  ml->next = Level->mlist;
X  Level->mlist = ml;
X  m->specialf = M_SP_COURT;
X}
X
END_OF_FILE
if test 7791 -ne `wc -c <'oenv.c'`; then
    echo shar: \"'oenv.c'\" unpacked with wrong size!
fi
# end of 'oenv.c'
fi
if test -f 'oglob.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oglob.h'\"
else
echo shar: Extracting \"'oglob.h'\" \(4919 characters\)
sed "s/^X//" >'oglob.h' <<'END_OF_FILE'
X/* omega copyright (c) 1987,1988 by Laurence Raphael Brothers */
X
X/* this file contains extern declarations of global variables used
X   throughout the program */
X/* it includes the other header files, so every program module 
X(except o.c) can just include this file. */
X
X/* oglob.h */
X
X#include "odefs.h"
X
X#include "oextern.h"
X
X/* one of each monster */
Xextern struct monster Monsters[NUMMONSTERS];
X
X/* one of each spell */
Xextern struct spell Spells[NUMSPELLS+1];
X
X/* one of each item */
Xextern struct object Objects[TOTALITEMS];
X
X/* locations of city sites [0] - found, [1] - x, [2] - y */
Xextern int CitySiteList[NUMCITYSITES][3];
X
Xextern struct player Player;                 
X/* the player */
X
Xextern int LENGTH;
X/* level y dimension */
X
Xextern int WIDTH;
X/* level x dimension */
X
Xextern int GameStatus;
X/* Game Status bit vector */
X
Xextern int ScreenLength;
X/* How large is level window */
X
Xextern struct terrain Country[MAXWIDTH][MAXLENGTH];
X/* The countryside */
X
Xextern struct level *City;
X/* The city of Rampart */
X
Xextern struct level *TempLevel;
X/* Place holder */
X
Xextern struct level *Dungeon;
X/* Pointer to current Dungeon */
X
Xextern struct level *Level;
X/* Pointer to current Level */
X
Xextern int Current_Dungeon;
X/* What is Dungeon now (an E_ constant) */
X
Xextern int Villagenum;
X/* Current Village number */ 
X
Xextern int ScreenOffset;
X/* Offset of displayed screen to level */
X
Xextern int MaxDungeonLevels;
X/*Deepest level allowed in dungeon */
X
Xextern int Current_Environment;
X/* Which environment are we in (an E_ constant) */
X
Xextern int Last_Environment;
X/* Which environment were we in last (an E_ constant) */
X
Xextern int Dirs[2][9];                       
X/* 9 xy directions */
X
Xextern char Cmd;                         
X/* last player command */
X
Xextern int Command_Duration;
X/* how long does current command take */
X
Xextern struct monster *Arena_Monster;
X/* Opponent in arena */
X
Xextern int Arena_Opponent;
X/* case label of opponent in l_arena()*/
X
Xextern int Arena_Victory;
X/* did player win in arena? */
X
Xextern int Imprisonment;
X/* amount of time spent in jail */
X
Xextern int Precipitation;
X/* Hours of rain, snow, etc */
X
Xextern int Phase;
X/* Phase of the moon */
X
Xextern int Lunarity;
X/* How player is affected by moon */
X
Xextern int Date;
X/* day of the year */
X
Xextern int Pawndate;
X/* Pawn Shop item generation date */
X
Xextern pob Pawnitems[PAWNITEMS];
X/* items in pawn shop */
X
Xextern int ViewHour;
X/* crystal ball use marker */
X
Xextern int ZapHour;
X/* staff of enchantment use marker */
X
Xint HelmHour;
X/* helm of teleportation use marker*/
X
Xextern int SymbolUseHour;                
X/* holy symbol use marker */
X
Xextern int Constriction;
X/* Dragonlord Attack State */
X
Xextern int Blessing;
X/* Altar Blessing State */
X
Xextern int LastDay;
X/* DPW date of dole */
X
Xextern int RitualHour;
X/* last use of ritual magic */
X
Xextern int RitualRoom;
X/* last room use of ritual magic */
X
Xextern int Lawstone;
X/* magic stone counter */
X
Xextern int Chaostone;
X/* magic stone counter */
X
Xextern int Mindstone;
X/* magic stone counter */
X
Xextern int Searchnum;                    
X/* number of times to search on 's' */
X
Xextern int Verbosity;
X/* verbosity level */
X
Xextern char Seed;                            
X/* random seed */
X
Xextern int Time;
X/* turn number */
X
Xextern int Tick;
X/* current second in minute; action coordinator */
X
Xextern char Stringbuffer[10][80];
X/* the last printed strings */
X
Xextern int Gymcredit;
X/* credit at rampart gym */
X
Xextern int Spellsleft;
X/* research allowance at college */
X
Xextern int StarGemUse;
X/* last date of star gem use */
X
Xextern int HiMagicUse;
X/* last date of high magic use */
X
Xextern int HiMagic;
X/* current level for l_throne */ 
X
Xextern int Balance;
X/* bank account */
X
Xextern int FixedPoints;
X/* points are frozen after adepthood*/
X
Xextern int LastCountryLocX;
X/* previous position in countryside */
X
Xextern int LastCountryLocY;
X/* previous position in countryside */
X
Xextern int LastTownLocX;
X/* previous position in village or city */
X
Xextern int LastTownLocY;
X/* previous position in village or city */
X
Xextern char Password[64];
X/* autoteller password */
X
Xpol Condoitems;
X/* items in condo */
X
Xextern char Str1[100],Str2[100],Str3[100],Str4[100];
X/* Some string space, random uses */
X
X
X
X/* high score names, levels, behavior */
X
Xextern int Shadowlordbehavior,Archmagebehavior,Primebehavior,Justiciarbehavior;
Xextern int Commandantbehavior,Chaoslordbehavior,Lawlordbehavior;
Xextern int Championbehavior,Priestbehavior[7],Hibehavior,Dukebehavior;
Xextern char Shadowlord[80],Archmage[80],Prime[80],Commandant[80],Duke[80];
Xextern char Champion[80],Priest[7][80],Hiscorer[80],Hidescrip[80];
Xextern char Chaoslord[80],Lawlord[80],Justiciar[80];
Xextern int Shadowlordlevel,Archmagelevel,Primelevel,Commandantlevel,Dukelevel;
Xextern int Championlevel,Priestlevel[7],Hiscore,Hilevel,Justiciarlevel;
Xextern int Chaoslordlevel,Lawlordlevel,Chaos,Law;
X
END_OF_FILE
if test 4919 -ne `wc -c <'oglob.h'`; then
    echo shar: \"'oglob.h'\" unpacked with wrong size!
fi
# end of 'oglob.h'
fi
if test -f 'ohelp3.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp3.txt'\"
else
echo shar: Extracting \"'ohelp3.txt'\" \(5156 characters\)
sed "s/^X//" >'ohelp3.txt' <<'END_OF_FILE'
XINVENTORY
X=========
Xomega inventories are now much different from other rogue-like games.
X
XUnlike rogue, et al., you cannot directly employ every object you
Xcarry. Every object may either go into your "pack" or into some
Xspecific inventory slot such as "belt" or "ready hand" or "left
Xshoulder" etc. Some slots are dedicated to certain types of items (eg,
Xonly armor can go in the armor slot), but other slots are general
Xpurpose, like your belt or your shoulder.
X
XIt takes game time to transfer an object from your pack, (which can
Xhold a fixed number of items) to specific slots from which the item may be
Xuseable. The pack is implemented as a mock-stack, so the deeper you burrow
Xinto your pack looking for some item, the more game time you are
Xwasting. Therefore, carrying a whole lot of (semi)useless items may be
Xa strategically bad move.  Of course, as always, you can't carry more
Xweight (either in your pack or in your inventory slots) than is
Xdictated by your current STRENGTH and AGILITY.
X
XINVENTORY CONTROL MODES
X=======================
XThere are two type of inventory control: Display mode and Quick mode.
XWhich mode you use by default can be toggled by the TOPLINE option
Xsettable with the 'O' command and in your .omegarc file.
X
XIn Display mode, all the inventory slots are displayed in the menu
Xwindow. In Quick mode, only the message lines above the main window
Xare used, and therefore the slots are not all displayed, only
Xone of them at a time. Additionally, the commands are slightly 
Xdifferent. One nuance to the display -- note the character following
Xthe index of the slot in the following two lines.
X
X-- a> weapon hand: mace
X-- e) belt: short sword
X
XThe '>' in the first line indicates the mace is "in use", while 
Xthe ') in the second lines means the short sword is not currently
Xbeing used. If it is possible for an item to be "in use" in the
Xcurrent slot, it will be indicated by a '>'. Therefore, if you
Xdon't want to put some new unidentified weapon into use, don't
Xtry to carry it in the weapon hand; the same holds for shields
Xin the shield slot, etc.
X
XThe amount of time each action takes is indicated below. Dropping two
Xitems takes twice as long as dropping one item.
X
XDISPLAY MODE:
X^l,^r: Redisplay inventory (if screen is munged). Takes no time.
Xd:  Drop the item currently in the 'up-in-the-air' slot, or in the
X    'selected' slot if there is nothing 'up-in-the-air'. Takes one second.
Xp:  Put the 'up-in-the-air' item into your pack, or the 'selected'
X    item, if the 'up-in-the-air' item is vacant. Takes 5 seconds.
Xs:  Show the contents of your pack. Takes 5 seconds.
Xt:  Take an item from your pack and put into the 'selected' slot, or
X    if that is full, tries to put into the 'up-in-the-air' slot.
X    Takes 5 seconds + 1 second/item examined in pack. I.e., rummaging
X    at three items before taking one takes 8 seconds.
Xe:  Exchange the 'up-in-the-air' slot with the 'selected' slot. This
X    will merge two quantities of an item together if possible.
X    Either slot may be vacant, in which case it is a simple 'put'
X    or 'take' to a slot.
X    Takes 2 seconds.
Xx:  Same as 'e' but quit inventory mode immediately if the
X    up-in-the-air slot is vacant after the action (ie, if it wasn't
X    an exchange, but was just a put). Helpful when picking up new items.
X    Takes 2 seconds.
X>:  Cause the next slot lower down to be the 'selected' one. Takes no time.
X<:  Cause the next slot higher up to be the 'selected' one. Takes no time.
X?:  Print this help. Takes no time.
XESCAPE: return to game, dropping any object in the 'up-in-the-air' slot.
X        Takes no time.
X
XIn Display Mode, the 'selected' slot is the one with a highlighted
X'->' before it.
X
XQUICK (TOPINV) MODE:
Xd:  Drop an item. Takes one second.
Xp:  Put some item into your pack. Takes 5 seconds.
Xs:  Show the contents of your pack. Takes 5 seconds.
Xt:  Take an item from your pack and put into some inventory slot, or
X    into the 'up-in-the-air' slot if the one selected is full.
X    Takes 5 seconds + depth of item in pack.
Xe:  Exchange the 'up-in-the-air' slot with some slot. This
X    will merge two quantities of an item together if possible.
X    Either slot may be vacant, in which case it is a simple 'put'
X    or 'take' to a slot.
X    Takes 2 seconds.
Xx:  Same as 'e' but quit inventory mode immediately if the
X    up-in-the-air slot is vacant after the action (ie, if it wasn't
X    an exchange, but was just a put). Helpful when picking up new items.
X    Takes 2 seconds.
X~:  Enter Display Mode. Takes no time.
X?:  Print this help. Takes no time.
XESCAPE: return to game, dropping any object in the 'up-in-the-air' slot.
X        Takes no time.
X
XIn quick mode, there is no 'selected' slot, instead the letter
Xidentifying the slot must be entered following the command.
X
XThe 'e' and 'x' commands in both modes are the ones you'll use most;
Xit combines taking and putting from inventory slot to "up-in-air"
Xwhere picked-up items will be, and where you will drop items from on
Xleaving the inventory mode. Usually the pack is used for items which
Xit is not important to be able to get at easily, while inventory
Xslots are for useful items.
END_OF_FILE
if test 5156 -ne `wc -c <'ohelp3.txt'`; then
    echo shar: \"'ohelp3.txt'\" unpacked with wrong size!
fi
# end of 'ohelp3.txt'
fi
if test -f 'ohelp5.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ohelp5.txt'\"
else
echo shar: Extracting \"'ohelp5.txt'\" \(4670 characters\)
sed "s/^X//" >'ohelp5.txt' <<'END_OF_FILE'
XCOMBAT
X======
XAs in most rogue-like games, you attack an adjacent monster by
Xattempting to move onto it.
X
XAt this time, your current real statistics on to-hit, damage, defense,
Xand armor protection are always displayed. It is felt that the
Xcharacter would know (or quickly discover) how well any weapon, armor,
Xetc. actually work. By comparing different weapons, armor, and shield
Xcombinations, you can decide what martial configuration is best for
Xyour character.  Keep in mind that cost of equipment does not
Xnecessarily indicate how good it is (though it is a good rule of
Xthumb).
X
XThe 'F' command allows you to select precisely which actions you will
Xtake in a combat round -- parry high, thrust low, etc.  You have
Xseveral maneuver points for use in each combat round, depending on
Xlevel, status as a gladiator, etc. At the beginning of the game, your
Xcombat options are already set for you, but as you progress, and
Xpossibly gain more maneuvers, the preset options will not be
Xautomatically updated, so remember to do it yourself periodically, as
Xyou may be losing the chance at more maneuvers if you do not.
X
XThe following are your combat options:
X
XATTACK: Punch, Cut, Strike, Shoot, or Thrust (depending on weapon) -- 1 pt.
XBLOCK: Prepare to block or parry enemy attack                      -- 1 pt.
XRIPOSTE: BLOCK/ATTACK (thrusting weapons only)                     -- 2 pts.
XLUNGE: More chance to hit than usual, does more damage             -- 2 pts.
X
XKeep on selecting maneuvers until you have no maneuver points left.
XIt does absolutely no good to have points left over.
X
XFollowing the choice of the maneuver, you must select a line for the
Xaction: L (low), C (center), or H (high). Some monster will tend to
Xattack in a given line (short/small monsters, for example, will
Xtend to attack low), so this choice is meaningful. If you block or
Xriposte low, when the attack is high, you will have wasted the effect
Xof the block. On the other hand, if you block low twice, and the
Xattack is low, you will defend doubly. If you don't block or riposte
Xat all, it will be particularly easy for monsters to hit you.
X
XKeep on selecting maneuvers until you have no maneuver points left.
XHitting the BACKSPACE or DELETE key will erase your current choices
Xand let you start over. When you are satisfied, confirm your
Xchoice with the RETURN key. Once a choice is selected, it stays in
Xeffect until you change it; you need not reset it for each attack.
XSelecting combat maneuvers takes no time.
X
XIf you are in VERBOSE mode (settable with the 'O' command) you'll see
Xjust what the monster is doing, whether the blocks are effective,
Xand so on. Otherwise you'll just be told whether you hit or miss.
X
XIf you select VERBOSE mode, you will be able to see just where your
Xopponent attacks. Some monsters may show a particular sequence or
Xlocation which they attack in; you can use this information to your
Xadvantage by setting your own attacks and blocks accordingly.
X
XYou can try multiple identical maneuvers if you like. If you don't try
Xany BLOCKS at all, it will be easier than usual for your opponent to
Xhit.  Even if you don't get the location correct, a BLOCK still does
Xsome good. A RIPOSTE attacks in the same line as its block, if you got
Xthe line right. I.e., if you are attacked high, a high riposte will
Xget a free attack back. If you are attacked high three times, a high
Xriposte will get three free attacks back. Each block or riposte is
Xgood for your entire move; no matter how many monsters attack you you
Xwill be able to block or riposte each one. Naturally, each attack can
Xonly be used against one monster.
X
XHeavy edged weapons and smashing weapons do CUTTING or STRIKING
Xdamage. Your strength affects this, so if it is high you will do
Xmuch more damage, and if low, much less.
X
XLight edged weapons, missile weapons, and pointed weapons do THRUSTING
Xor SHOOTING attacks, whose chance to hit is greatly affected by your
Xdexterity. Note that you can't use a missile weapon very well in
Xordinary combat (i.e. when you move adjacent to a monster) -- you
Xwould be using a crossbow as a club, for instance. Instead,
Xuse the 'f' command to fire missiles when at long range, and change
Xto a melee weapon for close combat.
X
XA note on weapons use: A weapon is not prepared for combat unless
Xit is in the "weapon hand" slot in your inventory. Anywhere else
Xmeans you are just carrying it around.... Two-handed weapons will
Xautomatically take both hand slots, so remember to have both
Xhands free if you want to wield such a weapon.
X
XShields, of course, will only have effect in the "shield" slot,
Xwhile armor is only considered to be worn if it is in the "armor"
Xslot.
END_OF_FILE
if test 4670 -ne `wc -c <'ohelp5.txt'`; then
    echo shar: \"'ohelp5.txt'\" unpacked with wrong size!
fi
# end of 'ohelp5.txt'
fi
if test -f 'oitemf2.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'oitemf2.c'\"
else
echo shar: Extracting \"'oitemf2.c'\" \(12153 characters\)
sed "s/^X//" >'oitemf2.c' <<'END_OF_FILE'
X/* omega copyright (C) 1987,1988 by Laurence Raphael Brothers */
X/* oitemf2.c */
X
X/* mostly ring, armor, and weapon functions */
X
X#include "oglob.h"
X
X
X
X
X/* ring functions */
Xvoid i_perm_knowledge(o)
Xpob o;
X{
X  if (o->known < 1)
X    o->known = 1;
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  if (o->used) 
X    knowledge(o->blessing);
X}
X
Xvoid i_perm_strength(o)
Xpob o;
X{
X  if (o->known < 1) o->known = 1;
X  Objects[o->id].known = 1;
X  if (o->used){
X    if (o->blessing > -1)
X      Player.str += abs(o->plus)+1;
X    else
X      Player.str -= abs(o->plus)+1;
X  }
X  else {
X    if (o->blessing > -1)
X      Player.str -= abs(o->plus)+1;
X    else
X      Player.str += abs(o->plus)+1;
X  }
X  calc_melee();
X}
X
X
X
Xvoid i_perm_burden(o)
Xpob o;
X{
X  int i;
X  
X  if (o->used) {
X    o->weight = 1000;
X    mprint("You feel heavier.");
X  }
X  else {
X    o->weight = 1;
X    mprint("Phew. What a relief.");
X  }
X  Player.itemweight = 0;
X  for (i=0;i<MAXITEMS;i++) {
X    if (Player.possessions[i] != NULL)
X      Player.itemweight += 
X	(Player.possessions[i]->weight*Player.possessions[i]->number);
X  }
X}
X
Xvoid i_perm_gaze_immune(o)
Xpob o;
X{
X  if (o->used) Player.immunity[GAZE]++;
X  else Player.immunity[GAZE]--;
X}
X
Xvoid i_perm_fire_resist(o)
Xpob o;
X{
X  if (o->used) Player.immunity[FLAME]++;
X  else Player.immunity[FLAME]--;
X}
X
Xvoid i_perm_poison_resist(o)
Xpob o;
X{
X  if (o->used) {
X    if (o->blessing < 0) {
X      Player.immunity[POISON] = 0;
X      p_poison(100);
X    }
X    else {
X      Player.immunity[POISON]++;
X      if (Player.status[POISONED] > 0) {
X	mprint("You feel much better now.");
X	Player.status[POISONED] = 0;
X      }
X    }
X  }
X  else {
X    Player.status[POISONED] = 0;
X    Player.immunity[POISON]--;
X  }
X}
X
X
X
X
X
X
Xvoid i_perm_regenerate(o)
Xpob o;
X{
X  if (o->known < 1)  o->known = 1;
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X  if (o->used) {
X    mprint("You seem abnormally healthy.");
X    Player.status[REGENERATING] += 1500;
X  }
X  else {
X    Player.status[REGENERATING] -= 1500;
X    if (Player.status[REGENERATING] < 1) {
X      mprint("Your vitality is back to normal");
X      Player.status[REGENERATING] = 0;
X    }
X  }
X}
X
X
X
X
X/* armor functions */
X
X
Xvoid i_normal_armor(o)
Xpob o;
X{
X  if (o->used) mprint("You put on your suit of armor.");
X}
X
Xvoid i_perm_energy_resist(o)
Xpob o;
X{
X  if (o->used){
X    Player.immunity[FLAME]++;
X    Player.immunity[COLD]++;
X    Player.immunity[ELECTRICITY]++;
X  }
X  else {
X    Player.immunity[FLAME]--;
X    Player.immunity[COLD]--;
X    Player.immunity[ELECTRICITY]--;
X  }
X}
X
X
X
Xvoid i_perm_fear_resist(o)
Xpob o;
X{
X  if (o->used){
X    Player.immunity[FEAR]++;
X    if (o->blessing < 0) {
X      Player.status[BERSERK] += 1500;
X      mprint("You feel blood-simple!");
X    }
X  }
X  else {
X    Player.immunity[FEAR]--;
X    if (o->blessing < 0) {
X      Player.status[BERSERK] -= 1500;
X      if (Player.status[BERSERK] < 1) {
X	mprint("You feel less rabid now.");
X      Player.status[BERSERK] = 0;
X      }
X    }
X  }
X}    
X
X
X
Xvoid i_perm_breathing(o)
Xpob o;
X{
X  if (o->known < 1)  o->known = 1;
X  if (o->blessing > -1)
X    Objects[o->id].known = 1;
X
X  if (o->blessing > -1) {
X    if (o->used) {
X      mprint("Your breath is energized!");
X      Player.status[BREATHING] += 1500;
X    }
X    else  {
X      Player.status[BREATHING] -= 1500;
X      if (Player.status[BREATHING] < 1) {
X	mprint("Your breathing is back to normal.");
X	Player.status[BREATHING] = 0;
X      }
X    }
X  }
X  else if (o->used) {
X    Player.status[BREATHING] = 0;
X    p_drown();
X  }
X}
X
X
X
X/* weapons functions */
X
Xvoid weapon_acidwhip(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if ((random_range(2) == 1) && (! m_immunityp(m,NORMAL_DAMAGE))) {
X    mprint("You entangle the monster!");
X    m_status_reset(m,MOBILE);
X  }
X  p_hit(m,Player.dmg+dmgmod,ACID);
X
X}
X
Xvoid weapon_scythe(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  mprint("Slice!");
X  m_death(m);
X  if (! Player.rank[ADEPT]) {
X    mprint("Ooops!");
X    mprint("You accidentally touch yourself on the backswing....");
X    p_death("the Scythe of Death");
X  }
X}
X
Xvoid weapon_demonblade(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{ 
X  if (o->blessing > -1) {
X    mprint("Demonblade disintegrates with a soft sigh.");
X    mprint("You stop foaming at the mouth.");
X    Player.status[BERSERK] = 0;
X    conform_lost_object(o);
X  }
X  else if (m->specialf == M_SP_DEMON) {
X    mprint("The demon flees in terror before your weapon!");
X    m_vanish(m);
X  }
X  else if (m->meleef != M_MELEE_SPIRIT) {
X    if (m->level > random_range(10)) {
X      Player.hp = min(Player.maxhp,Player.hp+m->hp);
X      Player.str++;
X      Player.pow = min(Player.maxpow,Player.pow+m->level);
X      m_death(m);
X      mprint("You feel a surge of raw power from Demonblade!");
X    }
X    else p_hit(m,Player.dmg+dmgmod,NORMAL_DAMAGE);
X
X  }
X  else {
X    mprint("Demonblade howls as it strikes the spirit!");
X    if (random_range(10) == 1) {
X      mprint("... and shatters into a thousand lost fragments!");
X      p_damage(50,UNSTOPPABLE,"Demonblade exploding");
X      conform_lost_object(o);
X    }
X    else {
X      mprint("You feel your lifeforce draining....");
X      p_damage(25,UNSTOPPABLE,"a backlash of negative energies");
X      Player.str -= 3;
X      Player.con -= 3;
X    }
X  }
X}
X
Xvoid weapon_lightsabre(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if (! o->known) {
X    mprint("Fumbling with the cylinder, you press the wrong stud....");
X    p_damage(100,UNSTOPPABLE,"fumbling with a lightsabre");
X    o->known = 1;
X  }
X  else {
X    /* test prevents confusing immunity messages.... */
X    if (! m_immunityp(m,NORMAL_DAMAGE)) {
X      mprint("Vzzzzmmm!");
X      m_damage(m,20,NORMAL_DAMAGE);
X    }
X    if ((m->hp>0) && (! m_immunityp(m,FLAME))) {
X      mprint("Zzzzap!");
X      m_damage(m,20,FLAME);
X    }
X  }
X}
X
Xvoid weapon_tangle(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if ((random_range(2) == 1) && (! m_immunityp(m,NORMAL_DAMAGE))) {
X    mprint("You entangle the monster!");
X    m_status_reset(m,MOBILE);
X  }
X  p_hit(m,Player.dmg+dmgmod,NORMAL_DAMAGE);
X}
X
X/* if wielding a bow, add bow damage to arrow damage */
Xvoid weapon_arrow(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if ((Player.possessions[O_WEAPON_HAND] != NULL) &&
X      (Player.possessions[O_WEAPON_HAND]->id == WEAPONID+26)) /* ie, using a bow */
X    p_hit(m,Player.dmg+o->plus+o->dmg+dmgmod,NORMAL_DAMAGE);
X  else p_hit(m,o->plus+o->dmg+dmgmod,NORMAL_DAMAGE);
X}
X
X/* if wielding a crossbow, add bow damage to arrow damage */
Xvoid weapon_bolt(dmgmod,o,m)
Xpob o;
Xstruct monster *m;
X{
X  if ((Player.possessions[O_WEAPON_HAND] != NULL) &&
X      (Player.possessions[O_WEAPON_HAND]->id == WEAPONID+27) && /*ie using a crossbow */
X      (Player.possessions[O_WEAPON_HAND]->aux==LOADED)) {
X	p_hit(m,Player.dmg+o->plus+o->dmg+dmgmod,NORMAL_DAMAGE);
X	Player.possessions[O_WEAPON_HAND]->aux = UNLOADED;
X      }
X  else p_hit(m,o->plus+o->dmg,NORMAL_DAMAGE);
X}
X
X
Xvoid weapon_mace_disrupt(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if (m->meleef == M_MELEE_SPIRIT) {
X    mprint("The monster crumbles away to dust!");
X    m_death(m);
X  }
X  else p_hit(m,Player.dmg+dmgmod,UNSTOPPABLE);
X}
X
Xvoid weapon_normal_hit(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  p_hit(m,Player.dmg+dmgmod,NORMAL_DAMAGE);
X}
X
X
X/* will be updated eventually */
Xvoid weapon_bare_hands(dmgmod,m)
Xint dmgmod;
Xstruct monster *m;
X{
X  p_hit(m,Player.dmg+dmgmod,NORMAL_DAMAGE);
X}
X
X
Xvoid i_demonblade(o)
Xpob o;
X{
X  if (o->used) {
X    o->known = 2;
X    mprint("Demonblade's fangs open and bury themselves in your wrist!");
X    mprint("You hear evil laughter in the distance....");
X    mprint("You begin to foam at the mouth!");
X    Player.status[BERSERK] = 1500;
X  }
X  else {
X    mprint("You hear a sound like a demon cursing.");
X    mprint("You feel less like biting your shield.");
X    Player.status[BERSERK] = 0;
X  }
X}
X
Xvoid i_normal_weapon(o)
Xpob o;
X{
X  if (o->used) mprint("You ready your weapon for battle.");
X}
X
Xvoid i_lightsabre(o)
Xpob o;
X{
X  if (o->used) mprint("You feel one with the Force.");
X  else mprint("You feel out of touch with the Force.");
X}
X
Xvoid i_mace_disrupt(o)
Xpob o;
X{
X  mprint("That's a damned heavy mace!");
X}
X
X
X
Xvoid weapon_vorpal(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if ((random_range(10) < 3) && (! m_immunityp(m,NORMAL_DAMAGE))) {
X    o->known = 2;
X    if (random_range(2) == 1)
X      mprint("One Two! One Two! And through and through!");
X    else mprint("Your vorpal blade goes snicker-snack!");
X    m_death(m);
X  }
X  else weapon_normal_hit(dmgmod,o,m);
X}
X
Xvoid weapon_desecrate(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  o->known = 2;
X  if (Player.alignment < 0) {
X    mprint("Your opponent screams in agony!");
X    p_hit(m,Player.dmg+dmgmod,UNSTOPPABLE);
X    Player.alignment--;
X    if (Player.hp < Player.maxhp) {
X      mprint("You feel a thrill of power surging up your blade!");
X      Player.hp = min(Player.maxhp,Player.hp+Player.dmg+dmgmod);
X    }
X  }
X  else {
X    mprint("Your blade turns in your hands and hits you!");
X    mprint("You hear evil laughter....");
X    level_drain(Player.dmg,"the sword Desecrator");
X    Player.alignment-=10;
X    mprint("A strange force spreads from the wound throughout your body...");
X    mprint("You feel much more chaotic now.");
X  }
X}
X
X
X
Xvoid weapon_firestar(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if (random_range(3) == 1) {
X    o->known = 2;
X    fball(Player.x,Player.y,Player.x,Player.y,max(Player.dmg,25));
X  }
X  if (m->hp > 0) weapon_normal_hit(dmgmod,o,m);
X}
X
Xvoid weapon_defend(dmgmod,o,m)
Xpob o;
Xstruct monster *m;
X{
X  if ((Player.alignment < 0) && (o->blessing > 0)) {
X      mprint("The Holy Defender screams in your hands....");
X      mprint("You stagger before the sound of its rage....");
X      p_damage(50,UNSTOPPABLE,"a pissed-off Holy Defender");
X      mprint("The weapon finally quiets. It seems less holy now.");
X      o->truename = o->cursestr;
X      Player.status[PROTECTION] -= (o->hit);
X      o->plus = 0-abs(o->plus);
X      o->blessing = -1;
X    }
X  if ((o->blessing > 0) &&
X      ((m->specialf == M_SP_DEMON) ||
X       (m->meleef == M_MELEE_SPIRIT))) {
X    mprint("Your opponent shies back before your holy weapon!");
X    m->hit = 0;
X    m->speed *=2;
X  }
X  weapon_normal_hit(dmgmod,o,m);
X}
X
Xvoid weapon_victrix(dmgmod,o,m)
Xint dmgmod;
Xpob o;
Xstruct monster *m;
X{
X  if (m->meleef == M_MELEE_SPIRIT) {
X    mprint("Your opponent dissipates in a harmless cloud of vapors...");
X    m_death(m);
X  }
X  else weapon_normal_hit(dmgmod,o,m);
X}
X
Xvoid i_defend(o)
Xpob o;
X{
X  o->known = 2;
X  if (o->used) {
X    mprint("You feel under an aegis!");
X    Player.status[PROTECTION] += o->hit;
X  }
X  else Player.status[PROTECTION] -= o->hit;
X}
X
X
Xvoid i_victrix(o)
Xpob o;
X{
X  o->known = 2;
X  o->blessing = abs(o->blessing);
X  if (o->used) {
X    Player.immunity[POISON]++;
X    Player.immunity[FEAR]++;
X    Player.immunity[INFECTION]++;
X  }
X  else {
X    Player.immunity[POISON]--;
X    Player.immunity[FEAR]--;
X    Player.immunity[INFECTION]--;
X  }
X}    
X
X
Xvoid i_desecrate(o)
Xpob o;
X{
X  if (o->known < 1)  o->known = 2;
X  if (o->blessing > 0) {
X    mprint("How weird, a blessed desecrator... ");
X    mprint("The structure of reality cannot permit such a thing....");
X    dispose_lost_objects(1,o);
X  }
X  else if (Level->site[Player.x][Player.y].locchar == ALTAR)
X    sanctify(-1);
X}
X
X
X/* shield functions */
Xvoid i_normal_shield(o)
Xpob o;
X{
X  if (o->used) mprint("You sling your shield across a forearm.");
X}
X
X
Xvoid i_perm_deflect(o)
Xpob o;
X{
X  if (o->known < 1)  o->known = 2;
X  if (o->blessing > -1) {
X    if (o->used) {
X      mprint("You feel buffered.");
X      Player.status[DEFLECTION] += 1500;
X    }
X    else {
X      Player.status[DEFLECTION] -= 1500;
X      if (Player.status[DEFLECTION] < 1) {
X	mprint("You feel less defended");
X	Player.status[DEFLECTION] = 0;
X      }
X    }
X  }
X  else {
X    if (o->used) {
X      mprint("You feel naked.");
X      Player.status[VULNERABLE] += 1500;
X      Player.status[DEFLECTION] = 0;
X    }
X    else {
X      Player.status[VULNERABLE] -= 1500;
X      if (Player.status[VULNERABLE] < 1) {
X	mprint("You feel less vulnerable");
X	Player.status[VULNERABLE] = 0;
X      }
X    }
X  }
X}
END_OF_FILE
if test 12153 -ne `wc -c <'oitemf2.c'`; then
    echo shar: \"'oitemf2.c'\" unpacked with wrong size!
fi
# end of 'oitemf2.c'
fi
if test -f 'omaze2.dat' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'omaze2.dat'\"
else
echo shar: Extracting \"'omaze2.dat'\" \(287 characters\)
sed "s/^X//" >'omaze2.dat' <<'END_OF_FILE'
X"z"""""""""""""""""""""....................""""""""""""""""""""".""?-."............?.".""?"."."""""""""""".".""""."."............".""..."."-"""""""""".".""."."."?"..?.......".""."."."""-".""""""""."".".?."???"..........""-""-""""""""""""""""""?>"...............-O"""""""""""""""""""""""
END_OF_FILE
if test 287 -ne `wc -c <'omaze2.dat'`; then
    echo shar: \"'omaze2.dat'\" unpacked with wrong size!
fi
# end of 'omaze2.dat'
fi
if test -f 'ommelee.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ommelee.c'\"
else
echo shar: Extracting \"'ommelee.c'\" \(7661 characters\)
sed "s/^X//" >'ommelee.c' <<'END_OF_FILE'
X/* omega copyright (c) 1987,1988 by Laurence Raphael Brothers */
X/* ommelee */
X/* various functions to do with monster melee */
X
X#include "oglob.h"
X
X
Xvoid m_hit(m,dtype)
Xstruct monster *m;
Xint dtype;
X{
X  if (m->uniqueness == COMMON) {
X    strcpy(Str3,"a ");
X    strcat(Str3,m->monstring);
X  }
X  else strcpy(Str3,m->monstring);
X  if ((Player.status[DISPLACED] > 0) && (random_range(2) == 1))
X    mprint("The attack was displaced!");
X  else  p_damage(random_range(m->dmg),dtype,Str3);
X}
X
X
X
X/* execute monster attacks versus player */
Xvoid tacmonster(m)
Xstruct monster *m;
X{
X  int i=0;
X  drawvision(Player.x,Player.y);
X  transcribe_monster_actions(m);
X  while ((i < strlen(m->meleestr)) && (m->hp > 0)) {
X    if (m->uniqueness == COMMON) {
X      strcpy(Str4,"The ");
X      strcat(Str4,m->monstring);
X    }
X    else strcpy(Str4,m->monstring);
X    if (m->meleestr[i] == 'A') {
X      strcat(Str4," attacks ");
X      strcat(Str4,actionlocstr(m->meleestr[i+1]));
X      if (Verbosity == VERBOSE) mprint(Str4);
X      monster_melee(m,m->meleestr[i+1],0);
X    }
X    else if (m->meleestr[i] == 'L') {
X      strcat(Str4," lunges ");
X      strcat(Str4,actionlocstr(m->meleestr[i+1]));
X      if (Verbosity == VERBOSE) mprint(Str4);
X      monster_melee(m,m->meleestr[i+1],m->level);
X    }
X    i+=2;
X  }
X}
X
X
X
Xvoid monster_melee(m,hitloc,bonus)
Xstruct monster *m;
Xchar hitloc;
Xint bonus;
X{
X  if (player_on_sanctuary())
X    print1("The aegis of your deity protects you!");
X  else {
X    /* It's lawful to wait to be attacked */
X    if (m->attacked==0) Player.alignment++;
X    m->attacked++;
X    if (m->uniqueness == COMMON) {
X      strcpy(Str2,"The ");
X      strcat(Str2,m->monstring);
X    }
X    else strcpy(Str2,m->monstring);
X    if (monster_hit(m,hitloc,bonus))
X      switch(m->meleef) {
X      case M_NO_OP: 
X	strcat(Str2," touches you.");
X	mprint(Str2);
X	break;
X      case M_MELEE_NORMAL:
X	strcat(Str2," hits you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	break;
X      case M_MELEE_NG:
X	strcat(Str2," hits you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	if (random_range(5)==3) m_sp_ng(m);
X	break;
X      case M_MELEE_FIRE:
X	strcat(Str2," blasts you with fire.");
X	mprint(Str2);
X	m_hit(m,FLAME);
X	break;
X      case M_MELEE_DRAGON:
X	strcat(Str2," hits you and blasts you with fire.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	m_hit(m,FLAME);
X	break;
X      case M_MELEE_ELEC:
X	strcat(Str2," lashes you with electricity.");
X	mprint(Str2);
X	m_hit(m,ELECTRICITY);
X	break;
X      case M_MELEE_COLD:
X	strcat(Str2," freezes you with cold.");
X	mprint(Str2);
X	m_hit(m,ELECTRICITY);
X	break;
X      case M_MELEE_POISON:
X	strcat(Str2," hits you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	if (random_range(10) < m->level) {
X	  mprint("You've been poisoned!");
X	  p_poison(m->dmg);
X	}
X	break;
X      case M_MELEE_GRAPPLE:
X	strcat(Str2," grabs you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	Player.status[IMMOBILE]++;
X	break;
X      case M_MELEE_SPIRIT:
X	strcat(Str2," touches you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	drain_life(m->level);
X	break;
X      case M_MELEE_DISEASE:
X	strcat(Str2," hits you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	if (random_range(10) < m->level) {
X	  mprint("You've been infected!");
X	  disease(m->level);
X	}
X	break;
X      case M_MELEE_SLEEP:
X	strcat(Str2," hit you.");
X	mprint(Str2);
X	m_hit(m,NORMAL_DAMAGE);
X	if (random_range(10) < m->level) {
X	  mprint("You feel drowsy");
X	  sleep_player(m->level);
X	}
X	break;
X      }
X    else {
X      if (random_range(10)) strcat(Str2," missed you.");
X      else switch(random_range(10)) {
X      case 0: strcat(Str2," flailed stupidly at you."); break;
X      case 1: strcat(Str2," made you laugh."); break;
X      case 2: strcat(Str2," blundered severely.");
X	m_damage(m,m->dmg,UNSTOPPABLE); break;
X      case 3: strcat(Str2," tripped while attacking.");m_dropstuff(m);break;
X      case 4: strcat(Str2," seems seriously confused.");
X	m->speed = min(30,m->speed*2); break;
X      case 5: strcat(Str2," is seriously ashamed."); break;
X      case 6: strcat(Str2," made a boo-boo."); break;
X      case 7: strcat(Str2," blundered."); break;
X      case 8: strcat(Str2," cries out in anger and frustration."); break;
X      case 9: strcat(Str2," curses your ancestry."); break;
X      }
X      mprint(Str2);
X    }
X  }
X}
X
X
X
X/* checks to see if player hits with hitmod vs. monster m at location hitloc */
Xint monster_hit(m,hitloc,bonus)
Xstruct monster *m;
Xchar hitloc;
Xint bonus;
X{
X  int i=0,blocks=FALSE,goodblocks=0,hit,riposte=FALSE;
X  while (i<strlen(Player.meleestr)) {
X    if ((Player.meleestr[i] == 'B') || (Player.meleestr[i] == 'R')) {
X      blocks = TRUE;
X      if (hitloc == Player.meleestr[i+1]) {
X	goodblocks++;
X	if (Player.meleestr[i] == 'R') riposte = TRUE;
X      }
X    }
X    i+=2;
X  }
X  if (! blocks) goodblocks = -1;
X  hit = hitp(m->hit+bonus,Player.defense+goodblocks*10);
X  if ((! hit) && (goodblocks > 0)) {
X    if (Verbosity == VERBOSE) mprint("You blocked it!");
X    if (riposte) {
X      if (Verbosity != TERSE) mprint("You got a riposte!");
X      if (hitp(Player.hit,m->ac)) {
X	mprint("You hit!");
X	weapon_use(0,Player.possessions[O_WEAPON_HAND],m);
X      }
X      else mprint("You missed.");
X    }
X  }
X  return(hit);
X}
X
X
X
X/* decide monster actions in tactical combat mode */
X/* if monster is skilled, it can try see the player's attacks coming and
X   try to block appropriately. */
X
Xvoid transcribe_monster_actions(m)
Xstruct monster *m;
X{
X  int i;
X  char attack_loc,block_loc;
X  static char mmstr[80];
X  
X  int p_blocks[3];
X  int p_attacks[3];
X
X  for(i=0;i<3;i++)p_blocks[i] = p_attacks[i] = 0;
X
X  /* Find which area player blocks and attacks least in */
X  i = 0;
X  while (i<strlen(Player.meleestr)) {
X    if ((Player.meleestr[i] == 'B') ||
X	(Player.meleestr[i] == 'R')) {
X      if (Player.meleestr[i+1] == 'H') p_blocks[0]++;
X      if (Player.meleestr[i+1] == 'C') p_blocks[1]++;
X      if (Player.meleestr[i+1] == 'L') p_blocks[2]++;
X    }
X    else if ((Player.meleestr[i] == 'A') ||
X	     (Player.meleestr[i] == 'L')) {
X      if (Player.meleestr[i+1] == 'H') p_attacks[0]++;
X      if (Player.meleestr[i+1] == 'C') p_attacks[1]++;
X      if (Player.meleestr[i+1] == 'L') p_attacks[2]++;
X    }
X    i+=2;
X  }
X
X  if ((p_blocks[2] <= p_blocks[1]) &&
X      (p_blocks[2] <= p_blocks[0]))
X    attack_loc = 'L';
X  else if ((p_blocks[1] <= p_blocks[2]) &&
X	   (p_blocks[1] <= p_blocks[0]))
X    block_loc = 'C';
X  else attack_loc = 'H';
X  if ((p_attacks[2] <= p_attacks[1]) &&
X      (p_attacks[2] <= p_attacks[0]))
X    block_loc = 'L';
X  else if ((p_attacks[1] <= p_attacks[2]) &&
X	   (p_attacks[1] <= p_attacks[0]))
X    block_loc = 'C';
X  else block_loc = 'H';
X
X  m->meleestr = mmstr;
X
X  if (m->id != NPC)
X    strcpy(m->meleestr,Monsters[m->id].meleestr);
X  else {
X    strcpy(m->meleestr,"");
X    for(i=0;i<m->level;i+=2) 
X      strcat(m->meleestr,"L?R?");
X  }
X
X  i = 0;
X  while (i<strlen(m->meleestr)) {
X    if ((m->meleestr[i] == 'A') || (m->meleestr[i] == 'L')) {
X      if (m->meleestr[i+1] == '?') {
X	if (m->level+random_range(30) > Player.level+random_range(20))
X	  m->meleestr[i+1] = attack_loc;
X	else m->meleestr[i+1] = random_loc();
X      }
X      else if (m->meleestr[i+1] == 'X') m->meleestr[i+1] = random_loc();
X    }
X    else if ((m->meleestr[i] == 'B') || (m->meleestr[i] == 'R')) {
X      if (m->meleestr[i+1] == '?') { 
X	if (m->level+random_range(30) > Player.level+random_range(20))
X	  m->meleestr[i+1] = block_loc;
X	else m->meleestr[i+1] = random_loc();
X      }
X      else if (m->meleestr[i+1] == 'X') m->meleestr[i+1] = random_loc();
X    }
X    i+=2;
X  }
X}
X
Xchar random_loc()
X{
X  switch(random_range(3)) {
X  case 0:return('H'); break;
X  case 1:return('C'); break;
X  case 2:return('L'); break;
X  }
X}
END_OF_FILE
if test 7661 -ne `wc -c <'ommelee.c'`; then
    echo shar: \"'ommelee.c'\" unpacked with wrong size!
fi
# end of 'ommelee.c'
fi
if test -f 'otrap.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'otrap.c'\"
else
echo shar: Extracting \"'otrap.c'\" \(7618 characters\)
sed "s/^X//" >'otrap.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* otrap.c */
X/* trap movement functions */
X
X#include "oglob.h"
X
X
X/* various traps */
X
X/* note special function on different levels */
Xvoid l_trap_siren()
X{
X  pml ml;
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  print1("A klaxon goes off!");
X  print2("'Intruder Alert -- Intruder Alert -- Intruder Alert'");
X  print3("You have the feeling you have been discovered....");
X  morewait();
X  clearmsg();
X  if ((Current_Environment == E_HOUSE) ||
X      (Current_Environment == E_MANSION)) {
X    if (! gamestatusp(DESTROYED_ORDER)) {
X      print1("The city guard arrives!");
X      print2("You are apprehended....");
X      morewait();
X      send_to_jail();
X    }
X    else print1("Nobody answers the alarm.");
X  }
X  else if (Current_Environment == E_HOVEL) 
X    print1("Nobody answers the alarm.");
X  else {
X    if (Current_Environment == E_CIRCLE) {
X      summon(-1,ML9+7); /* prime circle demon */
X      summon(-1,ML9+7);
X      summon(-1,ML9+7);
X    }
X    for(ml=Level->mlist;ml!=NULL;ml=ml->next) {
X      m_status_set(ml->m,AWAKE);
X      ml->m->sense *= 2;
X      if ((Current_Environment == E_CIRCLE) ||
X	  ((Current_Environment == E_VILLAGE) && (ml->m->id == ML0+3)) ||
X	  ((Current_Environment == E_CITY) && (ml->m->id == ML0+3)))
X	m_status_set(ml->m,HOSTILE);
X    }
X  }
X}
X
Xvoid l_trap_dart()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  if (gamestatusp(MOUNTED)) {
X    mprint("A dart annoys your horse....");
X  }
X  else if (random_range(100) < Player.absorption) 
X    mprint("A dart plinks off your armor");
X  else {
X    mprint("You were hit by a dart!");
X    p_damage(difficulty(),NORMAL_DAMAGE,"a dart trap");
X    if (random_range(3)==1) {
X      mprint("It was poisoned!");
X      p_poison(difficulty());
X    }
X  }
X}
X
Xvoid l_trap_pit()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  if (gamestatusp(MOUNTED)) {
X    mprint("Your horse stumbles into a pit and breaks a leg!");
X    mprint("You are forced to put it out of its misery.");
X    resetgamestatus(MOUNTED);
X    showflags();
X  }
X  else if (Player.itemweight < ((int) (Player.maxweight / 2)))
X    mprint("You nimbly dodge a pit trap.");
X  else {
X    mprint("You fell into a pit!");
X    if (random_range(3) == 1) {
X      mprint("And were impaled by spikes!");
X      p_damage(difficulty()*5,NORMAL_DAMAGE,"a spiked pit");
X    }
X    else p_damage(difficulty()*2,NORMAL_DAMAGE,"a pit");
X    Player.status[IMMOBILE] ++;
X  }
X}
X
Xvoid l_trap_door()
X{
X  if (Current_Environment != Current_Dungeon)
X    mprint("You feel oddly lucky.");
X  else {
X    Level->site[Player.x][Player.y].locchar = TRAP;
X    if (gamestatusp(MOUNTED)) {
X      mprint("You and your horse fall through a trap door!");
X      mprint("Your horse breaks its back. Snif.");
X      if (Level->site[Player.x][Player.y].aux != S_DISINTEGRATE) {
X	mprint("You're hit by a rockslide!");
X	p_damage(Level->depth*difficulty(),UNSTOPPABLE,"a rockslide");
X      }
X      change_level(Level->depth,Level->depth+1,FALSE);
X      resetgamestatus(MOUNTED);
X      showflags();
X      roomcheck();
X    }
X    else if (random_range(100) < Player.agi)
X      mprint("You leap over a trap door.");
X    else {
X      mprint("You fell through a trap door!");
X      p_damage(difficulty(),NORMAL_DAMAGE,"a trap door");
X      if (Level->site[Player.x][Player.y].aux != S_DISINTEGRATE) {
X	mprint("You're hit by a rockslide!");
X	p_damage(Level->depth*difficulty(),UNSTOPPABLE,"a rockslide");
X      }
X      change_level(Level->depth,Level->depth+1,FALSE);
X      roomcheck();
X    }
X  }
X}
X
Xvoid l_trap_snare()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  if (gamestatusp(MOUNTED)) 
X    mprint("Your horse steps out of a snare trap.");
X  else if (random_range(100) < Player.agi)
X    mprint("You agilely avoid a snare.");
X  else {
X    mprint("You were caught in a snare!");
X    Player.status[IMMOBILE]+=difficulty();
X  }
X}
X
Xvoid l_trap_blade()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  if (random_range(30) < Player.agi+Player.level)
X    mprint("You duck under a scything blade!");
X  else {
X    if (gamestatusp(MOUNTED)) {
X      mprint("Your horse is struck by a blade and killed instantly.");
X      resetgamestatus(MOUNTED);
X      showflags();
X    }
X    else {
X      mprint("A heavy blade scythes across the room and hits you!");
X      p_damage(random_range(difficulty()*3)+difficulty()-Player.absorption,
X	       NORMAL_DAMAGE,
X	       "a blade trap");
X    }
X  }
X}
X
Xvoid l_trap_fire()
X{
X  if (gamestatusp(MOUNTED)) {
X    mprint("Your horse is struck by a blast of fire and is charbroiled!");
X    resetgamestatus(MOUNTED);
X    showflags();
X  }
X  else if (random_range(50) < Player.agi+Player.level)
X    mprint("You dodge a pillar of fire!");
X  else {
X    mprint("You were blasted by a fire trap!");
X    p_damage(random_range((difficulty()+1)*5),FLAME,"a fire trap");
X  }
X  Level->site[Player.x][Player.y].locchar = FIRE;
X  Level->site[Player.x][Player.y].p_locf = L_FIRE;
X}
X
Xvoid l_trap_teleport()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  mprint("You experience a momentary disorientation....");
X  if (random_range(10000) > difficulty()*difficulty()) p_teleport(0);
X  else p_teleport(-1);
X}
X
Xvoid l_trap_disintegrate()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  mprint("Oh, no! A disintegration trap!");
X  if (gamestatusp(MOUNTED)) {
X    mprint("Your horse falls apart into its component atoms...");
X    resetgamestatus(MOUNTED);
X    showflags();
X  }
X  disintegrate(Player.x,Player.y);
X}
X
Xvoid l_trap_sleepgas()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  mprint("Hsssssssss....");
X  morewait();
X  mprint("You detect a strange odor....");
X  sleep_player((difficulty()/5)+1);
X}
X
X
Xvoid l_trap_acid()
X{
X  int i,k,itemdamage;
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  if (Player.agi+Player.level < random_range(100)) {
X    mprint("You are drenched by a spray of acid!");
X    if (gamestatusp(MOUNTED)) {
X      mprint("Your horse dies unpleasantly.");
X      resetgamestatus(MOUNTED);
X      showflags();
X    }
X    p_damage(random_range(difficulty()*5),ACID,"an acid trap");
X    if (! p_immune(ACID)) {
X      mprint("The acid seeps into your pack...");
X      morewait();
X      itemdamage = random_range(5);
X      for(i=k=0;((i<MAXITEMS) && (k<itemdamage));i++)
X	if (Player.possessions[i]!=NULL) {
X	  k++;
X	  damage_item(Player.possessions[i]);
X	}
X    }
X  }
X  else mprint("You somehow dodge a shower of hydroflouric acid!");
X}
X
Xvoid l_trap_abyss()
X{
X  Level->site[Player.x][Player.y].locchar = ABYSS;
X  if (gamestatusp(MOUNTED)) {
X    mprint("You and your horse fall into the infinite abyss!");
X    l_abyss();
X  }
X  if (Player.dex + Player.level < random_range(100)) {
X    mprint("You stumble over a concealed entrance to the abyss!");
X    l_abyss();
X  }
X  else mprint("You gingerly step around a concealed entrance to the abyss!");
X}
X
Xvoid l_trap_manadrain()
X{
X  Level->site[Player.x][Player.y].locchar = TRAP;
X  if (Player.mana==0) {
X    if (random_range(10)==3) {
X      mprint("That's strange.... You feel repowered!");
X      mprint("The manadrain trap overloads -- positive feedback....");
X      Level->site[Player.x][Player.y].locchar = FLOOR;
X      Level->site[Player.x][Player.y].p_locf = L_NO_OP;
X      Player.mana = calcmana();
X    }
X    else mprint("You feel strangely unaffected by the manadrain trap.");
X  }
X  else {
X    Level->site[Player.x][Player.y].locchar = TRAP;
X    mprint("A weird rainbow light seems to play over you....");
X    mprint("You feel drained.");
X    while (Player.mana > 1) {
X      Player.mana /= 2;
X      dataprint();
X    }
X    Player.mana = 0;
X    dispel(-1);
X  }
X}
END_OF_FILE
if test 7618 -ne `wc -c <'otrap.c'`; then
    echo shar: \"'otrap.c'\" unpacked with wrong size!
fi
# end of 'otrap.c'
fi
echo shar: End of archive 17 \(of 19\).
cp /dev/null ark17isdone
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