games@tekred.TEK.COM (07/26/88)
Submitted by: "Laurence R. Brothers" <brothers@paul.rutgers.edu> Comp.sources.games: Volume 5, Issue 17 Archive-name: omega2/Part07 #! /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 7 (of 19)." # Contents: odate.h oguild2.c osite1.c # Wrapped by billr@saab on Wed Jul 13 10:46:46 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'odate.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'odate.h'\" else echo shar: Extracting \"'odate.h'\" \(142 characters\) sed "s/^X//" >'odate.h' <<'END_OF_FILE' X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */ X/* odate.h */ X X#define LAST_OMEGA_EDIT_DATE "Sun Jul 10 22:22:19 EDT 1988" X END_OF_FILE if test 142 -ne `wc -c <'odate.h'`; then echo shar: \"'odate.h'\" unpacked with wrong size! fi # end of 'odate.h' fi if test -f 'oguild2.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'oguild2.c'\" else echo shar: Extracting \"'oguild2.c'\" \(22895 characters\) sed "s/^X//" >'oguild2.c' <<'END_OF_FILE' X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */ X/* oguild2.c */ X/* L_ functions */ X X/* These functions implement the various guilds. */ X/* They are all l_ functions since they are basically activated*/ X/* at some site or other. */ X X#include "oglob.h" X X Xvoid l_thieves_guild() X{ X int fee,count,i,number,done=FALSE,dues=1000; X char c,action; X pob lockpick; X print1("You have penetrated to the Lair of the Thieves' Guild."); X if (! nighttime()) X print2("There aren't any thieves around in the daytime."); X else { X if ((Player.rank[THIEVES]==TMASTER) && X (Player.level > Shadowlordlevel) && X find_and_remove_item(THINGID+16,-1)) { X print2("You nicked the Justiciar's Badge!"); X morewait(); X print1("The Badge is put in a place of honor in the Guild Hall."); X print2("You are now the Shadowlord of the Thieves' Guild!"); X morewait(); X print1("Who says there's no honor among thieves?"); X strcpy(Shadowlord,Player.name); X Shadowlordlevel = Player.level; X morewait(); X clearmsg(); X print1("You learn the Spell of Shadowform."); X Spells[S_SHADOWFORM].known = TRUE; X morewait(); X clearmsg(); X Player.rank[THIEVES]=SHADOWLORD; X Player.maxagi += 2; X Player.maxdex += 2; X Player.agi += 2; X Player.dex += 2; X } X while (! done) { X menuclear(); X menuprint("a: Join the Thieves' Guild.\n"); X menuprint("b: Raise your Guild rank.\n"); X menuprint("c: Get an item identified.\n"); X if (Player.rank[THIEVES] > 0) X menuprint("d: Fence an item.\n"); X menuprint("ESCAPE: Leave this Den of Iniquity."); X action = mgetc(); X if (action == ESCAPE) done = TRUE; X else if (action == 'a') { X done = TRUE; X if (Player.rank[THIEVES]> 0) X print2("You are already a member!"); X else if (Player.alignment > 10) X print2("You are too lawful to be a thief!"); X else { X dues = (int) (dues * (1+(12-Player.dex)/9.0)); X dues += Player.alignment*5; X dues = max(100,dues); X print1("Dues are "); X mnumprint(dues); X nprint1("Au. Pay it? [yn] "); X if (ynq1() =='y') { X if (Player.cash < dues) { X print1("You can't cheat the Thieves' Guild!"); X print2("... but the Thieves' Guild can cheat you...."); X Player.cash = 0; X } X else { X print1("Shadowlord "); X nprint1(Shadowlord); X print2("enters your name into the roll of the Guild."); X morewait(); X clearmsg(); X print1("As a special bonus, you get a free lockpick."); X print2("You are taught the spell of Object Detection."); X morewait(); X Spells[S_OBJ_DET].known = TRUE; X lockpick = ((pob) malloc(sizeof(objtype))); X *lockpick = Objects[THINGID+2]; /* lock pick */ X gain_item(lockpick); X Player.cash -= dues; X dataprint(); X Player.guildxp[THIEVES]=1; X Player.rank[THIEVES]=TMEMBER; X Player.maxdex++;Player.dex++;Player.agi++;Player.maxagi++; X } X } X } X } X else if (action == 'b') { X if (Player.rank[THIEVES]==0) X print2("You are not even a member!"); X else if (Player.rank[THIEVES]==SHADOWLORD) X print2("You can't get any higher than this!"); X else if (Player.rank[THIEVES]==TMASTER) { X if (Player.level <= Shadowlordlevel) X print2("You are not experienced enough to advance."); X else print2("You must bring back the Justiciar's Badge!"); X } X else if (Player.rank[THIEVES]==THIEF) { X if (Player.guildxp[THIEVES] < 4000) X print2("You are not experienced enough to advance."); X else { X print1("You are now a Master Thief of the Guild!"); X print2("You are taught the Spell of Apportation."); X morewait(); X print1("To advance to the next level you must return with"); X print2("the badge of the Justiciar (cursed be his name)."); X morewait(); X clearmsg(); X print1("The Justiciar's office is just south of the gaol."); X Spells[S_APPORT].known = TRUE; X Player.rank[THIEVES]=TMASTER; X Player.maxagi++; X Player.maxdex++; X Player.agi++; X Player.dex++; X } X } X else if (Player.rank[THIEVES]==ATHIEF) { X if (Player.guildxp[THIEVES] < 1500) X print2("You are not experienced enough to advance."); X else { X print1("You are now a ranking Thief of the Guild!"); X print2("You learn the Spell of Invisibility."); X Spells[S_INVISIBLE].known = TRUE; X Player.rank[THIEVES]=THIEF; X Player.agi++; X Player.maxagi++; X } X } X else if (Player.rank[THIEVES]==TMEMBER) { X if (Player.guildxp[THIEVES] < 400) X print2("You are not experienced enough to advance."); X else { X print1("You are now an Apprentice Thief!"); X print2("You are taught the Spell of Levitation."); X Spells[S_LEVITATE].known = TRUE; X Player.rank[THIEVES]=ATHIEF; X Player.dex++; X Player.maxdex++; X } X } X } X else if (action == 'c') { X if (Player.rank[THIEVES]==0) { X print1("RTG, Inc, Appraisers. Identification Fee: 50Au/item."); X fee = 50; X } X else { X fee = 5; X print1("The fee is 5Au per item."); X } X print2("Identify one item, or all possessions? [ip] "); X if (mcigetc()=='i') { X if (Player.cash < fee) X print2("Try again when you have the cash."); X else { X Player.cash -= fee; X dataprint(); X identify(0); X } X } X else { X count = 0; X for(i=1;i<MAXITEMS;i++) X if (Player.possessions[i] != NULL) X if (Player.possessions[i]->known < 2) X count++; X for(i=0;i<Player.packptr;i++) X if (Player.pack[i] != NULL) X if (Player.pack[i]->known < 2) X count++; X print1("The fee will be: "); X mnumprint(max(count*fee,fee)); X nprint1("Au. Pay it? [yn] "); X if (ynq1()=='y') X if (Player.cash < max(count*fee,fee)) X print2("Try again when you have the cash."); X else { X Player.cash -= max(count*fee,fee); X dataprint(); X identify(1); X } X } X } X else if (action == 'd') { X if (Player.rank[THIEVES]==0) X print2("Fence? Who said anything about a fence?"); X else { X print1("Fence one item or go through pack? [ip] "); X if (mcigetc()=='i') { X i = getitem(NULL); X if ((i==ABORT) || (Player.possessions[i] == NULL)) X print2("Huh, Is this some kind of set-up?"); X else if (Player.possessions[i]->blessing < 0) X print2("I don't want to buy a cursed item!"); X else { X print1("I'll give you "); X mnumprint(2 * item_value(Player.possessions[i]) / 3); X nprint1("Au each. OK? [yn] "); X if (ynq1() == 'y') { X number = getnumber(Player.possessions[i]->number); X if ((number >= Player.possessions[i]->number) && X Player.possessions[i]->used) { X Player.possessions[i]->used = FALSE; X item_use(Player.possessions[i]); X } X Player.cash += number*2*item_value(Player.possessions[i])/3; X dispose_lost_objects(number,Player.possessions[i]); X dataprint(); X } X else print2("Hey, gimme a break, it was a fair price!"); X } X } X else { X for(i=0;i<Player.packptr;i++) { X if (Player.pack[i]->blessing > -1) { X print1("Sell "); X nprint1(itemid(Player.pack[i])); X nprint1(" for "); X mnumprint(2*item_value(Player.pack[i])/3); X nprint1("Au each? [ynq] "); X if ((c=ynq1())=='y') { X number = getnumber(Player.pack[i]->number); X Player.cash += 2*number * item_value(Player.pack[i]) / 3; X Player.pack[i]->number -= number; X if (Player.pack[i]->number < 1) { X free((char *)Player.pack[i]); X Player.pack[i] = NULL; X } X dataprint(); X } X else if (c=='q') break; X } X } X fixpack(); X } X } X } X } X } X xredraw(); X} X Xvoid l_college() X{ X char action; X int done=FALSE,enrolled = FALSE; X print1("The Collegium Magii. Founded 16937, AOF."); X if (nighttime()) X print2("The Registration desk is closed at night...."); X else { X while (! done) { X if ((Player.rank[COLLEGE]==MAGE) && X (Player.level > Archmagelevel) && X find_and_remove_item(CORPSEID,ML10+1)) { X print1("You brought back the heart of the Eater of Magic!"); X morewait(); X print1("The Heart is sent to the labs for analysis."); X print2("The Board of Trustees appoints you Archmage!"); X morewait(); X clearmsg(); X strcpy(Archmage,Player.name); X Archmagelevel = Player.level; X Player.rank[COLLEGE] = ARCHMAGE; X Player.maxiq += 5; X Player.iq += 5; X Player.maxpow += 5; X Player.pow += 5; X } X menuclear(); X menuprint("May we help you?\n\n"); X menuprint("a: Enroll in the College.\n"); X menuprint("b: Raise your College rank.\n"); X menuprint("c: Do spell research.\n"); X menuprint("ESCAPE: Leave these hallowed halls.\n"); X action = mgetc(); X if (action == ESCAPE) done = TRUE; X else if (action == 'a') { X if (Player.rank[COLLEGE] > 0) X print2("You are already enrolled!"); X else if (Player.iq < 13) X print2("Your low IQ renders you incapable of being educated."); X else { X if (Player.iq > 17) { X print2("You are given a scholarship!"); X morewait(); X enrolled=TRUE; X } X else { X print1("Tuition is 1000Au. "); X nprint1("Pay it? [yn] "); X if (ynq1() =='y') { X if (Player.cash < 1000) X print2("You don't have the funds!"); X else { X Player.cash -= 1000; X enrolled = TRUE; X dataprint(); X } X } X } X if (enrolled) { X print1("Archmage "); X nprint1(Archmage); X nprint1(" greets you and congratulates you on your acceptance."); X print2("You are now enrolled in the Collegium Magii!"); X morewait(); X print1("You are now a Novice."); X print2("You may research 1 spell, for your intro class."); X Spellsleft = 1; X Player.rank[COLLEGE] = INITIATE; X Player.guildxp[COLLEGE] = 1; X Player.maxiq += 1; X Player.iq += 1; X Player.maxpow += 1; X Player.pow += 1; X } X } X } X else if (action == 'b') { X if (Player.rank[COLLEGE] == 0) X print2("You have not even been initiated, yet!"); X else if (Player.rank[COLLEGE]==ARCHMAGE) X print2("You are at the pinnacle of mastery in the Collegium."); X else if (Player.rank[COLLEGE]==MAGE) { X if (Player.level <= Archmagelevel) X print2("You are not experienced enough to advance."); X else X print2("You must return with the heart of the Eater of Magic!"); X } X else if (Player.rank[COLLEGE]==PRECEPTOR) { X if (Player.guildxp[COLLEGE] < 4000) X print2("You are not experienced enough to advance."); X else { X print1("You are now a Mage of the Collegium Magii!"); X print2("You may research 6 spells for postdoctoral research."); X Spellsleft += 6; X morewait(); X print1("To become Archmage, you must return with the"); X print2("heart of the Eater of Magic"); X morewait(); X clearmsg(); X print1("The Eater may be found on a desert isle somewhere."); X Player.rank[COLLEGE] = MAGE; X Player.maxiq += 2; X Player.iq += 2; X Player.maxpow += 2; X Player.pow += 2; X } X } X else if (Player.rank[COLLEGE]==STUDENT) { X if (Player.guildxp[COLLEGE] < 1500) X print2("You are not experienced enough to advance."); X else { X print1("You are now a Preceptor of the Collegium Magii!"); X print2("You are taught the basics of ritual magic."); X morewait(); X clearmsg(); X print1("Your position allows you to research 4 spells."); X Spellsleft +=4; X Spells[S_RITUAL].known = TRUE; X Player.rank[COLLEGE] = PRECEPTOR; X Player.maxiq += 1; X Player.iq += 1; X Player.maxpow += 1; X Player.pow += 1; X } X } X else if (Player.rank[COLLEGE]==NOVICE) { X if (Player.guildxp[COLLEGE] < 400) X print2("You are not experienced enough to advance."); X else { X print1("You are now a Student at the Collegium Magii!"); X print2("You are taught the spell of identification."); X morewait(); X clearmsg(); X print1("Thesis research credit is 2 spells."); X Spellsleft+=2; X Spells[S_IDENTIFY].known = TRUE; X Player.rank[COLLEGE] = STUDENT; X Player.maxiq += 1; X Player.iq += 1; X Player.maxpow += 1; X Player.pow += 1; X } X } X } X else if (action == 'c') { X clearmsg(); X if (Spellsleft > 0) { X print1("Research permitted: "); X mnumprint(Spellsleft); X nprint1(" Spells."); X morewait(); X } X if (Spellsleft < 1) { X print1("Extracurricular Lab fee: 2000 Au. "); X nprint1("Pay it? [yn] "); X if (ynq1()=='y') { X if (Player.cash < 2000) X print1("Try again when you have the cash."); X else { X Player.cash -= 2000; X dataprint(); X Spellsleft = 1; X } X } X } X if (Spellsleft > 0) { X learnspell(0); X Spellsleft--; X } X } X } X } X xredraw(); X} X X X Xvoid l_sorcerors() X{ X char action; X int done=FALSE,fee=3000,total; X print1("The Circle of Sorcerors."); X if (Player.rank[CIRCLE] == -1) { X print2("Fool! Didn't we tell you to go away?"); X Player.mana = 0; X dataprint(); X } X else while (! done) { X if ((Player.rank[CIRCLE]==HIGHSORCEROR) && X (Player.level > Primelevel) && X find_and_remove_item(CORPSEID,ML10+2)) { X print2("You obtained the Crown of the Lawgiver!"); X morewait(); X print1("The Crown is ritually sacrificed to the Lords of Chaos."); X print2("You are now the Prime Sorceror of the Inner Circle!"); X strcpy(Prime,Player.name); X Primelevel = Player.level; X morewait(); X clearmsg(); X print1("You learn the Spell of Disintegration!"); X morewait(); X clearmsg(); X Spells[S_DISINTEGRATE].known = TRUE; X Player.rank[CIRCLE] = PRIME; X Player.maxpow += 10; X Player.pow += 10; X } X menuclear(); X menuprint("May we help you?\n\n"); X menuprint("a: Become an Initiate of the Circle.\n"); X menuprint("b: Raise your rank in the Circle.\n"); X menuprint("c: Restore mana points\n"); X menuprint("ESCAPE: Leave these Chambers of Power.\n"); X action = mgetc(); X if (action == ESCAPE) done = TRUE; X else if (action == 'a') { X if (Player.rank[CIRCLE] > 0) X print2("You are already an initiate!"); X else if (Player.alignment > 0) X print2("You may not join -- you reek of Law!"); X else { X fee += Player.alignment*100; X fee = (int) (fee * (1+(12-Player.pow)/9.0)); X fee = max(100,fee); X print1("For you, there is an initiation fee of "); X mnumprint(fee); X nprint1("Au."); X print2("Pay it? [yn] "); X if (ynq2() =='y') { X if (Player.cash < fee) X print3("Try again when you have the cash!"); X else { X print1("Prime Sorceror "); X nprint1(Prime); X print2("conducts your initiation into the circle of novices."); X morewait(); X clearmsg(); X print1("You learn the Spell of Magic Missiles."); X Spells[S_MISSILE].known = TRUE; X Player.cash -= fee; X dataprint(); X Player.rank[CIRCLE] = INITIATE; X Player.guildxp[CIRCLE] = 1; X Player.maxpow++; X Player.pow++; X } X } X } X } X else if (action == 'b') { X if (Player.rank[CIRCLE] == 0) X print2("You have not even been initiated, yet!"); X else if (Player.alignment > -1) { X print1("Ahh! You have grown too lawful!!!"); X print2("You are hereby blackballed from the Circle!"); X Player.rank[CIRCLE] = -1; X morewait(); X clearmsg(); X print1("A pox upon thee!"); X if (! Player.immunity[INFECTION]) X Player.status[DISEASED]+=100; X print2("And a curse on your possessions!"); X morewait(); X clearmsg(); X acquire(-1); X clearmsg(); X enchant(-1); X bless(-1); X print3("Die, false sorceror!"); X p_damage(25,UNSTOPPABLE,"a sorceror's curse"); X } X else if (Player.rank[CIRCLE]==PRIME) X print2("You are at the pinnacle of mastery in the Circle."); X else if (Player.rank[CIRCLE]==HIGHSORCEROR) { X if (Player.level <= Primelevel) X print2("You are not experienced enough to advance."); X else X print2("You must return with the Crown of the LawBringer!"); X } X else if (Player.rank[CIRCLE]==SORCEROR) { X if (Player.guildxp[CIRCLE] < 4000) X print2("You are not experienced enough to advance."); X else { X print1("You are now a High Sorceror of the Inner Circle!"); X print2("You learn the Spell of Disruption!"); X morewait(); X clearmsg(); X print1("To advance you must return with the LawBringer's Crown!"); X print2("The LawBringer resides on Star Peak."); X Spells[S_DISRUPT].known = TRUE; X Player.rank[CIRCLE] = HIGHSORCEROR; X Player.maxpow += 5; X Player.pow += 5; X } X } X else if (Player.rank[CIRCLE]==ENCHANTER) { X if (Player.guildxp[CIRCLE] < 1500) X print2("You are not experienced enough to advance."); X else { X print1("You are now a member of the Circle of Sorcerors!"); X print2("You learn the Spell of Ball Lightning!"); X Spells[S_LBALL].known = TRUE; X Player.rank[CIRCLE] = SORCEROR; X Player.maxpow += 2; X Player.pow+=2; X } X } X else if (Player.rank[CIRCLE]==INITIATE) { X if (Player.guildxp[CIRCLE] < 400) X print2("You are not experienced enough to advance."); X else { X print1("You are now a member of the Circle of Enchanters!"); X print2("You learn the Spell of Firebolts."); X Spells[S_FIREBOLT].known = TRUE; X Player.rank[CIRCLE] = ENCHANTER; X Player.maxpow++; X Player.pow++; X } X } X } X else if (action == 'c') { X done = TRUE; X fee = Player.level*100; X if (Player.rank[CIRCLE]) fee = fee / 2; X print1("That will be: "); X mnumprint(fee); X nprint1("Au. Pay it? [yn] "); X if (ynq1()=='y') { X if (Player.cash < fee) X print2("Begone, deadbeat, or face the wrath of the Circle!"); X else { X Player.cash -= fee; X total = calcmana(); X while (Player.mana < total) { X Player.mana++; X dataprint(); X } X print2("Have a sorcerous day, now!"); X } X } X else print2("Be seeing you!"); X } X } X xredraw(); X} X X X X Xvoid l_order() X{ X pob newitem; X print1("The Headquarters of the Order of Paladins."); X morewait(); X if ((Player.rank[ORDER]==PALADIN) && X (Player.level > Justiciarlevel) && X gamestatusp(GAVE_STARGEM) && X Player.alignment > 300) { X print1("You have succeeded in your quest!"); X morewait(); X print1("The previous Justiciar steps down in your favor."); X print2("You are now the Justiciar of Rampart and the Order!"); X strcpy(Justiciar,Player.name); X Justiciarlevel = Player.level; X morewait(); X clearmsg(); X print1("You are awarded a blessed shield of deflection!"); X morewait(); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[SHIELDID+6]; /* shield of deflection */ X newitem->blessing = 9; X gain_item(newitem); X morewait(); X Player.rank[ORDER] = PRIME; X Player.maxpow += 10; X Player.pow += 10; X } X if ((Player.rank[ORDER] == -1) || (Player.alignment < 1)) X print1("Get thee hence, minion of chaos!"); X else if (Player.rank[ORDER] == 0) { X if (Player.rank[ARENA] != 0) X print1("We do not accept blood stained gladiators into our Order."); X else if (Player.rank[LEGION] != 0) X print1("Go back to your barracks, mercenary!"); X else { X print1("Dost thou wish to join our Order? [yn] "); X if (ynq1()=='y') { X print1("Justiciar "); X nprint1(Justiciar); X nprint1(" welcomes you to the Order."); X print2("'Mayest thou always follow the sublime path of Law.'"); X morewait(); X print1("You are now a Gallant in the Order."); X print2("You are given a horse and a blessed spear."); X morewait(); X Player.rank[ORDER] = GALLANT; X Player.guildxp[ORDER] = 1; X setgamestatus(MOUNTED); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[WEAPONID+19]; /* spear */ X newitem->blessing = 9; X newitem->plus = 1; X newitem->known = 2; X gain_item(newitem); X } X } X } X else { X if (Player.alignment < 1) { X print1("You have been tainted by chaos!"); X print2("You are stripped of your rank in the Order!"); X morewait(); X Player.rank[ORDER]= -1; X send_to_jail(); X } X else { X print1("'Welcome back, Paladin.'"); X if (!gamestatusp(MOUNTED)) { X print2("You are given a new steed."); X setgamestatus(MOUNTED); X } X morewait(); X clearmsg(); X if ((Player.hp < Player.maxhp) || (Player.status[DISEASED])) X print1("Your wounds are treated by a medic."); X cleanse(1); X Player.hp = Player.maxhp; X Player.food = 40; X print2("You get a hot meal from the refectory."); X morewait(); X clearmsg(); X if (Player.rank[ORDER]==PALADIN) { X if (Player.level <= Justiciarlevel) X print2("You are not experienced enough to advance."); X else if (Player.alignment < 300) X print2("You are not sufficiently Lawful as yet to advance."); X else print2("You must give the Star Gem to the LawBringer."); X } X else if (Player.rank[ORDER]==CHEVALIER) { X if (Player.guildxp[ORDER] < 4000) X print2("You are not experienced enough to advance."); X else if (Player.alignment < 200) X print2("You are not sufficiently Lawful as yet to advance."); X else { X print1("You are made a Paladin of the Order!"); X print2("You learn the Spell of Heroism and get Mithril Plate!"); X morewait(); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[ARMORID+11]; /* mithril plate armor */ X newitem->blessing = 9; X newitem->known = 2; X gain_item(newitem); X morewait(); X clearmsg(); X print1("To advance you must rescue the Star Gem and return it"); X print2("to its owner, the LawBringer, who resides on Star Peak."); X morewait(); X print1("The Star Gem was stolen by the cursed Prime Sorceror,"); X print2("whose headquarters may be found beyond the Astral Plane."); X morewait(); X print1("The Oracle will send you to the Astral Plane if you"); X print2("prove yourself worthy to her."); X morewait(); X Spells[S_HERO].known = TRUE; X Player.rank[ORDER] = PALADIN; X } X } X else if (Player.rank[ORDER]==GUARDIAN) { X if (Player.guildxp[ORDER] < 1500) X print2("You are not experienced enough to advance."); X else if (Player.alignment < 125) X print2("You are not yet sufficiently Lawful to advance."); X else { X Player.rank[ORDER] = CHEVALIER; X print1("You are made a Chevalier of the Order!"); X print2("You are given a Mace of Disruption!"); X morewait(); X clearmsg(); X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[WEAPONID+25]; /* mace of disruption */ X newitem->known = 2; X gain_item(newitem); X } X } X else if (Player.rank[ORDER]==GALLANT) { X if (Player.guildxp[ORDER] < 400) X print2("You are not experienced enough to advance."); X else if (Player.alignment < 50) X print2("You are not Lawful enough to advance."); X else { X print1("You are made a Guardian of the Order of Paladins!"); X print2("You are given a Holy Hand Grenade (of Antioch)."); X morewait(); X print1("You hear a nasal monotone in the distance...."); X print2("'...and the number of thy counting shall be 3...'"); X morewait(); X clearmsg(); X Player.rank[ORDER] = GUARDIAN; X newitem = ((pob) malloc(sizeof(objtype))); X *newitem = Objects[ARTIFACTID+7]; /* holy hand grenade. */ X newitem->known = 2; X gain_item(newitem); X } X } X } X } X} END_OF_FILE if test 22895 -ne `wc -c <'oguild2.c'`; then echo shar: \"'oguild2.c'\" unpacked with wrong size! fi # end of 'oguild2.c' fi if test -f 'osite1.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'osite1.c'\" else echo shar: Extracting \"'osite1.c'\" \(28126 characters\) sed "s/^X//" >'osite1.c' <<'END_OF_FILE' X/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */ X/* osite1.c */ X/* 1st half of site functions and aux functions to them */ X X#include "oglob.h" X X/* the bank; can be broken into (!) */ Xvoid l_bank() X{ X int done=FALSE,valid=FALSE,amount; X char response; X char passwd[64]; X print1("First Bank of Omega: Autoteller Carrel."); X X if (gamestatusp(BANK_BROKEN)) X print2("You see a damaged autoteller."); X else { X print2("The proximity sensor activates the autoteller as you approach."); X morewait(); X while (! done) { X clearmsg1(); X print1("Current Balance: "); X mnumprint(Balance); X nprint1("Au. "); X nprint1(" Enter command > "); X response = mgetc(); X if (response == '?') { X menuclear(); X menuprint("?: This List.\n"); X if (strcmp(Password,"")==0) X menuprint("O: Open an account.\n"); X else { X menuprint("P: Enter password.\n"); X menuprint("D: Deposit.\n"); X menuprint("W: Withdraw\n"); X } X menuprint("X: eXit\n"); X morewait(); X xredraw(); X } X else if ((response == 'P') && (strcmp(Password,"") != 0)) { X clearmsg(); X print1("Password: "); X strcpy(passwd,msgscanstring()); X valid = (strcmp(passwd,Password)==0); X if (! valid) { X done = TRUE; X menuclear(); X menuprint("Alert! Alert! Invalid Password!\n"); X menuprint("The police are being summoned!\n"); X menuprint("Please wait for the police to arrive....\n\n"); X menuprint("----Hit space bar to continue----\n"); X response = menugetc(); X if (response == SPACE) { X Player.alignment += 5; X xredraw(); X print1("Ah ha! Trying to rob the bank, eh?"); X print2("Take him away, boys!"); X morewait(); X send_to_jail(); X } X else { X Player.alignment -= 5; X menuclear(); X sleep(2); X menuprint("^@^@^@^@^@00AD1203BC0F0000FFFFFFFFFFFF\n"); X menuprint("Interrupt in _get_space. Illegal Character.\n"); X sleep(2); X menuprint("Aborting _police_alert.....\n"); X menuprint("Attempting reboot.....\n"); X sleep(2); X menuprint("Warning: Illegal shmop at _count_cash.\n"); X menuprint("Warning: Command Buffer NOT CLEARED\n"); X sleep(2); X menuprint("Reboot Complete. Execution Continuing.\n"); X menuprint("Withdrawing: 4294967297 Au.\n"); X menuprint("Warning: Arithmetic Overflow in _withdraw\n"); X sleep(2); X menuprint("Yo mama. Core dumped.\n"); X sleep(2); X xredraw(); X clearmsg(); X print1("The cash machine begins to spew gold pieces!"); X print2("You pick up your entire balance and then some!"); X Player.cash += Balance + 1000 + random_range(3000); X Balance = 0; X setgamestatus(BANK_BROKEN); X } X } X else print2("Password accepted. Working."); X } X else if ((response == 'D') && valid) { X clearmsg(); X print1("Amount: "); X amount = get_money(Player.cash); X if (amount < 1) X print3("Transaction aborted."); X else if (amount > Player.cash) X print3("Deposit too large -- transaction aborted."); X else { X print2("Transaction accomplished."); X Balance += amount; X Player.cash -= amount; X } X } X else if ((response == 'W') && valid) { X clearmsg(); X print2("Amount: "); X amount = get_money(Balance); X if (amount < 1) X print3("Transaction aborted."); X else if (amount > Balance) X print3("Withdrawal too large -- transaction aborted."); X else { X print2("Transaction accomplished."); X Balance -= amount; X Player.cash += amount; X } X } X else if (response == 'X') { X clearmsg(); X print1("Bye!"); X done = TRUE; X } X else if ((response == 'O') && (strcmp(Password,"")==0)) { X clearmsg(); X print1("Opening new account."); X nprint1(" Please enter new password: "); X strcpy(Password,msgscanstring()); X if (strcmp(Password,"")==0) { X print3("Illegal to use null password -- aborted."); X done = TRUE; X } X else { X print2("Password validated; account saved."); X valid = TRUE; X } X } X else print3(" Illegal command."); X dataprint(); X morewait(); X } X } X xredraw(); X} X X X X Xvoid l_armorer() X{ X int done = FALSE; X char action; X if (hour() == 12) X print3("Unfortunately, this is Julie's lunch hour -- try again later."); X else if (nighttime()) X print3("It seems that Julie keeps regular business hours."); X else { X while (! done) { X clearmsg(); X print1("Julie's: Buy Armor, Weapons, or Leave [a,w,ESCAPE] "); X action = mgetc(); X if (action == ESCAPE) X done = TRUE; X else if (action == 'a') X buyfromstock(ARMORID,10); X else if (action == 'w') X buyfromstock(WEAPONID,23); X } X } X xredraw(); X} X X Xvoid buyfromstock(base,numitems) Xint base,numitems; X{ X int i; X char item; X pob newitem; X X print2("Purchase which item? [ESCAPE to quit] "); X menuclear(); X for(i=0;i<numitems;i++) { X strcpy(Str4," :"); X Str4[0] = i + 'a'; X strcat(Str4,Objects[base+i].objstr); X menuprint(Str4); X menuprint("\n"); X } X item = ' '; X while ((item != ESCAPE) && X ((item < 'a') || (item >= 'a'+numitems))) X item = mgetc(); X if (item != ESCAPE) { X i = item - 'a'; X newitem = ((pob) calloc(1,sizeof(objtype))); X *newitem = Objects[base+i]; X newitem->known = 2; X print1("I can let you have it for "); X mnumprint(2*true_item_value(newitem)); X nprint1("Au. Buy it? [yn] "); X if (ynq1() == 'y') { X if (Player.cash < 2*true_item_value(newitem)) { X print2("Why not try again some time you have the cash?"); X free((char *) newitem); X } X else { X Player.cash -= 2*true_item_value(newitem); X dataprint(); X gain_item(newitem); X } X } X else free((char *)newitem); X } X} X X Xvoid l_club() X{ X static int hinthour = 0; X char response; X X print1("Rampart Explorers' Club."); X if (! gamestatusp(CLUB_MEMBER)) { X if (Player.level < 2) print3("Only reknowned adventurers need apply."); X else { X print2("Dues are 100Au. Pay it? [yn] "); X if (ynq2()=='y') { X if (Player.cash < 100) X print3("Beat it, or we'll blackball you!"); X else { X print1("Welcome to the club! You are taught the spell of Return."); X print2("When cast on the first level of a dungeon it"); X morewait(); X clearmsg(); X print1("will transport you down to the lowest level"); X print2("you have explored, and vice versa."); X Spells[S_RETURN].known = TRUE; X Player.cash -= 100; X setgamestatus(CLUB_MEMBER); X } X } X else print2("OK, but you're missing out on our benefits...."); X } X } X else { X print2("Shop at the club store or listen for rumors [sl] "); X do response = mcigetc(); X while ((response != 's') && (response != 'l') && (response != ESCAPE)); X if (response == 'l') { X if (hinthour == hour()) print2("You don't hear anything useful."); X else { X print1("You overhear a conversation...."); X hint(); X hinthour = hour(); X } X } X else if (response == 's') { X buyfromstock(THINGID+7,2); X xredraw(); X } X else if (response == ESCAPE) X print2("Be seeing you, old chap!"); X } X} X Xvoid l_gym() X{ X int done=TRUE; X do { X print1("The Rampart Gymnasium"); X if ((Gymcredit > 0) || (Player.rank[ARENA])) { X nprint1("-- Credit: "); X mnumprint(Gymcredit); X nprint1("Au."); X } X done = FALSE; X menuclear(); X menuprint("Train for 2000 Au. Choose:\n"); X menuprint("\na: work out in the weight room"); X menuprint("\nb: use our gymnastics equipment"); X menuprint("\nc: take our new anaerobics course"); X menuprint("\nd: enroll in dance lessons."); X menuprint("\nESCAPE: Leave this place."); X switch(mgetc()) { X case 'a': X gymtrain(&(Player.maxstr),&(Player.str)); X break; X case 'b': X gymtrain(&(Player.maxdex),&(Player.dex)); X break; X case 'c': X gymtrain(&(Player.maxcon),&(Player.con)); X break; X case 'd': X gymtrain(&(Player.maxagi),&(Player.agi)); X break; X case ESCAPE: X clearmsg(); X print1("Well, it's your body you're depriving!"); X done = TRUE; X break; X } X } while (! done); X xredraw(); X calc_melee(); X} X X X Xvoid l_healer() X{ X print1("Rampart Healers. Member RMA."); X morewait(); X clearmsg(); X print1("a: Heal injuries (50 crowns)"); X print2("b: Cure disease (250 crowns)"); X print3("ESCAPE: Leave these antiseptic alcoves."); X switch(mcigetc()) { X case 'a': healforpay(); break; X case 'b': cureforpay(); break; X default: print3("OK, but suppose you have Acute Satyriasis?"); break; X } X} X X Xvoid statue_random(x,y) Xint x,y; X{ X pob item; X int i,j; X switch(random_range(difficulty()+3)-1) { X default: l_statue_wake(); break; X case 0: X print1("The statue crumbles with a clatter of gravel."); X Level->site[x][y].locchar = RUBBLE; X Level->site[x][y].p_locf = L_RUBBLE; X break; X case 1: X print1("The statue stoutly resists your attack."); X break; X case 2: X print1("The statue crumbles with a clatter of gravel."); X Level->site[x][y].locchar = RUBBLE; X Level->site[x][y].p_locf = L_RUBBLE; X make_site_treasure(x,y,difficulty()); X break; X case 3: X print1("The statue hits you back!"); X p_damage(random_range(difficulty()*5),UNSTOPPABLE,"a statue"); X break; X case 4: X print1("The statue looks slightly pained. It speaks:"); X morewait(); X clearmsg(); X hint(); X break; X case 5: X if ((Current_Environment == Current_Dungeon) || X (Current_Environment == E_CITY)) { X print1("You hear the whirr of some mechanism."); X print2("The statue glides smoothly into the floor!"); X Level->site[x][y].locchar = DOWN; X Level->site[x][y].p_locf = L_NO_OP; X } X break; X case 6: X print1("The statue was covered with contact cement!"); X print2("You can't move...."); X Player.status[IMMOBILE]+=random_range(6)+2; X break; X case 7: X print1("A strange radiation emanates from the statue!"); X dispel(-1); X break; X case 8: /* I think this is particularly evil. Heh heh. */ X if (Player.possessions[O_WEAPON_HAND] != NULL) { X print1("Your weapon sinks deeply into the statue and is sucked away!"); X item = Player.possessions[O_WEAPON_HAND]; X conform_lost_object(Player.possessions[O_WEAPON_HAND]); X item->blessing = -1-abs(item->blessing); X drop_at(x,y,item); X } X break; X case 9: X print1("The statue extends an arm. Beams of light illuminate the level!"); X for(i=0;i<WIDTH;i++) X for(j=0;j<LENGTH;j++) { X lset(i,j,SEEN); X lreset(i,j,SECRET); X show_screen(); X } X break; X } X} X Xvoid l_statue_wake() X{ X int i; X int x=Player.x,y=Player.y; X for(i=0;i<9;i++) X wake_statue(x+Dirs[0][i],y+Dirs[1][i],TRUE); X} X Xvoid wake_statue(x,y,first) Xint x,y,first; X{ X int i; X pml tml; X if (Level->site[x][y].locchar == STATUE) { X if (! first) mprint("Another statue awakens!"); X else mprint("A statue springs to life!"); X Level->site[x][y].locchar = FLOOR; X tml = ((pml) malloc(sizeof(mltype))); X tml->m = X (Level->site[x][y].creature = m_create(x,y,0,difficulty()+1)); X m_status_set(Level->site[x][y].creature,HOSTILE); X tml->next = Level->mlist; X Level->mlist = tml; X for(i=0;i<8;i++) wake_statue(x+Dirs[0][i],y+Dirs[1][i],FALSE); X } X} X X Xvoid l_casino() X{ X int i,done = FALSE,a,b,c,match; X static int winnings = 0; X char response; X print1("Rampart Mithril Nugget Casino."); X if (random_range(10)==1) X print2("Casino closed due to Grand Jury investigation."); X else { X while (! done) { X morewait(); X clearmsg(); X print1("a: Drop 100Au in the slots."); X print2("b: Risk 1000Au at roulette."); X print3("ESCAPE: Leave this green baize hall."); X response = mcigetc(); X if (response == 'a') { X if (Player.cash < 100) print3("No credit, jerk."); X else { X Player.cash -= 100; X dataprint(); X for(i=0;i<20;i++) { X if (i==19) sleep(1); X a = random_range(10); X b = random_range(10); X c = random_range(10); X clearmsg(); X mprint(slotstr(a)); X mprint(slotstr(b)); X mprint(slotstr(c)); X } X if (winnings > 0) do { X a = random_range(10); X b = random_range(10); X c = random_range(10); X } while ((a==b) || (a == c) || (b == c)); X else { X a = random_range(10); X b = random_range(10); X c = random_range(10); X } X clearmsg(); X mprint(slotstr(a)); X mprint(slotstr(b)); X mprint(slotstr(c)); X if ((a==b) && (a==c)) { X print3("Jackpot Winner!"); X winnings += (a+2)*(b+2)*(c+2)*5; X Player.cash += (a+2)*(b+2)*(c+2)*5; X dataprint(); X } X else if (a==b) { X print3("Winner!"); X Player.cash += (a+2)*(b+2)*5; X dataprint(); X winnings += (a+2)*(b+2)*5; X } X else if (a==c) { X print3("Winner!"); X Player.cash += (a+2)*(c+2)*5; X dataprint(); X winnings += (a+2)*(c+2)*5; X } X else if (c==b) { X print3("Winner!"); X Player.cash += (c+2)*(b+2)*5; X dataprint(); X winnings += (c+2)*(b+2)*5; X } X else { X print3("Loser!"); X winnings -= 100; X } X } X } X else if (response == 'b') { X if (Player.cash < 1000) mprint("No credit, jerk."); X else { X Player.cash -= 1000; X dataprint(); X print1("Red or Black? [rb]"); X do response = mcigetc(); X while ((response != 'r') && (response != 'b')); X match = (response == 'r' ? 0 : 1); X for(i=0;i<20;i++) { X if (i==19) sleep(1); X a = random_range(37); X b = a % 2; X if (a == 0) print1(" 0 "); X else if (a==1) print1(" 0 - 0 "); X else { X print1(( b == 0) ? "Red ": "Black "); X mnumprint(a-1); X } X } X if (winnings > 0) do { X a = random_range(37); X b = a % 2; X } while (b == match); X else { X a = random_range(37); X b = a % 2; X } X if (a == 0) print1(" 0 "); X else if (a==1) print1(" 0 - 0 "); X else { X print1((b == 0) ? "Red ": "Black "); X mnumprint(a-1); X } X if ((a > 1) && (b == match)){ X print3(" Winner!"); X winnings += 1000; X Player.cash += 2000; X dataprint(); X } X else { X print3(" Loser!"); X winnings -= 1000; X dataprint(); X } X } X } X else if (response == ESCAPE) done = TRUE; X } X } X} X X X X X Xvoid l_commandant() X{ X int num; X pob food; X print1("Commandant Sonder's Rampart-fried Lyzzard partes. Open 24 hrs."); X print2("Buy a bucket! Only 5 Au. Make a purchase? [yn] "); X if (ynq2()=='y') { X clearmsg(); X print1("How many? "); X num = parsenum(); X if (num < 1) print3("Cute. Real cute."); X else if (num*5 > Player.cash) X print3("No handouts here, mac!"); X else { X Player.cash -= num*5; X food = ((pob) malloc(sizeof(objtype))); X *food = Objects[FOODID+0]; /* food ration */ X food->number = num; X if (num == 1) X print2("There you go, mac! One Lyzzard Bucket, coming up."); X else print2("A passel of Lyzzard Buckets, for your pleasure."); X morewait(); X gain_item(food); X } X } X else print2("Don't blame the Commandant if you starve!"); X} X X Xvoid l_diner() X{ X print1("The Rampart Diner. All you can eat, 25Au."); X print2("Place an order? [yn] "); X if (ynq2()=='y') { X if (Player.cash < 25) X mprint("TANSTAAFL! Now git!"); X else { X Player.cash -= 25; X dataprint(); X Player.food = 44; X foodcheck(); X } X } X} X Xvoid l_crap() X{ X print1("Les Crapeuleaux. (****) "); X if ((hour() < 17) || (hour() > 23)) X print2 ("So sorry, we are closed 'til the morrow..."); X else { X print2("May I take your order? [yn] "); X if (ynq2()=='y') { X if (Player.cash < 1000) X print2("So sorry, you have not the funds for dinner."); X else { X print2("Hope you enjoyed your tres expensive meal, m'sieur..."); X Player.cash -= 1000; X dataprint(); X Player.food += 8; X foodcheck(); X } X } X } X} X Xvoid l_tavern() X{ X static int hinthour; X char response; X print1("The Centaur and Nymph -- J. Riley, prop."); X if (nighttime()) { X menuclear(); X menuprint("Riley says: Whataya have?\n\n"); X menuprint("a: Pint of Riley's ultra-dark 1Au\n"); X menuprint("b: Shot of Tullimore Dew 10Au\n"); X menuprint("c: Round for the House. 100Au\n"); X menuprint("d: Bed and Breakfast. 25Au\n"); X menuprint("ESCAPE: Leave this comfortable haven.\n"); X do response = mcigetc(); X while ((response != 'a') && X (response != 'b') && X (response != 'c') && X (response != 'd') && X (response != ESCAPE)); X switch (response) { X case 'a': X if (Player.cash < 1) X print2("Aw hell, have one on me."); X else { X hinthour = hour(); X Player.cash -= 1; X dataprint(); X if (hinthour!=hour()) { X if (random_range(3)) { X print1("You overhear a rumor..."); X hint(); X } X else print1("You don't hear much of interest."); X hinthour = hour(); X } X else print1("You just hear the same conversations again."); X } X break; X case 'b': X if (Player.cash < 10) X print2("I don't serve the Dew on no tab, buddy!"); X else { X Player.cash -= 10; X print1("Ahhhhh...."); X if (Player.status[POISONED] || Player.status[DISEASED]) X print2("Phew! That's, er, smooth stuff!"); X Player.status[POISONED] = 0; X Player.status[DISEASED] = 0; X showflags(); X } X break; X case 'c': X if (Player.cash < 100) { X print1("Whatta feeb!"); X print2("Outta my establishment.... Now!"); X p_damage(random_range(20),UNSTOPPABLE,"Riley's right cross"); X } X else { X Player.cash -= 100; X dataprint(); X print1("'What a guy!'"); morewait(); X print2("'Hey, thanks, fella.'"); morewait(); X print3("'Make mine a double...'"); morewait(); X clearmsg(); X switch(random_range(4)) { X case 0: X print1("'You are a real pal. Say, have you heard.... "); X hint(); X break; X case 1: X print1("A wandering priest of Dionysus blesses you..."); X if ((Player.patron == ODIN) || (Player.patron == ATHENA)) X Player.alignment++; X else if ((Player.patron == HECATE) || (Player.patron == SET)) X Player.alignment--; X else if (Player.alignment > 0) Player.alignment--; X else Player.alignment++; X break; X case 2: X print1("A thirsty bard promises to put your name in a song!"); X gain_experience(20); X break; X case 3: X print1("Riley draws you a shot of his 'special reserve'"); X print2("Drink it [yn]?"); X if (ynq2()=='y') { X if (Player.con < random_range(20)) { X print1("<cough> Quite a kick!"); X print2("You feel a fiery warmth in your tummy...."); X Player.con++; X Player.maxcon++; X } X else print2("You toss it back nonchalantly."); X } X } X } X break; X case 'd': X if (Player.cash < 25) X print2("Pay in advance, mac!"); X else { X Player.cash -= 25; X print2("How about a shot o' the dew for a nightcap?"); X morewait(); X Time += (6+random_range(4)) * 60; X Player.status[POISONED] = 0; X Player.status[DISEASED] = 0; X Player.food = 40; X /* reduce temporary stat gains to max stat levels */ X toggle_item_use(TRUE); X Player.str = min(Player.str,Player.maxstr); X Player.con = min(Player.con,Player.maxcon); X Player.agi = min(Player.agi,Player.maxagi); X Player.dex = min(Player.dex,Player.maxdex); X Player.iq = min(Player.iq,Player.maxiq); X Player.pow = min(Player.pow,Player.maxpow); X toggle_item_use(FALSE); X timeprint(); X dataprint(); X showflags(); X print1("The next day....."); X if (hour() > 10) print2("Oh my! You overslept!"); X } X break; X default: X print2("So? Just looking? Go on!"); X break; X } X } X else print2("The pub don't open til dark, fella."); X xredraw(); X} X X Xvoid l_alchemist() X{ X int i,done=FALSE,mlevel; X char response; X pob obj; X print1("Ambrosias' Potions et cie."); X if (nighttime()) X print2("Ambrosias doesn't seem to be in right now."); X else while (! done){ X morewait(); X clearmsg(); X print1("a: Sell monster components."); X print2("b: Pay for transformation."); X print3("ESCAPE: Leave this place."); X response = mcigetc(); X if (response == 'a') { X clearmsg(); X done = TRUE; X i = getitem(CORPSE); X if ((i != ABORT) && (Player.possessions[i] != NULL)){ X obj = Player.possessions[i]; X if (Monsters[obj->charge].transformid == -1) { X print1("I don't want such a thing."); X if (obj->basevalue > 0) X print2("You might be able to sell it to someone else, though."); X } X else { X print1("I'll give you "); X mnumprint(obj->basevalue/3); X nprint1("Au for it. Take it? [yn] "); X if (ynq1()=='y') { X Player.cash += (obj->basevalue/3); X conform_lost_objects(1,obj); X } X else print2("Well, keep the smelly old thing, then!"); X } X } X else print2("So nu?"); X } X else if (response == 'b') { X clearmsg(); X done = TRUE; X i = getitem(CORPSE); X if ((i != ABORT) && (Player.possessions[i] != NULL)){ X obj = Player.possessions[i]; X mlevel = Monsters[obj->charge].level; X print1("It'll cost you "); X mnumprint(max(10,obj->basevalue*2)); X nprint1("for the transformation. Pay it? [yn] "); X if (ynq1()=='y') { X if (Player.cash < max(10,obj->basevalue*2)) X print2("You can't afford it!"); X else if (Monsters[obj->charge].transformid == -1) { X print1("There is a puff of smoke, and the corpse disappears."); X Player.cash -= max(10,obj->basevalue*2); X dispose_lost_objects(1,obj); X } X else { X print1("Voila! A tap of the Philosopher's Stone..."); X Player.cash -= obj->basevalue*2; X *obj = Objects[Monsters[obj->charge].transformid]; X if ((obj->id >= STICKID) && (obj->id < STICKID+NUMSTICKS)) X obj->charge = 20; X if (obj->plus == 0) obj->plus = mlevel; X if (obj->blessing == 0) obj->blessing = 1; X } X } X else print2("I don't need your business, anyhow."); X } X else print2("So nu?"); X } X else if (response == ESCAPE) done = TRUE; X } X} X Xvoid l_dpw() X{ X print1("Rampart Department of Public Works."); X if (Date - LastDay < 7) X print2("G'wan! Get a job!"); X else if (Player.cash < 100) { X print2("Do you want to go on the dole? [yn] "); X if (ynq2()=='y') { X print1("Well, ok, but spend it wisely."); X print2("Please enter your name for our records."); X if (strcmp(Player.name,msgscanstring()) != 0) { X print3("Aha! Welfare Fraud! It's off to gaol for you, lout!"); X morewait(); X send_to_jail(); X } X else { X print1("Here's your handout, layabout!"); X LastDay = Date; X Player.cash = 99; X dataprint(); X } X } X } X else print2("You're too well off for us to help you!"); X} X Xvoid l_library() X{ X char response; X int done=FALSE,fee = 1000; X print1("Rampart Public Library."); X if (nighttime()) X print2("CLOSED"); X else { X morewait(); X print1("Library Research Fee: 1000Au."); X if (Player.maxiq < 18) { X print2("The Rampart student aid system has arranged a grant!"); X morewait(); X clearmsg(); X print1("Your revised fee is: "); X mnumprint(fee=max(50,1000-(18-Player.maxiq)*125)); X nprint1("Au."); X } X morewait(); X while(! done) { X print1("Pay the fee? [yn] "); X if (ynq1()=='y') { X if (Player.cash < fee) X print2("No payee, No studee."); X else { X Player.cash -= fee; X menuclear(); X menuprint("Peruse a scroll:\n"); X menuprint("a: Omegan Theology\n"); X menuprint("b: Guide to Rampart\n"); X menuprint("c: High Magick\n"); X menuprint("d: Odd Uncatalogued Document\n"); X menuprint("e: Attempt Advanced Research\n"); X menuprint("ESCAPE: Leave this font of learning.\n"); X response = mcigetc(); X if (response == 'a') { X print1("You unfurl an ancient, yellowing scroll..."); X morewait(); X theologyfile(); X } X else if (response == 'b') { X print1("You unroll a slick four-color document..."); X morewait(); X cityguidefile(); X } X else if (response == 'c') { X print1("This scroll is written in a strange magical script..."); X morewait(); X wishfile(); X } X else if (response == 'd') { X print1("You find a strange document, obviously misfiled"); X print2("under the heading 'acrylic fungus painting technique'"); X morewait(); X adeptfile(); X } X else if (response == 'e') { X if (random_range(30) > Player.iq) { X print1("You feel more knowledgeable!"); X Player.iq++; X Player.maxiq++; X } X else { X print1("You find advice in an ancient tome: "); X hint(); X } X } X else done = (response == ESCAPE); X } X xredraw(); X } X else { X done = TRUE; X print2("You philistine!"); X } X } X } X} X X Xvoid l_pawn_shop() X{ X int i,j,k,limit,number,done = FALSE; X char item,action; X X if (nighttime()) X print1("Shop Closed: Have a Nice (K)Night"); X else { X limit = min(5,Date-Pawndate); X Pawndate = Date; X for(k=0;k<limit;k++) { X if (Pawnitems[0] != NULL) { X free((char *) Pawnitems[0]); X Pawnitems[0] = NULL; X } X for (i=0;i<PAWNITEMS-1;i++) X Pawnitems[i] = Pawnitems[i+1]; X Pawnitems[PAWNITEMS-1] = NULL; X for (i=0;i<PAWNITEMS;i++) X do { X if (Pawnitems[i] == NULL) { X Pawnitems[i] = create_object(5); X Pawnitems[i]->known = 2; X } X } while ((Pawnitems[i]->objchar == CASH) && X (Pawnitems[i]->objchar == ARTIFACT)); X } X while (! done) { X print1("Knight's Pawn Shop:"); X print2("Buy item, Sell item, sell Pack contents, Leave [b,s,p,ESCAPE] "); X menuclear(); X for(i=0;i<PAWNITEMS;i++) X if (Pawnitems[i] != NULL) { X strcpy(Str3," :"); X Str3[0] = i+'a'; X strcat(Str3,itemid(Pawnitems[i])); X menuprint(Str3); X menuprint("\n"); X } X action = mcigetc(); X if (action == ESCAPE) X done = TRUE; X else if (action == 'b') { X print2("Purchase which item? [ESCAPE to quit] "); X item = ' '; X while ((item != ESCAPE) && X ((item < 'a') || (item > 'k'))) X item = mcigetc(); X if (item != ESCAPE) { X i = item - 'a'; X if (Pawnitems[i] == NULL) print3("No such item!"); X else { X print1("The low, low, cost is: "); X mnumprint(Pawnitems[i]->number*true_item_value(Pawnitems[i])); X nprint1(" Buy it? [ynq] "); X if (ynq1() == 'y') { X if (Player.cash < X Pawnitems[i]->number * X true_item_value(Pawnitems[i])) X print2("No credit! Gwan, Beat it!"); X else { X Player.cash -= X Pawnitems[i]->number* X true_item_value(Pawnitems[i]); X Objects[Pawnitems[i]->id].known = 1; X gain_item(Pawnitems[i]); X Pawnitems[i] = NULL; X } X } X } X } X } X else if (action == 's') { X print2("Sell which item: "); X i = getitem(NULL); X if ((i != ABORT) && (Player.possessions[i] != NULL)) { X if (cursed(Player.possessions[i])) X print1("No loans on cursed items! I been burned before...."); X else { X print1("You can get "); X mnumprint(item_value(Player.possessions[i]) / 2); X nprint1("Au each. Sell [yn]? "); X if (ynq1() == 'y') { X number = getnumber(Player.possessions[i]->number); X if ((number >= Player.possessions[i]->number) && X Player.possessions[i]->used) { X Player.possessions[i]->used = FALSE; X item_use(Player.possessions[i]); X } X Player.cash += number * item_value(Player.possessions[i]) / 2; X free((char *) Pawnitems[0]); X for(j=0;j<9;j++) X Pawnitems[j] = Pawnitems[j+1]; X Pawnitems[9] = ((pob) malloc(sizeof(objtype))); X *(Pawnitems[9]) = *(Player.possessions[i]); X Pawnitems[9]->number = number; X Pawnitems[9]->known = 2; X dispose_lost_objects(number,Player.possessions[i]); X dataprint(); X } X } X } X } X else if (action == 'p') { X for(i=0;i<Player.packptr;i++) { X if (Player.pack[i]->blessing > -1) { X print1("Sell "); X nprint1(itemid(Player.pack[i])); X nprint1(" for "); X mnumprint(item_value(Player.pack[i])/2); X nprint1("Au each? [yn] "); X if (ynq1()=='y') { X number = getnumber(Player.pack[i]->number); X if (number > 0) { X Player.cash += number * item_value(Player.pack[i]) / 2; X free((char *) Pawnitems[0]); X for(j=0;j<9;j++) X Pawnitems[j] = Pawnitems[j+1]; X Pawnitems[9] = ((pob) malloc(sizeof(objtype))); X *(Pawnitems[9]) = *(Player.pack[i]); X Pawnitems[9]->number = number; X Pawnitems[9]->known = 2; X Player.pack[i]->number -= number; X if (Player.pack[i]->number < 1) X free((char *)Player.pack[i]); X Player.pack[i] = NULL; X dataprint(); X } X } X } X } X fixpack(); X } X } X } X calc_melee(); X xredraw(); X} X X X END_OF_FILE if test 28126 -ne `wc -c <'osite1.c'`; then echo shar: \"'osite1.c'\" unpacked with wrong size! fi # end of 'osite1.c' fi echo shar: End of archive 7 \(of 19\). cp /dev/null ark7isdone 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