home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume5 / omega2 / part09 / osite2.c < prev   
C/C++ Source or Header  |  1988-07-25  |  27KB  |  972 lines

  1. /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988 */
  2. /* osite2.c */
  3. /* 2nd half of site functions and aux functions to them */
  4.  
  5. #include "oglob.h"
  6.  
  7.  
  8.  
  9. void l_condo()
  10. {
  11.   pol ol,prev=NULL;
  12.   int i,done=FALSE,over=FALSE,weeksleep=FALSE;
  13.   char response;
  14.  
  15.   if (! gamestatusp(SOLD_CONDO)) {
  16.     print1("Rampart Arms. Weekly Rentals and Purchases");
  17.     print2("Which are you interested in [r,p, or ESCAPE] ");
  18.     response = mgetc();
  19.     if (response == 'p') {
  20.       print2("Only 50,000Au. Buy it? [yn] ");
  21.       if (ynq2()=='y') {
  22.     if (Player.cash < 50000) 
  23.       print3("No mortgages, buddy.");
  24.     else {
  25.       setgamestatus(SOLD_CONDO);
  26.       Player.cash-=50000;
  27.       dataprint();
  28.       print2("You are the proud owner of a luxurious condo penthouse.");
  29.       Condoitems = NULL;
  30.     }
  31.       }
  32.     }
  33.     else if (response == 'r') {
  34.       print2("Weekly Rental, 1000Au. Pay for it? [yn] ");
  35.       if (ynq2()=='y') {
  36.     if (Player.cash < 1000)
  37.       print2("Hey, pay the rent or out you go....");
  38.     else {
  39.       weeksleep = TRUE;
  40.       Player.cash -=1000;
  41.       dataprint();
  42.     }
  43.       }
  44.     }
  45.     else print2("Please keep us in mind for your housing needs.");
  46.   }
  47.   else {
  48.     while (! done) {
  49.       menuclear();
  50.       menuprint("Home Sweet Home");
  51.       menuprint("a: Leave items in your safe.\n");
  52.       menuprint("b: Retrieve items.\n");
  53.       menuprint("c: Take a week off to rest.\n");
  54.       menuprint("d: Retire permanently.\n");
  55.       menuprint("ESCAPE: Leave this place.\n");
  56.       response = mcigetc();
  57.       if (response == 'a') {
  58.     i = getitem(NULL);
  59.     if (i != ABORT) {
  60.       if (Player.possessions[i]->blessing < 0) 
  61.         print2("The item just doesn't want to be stored away...");
  62.       else {
  63.         ol = ((pol) malloc(sizeof(oltype)));
  64.         ol->thing = Player.possessions[i];
  65.         ol->next = Condoitems;
  66.         Condoitems = ol;
  67.         conform_lost_objects(Player.possessions[i]->number,
  68.                  Player.possessions[i]);
  69.       }
  70.     }
  71.       }
  72.       else if (response == 'b') {
  73.     ol = Condoitems;
  74.     while ((ol != NULL) && (! over)) {
  75.       print1("Retrieve ");
  76.       nprint1(itemid(ol->thing));
  77.       nprint1(" [ynq] ");
  78.       response = mcigetc();
  79.       if (response == 'y') {
  80.         gain_item(ol->thing);
  81.         if (ol == Condoitems)
  82.           Condoitems = Condoitems->next;
  83.         else if (prev != NULL) prev->next = ol->next;
  84.       }
  85.       else if (response == 'q')
  86.         over = TRUE;
  87.       prev = ol;
  88.       ol = ol->next;
  89.     }
  90.       }
  91.       else if (response == 'c') weeksleep = TRUE;
  92.       else if (response == 'd') {
  93.     clearmsg();
  94.     print1("You sure you want to retire, now? [yn] ");
  95.     if (ynq1() == 'y') {
  96.       p_win();
  97.     }
  98.       }
  99.       else if (response == ESCAPE) done = TRUE;
  100.     }
  101.     xredraw();
  102.   }
  103.   if (weeksleep) {
  104.     clearmsg();
  105.     print1("Taking a week off to rest...");
  106.     morewait();
  107.     toggle_item_use(TRUE);
  108.     Player.hp = Player.maxhp;
  109.     Player.str = Player.maxstr;
  110.     Player.agi = Player.maxagi;
  111.     Player.con = Player.maxcon;
  112.     Player.dex = Player.maxdex;
  113.     Player.iq = Player.maxiq;
  114.     Player.pow = Player.maxpow;
  115.     toggle_item_use(FALSE);
  116.     Player.food = 36;
  117.     for (i=0;i<NUMSTATI;i++)
  118.       if (Player.status[i]<1000) Player.status[i]=0;
  119.     print2("You're once again fit and ready to continue your adventure.");
  120.     Time += 60*24*7;
  121.     Date += 7;
  122.     moon_check();
  123.     timeprint();
  124.   }
  125. }
  126.  
  127.  
  128.  
  129.  
  130. void gymtrain(maxstat,stat)
  131. int *maxstat,*stat;
  132. {
  133.   if (Gymcredit + Player.cash < 2000)
  134.     print2("You can't afford our training!");
  135.   else {
  136.     if (Gymcredit > 2000) Gymcredit -= 2000;
  137.     else {
  138.       Player.cash -= (2000-Gymcredit);
  139.       Gymcredit = 0;
  140.     }
  141.     print2("Sweat. Sweat. ");
  142.     if ((*maxstat < 30) && 
  143.     ((*maxstat < random_range(30)) || (random_range(3)==1))){
  144.       nprint2("The training pays off!");
  145.       (*maxstat)++;
  146.       (*stat)++;
  147.     }
  148.     else {
  149.       nprint2("You feel the healthy glow of a good workout.");
  150.       if (*stat < *maxstat) {
  151.     (*stat)++;
  152.     print3("A feeling of rehabilitation washes through you.");
  153.       }
  154.     }
  155.   }
  156.   dataprint();
  157. }
  158.  
  159. void healforpay()
  160. {
  161.   if (Player.cash < 50)
  162.     print2("You can't afford to be healed!");
  163.   else {
  164.     Player.cash -= 50;
  165.     Player.hp += 20+random_range(20);
  166.     if (Player.hp > Player.maxhp) 
  167.       Player.hp = Player.maxhp;
  168.     print2("Another medical marvel....");
  169.   }
  170.   calc_melee();
  171. }
  172.  
  173. void cureforpay()
  174. {
  175.   if (Player.cash < 250)
  176.     print2("You can't afford to be cured!");
  177.   else {
  178.     Player.cash -= 250;
  179.     Player.status[DISEASED] = 0;
  180.     print2("Quarantine lifted....");
  181.   }
  182. }  
  183.  
  184.  
  185.  
  186. void send_to_jail()
  187. {
  188.   if (Player.rank[ORDER] > 0) {
  189.     print1("A member of the Order of Paladins sent to jail!");
  190.     print2("It cannot be!");
  191.     morewait();
  192.     print1("You are immediately expelled permanently from the Order!");
  193.     print2("Your name is expunged from the records....");
  194.     Player.rank[ORDER] = -1;
  195.   }
  196.   else if (gamestatusp(DESTROYED_ORDER)) 
  197.     print1("The destruction of the Order of Paladins has negated the law!");
  198.   else if ((Current_Environment != E_CITY) &&
  199.        (Last_Environment != E_CITY)) 
  200.     print1("Fortunately, there is no jail around here, so you are freed!");
  201.   else {
  202.     if (((Current_Environment == E_HOUSE) || 
  203.      (Current_Environment == E_MANSION) ||
  204.      (Current_Environment == E_HOVEL)) &&
  205.     (Last_Environment == E_CITY))
  206.       change_environment(E_CITY);
  207.     if (Current_Environment == E_CITY) {
  208.       if (gamestatusp(UNDEAD_GUARDS)) {
  209.     print1("You are taken to a weirdly deserted chamber where an undead");
  210.     print2("Magistrate presides over a court of ghosts and haunts.");
  211.     morewait();
  212.     print1("'Mr. Foreman, what is the verdict?'");
  213.     print2("'Guilty as charged, your lordship.'");
  214.     morewait();
  215.     clearmsg();
  216.     print1("'Guilty...");
  217.     morewait();
  218.     nprint1("Guilty...");
  219.     morewait();
  220.     nprint1("Guilty...");
  221.     morewait();
  222.     nprint1("Guilty...'");
  223.     clearmsg();
  224.     print1("The members of the court close in around, fingers pointing.");
  225.     print2("You feel insubstantial hands closing around your throat....");
  226.     print3("You feel your life draining away!");
  227.     while(Player.level > 0) {
  228.       Player.level--;
  229.       Player.xp /= 2;
  230.       Player.hp /= 2;
  231.       dataprint();
  232.     }
  233.     Player.maxhp = Player.maxcon;
  234.     morewait();
  235.     print1("You are finally released, a husk of your former self....");
  236.     Player.x = 58;
  237.     Player.y = 40;
  238.     screencheck(58);
  239.       }
  240.       else if (Player.alignment + random_range(200) < 0) {
  241.     print1("Luckily for you, a smooth-tongued advocate from the");
  242.     print2("Rampart Chaotic Liberties Union gets you off!");
  243.     Player.x = 58;
  244.     Player.y = 40;
  245.     screencheck(58);
  246.       }
  247.       else switch(Imprisonment++) {
  248.       case 0:
  249.     print1("The Magistrate sternly reprimands you.");
  250.     print2("As a first-time offender, you are given probation.");
  251.     Player.y = 58;
  252.     Player.x = 40;
  253.     screencheck(58);
  254.     break;
  255.       case 1:
  256.     print1("The Magistrate expresses shame for your conduct.");
  257.     print2("You are thrown in jail!");
  258.     morewait();    
  259.     repair_jail();
  260.     Player.y = 54;
  261.     Player.x = 37 + (2*random_range(4));
  262.     screencheck(54);
  263.     l_portcullis_trap();
  264.     break;
  265.       default:
  266.     print1("The Magistrate renders summary judgement.");
  267.     print2("You are sentenced to prison!");
  268.     morewait();
  269.     print1("The guards recognize you as a 'three-time-loser'"); 
  270.     print2("...and beat you up a little to teach you a lesson.");
  271.     p_damage(random_range(Imprisonment * 10),
  272.          UNSTOPPABLE,
  273.          "police brutality");
  274.     morewait();
  275.     repair_jail();
  276.     Player.y = 54;
  277.     Player.x = 37 + (2*random_range(4));
  278.     screencheck(54);
  279.     l_portcullis_trap();
  280.       }
  281.     }
  282.   }
  283. }
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290. void l_adept()
  291. {
  292.   print1("You see a giant shimmering gate in the form of an omega.");
  293.   if (! gamestatusp(ATTACKED_ORACLE)) {
  294.     if (Player.str+Player.con+Player.iq+Player.pow < 100)
  295.       print2("A familiar female voice says: I would not advise this now....");
  296.     else print2("A familiar female voice says: Go for it!");
  297.     morewait();
  298.     clearmsg();
  299.   }
  300.   print2("Enter the mystic portal? [yn] ");
  301.   if (ynq2()!='y') {
  302.     if (Player.level > 100) {
  303.       print1("The Lords of Destiny spurn your cowardice....");
  304.       Player.xp = 0;
  305.       Player.level = 0;
  306.       Player.hp = Player.maxhp = Player.con;
  307.       Player.mana = calcmana();
  308.       print2("You suddenly feel very inexperienced.");
  309.       dataprint();
  310.     }    
  311.   }
  312.   else {
  313.     clearmsg();
  314.     print1("You pass through the portal.");
  315.     morewait();
  316.     drawomega();
  317.     print1("Like wow man! Colors! ");
  318.     if (Player.patron != DESTINY) {
  319.       print2("Strange forces try to tear you apart!");
  320.       p_damage(random_range(200),UNSTOPPABLE,"a vortex of chaos");
  321.     }
  322.     else print2("Some strange force shields you from a chaos vortex!");
  323.     morewait();
  324.     print1("Your head spins for a moment....");
  325.     print2("and clears....");
  326.     morewait();
  327.     print1("You hear a voice boom:");
  328.     print2("Welcome to the Adept's Challenge!");
  329.     morewait();
  330.     Player.hp = Player.maxhp;
  331.     Player.mana = calcmana();
  332.     change_environment(E_ABYSS);
  333.   }
  334. }
  335.  
  336.  
  337.  
  338.  
  339. void l_trifid()
  340. {
  341.   int damage=0,stuck=TRUE;
  342.   print1("The hedge comes alive with a surge of alien growth!");
  343.   while (stuck) {
  344.     dataprint();
  345.     damage += Level->depth/2+1;
  346.     print2("Razor-edged vines covered in suckers attach themselves to you.");
  347.     morewait();
  348.     if (find_and_remove_item(THINGID+6,-1)) {
  349.       print1("Thinking fast, you toss salt water on the trifid...");
  350.       print2("The trifid disintegrates with a frustrated sigh.");
  351.       Level->site[Player.x][Player.y].locchar = FLOOR;
  352.       Level->site[Player.x][Player.y].p_locf = L_NO_OP;
  353.       gain_experience(1000);
  354.       stuck = FALSE;
  355.     }
  356.     else {
  357.       p_damage(damage,UNSTOPPABLE,"a trifid");
  358.       morewait();
  359.       print1("You are entangled in tendrils...");
  360.       menuclear();
  361.       menuprint("a: Try to break free.\n");
  362.       menuprint("b: Hang limp and hope the tendrils uncoil.\n");
  363.       menuprint("c: Pray for assistance.\n");
  364.       menuprint("d: Attempt to bargain with the hedge.\n");
  365.       menuprint("e: Click your heels together and wish for escape.\n");
  366.       menuprint("ANYTHING ELSE: writhe and scream hopelessly.\n");
  367.       switch(menugetc()) {
  368.       case 'a': 
  369.     if (Player.str > random_range(200)) {
  370.       print1("Amazing! You're now free.");
  371.       print2("The trifid writhes hungrily at you.");
  372.       stuck = FALSE;
  373.     }
  374.     else print1("Well, THAT didn't work.");
  375.     break;
  376.       case 'b': 
  377.     print1("Well, at least you're facing your fate with dignity.");
  378.     break;
  379.       case 'c': 
  380.     if ((Player.patron == DRUID) && 
  381.         (Player.rank[PRIESTHOOD] > random_range(5))) {
  382.         print1("A shaft of golden light bathes the alien plant");
  383.         print2("which grudginly lets you go....");
  384.         stuck = FALSE;
  385.       }
  386.     else print1("You receive no divine aid as yet.");
  387.     break;
  388.       case 'd':
  389.     print1("The hedge doesn't answer your entreaties.");
  390.     break;
  391.       case 'e':
  392.     print1("You forgot your ruby slippers, stupid.");
  393.     break;
  394.       default:
  395.     print1("The hedge enjoys your camp play-acting....");
  396.     break;
  397.       }
  398.     }
  399.   }
  400.   xredraw();
  401. }
  402.  
  403.  
  404.  
  405.  
  406. void l_vault()
  407. {
  408.   print1("You come to a thick vault door with a complex time lock.");
  409.   if ((hour()==23)) {
  410.     print2("The door is open.");
  411.     Level->site[Player.x][Player.y+1].locchar = FLOOR;
  412.   }
  413.   else {
  414.     print2("The door is closed.");
  415.     Level->site[Player.x][Player.y+1].locchar = WALL;
  416.     morewait();
  417.     clearmsg();
  418.     print1("Try to crack it? [yn] ");
  419.     if (ynq1()=='y') {
  420.       if (random_range(100) < Player.rank[THIEVES]*Player.rank[THIEVES]) {
  421.     print2("The lock clicks open!!!");
  422.     gain_experience(5000);
  423.     Level->site[Player.x][Player.y+1].locchar = FLOOR;
  424.       }    
  425.       else {
  426.     print2("Uh, oh, set off the alarm.... The castle guard arrives....");
  427.     morewait();
  428.     send_to_jail();
  429.       }
  430.     }
  431.     else print2("Good move.");
  432.   }
  433. }
  434.  
  435.  
  436. void l_brothel()
  437. {
  438.   char response;
  439.   print1("You come to a heavily reinforced inner door.");
  440.   print2("A sign reads `The House of the Eclipse'");
  441.   morewait();
  442.   clearmsg();
  443.   print1("Try to enter? [yn] ");
  444.   if (ynq1()=='y') {
  445.     menuclear();
  446.     menuprint("a:knock on the door.\n");
  447.     menuprint("b:try to pick the lock.\n");
  448.     menuprint("c:bash down the door.\n");
  449.     menuprint("ESCAPE: Leave this house of ill repute.\n");
  450.     do 
  451.       response = menugetc();
  452.     while ((response != 'a') &&
  453.        (response != 'b') &&
  454.        (response != 'c') &&
  455.        (response != ESCAPE));
  456.     xredraw();
  457.     if (response == 'a') {
  458.       if (!nighttime())
  459.     print2("There is no reponse.");
  460.       else {
  461.     print1("A window opens in the door.");
  462.     print2("`500Au, buddy. For the night.' pay it? [yn] ");
  463.     if (ynq2()=='y') {
  464.       if (Player.cash < 500) {
  465.         print1("`What, no roll?!'");
  466.         print2("The bouncer bounces you a little and lets you go.");
  467.         p_damage(25,UNSTOPPABLE,"da bouncer");
  468.       }
  469.       else {
  470.         Player.cash -= 500;
  471.         print1("You are ushered into an opulently appointed hall.");
  472.         print2("After an expensive dinner (takeout from Les Crapuleux)");
  473.         morewait();
  474.         print1("you spend an enjoyable and educational evening with");
  475.         if (Player.preference == 'm') 
  476.           switch(random_range(4)) {
  477.           case 0: 
  478.         print2("Skarn the Insatiable, a satyr.");
  479.         break;
  480.           case 1: 
  481.         print2("Dryden the Defanged, an incubus.");
  482.         break;
  483.           case 2: 
  484.         print2("Gorgar the Equipped, a centaur.");
  485.         break;
  486.           case 3: 
  487.         print2("Hieronymus, the mendicant priest of Eros.");
  488.         break;
  489.           }    
  490.         else switch(random_range(4)) {
  491.         case 0: 
  492.           print2("Noreen the Nymph (omaniac)");
  493.           break;
  494.         case 1: 
  495.           print2("Angelface, a recanted succubus.");
  496.           break;
  497.         case 2: 
  498.           print2("Corporal Sue of the City Guard (moonlighting).");
  499.           break;
  500.         case 3: 
  501.           print2("Sheena the Queena the Jungle, a wereleopard.");
  502.           break;
  503.         }    
  504.         morewait();
  505.         if (hour() > 12) Time += ((24-hour())+8) * 60;
  506.         else {
  507.           Time += ((9-hour())*60);
  508.           Date++;
  509.         }
  510.         Player.food = 40;
  511.         Player.status[DISEASED] = 0;
  512.         Player.status[POISONED] = 0;
  513.         Player.hp = Player.maxhp;
  514.         /* reduce temporary stat gains to max stat levels */
  515.         toggle_item_use(TRUE);
  516.         Player.str = min(Player.str,Player.maxstr);
  517.         Player.con = min(Player.con,Player.maxcon);
  518.         Player.agi = min(Player.agi,Player.maxagi);
  519.         Player.dex = min(Player.dex,Player.maxdex);
  520.         Player.iq = min(Player.iq,Player.maxiq);
  521.         Player.pow = min(Player.pow,Player.maxpow);
  522.         toggle_item_use(FALSE);
  523.         Player.con++;
  524.         gain_experience(100);
  525.         timeprint();
  526.         dataprint();
  527.         showflags();
  528.         morewait();
  529.         clearmsg();
  530.         print1("You arise, tired but happy, the next morning...");
  531.       }
  532.     }
  533.     else print2("What are you, some kinda prude?");
  534.       }
  535.     }
  536.     else if (response == 'b') {
  537.       if (nighttime()) {
  538.     print1("As you fumble at the lock, the door opens....");
  539.     print2("The bouncer tosses you into the street.");
  540.       }
  541.       else print1("The door appears to be bolted and barred from behind.");
  542.     }
  543.     else if (response == 'c') {
  544.       if (nighttime()) {
  545.     print1("As you charge toward the door it opens....");
  546.     print2("Yaaaaah! Thud!");
  547.     morewait();
  548.     print1("You run past the startled bouncer into a wall.");
  549.     p_damage(20,UNSTOPPABLE,"a move worthy of Clouseau");
  550.     print2("The bouncer tosses you into the street.");
  551.       }
  552.       else {
  553.     print1("Ouch! The door resists your efforts.");
  554.     p_damage(1,UNSTOPPABLE,"a sturdy door");
  555.     morewait();
  556.     print1("You hear an irritated voice from inside:");
  557.     print2("'Keep it down out there! Some of us are trying to sleep!'");
  558.       }
  559.     }
  560.   }
  561. }
  562.  
  563.  
  564.  
  565. /* if sign is true, always print message, otherwise do so only sometimes */
  566. void sign_print(x,y,sign)
  567. int x,y,sign;
  568. {
  569.   if ((Level->site[x][y].p_locf >= CITYSITEBASE) &&
  570.       (Level->site[x][y].p_locf < CITYSITEBASE+NUMCITYSITES))
  571.     CitySiteList[Level->site[x][y].p_locf - CITYSITEBASE][0] = TRUE;
  572.   switch(Level->site[x][y].p_locf) {
  573.   case L_CHARITY:
  574.     print1("You notice a sign: The Rampart Orphanage And Hospice For The Needy.");
  575.     break;
  576.   case L_MANSION:
  577.     print1("You notice a sign:");
  578.     print2("This edifice protected by DeathWatch Devices, Ltd.");
  579.     morewait();
  580.     break;
  581.   case L_GRANARY:  
  582.     print1("You notice a sign:");
  583.     print2("Public Granary: Entrance Strictly Forbidden.");
  584.     break;
  585.   case L_PORTCULLIS:
  586.     if (Level->site[x][y].locchar == FLOOR)
  587.       print1("You see a groove in the floor and slots above you.");
  588.     break;
  589.   case L_STABLES:
  590.     print1("You notice a sign:");
  591.     print2("Village Stables");
  592.     break;
  593.   case L_COMMONS:
  594.     print1("You notice a sign:");
  595.     print2("Village Commons: No wolves allowed.");
  596.     break;
  597.   case L_MAZE:
  598.     print1("You notice a sign:");
  599.     print2("Hedge maze closed for trifid extermination.");
  600.     break;
  601.   case L_BANK:
  602.     if (sign) {
  603.       print1("You notice a sign:");
  604.       print2("First Bank of Omega: Autoteller Carrel.");
  605.     }
  606.     break;
  607.   case L_TEMPLE:
  608.     print1("You see the ornate portico of the Rampart Pantheon");
  609.     break;
  610.   case L_ARMORER:
  611.     if (sign) {
  612.       print1("You notice a sign:");
  613.       print2("Julie's Armor of Proof and Weapons of Quality");
  614.     }
  615.     break;
  616.   case L_CLUB:
  617.     if (sign) {
  618.       print1("You notice a sign:");
  619.       print2("Rampart Explorers' Club.");
  620.     }
  621.     break;
  622.   case L_GYM:
  623.     if (sign) {
  624.       print1("You notice a sign:");
  625.       print2("The Rampart Gymnasium, (affil. Rampart Coliseum).");
  626.     }
  627.     break;
  628.   case L_HEALER:
  629.     if (sign) {
  630.       print1("You notice a sign:");
  631.       print2("Rampart Healers. Member RMA.");
  632.     }
  633.     break;
  634.   case L_CASINO:
  635.     if (sign) {
  636.       print1("You notice a sign:");
  637.       print2("Rampart Mithril Nugget Casino.");
  638.     }
  639.     break;
  640.   case L_SEWER:
  641.     print1("A sewer entrance. You don't want to go down THERE, do you?");
  642.     break;
  643.   case L_COMMANDANT:
  644.     if (sign) {
  645.       print1("You notice a sign:");
  646.       print2("Commandant Sonder's Rampart-fried Lyzzard partes. Open 24 hrs.");
  647.     }
  648.     break;
  649.   case L_DINER:
  650.     if (sign) {
  651.       print1("You notice a sign:");
  652.       print2("The Rampart Diner. All you can eat, 25Au.");
  653.     }
  654.     break;
  655.   case L_CRAP:
  656.     if (sign) {
  657.       print1("You notice a sign:"); 
  658.       print2("Les Crapeuleaux. (****)");
  659.     }
  660.     break;
  661.   case L_TAVERN:
  662.     if (sign) {
  663.       print1("You notice a sign:"); 
  664.       print2("The Centaur and Nymph -- J. Riley, prop.");
  665.     }
  666.     break;
  667.   case L_ALCHEMIST:
  668.     if (sign) {
  669.       print1("You notice a sign:"); 
  670.       print2("Ambrosias' Potions et cie.");
  671.     }
  672.     break;
  673.   case L_DPW:
  674.     if (sign) {
  675.       print1("You notice a sign:"); 
  676.       print2("Rampart Department of Public Works.");
  677.     }
  678.     break;
  679.   case L_LIBRARY:
  680.     if (sign) {
  681.       print1("You notice a sign:"); 
  682.       print2("Rampart Public Library.");
  683.     }
  684.     break;
  685.   case L_CONDO:
  686.     if (sign) {
  687.       print1("You notice a sign:"); 
  688.       if (gamestatusp(SOLD_CONDO)) 
  689.     print2("Home Sweet Home");
  690.       else print2("Luxury Condominium For Sale; Inquire Within");
  691.     }
  692.     break;
  693.   case L_PAWN_SHOP:
  694.     if (sign) {
  695.       print1("You notice a sign:"); 
  696.       print2("Knight's Pawn Shop.");
  697.     }
  698.     break;
  699.   case L_CEMETARY:
  700.     print1("You notice a sign:"); 
  701.     print2("Rampart City Cemetary. Closed -- Full.");
  702.     break;
  703.   case L_GARDEN:
  704.     print1("You notice a sign:"); 
  705.     print2("Rampart Botanical Gardens---Do not deface statues.");
  706.     break;
  707.   case L_JAIL:
  708.     print1("You notice a sign:"); 
  709.     print2("Rampart City Gaol -- always room for more.");
  710.     break;
  711.   case L_ORACLE:
  712.     print1("You notice a sign:");
  713.     print2("The Oracle of the Cyan Flames");
  714.     morewait();
  715.     break;
  716.   }
  717. }
  718.   
  719.  
  720.  
  721. void l_countryside()
  722. {
  723.   change_environment(E_COUNTRYSIDE);
  724. }
  725.  
  726.  
  727.  
  728. void l_oracle()
  729. {
  730.   char response;
  731.   if (gamestatusp(ATTACKED_ORACLE) && (! gamestatusp(COMPLETED_ASTRAL))) {
  732.     print1("You come before a blue crystal dais. You see a broken mirror.");
  733.     print2("Look in the mirror? [yn] ");
  734.     if (ynq2()=='y') {
  735.       print1("A strange force rips you from your place....");
  736.       Player.hp = 1;
  737.       print2("You feel drained....");
  738.       dataprint();
  739.       print3("You find yourself in a weird flickery maze.");
  740.       change_environment(E_ASTRAL);
  741.     }
  742.   }
  743.   else {
  744.     print1("You come before a blue crystal dais. There is a bell and a mirror.");
  745.     print2("Ring the bell [b], look in the mirror [m], or leave [ESCAPE] ");
  746.     do response = mcigetc();
  747.     while ((response != 'b') && (response != 'm') && (response != ESCAPE));
  748.     if (response == 'b') {
  749.       print1("The ringing note seems to last forever.");
  750.       print2("You notice a robed figure in front of you....");
  751.       morewait();
  752.       print1("The oracle doffs her cowl. Her eyes glitter with blue fire!");
  753.       print2("Attack her? [yn] ");
  754.       if (ynq2() == 'y') {
  755.     setgamestatus(ATTACKED_ORACLE);
  756.     print1("The oracle deftly avoids your attack.");
  757.     print2("She sneers at you and vanishes.");
  758.       }
  759.       else {
  760.     print2("She stares at you...and speaks:");
  761.     if (!gamestatusp(SPOKE_TO_DRUID)) {
  762.       print3("'The ArchDruid speaks wisdom in his forest shrine.'");
  763.     }
  764.     else if (!gamestatusp(COMPLETED_CAVES)) {
  765.       print3("'Thou mayest find aught of interest in the caves to the South.'");
  766.     }
  767.     else if (!gamestatusp(COMPLETED_SEWERS)) {
  768.       print3("'Turn thy attention to the abyssal depths of the city.'");
  769.     }
  770.     else if (!gamestatusp(COMPLETED_CASTLE)) {
  771.       print3("'Explorest thou the depths of the Castle of the ArchMage.'");
  772.     }
  773.     else if (!gamestatusp(COMPLETED_ASTRAL)) {
  774.       morewait();
  775.       print1("'Journey to the Astral Plane and meet the Gods' servants.'");
  776.       print2("The oracle holds out her hand. Do you take it? [yn] ");
  777.       if (ynq2()=='y') {
  778.         print1("'Beware: Only the Star Gem can escape the Astral Plane.'");
  779.         print2("A magic portal opens behind the oracle. She leads you");
  780.         morewait();
  781.         print1("through a sequence of special effects that would have");
  782.         print2("IL&M technicians cursing in awe and deposits you in an");
  783.         morewait();
  784.         clearmsg();
  785.         print1("odd looking room whose walls seem strangely insubstantial.");
  786.         gain_experience(5000);
  787.         change_environment(E_ASTRAL);
  788.       }
  789.       else print3("You detect the hint of a sneer from the oracle.");
  790.     }
  791.     else if (!gamestatusp(COMPLETED_VOLCANO)) {
  792.       print3("'The infernal maw may yield its secrets to thee now.'");
  793.     }
  794.     else if (!gamestatusp(COMPLETED_CHALLENGE)) {
  795.       print3("'The challenge of adepthood yet awaits thee.'");
  796.     }
  797.     else {
  798.       morewait();
  799.       print1("'My lord: Thou hast surpassed my tutelage forever.");
  800.       print2("Fare thee well.'");
  801.       print3("The oracle replaces her hood and seems to fade away....");
  802.     }
  803.       }
  804.     }
  805.     else if (response == 'm') {
  806.       print1("You seem to see yourself. Odd....");
  807.       knowledge(1);
  808.     }
  809.     else print2("You leave this immanent place.");
  810.   }
  811. }
  812.  
  813. void l_mansion()
  814. {
  815.   print1("Enter the mansion? [yn] ");
  816.   if (ynq1()=='y')
  817.     change_environment(E_MANSION);
  818. }
  819.  
  820. void l_house()
  821. {
  822.   print1("Enter the house? [yn] ");
  823.   if (ynq1()=='y')
  824.     change_environment(E_HOUSE);
  825. }
  826.  
  827. void l_hovel()
  828. {
  829.   print1("Enter the hovel? [yn] ");
  830.   if (ynq1()=='y')
  831.     change_environment(E_HOVEL);
  832. }
  833.  
  834. void l_safe()
  835. {
  836.   char response;
  837.   pob newitem;
  838.   int attempt = 0;
  839.   print1("You have discovered a safe!");
  840.   print2("Pick the lock [p], Force the door [f], or ignore [ESCAPE]");
  841.   do response = mcigetc();
  842.   while ((response != 'p') && (response != 'f') && (response != ESCAPE));
  843.   if (response == 'p')
  844.     attempt = (2*Player.dex + Player.rank[THIEVES]*10 - random_range(100))/10;
  845.   else if (response == 'f')
  846.     attempt = (Player.dmg - random_range(100))/10;
  847.   if (attempt > 0) {
  848.     Player.alignment -= 4;
  849.     gain_experience(50);
  850.     print2("The door springs open!");
  851.     Level->site[Player.x][Player.y].locchar = FLOOR;
  852.     Level->site[Player.x][Player.y].p_locf = L_NO_OP;
  853.     if (random_range(2) == 1) {
  854.       print1("You find:");
  855.       do {
  856.     newitem = NULL;
  857.     while (newitem == NULL)
  858.       newitem = create_object(difficulty());
  859.     print2(itemid(newitem));
  860.     morewait();
  861.     gain_item(newitem);
  862.       } while (random_range(3) == 1);
  863.     }
  864.     else print2("The safe was empty (awwwww....)");
  865.   }
  866.   else {
  867.     print3("Your attempt at burglary failed!");
  868.     if (attempt == -1) {
  869.       print1("A siren goes off! You see flashing red lights everywhere!");
  870.       if (Last_Environment == E_CITY) {
  871.     print2("The city guard shows up! They collar you in no time flat!");
  872.     change_environment(E_CITY);
  873.     morewait();
  874.     send_to_jail();
  875.       }
  876.     }
  877.     else if (attempt == -2) {
  878.       print1("There is a sudden flash!");
  879.       p_damage(random_range(25),FLAME,"a safe");
  880.       print2("The safe has self-destructed.");
  881.       Level->site[Player.x][Player.y].locchar = RUBBLE;
  882.       Level->site[Player.x][Player.y].p_locf = L_RUBBLE;
  883.     }
  884.     else if (attempt == -3) {
  885.       print1("The safe jolts you with electricity!");
  886.       lball(Player.x,Player.y,Player.x,Player.y,30);
  887.     }
  888.     else if (attempt < -3) {
  889.       print1("You are hit by an acid spray!");
  890.       if (Player.possessions[O_CLOAK] != NULL) {
  891.     print2("Your cloak is destroyed!");
  892.     conform_lost_object(Player.possessions[O_CLOAK]);
  893.     p_damage(10,ACID,"a safe");
  894.       }
  895.       else if (Player.possessions[O_ARMOR] != NULL) {
  896.     print2("Your armor corrodes!");
  897.     Player.possessions[O_ARMOR]->dmg-=3;
  898.     Player.possessions[O_ARMOR]->hit-=3;
  899.     Player.possessions[O_ARMOR]->aux-=3;
  900.     p_damage(10,ACID,"a safe");
  901.       }
  902.       else {
  903.     print2("The acid hits your bare flesh!");
  904.     p_damage(random_range(100),ACID,"a safe");
  905.       }
  906.     }
  907.   }
  908. }
  909.  
  910.  
  911. void l_cartographer()
  912. {
  913.   int i,j,x,y;
  914.   print1("Ye Olde Mappe Shoppe.");
  915.   print2("Map of the local area: 500Au. Buy it? [yn] ");
  916.   if (ynq2()=='y') {
  917.     if (Player.cash < 500) 
  918.       print3("Cursed be cheapskates! May you never find an aid station....");
  919.     else {
  920.       print3("You now have the local area mapped.");
  921.       Player.cash -= 500;
  922.       dataprint();
  923.       switch(Villagenum) {
  924.       case 1: x = 56; y = 5; break;
  925.       default: case 2: x = 35; y = 11; break;
  926.       case 3: x = 10; y = 40; break;
  927.       case 4: x = 7; y = 6; break;
  928.       case 5: x = 40; y = 43; break;
  929.       case 6: x = 20; y = 41; break;
  930.       }    
  931.       for(i=x-15;i<=x+15;i++)
  932.     for(j=y-15;j<=y+15;j++)
  933.       if ((i>=0)&&(i<64)&&(j>=0)&&(j<64)) {
  934.         Country[i][j].current_terrain_type =
  935.           Country[i][j].base_terrain_type;
  936.         Country[i][j].explored = TRUE;
  937.       }
  938.     }
  939.   }
  940.   else print3("Don't blame me if you get lost....");
  941. }
  942.         
  943. void l_charity()
  944. {
  945.   int donation;
  946.   print2("'Greetings, friend. Do you wish to make a donation?' [yn] ");
  947.   if (ynq2()!='y') 
  948.     print3("'Pinchpurse!'");
  949.   else {
  950.     clearmsg();
  951.     print1("How much can you give? ");
  952.     donation = parsenum();
  953.     if (donation < 1)
  954.       print2("'Go stick your head in a pig.'");
  955.     else if (donation > Player.cash)
  956.       print2("'I'm afraid you're charity is bigger than your purse!'");
  957.     else if (donation < max(100,Player.level*Player.level*100)) {
  958.       print2("'Oh, can't you do better than that?'");
  959.       print3("'Well, I guess we'll take it....'");
  960.       if (Player.alignment < 10) Player.alignment++;
  961.       Player.cash -= donation;
  962.     }
  963.     else {
  964.       print2("'Oh thank you kindly, friend, and bless you!'");
  965.       Player.cash -= donation;
  966.       Player.alignment += 5;
  967.     }
  968.   }
  969.   dataprint();
  970.  
  971.