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