games@tekred.TEK.COM (07/26/88)
Submitted by: "Laurence R. Brothers" <brothers@paul.rutgers.edu>
Comp.sources.games: Volume 5, Issue 25
Archive-name: omega2/Part15
#! /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 15 (of 19)."
# Contents: ochar.c ocom1.c oetc.c ohelp11.txt opriest.c
# Wrapped by billr@saab on Wed Jul 13 10:46:57 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'ochar.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'ochar.c'\"
else
echo shar: Extracting \"'ochar.c'\" \(13387 characters\)
sed "s/^X//" >'ochar.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* ochar.c */
X/* Player generation */
X
X#include "oglob.h"
X
X
X/* set player to begin with */
Xvoid initplayer()
X{
X int i;
X int oldchar=FALSE;
X FILE *fd;
X
X strcpy(Player.name,getlogin());
X Player.itemweight = 0;
X Player.food = 36;
X Player.packptr = 0;
X Player.options = 0;
X for (i=0;i<MAXITEMS;i++)
X Player.possessions[i] = NULL;
X for (i=0;i<MAXPACK;i++)
X Player.pack[i] = NULL;
X for (i=0;i<NUMIMMUNITIES;i++) Player.immunity[i] = 0;
X for (i=0;i<NUMSTATI;i++) Player.status[i] = 0;
X for (i=0;i<NUMRANKS;i++) {
X Player.rank[i] = 0;
X Player.guildxp[i] = 0;
X }
X Player.alignment = 0;
X Player.cash = 250;
X if ((fd=omegarc_check())!=NULL) {
X fread((char *)&i,sizeof(int),1,fd);
X if (i != VERSION) {
X print1("Out of date .omegarc! Make another!");
X morewait();
X }
X else {
X oldchar = TRUE;
X fread((char *)&Player,sizeof(Player),1,fd);
X fread((char *)&Searchnum,sizeof(int),1,fd);
X fread((char *)&Verbosity,sizeof(char),1,fd);
X strcpy(Player.name,getlogin());
X }
X fclose(fd);
X }
X if (! oldchar) {
X initstats();
X optionset(RUNSTOP);
X optionset(CONFIRM);
X }
X Searchnum = max(1,min(9,Searchnum));
X Player.hp = Player.maxhp = Player.maxcon;
X calc_melee();
X Player.mana = Player.maxmana = calcmana();
X Player.click = 1;
X strcpy(Player.meleestr,"CCBC");
X dataprint();
X }
X
X
XFILE *omegarc_check()
X{
X FILE *fd;
X strcpy(Str3,".omegarc");
X if ((fd = fopen(Str3,"r")) != NULL) {
X print2("Use .omegarc in wd? [yn] ");
X if (ynq2()!='y') fd = NULL;
X }
X clearmsg();
X return(fd);
X}
X
Xvoid initstats()
X{
X char response;
X print1("Do you want to run a character [c] or play yourself [p]?");
X do response = mcigetc(); while ((response!='c')&&(response != 'p'));
X if (response == 'c') omegan_character_stats();
X else {
X user_character_stats();
X user_intro();
X print1("Do you want to save this set-up to .omegarc in this wd? [yn] ");
X if (ynq1()=='y')
X save_omegarc();
X }
X xredraw();
X}
X
Xvoid save_omegarc()
X{
X FILE *fd = fopen(".omegarc","w");
X int i=VERSION;
X if (fd == NULL)
X print1("Sorry, couldn't save .omegarc for some reason.");
X else {
X fwrite((char *)&i,sizeof(int),1,fd);
X print1("First, set options.");
X setoptions();
X fwrite((char *)&Player,sizeof(Player),1,fd);
X fwrite((char *)&Searchnum,sizeof(int),1,fd);
X fwrite((char *)&Verbosity,sizeof(char),1,fd);
X fclose(fd);
X }
X}
X
X
X
Xint calcmana()
X{
X return(Player.pow * (Player.level+1));
X}
X
X
X/* npcbehavior digits 1234
X
X4 : alignment (LAWFUL,CHAOTIC, or NEUTRAL)
X3 : primary combat action (melee,missile,spell,thief,flight,1..5)
X2 : competence at 4 (0..9, 0 = incompetent, 9 = masterful)
X1 : conversation mode
X
Xstatus : 1 = dead, 2 = saved, 3 = retired
X*/
Xint fixnpc(status)
Xint status;
X{
X int npcbehavior=0;
X char response;
X if (status == 1) { /* player is dead, all undead are chaotic */
X npcbehavior+=CHAOTIC;
X npcbehavior+=10; /* melee */
X npcbehavior+=100*min(9,((int) (Player.level/3)));
X npcbehavior+=3000; /* evil */
X }
X else {
X clearmsg();
X print1("NPC Behavior Determination Module");
X menuclear();
X menuprint("Your overall NPC behavior is:");
X if (Player.alignment < -10) {
X npcbehavior += CHAOTIC;
X menuprint("\n\n CHAOTIC");
X }
X else if (Player.alignment > 10) {
X npcbehavior += LAWFUL;
X menuprint("\n\n LAWFUL");
X }
X else {
X npcbehavior += NEUTRAL;
X menuprint("\n\n NEUTRAL");
X }
X menuprint("\n\n1: hand-to-hand combat");
X menuprint("\n2: missile combat");
X menuprint("\n3: spellcasting");
X menuprint("\n4: thieving");
X menuprint("\n5: escape");
X menuprint("\n\nEnter NPC response to combat: ");
X response = '0';
X while ((response != '1') &&
X (response != '2') &&
X (response != '3') &&
X (response != '4') &&
X (response != '5'))
X response = menugetc();
X menuaddch(response);
X npcbehavior+=10*(response - '0');
X npcbehavior+=100*competence_check(response-'0');
X response = '0';
X menuclear();
X menuprint("1: threaten");
X menuprint("\n2: greet");
X menuprint("\n3: aid");
X menuprint("\n4: beg");
X menuprint("\n5: silence");
X menuprint("\n\nEnter NPC response to conversation: ");
X while ((response != '1') &&
X (response != '2') &&
X (response != '3') &&
X (response != '4') &&
X (response != '5'))
X response = menugetc();
X menuaddch(response);
X npcbehavior+=1000*(response - '0');
X xredraw();
X }
X return(npcbehavior);
X}
X
X
X/* estimates on a 0..9 scale how good a player is at something */
Xint competence_check(attack)
Xint attack;
X{
X int ability = 0;
X switch(attack) {
X case 1: /* melee */
X ability += statmod(Player.str);
X case 2: /* missle */
X ability += statmod(Player.dex);
X ability += Player.rank[LEGION];
X ability += ((int) (Player.dmg / 10) - 1);
X break;
X case 3: /* spellcasting */
X ability += statmod(Player.iq);
X ability += statmod(Player.pow);
X ability += Player.rank[CIRCLE];
X ability += Player.rank[COLLEGE];
X ability += Player.rank[PRIEST];
X break;
X case 4: /* thieving */
X ability += statmod(Player.dex);
X ability += statmod(Player.agi);
X ability += Player.rank[THIEVES];
X break;
X case 5: /* escape */
X ability += 2 * statmod(Player.agi);
X break;
X }
X ability += ((int) (Player.level / 5));
X if (ability < 0) ability = 0;
X if (ability > 9) ability = 9;
X return(ability);
X}
X
Xvoid user_character_stats()
X{
X int num,iqpts=0,numints=0,ok,agipts=0,dexpts=0,powpts=0,conpts=0;
X print1("OK, now try to answer honestly the following questions:");
X morewait();
X print1("How many pounds can you bench press? ");
X num = parsenum();
X if (num < 30) Player.str = Player.maxstr = 3;
X else if (num < 90) Player.str = Player.maxstr = num/10;
X else Player.str = Player.maxstr = 9+((num-120)/30);
X if (Player.str > 18) {
X print2("Even if it's true, I don't believe it.");
X morewait();
X clearmsg();
X Player.str = Player.maxstr = 18;
X }
X
X print1("Took an official IQ test? [yn] ");
X if (ynq1()=='y') {
X print1("So, whadja get? ");
X num = parsenum()/10;
X if (num > 18) {
X print2("Even if it's true, I don't believe it.");
X morewait();
X clearmsg();
X num = 18;
X }
X iqpts+=num;
X numints++;
X }
X
X print1("Took Undergraduate entrance exams? [yn] ");
X if (ynq1()=='y') {
X do {
X print1("So, what percentile? ");
X num = parsenum();
X ok = (num < 100);
X if (! ok) {
X print2("That's impossible!");
X morewait();
X clearmsg();
X }
X } while (! ok);
X iqpts += (int) ((((num - 49)/50.0)*9)+9);
X numints++;
X }
X print1("Took Graduate entrance exams? [yn] ");
X if (ynq1()=='y') {
X do {
X print1("So, what percentile? ");
X num = parsenum();
X ok = (num < 100);
X if (! ok) {
X print2("That's impossible!");
X morewait();
X clearmsg();
X }
X } while (! ok);
X iqpts += (int) ((((num - 49)/50.0)*9)+9);
X numints++;
X }
X
X if (numints == 0) {
X print1("Pretty dumb, aren't you? [yn] ");
X if (ynq1()=='y') {
X Player.iq = random_range(3)+3;
X print2("I thought so....");
X }
X else {
X Player.iq = random_range(6)+8;
X print2("Well, not *that* dumb.");
X }
X morewait();
X clearmsg();
X }
X else Player.iq = iqpts/numints;
X Player.maxiq = Player.iq;
X agipts = 0;
X print1("Can you dance? [yn] ");
X if (ynq1()=='y') {
X agipts++;
X nprint1(" Well? [yn] ");
X if (ynq1()=='y') agipts+=2;
X }
X print1("Do you have training in a martial art or gymnastics? [yn] ");
X if (ynq1()=='y') {
X agipts+=2;
X print2("Do you have dan rank or equivalent? [yn] ");
X if (ynq2()=='y') agipts+=4;
X }
X clearmsg();
X print1("Do you play some field sport? [yn] ");
X if (ynq1()=='y') {
X agipts++;
X nprint1(" Are you good? [yn] ");
X if (ynq1()=='y') agipts++;
X }
X print1("Do you cave, mountaineer, etc.? [yn] ");
X if (ynq1()=='y')
X agipts+=3;
X print1("Do you skate or ski? [yn] ");
X if (ynq1()=='y') {
X agipts+=2;
X nprint1(" Well? [yn] ");
X if (ynq1()=='y') agipts+=2;
X }
X print1("Are you physically handicapped? [yn] ");
X if (ynq1()=='y')
X agipts-=4;
X print1("Are you accident prone? [yn] ");
X if (ynq1()=='y')
X agipts-=4;
X print1("Can you use a bicycle? [yn] ");
X if (ynq1()!='y')
X agipts-=4;
X Player.agi = Player.maxagi = 9 + agipts/2;
X print1("Do you play video games? [yn] ");
X if (ynq1()=='y') {
X dexpts+=2;
X print2("Do you get high scores? [yn] ");
X if (ynq2()=='y') dexpts+=4;
X }
X clearmsg();
X print1("Are you an archer, fencer, or marksman? [yn] ");
X if (ynq1()=='y') {
X dexpts+=2;
X print2("A good one? [yn] ");
X if (ynq2()=='y') dexpts+=4;
X }
X clearmsg();
X print1("Have you ever picked a lock? [yn] ");
X if (ynq1()=='y') {
X dexpts+=2;
X print2("Really. Well, the police are being notified.");
X }
X morewait();
X clearmsg();
X print1("What's your typing speed (words per minute) ");
X num = parsenum();
X if (num > 125) {
X print2("Tell me another one....");
X morewait();
X clearmsg();
X num = 125;
X }
X dexpts += num/25;
X print1("Hold your arm out. Tense your fist. Hand shaking? [yn] ");
X if (ynq1()=='y')
X dexpts-=3;
X print1("Ambidextrous, are you? [yn] ");
X if (ynq1()=='y')
X dexpts+=4;
X print1("Can you cut a deck of cards with one hand? [yn] ");
X if (ynq1()=='y')
X dexpts+=2;
X print1("Can you tie your shoes blindfolded? [yn] ");
X if (ynq1()!='y')
X dexpts-=3;
X Player.dex = Player.maxdex = 6 + dexpts/2;
X print1("Do you ever get colds? [yn] ");
X if (ynq1()!='y')
X conpts+=4;
X else {
X nprint1(" Frequently? [yn] ");
X if (ynq1() == 'y') conpts -=4;
X }
X print1("Had any serious accident or illness this year? [yn] ");
X if (ynq1()=='y') conpts -=4;
X else conpts +=4;
X print1("Have a chronic disease? [yn] ");
X if (ynq1() =='y') conpts -=4;
X print1("Overweight or underweight by more than 20 percent? [yn] ");
X if (ynq1() =='y') conpts -=2;
X print1("High Blood Pressure? [yn] ");
X if (ynq1() =='y') conpts -=2;
X print1("Smoke? [yn] ");
X if (ynq1() =='y') conpts -=3;
X print1("Take aerobics classes? [yn] ");
X if (ynq1() =='y') conpts +=2;
X print1("How many miles can you run? ");
X num = parsenum();
X if (num > 25) {
X print2("Right. Sure. Give me a break.");
X morewait();
X clearmsg();
X conpts += 8;
X }
X else if (num < 1) conpts -= 3;
X else if (num < 5) conpts += 2;
X else if (num < 10) conpts += 4;
X else conpts += 8;
X Player.con = Player.maxcon = 12 + conpts/3;
X print1("Do animals react oddly to your presence? [yn] ");
X if (ynq1()=='y') {
X print2("How curious that must be.");
X morewait();
X clearmsg();
X powpts += 2;
X }
X print1("Can you see auras? [yn] ");
X if (ynq1()=='y') {
X nprint1(" How strange.");
X morewait();
X powpts += 3;
X }
X print1("Ever have an out-of-body experience? [yn] ");
X if (ynq1()=='y') {
X print2("Wow, man. Fly the friendly skies....");
X morewait();
X clearmsg();
X powpts += 3;
X }
X print1("Did you ever cast a spell? [yn] ");
X if (ynq1()=='y') {
X powpts += 3;
X nprint1(" Did it work? [yn] ");
X if (ynq1()=='y') {
X powpts+=7;
X print2("Sure it did.");
X morewait();
X clearmsg();
X }
X }
X print1("Do you have ESP? [yn] ");
X if (ynq1()=='y') {
X powpts += 3;
X print2("Yeah, tell me more.");
X morewait();
X clearmsg();
X }
X print1("Do you have PK? [yn] ");
X if (ynq1()=='y') {
X powpts+= 6;
X print2("I can't tell you how much that moves me.");
X morewait();
X clearmsg();
X }
X print1("Do you believe in ghosts? [yn] ");
X if (ynq1()=='y') {
X powpts+=2;
X print2("I do! I do! I do believe in ghosts!");
X morewait();
X clearmsg();
X }
X print1("Are you Irish? [yn] ");
X if (ynq1()=='y') {
X powpts+=2;
X nprint1(" Is that blarney or what?");
X morewait();
X }
X Player.pow = Player.maxpow = 3 + powpts/2;
X print1("What is your sexual preference? [mf] ");
X do Player.preference = mcigetc();
X while ((Player.preference != 'm') && (Player.preference != 'f'));
X}
X
X
X
Xvoid omegan_character_stats()
X{
X int share1,share2,i=0;
X print1("To reroll hit ESCAPE; hit any other key to accept these stats.");
X print2("You have only 10 chances to reroll....");
X do {
X i++;
X Player.iq = Player.maxiq = 4 + random_range(5)+
X (share1 = random_range(6)) + (share2 = random_range(6));
X Player.pow = Player.maxpow = 4 + random_range(5) + share1 +share2;
X Player.dex = Player.maxdex = 4 + random_range(5)+
X (share1 = random_range(6)) + (share2 = random_range(6));
X Player.agi = Player.maxagi = 4 + random_range(5) + share1 +share2;
X Player.str = Player.maxstr = 4 + random_range(5)+
X (share1 = random_range(6)) + (share2 = random_range(6));
X Player.con = Player.maxcon = 4 + random_range(5) + share1 +share2;
X Player.cash = random_range(100)+random_range(100)+
X random_range(100)+random_range(100)+random_range(100);
X calc_melee();
X dataprint();
X } while ((i < 11) && (mgetc() == ESCAPE));
X clearmsg();
X print1("Please enter your character's name: ");
X strcpy(Player.name,msgscanstring());
X print1("What is your character's sexual preference? [mf] ");
X do Player.preference = mcigetc();
X while ((Player.preference != 'm') && (Player.preference != 'f'));
X
X}
X
END_OF_FILE
if test 13387 -ne `wc -c <'ochar.c'`; then
echo shar: \"'ochar.c'\" unpacked with wrong size!
fi
# end of 'ochar.c'
fi
if test -f 'ocom1.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'ocom1.c'\"
else
echo shar: Extracting \"'ocom1.c'\" \(9308 characters\)
sed "s/^X//" >'ocom1.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* ocom1.c */
X
X/* This file has the two toplevel command scanners, p_process,
Xwhich works everywhere but the countryside, and p_couyntry_process,
Xwhich works.... */
X
X#include "oglob.h"
X
X
X/* deal with a new player command in dungeon or city mode*/
Xvoid p_process()
X{
X static int searchval=0;
X
X if (Player.status[BERSERK])
X if (goberserk()) {
X setgamestatus(SKIP_PLAYER);
X drawvision();
X }
X if (! gamestatusp(SKIP_PLAYER)) {
X if (searchval > 0) {
X searchval--;
X if (searchval == 0) resetgamestatus(FAST_MOVE);
X }
X drawvision(Player.x,Player.y);
X if (! gamestatusp(FAST_MOVE)) {
X searchval = 0;
X Cmd = mgetc();
X clear_if_necessary();
X }
X Command_Duration = 0;
X switch (Cmd) {
X case ' ':
X case 13: setgamestatus(SKIP_MONSTERS); break; /*no op on space or return*/
X case 6: abortshadowform(); break; /* ^f */
X case 7: wizard(); break; /* ^g */
X case 9: display_pack(); morewait(); xredraw(); break; /* ^i */
X case 11: if (gamestatusp(CHEATED)) frobgamestatus();
X case 12: xredraw(); setgamestatus(SKIP_MONSTERS); break; /* ^l */
X case 16: bufferprint(); setgamestatus(SKIP_MONSTERS); break; /* ^p */
X case 18: redraw(); setgamestatus(SKIP_MONSTERS); break; /* ^r */
X case 23: if (gamestatusp(CHEATED)) drawscreen(); break; /* ^w */
X case 24: /* ^x */
X if (gamestatusp(CHEATED) ||
X Player.rank[ADEPT])
X wish(1);
X Command_Duration = 5;
X break;
X case 'a': zapwand();
X Command_Duration =((int) 8.0*Player.speed/5.0);
X break;
X case 'c': closedoor();
X Command_Duration =((int) 2.0*Player.speed/5.0);
X break;
X case 'd': drop();
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case 'e': eat();
X Command_Duration = 30;
X break;
X case 'f': fire();
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case 'g': pickup();
X Command_Duration =((int) 10.0*Player.speed/5.0);
X break;
X case 'i':
X if (optionp(TOPINV)) top_inventory_control();
X else {
X menuclear();
X display_possessions();
X inventory_control();
X }
X break;
X case 'm': magic();
X Command_Duration = 12;
X break;
X case 'o': opendoor();
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case 'p': pickpocket();
X Command_Duration =((int) 20.0*Player.speed/5.0);
X break;
X case 'q': quaff();
X Command_Duration = 10;
X break;
X case 'r': peruse();
X Command_Duration = 20;
X break;
X case 's': search(&searchval);
X Command_Duration = 20;
X break;
X case 't': talk();
X Command_Duration = 10;
X break;
X case 'v': vault();
X Command_Duration =((int) 10.0*Player.speed/5.0);
X break;
X case 'x': examine();
X Command_Duration = 1;
X break;
X case 'z': bash_location();
X Command_Duration =((int) 10.0*Player.speed/5.0);
X break;
X case 'A': activate();
X Command_Duration = 10;
X break;
X case 'C': callitem();
X break;
X case 'D': disarm();
X Command_Duration = 30;
X break;
X case 'E': dismount_steed();
X Command_Duration =((int) 10.0*Player.speed/5.0);
X break;
X case 'F': tacoptions();
X break;
X case 'G': give();
X Command_Duration = 10;
X break;
X case 'I':
X if (! optionp(TOPINV)) top_inventory_control();
X else {
X menuclear();
X display_possessions();
X inventory_control();
X }
X break;
X case 'M': city_move();
X Command_Duration = 10;
X break;
X case 'O': setoptions();
X break;
X case 'P': show_license();
X break; /* actually show_license is in ofile */
X case 'Q': quit();
X break;
X case 'R': rename_player();
X break;
X case 'S': save(TRUE);
X break;
X case 'T': tunnel();
X Command_Duration = ((int) 30.0*Player.speed/5.0);
X break;
X case 'V': version();
X break;
X case 'Z': bash_item();
X Command_Duration =((int) 10.0*Player.speed/5.0);
X break;
X case '.': rest();
X Command_Duration = 10;
X break;
X case ',':
X Command_Duration = 10;
X nap();
X break;
X case '>':
X downstairs();
X break;
X case '<':
X upstairs();
X break;
X case '@':
X p_movefunction(Level->site[Player.x][Player.y].p_locf);
X Command_Duration = 5;
X break;
X case '/': charid(); setgamestatus(SKIP_MONSTERS);
X break;
X case '?': help(); setgamestatus(SKIP_MONSTERS);
X break;
X case '4':
X case 'h': moveplayer(-1,0);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '2':
X case 'j': moveplayer(0,1);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '8':
X case 'k': moveplayer(0,-1);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '6':
X case 'l': moveplayer(1,0);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '1':
X case 'b': moveplayer(-1,1);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '3':
X case 'n': moveplayer(1,1);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '7':
X case 'y': moveplayer(-1,-1);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '9':
X case 'u': moveplayer(1,-1);
X Command_Duration =((int) 5.0*Player.speed/5.0);
X break;
X case '5':
X setgamestatus(SKIP_MONSTERS); /* don't do anything; a dummy turn */
X Cmd = mgetc();
X while ((Cmd != ESCAPE) &&
X ((Cmd < '1') || (Cmd > '9') || (Cmd=='5'))) {
X print3("Run in keypad direction [ESCAPE to abort]: ");
X Cmd = mgetc();
X }
X if (Cmd != ESCAPE) setgamestatus(FAST_MOVE);
X break;
X case 'H': setgamestatus(FAST_MOVE); Cmd = 'h'; moveplayer(-1,0);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'J': setgamestatus(FAST_MOVE); Cmd = 'j'; moveplayer(0,1);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'K': setgamestatus(FAST_MOVE); Cmd = 'k'; moveplayer(0,-1);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'L': setgamestatus(FAST_MOVE); Cmd = 'l'; moveplayer(1,0);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'B': setgamestatus(FAST_MOVE); Cmd = 'b'; moveplayer(-1,1);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'N': setgamestatus(FAST_MOVE); Cmd = 'n'; moveplayer(1,1);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'Y': setgamestatus(FAST_MOVE); Cmd = 'y'; moveplayer(-1,-1);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X case 'U': setgamestatus(FAST_MOVE); Cmd = 'u'; moveplayer(1,-1);
X Command_Duration =((int) 4.0*Player.speed/5.0);
X break;
X default: commanderror(); setgamestatus(SKIP_MONSTERS); break;
X }
X }
X if (Current_Environment != E_COUNTRYSIDE) roomcheck();
X screencheck(Player.y);
X}
X
X
X
X
X
X/* deal with a new player command in countryside mode */
Xvoid p_country_process()
X{
X int no_op;
X
X drawvision(Player.x,Player.y);
X do {
X no_op = FALSE;
X Cmd = mgetc();
X clear_if_necessary();
X switch (Cmd) {
X case ' ':
X case 13: no_op = TRUE; break;
X case 7: wizard(); break; /* ^g */
X case 14: xredraw(); no_op = TRUE; break; /* ^l */
X case 16: bufferprint(); no_op = TRUE; break; /* ^p */
X case 18: redraw(); no_op = TRUE; break; /* ^r */
X case 23: if (gamestatusp(CHEATED)) drawscreen(); break; /* ^w */
X case 24: if (gamestatusp(CHEATED) ||
X Player.rank[ADEPT]) wish(1); break; /* ^x */
X case 'd': drop(); break;
X case 'e': eat(); break;
X case 'i':
X if (optionp(TOPINV)) top_inventory_control();
X else {
X menuclear();
X display_possessions();
X inventory_control();
X }
X break;
X case 's': countrysearch(); break;
X case 'x': examine(); break;
X case 'E': dismount_steed(); break;
X case 'H': hunt(Country[Player.x][Player.y].current_terrain_type); break;
X case 'I':
X if (! optionp(TOPINV)) top_inventory_control();
X else {
X menuclear();
X display_possessions();
X inventory_control();
X }
X break;
X case 'O': setoptions(); break;
X case 'P': show_license(); break; /* actually show_license is in ofile */
X case 'Q': quit(); break;
X case 'R': rename_player(); break;
X case 'S': save(TRUE); break;
X case 'V': version(); break;
X case '>':
X enter_site(Country[Player.x][Player.y].base_terrain_type);
X break;
X case '/': charid(); no_op = TRUE; break;
X case '?': help(); no_op = TRUE; break;
X case '4':
X case 'h': movepincountry(-1,0); break;
X case '2':
X case 'j': movepincountry(0,1); break;
X case '8':
X case 'k': movepincountry(0,-1); break;
X case '6':
X case 'l': movepincountry(1,0); break;
X case '1':
X case 'b': movepincountry(-1,1); break;
X case '3':
X case 'n': movepincountry(1,1); break;
X case '7':
X case 'y': movepincountry(-1,-1); break;
X case '9':
X case 'u': movepincountry(1,-1); break;
X default: commanderror(); no_op = TRUE; break;
X }
X } while (no_op);
X screencheck(Player.y);
X}
X
X
END_OF_FILE
if test 9308 -ne `wc -c <'ocom1.c'`; then
echo shar: \"'ocom1.c'\" unpacked with wrong size!
fi
# end of 'ocom1.c'
fi
if test -f 'oetc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'oetc.c'\"
else
echo shar: Extracting \"'oetc.c'\" \(12947 characters\)
sed "s/^X//" >'oetc.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* oetc.c */
X/* grab bag of random functions used in random places */
X
X#include "oglob.h"
X
X/* there are various ways for the player to receive one of these hints */
Xvoid hint()
X{
X switch(random_range(95)) {
X case 0:mprint("There is an entrance to the sewers in the Garden.");break;
X case 1:mprint("Statues can be dangerous.");break;
X case 2:mprint("Unidentified Artifacts can be dangerous.");break;
X case 3:mprint("The higher form of mercury is desirable.");break;
X case 4:mprint("A sense of unease is a good thing to have.");break;
X case 5:mprint("If you dig too much, you might cause a cave in!.");break;
X case 6:mprint("Be Lawful: Live and Let Live.");break;
X case 7:mprint("Be Chaotic: Live and Let Die."); break;
X case 8:mprint("The world doesn't slow down; you speed up.");break;
X case 9:mprint("Security is a sense of dislocation.");break;
X case 10:mprint("Tullimore Dew is a panacea.");break;
X case 11:mprint("Thieves hide behind closed doors.");break;
X case 12:mprint("`No jail is escapeproof' -- John Dillinger.");break;
X case 13:mprint("Oh, to have an apartment of your own!");break;
X case 14:mprint("Some homes have money and treasure.");break;
X case 15:mprint("Some homes are defended.");break;
X case 16:mprint("Sometimes you could just wish for Death."); break;
X case 17:mprint("A cursed wish can be fatal.");break;
X case 18:mprint("The way you play, you should wish for Skill."); break;
X case 19:mprint("A druid might wish for Balance."); break;
X case 20:mprint("Mages always wish for Knowledge.");break;
X case 21:mprint("Some fairies are good.");break;
X case 22:mprint("An affair with a demon can be heartbreaking."); break;
X case 23:mprint("The Explorer's Club knows a useful spell."); break;
X case 24:mprint("They say some famous people live in mansions."); break;
X case 25:mprint("Magic pools are totally random."); break;
X case 26:mprint("There are five elements, including Void."); break;
X case 27:mprint("Humans can be good or evil, lawful or chaotic."); break;
X case 28:mprint("There are many kinds of wishes. Case counts, you know.");
X break;
X case 29:mprint("There are caves due south of Rampart"); break;
X case 30:mprint("Donaldson's Giants can withstand lava.");break;
X case 31:mprint("Ritual magic can have many different effects.");break;
X case 32:mprint("The Mercenaries are the best equipped fighters."); break;
X case 33:mprint("The Gladiators are the most skilled fighters."); break;
X case 34:mprint("Rent a flat and lose any bad stati you may have."); break;
X case 35:mprint("Some junk may be worth a fortune if identified."); break;
X case 36:mprint("Identify humans by talking to them."); break;
X case 37:mprint("They say the Duke has a treasure trove."); break;
X case 38:mprint("If you yield, your opponent will gain experience."); break;
X case 39:mprint("The Dragon Lord lives in the Waste of Time."); break;
X case 40:mprint("A full moon bodes well for the followers of Law."); break;
X case 41:mprint("A new moon omens evil for the Law-abiding."); break;
X case 42:mprint("Druids revere the half-moon."); break;
X case 43:mprint("Most grot is useless."); break;
X case 44:mprint("Cash can sometimes be found in the walls."); break;
X case 45:mprint("Pointy weapons break often but dig better."); break;
X case 46:mprint("The DREADED AQUAE MORTIS is invulnerable."); break;
X case 47:mprint("There must be *some* reason to worship Destiny!"); break;
X case 48:mprint("Kill a trifid? A puzzle! Try a saline solution!"); break;
X case 49:mprint("Beware! The Eater of Souls inhabits the abyss!"); break;
X case 50:mprint("They say there's a red-light district in town."); break;
X case 51:mprint("The House of the Eclipse is behind a closed door."); break;
X case 52:mprint("The Orbs may be encountered on the Astral Plane."); break;
X case 53:mprint("The Champion should never refuse a challenge."); break;
X case 54:mprint("They say that the autoteller program is buggy."); break;
X case 55:mprint("It's better not to sleep on the ground."); break;
X case 56:mprint("Try ritual magic in different kinds of rooms."); break;
X case 57:mprint("Breaking down a wall by bashing it is a bad idea!"); break;
X case 58:mprint("Follow the Oracle's advice; she is all-wise."); break;
X case 59:mprint("The ArchDruid lives in the northern forest.");break;
X case 60:mprint("A search of the mountains may reveal a secret pass.");break;
X case 61:mprint("Star Peak is to the far North-East."); break;
X case 62:mprint("The Archmage lives in the far North-West beyond a pass.");
X break;
X case 63:mprint("There is a volcano in the southern marshes."); break;
X case 64:mprint("The Demon Emperor resides in the Volcano."); break;
X case 65:mprint("The Lawgiver can be found at Star Peak."); break;
X case 66:mprint("The Temple of Athena is to the North-East."); break;
X case 67:mprint("The Temple of Set can be found in a desert.");break;
X case 68:mprint("The Temple of Hecate is in the swamp."); break;
X case 69:mprint("The Temple of Odin is to the South in some mountains.");
X break;
X case 70:mprint("There is a curious island off a promontory of the swamp.");
X break;
X case 71:mprint("The Eater of Magic can be found on an island.");break;
X case 72:mprint("The Temple of Destiny is practically inaccessible.");break;
X case 73:mprint("Each sect has its own main temple outside the city.");break;
X case 74:mprint("The aligned temples are dangerous to unbelievers.");break;
X case 75:mprint("If you are poor, maybe you should wish for Wealth.");break;
X case 76:mprint("Need mana? Wish for Power.");break;
X case 77:mprint("Wishing for Law, Balance, or Chaos alters alignment.");break;
X case 78:mprint("Feeling out of sorts? Wish for Health.");break;
X case 79:mprint("Challenge the abyss at the Temple of Destiny.");break;
X case 80:mprint("The Circle of Sorcerors has an Astral HQ");break;
X case 81:mprint("The Star Gem is the only way back from the Astral Plane.");
X break;
X case 82:mprint("The Star Gem is guarded by the Circle of Sorcerors.");break;
X case 83:mprint("The Star Gem is rightfully the property of the LawBringer.");
X break;
X case 84:mprint("They say the Demon Emperor owns the Amulet of the Planes.");
X break;
X case 85:mprint("An Amulet might get you to the Temple of Destiny.");break;
X case 86:mprint("A wish for Location might help you become Adept.");break;
X case 87:mprint("Some Artifacts may be used only once per day.");break;
X case 88:mprint("Overusing Artifacts can be a bad move."); break;
X case 89:mprint("You might starve in the Swamp or the Mountains!");break;
X case 90:mprint("You would have to be very chaotic to attack a guard!");break;
X case 91:mprint("You would have to be very foolhardy to attack a guard!");
X break;
X case 92:mprint("Only a master of chaos would kill all the city guards!");
X break;
X case 93:mprint("The Order depends on the force of the LawGiver");break;
X case 94:mprint("City Guards are employees of the Order");break;
X }
X}
X
X/* for when a deity teaches spells to a devotee */
Xvoid learnclericalspells(deity,level)
Xint deity,level;
X{
X mprint("With your new clerical rank comes knowledge of magic...");
X Player.pow+=level;
X Player.maxpow+=level;
X switch(level) {
X case LAY:
X if (deity==ODIN)
X Spells[S_MISSILE].known = TRUE;
X else if (deity==SET)
X Spells[S_INVISIBLE].known = TRUE;
X else if (deity==ATHENA)
X Spells[S_IDENTIFY].known = TRUE;
X else if (deity==HECATE)
X Spells[S_DRAIN].known = TRUE;
X else if (deity==DRUID) {
X Spells[S_KNOWLEDGE].known = TRUE;
X Spells[S_MON_DET].known = TRUE;
X }
X break;
X case ACOLYTE:
X if (deity==ODIN) {
X Spells[S_LBALL].known = TRUE;
X Spells[S_TRUESIGHT].known = TRUE;
X }
X else if (deity==SET) {
X Spells[S_SUMMON].known = TRUE;
X Spells[S_FIREBOLT].known = TRUE;
X }
X else if (deity==ATHENA) {
X Spells[S_HEAL].known = TRUE;
X Spells[S_SANCTUARY].known = TRUE;
X }
X else if (deity==HECATE) {
X Spells[S_SLEEP].known = TRUE;
X Spells[S_DISPEL].known = TRUE;
X }
X else if (deity==DRUID) {
X Spells[S_HEAL].known = TRUE;
X Spells[S_CURE].known = TRUE;
X }
X else if (deity==DESTINY)
X mprint("An acolyte of the Lords of Destiny. Gee whiz.");
X break;
X case PRIEST:
X Spells[S_SANCTIFY].known = TRUE;
X if (deity==ODIN) {
X Spells[S_HERO].known = TRUE;
X Spells[S_HEAL].known = TRUE;
X }
X else if (deity==SET) {
X Spells[S_INVISIBLE].known = TRUE;
X Spells[S_DISPEL].known = TRUE;
X }
X else if (deity==ATHENA) {
X Spells[S_REGENERATE].known = TRUE;
X Spells[S_ACCURACY].known = TRUE;
X }
X else if (deity==HECATE) {
X Spells[S_SHADOWFORM].known = TRUE;
X Spells[S_CURE].known = TRUE;
X }
X else if (deity==DRUID) {
X Spells[S_DISRUPT].known = TRUE;
X Spells[S_ALERT].known = TRUE;
X Spells[S_CLAIRVOYANCE].known = TRUE;
X }
X else if (deity==DESTINY)
X mprint("How useless, a new priest of the Lords of Destiny.");
X break;
X case SPRIEST:
X Spells[S_BLESS].known = TRUE;
X if (deity == ODIN)
X Spells[S_ACCURACY].known = TRUE;
X else if (deity == SET)
X Spells[S_SHADOWFORM].known = TRUE;
X else if (deity == ATHENA)
X Spells[S_HERO].known = TRUE;
X else if (deity == HECATE)
X Spells[S_POLYMORPH].known = TRUE;
X else if (deity == DRUID) {
X Spells[S_POLYMORPH].known = TRUE;
X Spells[S_LEVITATE].known = TRUE;
X }
X else if (deity == DESTINY)
X mprint("Wow, a new senior priest of the Lords of Destiny.");
X break;
X case HIGHPRIEST:
X if (deity == ODIN)
X Spells[S_RESTORE].known = TRUE;
X else if (deity == SET)
X Spells[S_HELLFIRE].known = TRUE;
X else if (deity == ATHENA)
X Spells[S_HELLFIRE].known = TRUE;
X else if (deity == HECATE)
X Spells[S_DESECRATE].known = TRUE;
X else if (deity == DRUID) {
X Spells[S_DISINTEGRATE].known = TRUE;
X Spells[S_HERO].known = TRUE;
X }
X else if (deity == DESTINY) {
X mprint("So you're now the high priest of the Lords of Destiny.");
X mprint("You didn't think you were going to get anything, did you?");
X }
X }
X}
X
X/* for the use of the casino slot machine */
Xchar *slotstr(num)
Xint num;
X{
X switch(num) {
X case 0:
X return("<Slime Mold>");
X break;
X case 1:
X return("<Lemon>");
X break;
X case 2:
X return("<Copper>");
X break;
X case 3:
X return("<Nymph>");
X break;
X case 4:
X return("<Sword>");
X break;
X case 5:
X return("<Shield>");
X break;
X case 6:
X return("<Chest>");
X break;
X case 7:
X return("<Bar>");
X break;
X case 8:
X return("<Orb>");
X break;
X case 9:
X return("<Mithril Nugget>");
X break;
X }
X}
X
X/* random names for various uses */
Xchar *nameprint()
X{
X switch(random_range(40)) {
X case 0:strcpy(Str3,"Orion Splash");break;
X case 1:strcpy(Str3,"Gorgar");break;
X case 2:strcpy(Str3,"Hieronymous");break;
X case 3:strcpy(Str3,"Quantifor Quotron");break;
X case 4:strcpy(Str3,"Leon");break;
X case 5:strcpy(Str3,"Joyce");break;
X case 6:strcpy(Str3,"Leticia Smiley");break;
X case 7:strcpy(Str3,"Ogilvy the Grim");break;
X case 8:strcpy(Str3,"Salara Storn");break;
X case 9:strcpy(Str3,"Murgo");break;
X case 10:strcpy(Str3,"Jonathan Atwilder");break;
X case 11:strcpy(Str3,"Xylos the Tan");break;
X case 12:strcpy(Str3,"Terence");break;
X case 13:strcpy(Str3,"Toronado");break;
X case 14:strcpy(Str3,"Kelly");break;
X case 15:strcpy(Str3,"Cantinflas");break;
X case 16:strcpy(Str3,"Ixel");break;
X case 17:strcpy(Str3,"Toto");break;
X case 18:strcpy(Str3,"Frost");break;
X case 19:strcpy(Str3,"Aliera Erinyes");break;
X case 20:strcpy(Str3,"Godel");break;
X case 21:strcpy(Str3,"Kerst Blackblade");break;
X case 22:strcpy(Str3,"Ebenezer");break;
X case 23:strcpy(Str3,"Jeremiah");break;
X case 24:strcpy(Str3,"Triskelion Shadow");break;
X case 25:strcpy(Str3,"Eleskir Eremar");break;
X case 26:strcpy(Str3,"Tyron");break;
X case 27:strcpy(Str3,"Morgon");break;
X case 28:strcpy(Str3,"Achmed");break;
X case 29:strcpy(Str3,"Chin");break;
X case 30:strcpy(Str3,"Fujimoto");break;
X case 31:strcpy(Str3,"Dos Santos");break;
X case 32:strcpy(Str3,"Federico");break;
X case 33:strcpy(Str3,"Jaime");break;
X case 34:strcpy(Str3,"Siobhan");break;
X case 35:strcpy(Str3,"Hans");break;
X case 36:strcpy(Str3,"Gurkov");break;
X case 37:strcpy(Str3,"Krilos the Slayer");break;
X case 38:strcpy(Str3,"Oxxblud");break;
X case 39:strcpy(Str3,"Dorian");break;
X }
X return(Str3);
X}
X
X
X/* returns english string equivalent of number */
Xchar *wordnum(num)
X{
X switch(num) {
X case 0: return("zero "); break;
X case 1: return("one "); break;
X case 2: return("two "); break;
X case 3: return("three "); break;
X case 4: return("four "); break;
X case 5: return("five "); break;
X case 6: return("six "); break;
X case 7: return("seven "); break;
X case 8: return("eight "); break;
X case 9: return("nine "); break;
X case 10: return("ten "); break;
X default: return(""); break;
X }
X}
END_OF_FILE
if test 12947 -ne `wc -c <'oetc.c'`; then
echo shar: \"'oetc.c'\" unpacked with wrong size!
fi
# end of 'oetc.c'
fi
if test -f 'ohelp11.txt' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'ohelp11.txt'\"
else
echo shar: Extracting \"'ohelp11.txt'\" \(803 characters\)
sed "s/^X//" >'ohelp11.txt' <<'END_OF_FILE'
XOPTION SETTINGS
X===============
XOptions may be set with the 'O' command. The options are:
X
X(F) BELLICOSE: Attack friendly monsters without confirmation.
X(F) JUMPMOVE: Don't display things until the end of a run.
X(T) PICKUP: Automatically pick things up when you move over them.
X(T) RUNSTOP: Stop a run when something like a door is passed.
X(T) CONFIRM: Ask confirmation before you do some dangerous things.
X(F) TOPINV: Display inventory to message line, not to full screen.
X(F) PACKADD: Add new items to pack, instead of going into inventory mode
X(V) VERBOSITY: TERSE, MEDIUM, or VERBOSE, the level of detail in combat.
X(1) SEARCHNUM: the number of turns spent searching when you hit the 's' key.
X
XThe default values are parenthesized. These options will be recovered from
Xyour .omegarc if you use one.
END_OF_FILE
if test 803 -ne `wc -c <'ohelp11.txt'`; then
echo shar: \"'ohelp11.txt'\" unpacked with wrong size!
fi
# end of 'ohelp11.txt'
fi
if test -f 'opriest.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'opriest.c'\"
else
echo shar: Extracting \"'opriest.c'\" \(14332 characters\)
sed "s/^X//" >'opriest.c' <<'END_OF_FILE'
X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
X/* opriest.c */
X/* functions for clerics. */
X
X#include "oglob.h"
X
X/* prayer occurs at altars, hence name of function */
Xvoid l_altar()
X{
X int i,deity;
X char response;
X
X if (Current_Environment == E_COUNTRYSIDE) deity = DRUID;
X else deity = Level->site[Player.x][Player.y].aux;
X
X switch(deity) {
X default:
X print1("This rude altar has no markings.");
X break;
X case ODIN:
X print1("This granite altar is graven with a gallows.");
X break;
X case SET:
X print1("This sandstone altar has a black hand drawn on it.");
X break;
X case HECATE:
X print1("This silver altar is inlaid with a black crescent moon.");
X break;
X case ATHENA:
X print1("This golden altar is inscribed with an owl.");
X break;
X case DESTINY:
X print1("This crystal altar is in the form of an omega.");
X break;
X case DRUID:
X print1("This oaken altar is ornately engraved with leaves.");
X break;
X }
X print2("Worship at this altar? [yn] ");
X if (ynq2() == 'y') {
X if (Player.rank[PRIESTHOOD] == 0) increase_priest_rank(deity);
X else if (! check_sacrilege(deity)) {
X if (Blessing) print1("You have a sense of immanence.");
X print2("Request a Blessing, Sacrifice an item, or just Pray [b,s,p] ");
X do response = mcigetc();
X while ((response != 'b') &&
X (response != 's') &&
X (response != 'p') &&
X (response != ESCAPE));
X if (response == 'b') {
X print1("You beg a heavenly benefice.");
X print2("You hear a gong resonating throughout eternity....");
X morewait();
X if (Blessing) {
X print1("A shaft of lucent radiance lances down from the heavens!");
X print2("You feel uplifted....");
X morewait();
X gain_experience(Player.rank[PRIESTHOOD]*Player.rank[PRIESTHOOD]*50);
X cleanse(1);
X heal(10);
X bless(1);
X Blessing = FALSE;
X increase_priest_rank(deity);
X }
X else {
X print1("Your ardent plea is ignored.");
X print2("You feel ashamed.");
X Player.xp -= (Player.xp/4);
X }
X calc_melee();
X }
X else if (response == 's') {
X print1("Which item to Sacrifice?");
X i = getitem(NULL);
X if (i==ABORT) i = 0;
X if (Player.possessions[i] == NULL) {
X print1("You have insulted your deity!");
X print2("Not a good idea, as it turns out...");
X dispel(-1);
X p_damage(Player.hp-1,UNSTOPPABLE,"a god's pique");
X }
X else if (true_item_value(Player.possessions[i]) >
X (Player.rank[PRIESTHOOD] *
X Player.rank[PRIESTHOOD] *
X Player.rank[PRIESTHOOD] * 50)) {
X print1("With a burst of blue flame, your offering vanishes!");
X dispose_lost_objects(1,Player.possessions[i]);
X print2("A violet nimbus settles around your head and slowly fades.");
X morewait();
X Blessing = TRUE;
X }
X else {
X print1("A darkling glow envelopes your offering!");
X print2("The glow slowly fades....");
X morewait();
X setgamestatus(SUPPRESS_PRINTING);
X if (Player.possessions[i]->used) {
X Player.possessions[i]->used = FALSE;
X item_use(Player.possessions[i]);
X Player.possessions[i]->blessing =
X -1 - abs(Player.possessions[i]->blessing);
X Player.possessions[i]->used = TRUE;
X item_use(Player.possessions[i]);
X }
X else Player.possessions[i]->blessing =
X -1 - abs(Player.possessions[i]->blessing);
X resetgamestatus(SUPPRESS_PRINTING);
X }
X }
X else if (response == 'p') {
X if (deity != Player.patron)
X print1("Nothing seems to happen.");
X else increase_priest_rank(deity);
X }
X }
X }
X}
X
X
X
X
Xint check_sacrilege(deity)
Xint deity;
X{
X int i,sacrilege=FALSE;
X if ((Player.patron != deity) && (Player.patron > 0)) {
X sacrilege=TRUE;
X Player.pow--;
X Player.maxpow--;
X switch(Player.patron) {
X case ODIN:
X print1("Odin notices your lack of faith! ");
X morewait();
X if (deity == ATHENA) {
X print2("However, Athena intercedes on your behalf.");
X sacrilege = FALSE;
X }
X else {
X print2("You are struck by a thunderbolt!");
X p_damage(Player.level*5,UNSTOPPABLE,"Odin's wrath");
X if (Player.hp > 0) {
X morewait();
X print2("The bolt warps your feeble frame....");
X Player.maxcon = Player.maxcon/2;
X Player.con = min(Player.con,Player.maxcon);
X Player.maxstr = Player.maxstr/2;
X Player.con = min(Player.str,Player.maxstr);
X }
X }
X morewait();
X break;
X case SET:
X print1("Set notices your lack of faith! ");
X morewait();
X if (deity == HECATE) {
X print1("But since you pray to a friendly deity,");
X print2("Set decides not to punish you.");
X sacrilege = FALSE;
X }
X else {
X print2("You are blasted by a shaft of black fire!");
X p_damage(Player.level*5,UNSTOPPABLE,"Set's anger");
X if (Player.hp > 0) {
X morewait();
X print1("You are wreathed in clouds of smoke.");
X for(i=0;i<MAXITEMS;i++)
X if ((Player.possessions[i] != NULL) &&
X (Player.possessions[i]->blessing > -1))
X conform_lost_object(Player.possessions[i]);
X morewait();
X print2("You feel Set's Black Hand on your heart....");
X Player.con = Player.maxcon = Player.maxcon / 4;
X }
X }
X morewait();
X break;
X case HECATE:
X print1("Hecate notices your lack of faith! ");
X morewait();
X if (deity == SET) {
X print1("But ignores the affront since she likes Set.");
X sacrilege = FALSE;
X }
X else {
X print1("You are zapped by dark moonbeams!");
X p_damage(Player.level*5,UNSTOPPABLE,"Hecate's malice");
X if (Player.hp > 0) {
X print2("The beams leach you of magical power!");
X Player.maxpow = Player.maxpow/5;
X Player.pow = min(Player.pow,Player.maxpow);
X for(i=0;i<NUMSPELLS;i++)
X Spells[i].known = FALSE;
X }
X }
X morewait();
X break;
X case ATHENA:
X print1("Athena notices your lack of faith! ");
X morewait();
X if (deity == ODIN) {
X print2("But lets you off this time since Odin is also Lawful.");
X sacrilege = FALSE;
X }
X else {
X print2("You are zorched by godsfire!");
X if (Player.hp > 0) {
X morewait();
X print1("The fire burns away your worldly experience!");
X Player.level = 0;
X Player.xp = 0;
X Player.maxhp = Player.hp = Player.con;
X print2("Your power is reduced by the blast!!!");
X Player.pow = Player.maxpow = Player.maxpow/3;
X Player.mana = min(Player.mana,calcmana());
X }
X }
X morewait();
X break;
X case DESTINY:
X print2("The Lords of Destiny ignore your lack of faith.");
X sacrilege = FALSE;
X morewait();
X break;
X case DRUID:
X print2("Your treachery to the ArchDruid has been noted.");
X if (random_range(2) == 1)
X Player.alignment += 40;
X else Player.alignment -= 40;
X morewait();
X break;
X }
X if (sacrilege) {
X Player.patron = 0;
X Player.rank[PRIESTHOOD] = 0;
X }
X }
X return(sacrilege);
X}
X
Xvoid increase_priest_rank(deity)
Xint deity;
X{
X if (Player.rank[PRIESTHOOD] == 0) switch(deity) {
X default:
X print2("Some nameless god blesses you....");
X Player.hp = Player.maxhp;
X morewait();
X print2("The altar crumbles to dust and blows away.");
X Level->site[Player.x][Player.y].locchar = FLOOR;
X Level->site[Player.x][Player.y].p_locf = L_NO_OP;
X break;
X case ODIN:
X if (Player.alignment > 0) {
X print1("Odin hears your prayer!");
X print2(Priest[ODIN]);
X nprint2(" personally blesses you.");
X nprint2(" You are now a lay devotee of Odin.");
X Player.patron = ODIN;
X Player.rank[PRIESTHOOD] = LAY;
X Player.guildxp[PRIESTHOOD] = 1;
X morewait();
X learnclericalspells(ODIN,LAY);
X }
X else print1("Odin ignores you.");
X break;
X case SET:
X if (Player.alignment < 0) {
X print1("Set hears your prayer!");
X print2(Priest[SET]);
X nprint2(" personally blesses you. ");
X nprint2(" You are now a lay devotee of Set.");
X Player.patron = SET;
X Player.rank[PRIESTHOOD] = LAY;
X Player.guildxp[PRIESTHOOD] = 1;
X morewait();
X learnclericalspells(SET,LAY);
X }
X else print1("Set ignores you.");
X break;
X case ATHENA:
X if (Player.alignment > 0) {
X print1("Athena hears your prayer!");
X print2(Priest[ATHENA]);
X nprint2(" personally blesses you.");
X nprint2(" You are now a lay devotee of Athena.");
X Player.patron = ATHENA;
X Player.rank[PRIESTHOOD] = LAY;
X Player.guildxp[PRIESTHOOD] = 1;
X morewait();
X learnclericalspells(ATHENA,LAY);
X }
X else print1("Athena ignores you.");
X break;
X case HECATE:
X if (Player.alignment < 0) {
X print1("Hecate hears your prayer!");
X print2(Priest[HECATE]);
X nprint2(" personally blesses you.");
X nprint2(" You are now a lay devotee of Hecate.");
X Player.patron = HECATE;
X Player.rank[PRIESTHOOD] = LAY;
X Player.guildxp[PRIESTHOOD] = 1;
X morewait();
X learnclericalspells(HECATE,LAY);
X }
X else print1("Hecate ignores you.");
X break;
X case DRUID:
X if (abs(Player.alignment) < 10) {
X print1(Priest[DRUID]);
X nprint1(" personally blesses you.");
X print2("You are now a lay devotee of the Druids.");
X Player.patron = DRUID;
X Player.rank[PRIESTHOOD] = LAY;
X Player.guildxp[PRIESTHOOD] = 1;
X morewait();
X learnclericalspells(DRUID,LAY);
X }
X else {
X print1("You hear a voice....");
X morewait();
X print2("'Only those who embody the Balance may become Druids.'");
X }
X break;
X case DESTINY:
X print1("The Lords of Destiny could hardly care less.");
X print2("But you can consider yourself now to be a lay devotee.");
X Player.patron = DESTINY;
X Player.rank[PRIESTHOOD] = LAY;
X Player.guildxp[PRIESTHOOD] = 1;
X break;
X }
X else if (deity == Player.patron) {
X if ((((deity == ODIN) || (deity == ATHENA)) &&
X (Player.alignment < 1)) ||
X (((deity == SET) || (deity == HECATE)) &&
X (Player.alignment > 1)) ||
X ((deity == DRUID) && (abs(Player.alignment) > 10))) {
X print1("You have swerved from the One True Path!");
X print2("Your deity is greatly displeased...");
X Player.xp -= Player.level*Player.level;
X Player.xp = max(0,Player.xp);
X }
X else if (Player.rank[PRIESTHOOD]== HIGHPRIEST) answer_prayer();
X else if (Player.rank[PRIESTHOOD]== SPRIEST) {
X if (Player.level > Priestlevel[deity])
X hp_req_test();
X else answer_prayer();
X }
X else if (Player.rank[PRIESTHOOD]==PRIEST) {
X if (Player.guildxp[PRIESTHOOD] >= 4000) {
X print1("An heavenly fanfare surrounds you!");
X print2("Your deity raises you to the post of Senior Priest.");
X hp_req_print();
X Player.rank[PRIESTHOOD] = SPRIEST;
X }
X else answer_prayer();
X }
X else if (Player.rank[PRIESTHOOD]==ACOLYTE) {
X if (Player.guildxp[PRIESTHOOD] >= 1500) {
X print1("A trumpet sounds in the distance.");
X print2("Your deity raises you to the post of Priest.");
X Player.rank[PRIESTHOOD] = PRIEST;
X morewait();
X learnclericalspells(deity,PRIEST);
X }
X else answer_prayer();
X }
X else if (Player.rank[PRIESTHOOD]==LAY) {
X if (Player.guildxp[PRIESTHOOD] >= 400) {
X print1("A mellifluous chime sounds from above the altar.");
X print2("Your deity raises you to the post of Acolyte.");
X Player.rank[PRIESTHOOD] = ACOLYTE;
X morewait();
X learnclericalspells(deity,ACOLYTE);
X }
X else answer_prayer();
X }
X }
X}
X
X
Xvoid answer_prayer()
X{
X clearmsg();
X switch(random_range(12)) {
X case 0: print1("You have a revelation!"); break;
X case 1: print1("You feel pious."); break;
X case 2: print1("A feeling of sanctity comes over you."); break;
X default: print1("Nothing unusual seems to happen."); break;
X }
X}
X
X
Xvoid hp_req_test()
X{
X pob o;
X switch (Player.patron) {
X case ODIN:
X if (find_item(&o,ARTIFACTID+17,-1))
X make_hp(o);
X else hp_req_print();
X break;
X case SET:
X if (find_item(&o,ARTIFACTID+14,-1))
X make_hp(o);
X else hp_req_print();
X break;
X case ATHENA:
X if (find_item(&o,ARTIFACTID+15,-1))
X make_hp(o);
X else hp_req_print();
X break;
X case HECATE:
X if (find_item(&o,ARTIFACTID+16,-1))
X make_hp(o);
X else hp_req_print();
X break;
X case DRUID:
X if (find_item(&o,ARTIFACTID+14,-1))
X make_hp(o);
X else if (find_item(&o,ARTIFACTID+15,-1))
X make_hp(o);
X else if (find_item(&o,ARTIFACTID+16,-1))
X make_hp(o);
X else if (find_item(&o,ARTIFACTID+17,-1))
X make_hp(o);
X else hp_req_print();
X break;
X case DESTINY:
X if (find_item(&o,ARTIFACTID+19,-1))
X make_hp(o);
X else hp_req_print();
X break;
X }
X}
X
X
Xvoid hp_req_print()
X{
X morewait();
X print1("To advance further, you must obtain the Holy Symbol of ");
X switch(Player.patron) {
X case ODIN:
X nprint1(Priest[SET]);
X print2("who may be found in the main Temple of Set.");
X break;
X case SET:
X nprint1(Priest[ODIN]);
X print2("who may be found in the main Temple of Odin.");
X break;
X case ATHENA:
X nprint1(Priest[HECATE]);
X print2("who may be found in the main Temple of Hecate.");
X break;
X case HECATE:
X nprint1(Priest[ATHENA]);
X print2("who may be found in the main Temple of Athena.");
X break;
X case DRUID:
X print2("any of the aligned priests");
X nprint2(" who may be found in their main temples.");
X break;
X case DESTINY:
X nprint1(Priest[DESTINY]);
X print2("who may be found in the main Temple of Destiny.");
X break;
X }
X}
X
Xvoid make_hp(o)
Xpob o;
X{
X print1("A full-scale heavenly choir chants 'Hallelujah' all around you!");
X print2("You notice a change in the symbol you carry....");
X switch(Player.patron) {
X case ODIN:
X *o = Objects[ARTIFACTID+14];
X break;
X case SET:
X *o = Objects[ARTIFACTID+17];
X break;
X case ATHENA:
X *o = Objects[ARTIFACTID+16];
X break;
X case HECATE:
X *o = Objects[ARTIFACTID+15];
X break;
X case DRUID:
X *o = Objects[ARTIFACTID+18];
X break;
X case DESTINY:
X *o = Objects[ARTIFACTID+19];
X break;
X }
X o->known = 2;
X o->charge = 17; /* random hack to convey bit that symbol is functional */
X morewait();
X if (Player.patron == DRUID)
X print1("Your deity raises you to the post of ArchDruid!");
X else print1("Your deity raises you to the post of High Priest!");
X print2("You feel holy.");
X strcpy(Priest[Player.patron],Player.name);
X Priestlevel[Player.patron] = Player.level;
X Player.rank[PRIESTHOOD] = HIGHPRIEST;
X morewait();
X learnclericalspells(Player.patron,HIGHPRIEST);
X}
END_OF_FILE
if test 14332 -ne `wc -c <'opriest.c'`; then
echo shar: \"'opriest.c'\" unpacked with wrong size!
fi
# end of 'opriest.c'
fi
echo shar: End of archive 15 \(of 19\).
cp /dev/null ark15isdone
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