-
Notifications
You must be signed in to change notification settings - Fork 1
/
move.c
1165 lines (1074 loc) · 33.2 KB
/
move.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
/* move.c */
/* general functions for player moving */
#include "glob.h"
#include <unistd.h> /* usleep */
/* various miscellaneous location functions */
void l_water(void)
{
if (! gamestatusp(MOUNTED)) {
if ((Player.possessions[O_ARMOR] != NULL)) {
print1("Your heavy armor drags you under the water!");
morewait();
p_drown();
print2("You reach the surface again.");
}
else if (Player.itemweight > ((int) (Player.maxweight / 2))) {
print1("The weight of your burden drags you under water!");
morewait();
p_drown();
print2("You reach the surface again.");
}
else switch(random_range(32)) {
case 0:print1("Splish. Splash!"); break;
case 1:print1("I want my ducky!"); break;
case 2:print1("So finally you take a bath!"); break;
case 3:print1("You must be very thirsty!"); break;
}
}
else switch(random_range(32)) {
case 0:print1("Your horse frolics playfully in the water."); break;
case 1:print1("Your horse quenches its thirst."); break;
case 2:print1("Your steed begins to swim...."); break;
case 3:print1("Your mount thrashes about in the water."); break;
}
}
void l_chaos(void)
{
if (gamestatusp(MOUNTED)) {
print1("Your steed tries to swim in the raw Chaos, but seems to");
print2("be having some difficulties...");
morewait();
print1("probably because it's just turned into a chaffinch.");
morewait();
resetgamestatus(MOUNTED);
}
if (! onewithchaos)
print1("You are immersed in raw Chaos....");
if (Player.rank[ADEPT]) {
if (! onewithchaos)
{
onewithchaos = 1;
print2("You achieve oneness of Chaos....");
}
Player.mana = max(Player.mana,calcmana());
Player.hp = max(Player.hp, Player.maxhp);
}
else if (onewithchaos) /* adept that gets amnesia from chaos storm */
{
print2("The chaos sea doesn't seem to bother you at all.");
}
else if (Player.rank[PRIESTHOOD] && (! saved)) {
print2("A mysterious force protects you from the Chaos!");
print3("Wow.... You feel a bit smug.");
gain_experience(500);
saved = TRUE;
}
else {
print2("Uh oh....");
if (saved) nprint2("Nothing mysterious happens this time....");
morewait();
print1("Congratulations! You've achieved maximal entropy!");
Player.alignment -= 50;
gain_experience(1000);
p_death("immersion in raw Chaos");
}
}
void l_hedge(void)
{
if (Player.patron == DRUID) print1("You move through the hedges freely.");
else {
print1("You struggle in the brambly hedge... ");
switch(random_range(6)) {
case 0:
print2("You are stabbed by thorns!");
p_damage(random_range(6),NORMAL_DAMAGE,"a hedge");
print3("The thorns were poisonous!");
p_poison(random_range(12));
break;
case 1:
print2("You are stabbed by thorns!");
p_damage(random_range(12),NORMAL_DAMAGE,"a hedge");
break;
case 2:
print2("You seem to have gotten stuck in the hedge.");
Player.status[IMMOBILE]+=random_range(5)+1;
break;
case 3:
if (Player.possessions[O_CLOAK] != NULL) {
print2("Your cloak was torn on the brambles!");
dispose_lost_objects(1,Player.possessions[O_CLOAK]);
}
else print2("Ouch! These thorns are scratchy!");
break;
default: print2("You make your way through unscathed."); break;
}
}
}
void l_lava(void)
{
print1("Very clever -- walking into a pool of lava...");
if (gamestatusp(MOUNTED)) {
print2("Your horse is incinerated... You fall in too!");
resetgamestatus(MOUNTED);
}
morewait();
if (strcmp(Player.name,"Saltheart Foamfollower")==0) {
print1("Strangely enough, you don't seem terribly affected.");
p_damage(1,UNSTOPPABLE,"slow death in a pool of lava");
}
else {
p_damage(random_range(75),FLAME,"incineration in a pool of lava");
if (Player.hp> 0) p_drown();
Player.status[IMMOBILE]+=2;
}
}
void l_fire(void)
{
print1("You boldly stride through the curtain of fire...");
if (gamestatusp(MOUNTED)) {
print2("Your horse is fried and so are you...");
resetgamestatus(MOUNTED);
}
p_damage(random_range(100),FLAME,"self-immolation");
}
void l_abyss(void)
{
int i;
if (Current_Environment != Current_Dungeon) {
print1("You fall through a dimensional portal!");
morewait();
strategic_teleport(-1);
}
else {
print1("You enter the infinite abyss!");
morewait();
if (random_range(100)==13) {
print1("As you fall you see before you what seems like");
print2("an infinite congerie of iridescent bubbles.");
print3("You have met Yog Sothoth!!!");
morewait();
clearmsg();
if (Player.alignment > -10)
p_death("the Eater of Souls");
else {
print1("The All-In-One must have taken pity on you.");
print2("A transdimensional portal appears...");
morewait();
change_level(Level->depth,Level->depth+1,FALSE);
gain_experience(2000);
Player.alignment -= 50;
}
}
else {
i = 0;
print1("You fall...");
while(random_range(3)!=2) {
if (i%6 == 0)
print2("and fall... ");
else
nprint2("and fall... ");
i++;
morewait();
}
i++;
print1("Finally,you emerge through an interdimensional interstice...");
morewait();
if (Level->depth+i>MaxDungeonLevels) {
print2("You emerge high above the ground!!!!");
print3("Yaaaaaaaah........");
morewait();
change_environment(E_COUNTRYSIDE);
do {
setPlayerXY( random_range(COUNTRY_WIDTH), random_range(COUNTRY_LENGTH));
} while(Country[Player.x][Player.y].base_terrain_type == CHAOS_SEA);
p_damage(i*50,NORMAL_DAMAGE,"a fall from a great height");
}
else {
print2("You built up some velocity during your fall, though....");
morewait();
p_damage(i*5,NORMAL_DAMAGE,"a fall through the abyss");
change_level(Level->depth,Level->depth+i,FALSE);
gain_experience(i*i*50);
}
}
}
}
void l_lift(void)
{
char response;
int levelnum;
int distance;
int too_far = 0;
Level->site[Player.x][Player.y].locchar = FLOOR;
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
lset(Player.x, Player.y, CHANGED);
print1("You walk onto a shimmering disk....");
print2("The disk vanishes, and a glow surrounds you.");
print3("You feel weightless.... You feel ghostly....");
morewait();
clearmsg();
print1("Go up, down, or neither [u,d,ESCAPE] ");
do response = (char) mcigetc();
while ((response != 'u') &&
(response != 'd') &&
(response != ESCAPE));
if (response != ESCAPE) {
print1("How many levels?");
levelnum = (int) parsenum("");
if (levelnum > 6) {
too_far = 1;
levelnum = 6;
}
if (response == 'u' && Level->depth - levelnum < 1) {
distance = levelnum - Level->depth;
change_environment(E_COUNTRYSIDE); /* "you return to the countryside." */
if (distance > 0) {
nprint1("..");
print2("...and keep going up! You hang in mid air...");
morewait();
print3("\"What goes up...\"");
morewait();
print3("Yaaaaaaaah........");
p_damage(distance*10,NORMAL_DAMAGE,"a fall from a great height");
}
return;
}
else if (response == 'd' && Level->depth + levelnum > MaxDungeonLevels) {
too_far = 1;
levelnum = MaxDungeonLevels - Level->depth;
}
if (levelnum == 0) {
print1("Nothing happens.");
return;
}
if (too_far) {
print1("The lift gives out partway...");
print2("You rematerialize.....");
}
else
print1("You rematerialize.....");
change_level(Level->depth,
(response=='d' ?
Level->depth+levelnum :
Level->depth-levelnum),
FALSE);
roomcheck();
}
}
void l_magic_pool(void)
{
int possibilities=random_range(100);
print1("This pool seems to be enchanted....");
if (gamestatusp(MOUNTED)) {
if (random_range(2)) {
print2("Your horse is polymorphed into a fig newton.");
resetgamestatus(MOUNTED);
}
else print2("Whatever it was, your horse enjoyed it....");
}
else if (possibilities == 0) {
print1("Oh no! You encounter the DREADED AQUAE MORTIS...");
if (random_range(1000) < Player.level*Player.level*Player.level) {
print2("The DREADED AQUAE MORTIS throttles you within inches....");
print3("but for some reason chooses to let you escape.");
gain_experience(500);
Player.hp = 1;
}
else p_death("the DREADED AQUAE MORTIS!");
}
else if (possibilities < 25)
augment(0);
else if (possibilities < 30)
augment(1);
else if (possibilities < 60)
augment(-1);
else if (possibilities < 65)
cleanse(1);
else if (possibilities < 80) {
if (Player.possessions[O_WEAPON_HAND] != NULL) {
print1("You drop your weapon in the pool! It's gone forever!");
dispose_lost_objects(1,Player.possessions[O_WEAPON_HAND]);
}
else print1("You feel fortunate.");
}
else if (possibilities < 90) {
if (Player.possessions[O_WEAPON_HAND] != NULL) {
print1("Your weapon leaves the pool with a new edge....");
Player.possessions[O_WEAPON_HAND]->plus += random_range(10)+1;
calc_melee();
}
else print1("You feel unfortunate.");
}
else if (possibilities < 95) {
Player.hp += 10;
print1("You feel healthier after the dip...");
}
else if (possibilities < 99) {
print1("Oooh, a tainted pool...");
p_poison(10);
}
else if (possibilities == 99) {
print1("Wow! A pool of azoth!");
heal(10);
cleanse(1);
Player.mana = calcmana()*3;
Player.str = (Player.maxstr++)*3;
}
print2("The pool seems to have dried up.");
Level->site[Player.x][Player.y].locchar = TRAP;
Level->site[Player.x][Player.y].p_locf = L_TRAP_PIT;
lset(Player.x, Player.y, CHANGED);
}
void l_no_op(void)
{
}
void l_tactical_exit(void)
{
if (optionp(CONFIRM)) {
if (cinema_confirm("You're about to leave this place.") != 'y')
return;
}
/* Free up monsters and items, and the level, if not SAVE_LEVELS */
free_level(Level);
Level = NULL;
if ((Current_Environment == E_TEMPLE) ||
(Current_Environment == E_TACTICAL_MAP) )
change_environment(E_COUNTRYSIDE);
else change_environment(Last_Environment);
}
void l_rubble(void)
{
int screwup = random_range(100) - (Player.agi + Player.level);
print1("You climb over the unstable pile of rubble....");
if (screwup < 0) print2("No problem!");
else {
print2("You tumble and fall in a small avalanche of debris!");
print3("You're trapped in the pile!");
Player.status[IMMOBILE]+=2;
p_damage(screwup/5,UNSTOPPABLE,"rubble and debris");
morewait();
}
}
/* Drops all portcullises in 5 moves */
void l_portcullis_trap(void)
{
int i,j,slam=FALSE;
print3("Click.");
morewait();
for (i=max(Player.x-5,0);i<min(Player.x+6,Level->level_width);i++)
for(j=max(Player.y-5,0);j<min(Player.y+6,Level->level_length);j++) {
if ((Level->site[i][j].p_locf == L_PORTCULLIS) &&
(Level->site[i][j].locchar != PORTCULLIS)) {
Level->site[i][j].locchar = PORTCULLIS;
lset(i, j, CHANGED);
putspot(i,j,PORTCULLIS);
if ((i==Player.x)&&(j==Player.y)) {
print3("Smash! You've been hit by a falling portcullis!");
morewait();
p_damage(random_range(1000),NORMAL_DAMAGE,"a portcullis");
}
slam = TRUE;
}
}
if (slam) print3("You hear heavy walls slamming down!");
}
/* drops every portcullis on level, then kills itself and all similar traps. */
void l_drop_every_portcullis(void)
{
int i,j,slam=FALSE;
print3("Click.");
morewait();
for(j=0;j<Level->level_length;j++)
for(i=0;i<Level->level_width;i++) {
if (Level->site[i][j].p_locf == L_DROP_EVERY_PORTCULLIS) {
Level->site[i][j].p_locf = L_NO_OP;
lset(i, j, CHANGED);
}
else if ((Level->site[i][j].p_locf == L_PORTCULLIS) &&
(Level->site[i][j].locchar != PORTCULLIS)) {
Level->site[i][j].locchar = PORTCULLIS;
lset(i, j, CHANGED);
putspot(i,j,PORTCULLIS);
if ((i==Player.x)&&(j==Player.y)) {
print3("Smash! You've been hit by a falling portcullis!");
morewait();
p_damage(random_range(1000),NORMAL_DAMAGE,"a portcullis");
}
slam = TRUE;
}
}
if (slam) print3("You hear heavy walls slamming down!");
}
void l_raise_portcullis(void)
{
int i,j,open=FALSE;
for(j=0;j<Level->level_length;j++)
for(i=0;i<Level->level_width;i++) {
if (Level->site[i][j].locchar == PORTCULLIS) {
Level->site[i][j].locchar = FLOOR;
lset(i, j, CHANGED);
putspot(i,j,FLOOR);
open = TRUE;
}
}
if (open) print1("You hear the sound of steel on stone!");
}
void l_arena_exit(void)
{
resetgamestatus(ARENA_MODE);
#ifndef MSDOS_SUPPORTED_ANTIQUE
free_level(Level);
#endif
Level = NULL;
change_environment(E_CITY);
}
void l_house_exit(void)
{
if (optionp(CONFIRM)) {
clearmsg();
if (cinema_confirm("You're about to step out of this abode.") != 'y')
return;
}
#ifndef MSDOS_SUPPORTED_ANTIQUE
free_level(Level);
#endif
Level = NULL;
change_environment(Last_Environment);
}
void l_void(void)
{
clearmsg();
print1("Geronimo!");
morewait();
clearmsg();
print1("You leap into the void.");
if (Level->mlist) {
print2("Death peers over the edge and gazes quizzically at you....");
morewait();
print3("'Bye-bye,' he says... 'We'll meet again.'");
}
morewait();
while(Player.hp>0) {
Time+=60;
hourly_check();
/* WDT: GCC doesn't like usleep being included from unistd.h when it's
* checking for ANSI compliance. That's the stupidest thing I've seen,
* but I wasn't offered a choice -- the man pages don't document any other
* options.
* Fortunately, this is a bad use of usleep, so commenting it out won't
* hurt the game, and might even help it. */
/* usleep(250000);*/
}
}
void l_fire_station(void)
{
print1("The flames leap up, and the heat is incredible.");
if (Player.immunity[FLAME]) {
print2("You feel the terrible heat despite your immunity to fire!");
morewait();
}
print2("Enter the flames? [yn] ");
if (ynq2()=='y') {
if (Player.hp == 1) p_death("total incineration");
else Player.hp = 1;
dataprint();
print1("You feel like you are being incinerated! Jump back? [yn] ");
if (ynq1()=='y')
print2("Phew! That was close!");
else {
Player.pow -= (15+random_range(15));
if (Player.pow > 0) {
print2("That's odd, the flame seems to have cooled down now....");
print3("A flicker of fire seems to dance above the void nearby.");
Level->site[Player.x][Player.y].locchar = FLOOR;
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
stationcheck();
}
else {
print2("The flames seem to have leached away all your mana!");
p_death("the Essence of Fire");
}
}
}
else print2("You flinch away from the all-consuming fire.");
}
void l_water_station(void)
{
print1("The fluid seems murky and unknowably deep.");
print2("It bubbles and hisses threateningly.");
morewait();
if (Player.status[BREATHING]) {
print1("You don't feel sanguine about trying to breathe that stuff!");
morewait();
}
if (Player.immunity[ACID]) {
print2("The vapor burns despite your immunity to acid!");
morewait();
}
print1("Enter the fluid? [yn] ");
if (ynq1()=='y') {
if (Player.hp == 1) p_death("drowning in acid (ick, what a way to go)");
else Player.hp = 1;
dataprint();
print2("You choke....");
morewait();
nprint2("Your lungs burn....");
morewait();
print2("Your body begins to disintegrate.... Leave the pool? [yn] ");
if (ynq2()=='y')
print2("Phew! That was close!");
else {
clearmsg();
Player.con -= (15+random_range(15));
if (Player.con > 0) {
print1("That's odd, the fluid seems to have been neutralized....");
print2("A moist miasma wafts above the void nearby.");
Level->site[Player.x][Player.y].locchar = FLOOR;
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
stationcheck();
}
else {
print2("The bubbling fluid has destroyed your constitution!");
p_death("the Essence of Water");
}
}
}
else print2("You step back from the pool of acid.");
}
void l_air_station(void)
{
print1("The whirlwind spins wildly and crackles with lightning.");
if (Player.immunity[ELECTRICITY])
print2("You feel static cling despite your immunity to electricity!");
morewait();
print1("Enter the storm? [yn] ");
if (ynq1()=='y') {
if (Player.hp == 1) p_death("being torn apart and then electrocuted");
else Player.hp = 1;
dataprint();
print1("You are buffeted and burnt by the storm....");
print2("You begin to lose consciousness.... Leave the storm? [yn] ");
if (ynq1()=='y')
print2("Phew! That was close!");
else {
Player.iq -= (random_range(15)+15);
if (Player.iq > 0) {
print1("That's odd, the storm subsides....");
print2("A gust of wind brushes past the void nearby.");
Level->site[Player.x][Player.y].locchar = FLOOR;
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
stationcheck();
}
else {
print2("The swirling storm has destroyed your intelligence!");
p_death("the Essence of Air");
}
}
}
else print2("You step back from the ominous whirlwind.");
}
void l_earth_station(void)
{
pob o;
print1("The tendrilled mass reaches out for you from the muddy ooze.");
if (find_item(&o,OB_SALT_WATER,-1))
print2("A splash of salt water does nothing to dissuade the vines.");
morewait();
print1("Enter the overgrown mire? [yn] ");
if (ynq1()=='y') {
if (Player.hp == 1) p_death("being eaten alive");
else Player.hp = 1;
dataprint();
print1("You are being dragged into the muck. Suckers bite you....");
print2("You're about to be entangled.... Leave the mud? [yn] ");
if (ynq2()=='y')
print2("Phew! That was close!");
else {
Player.str -= (15+random_range(15));
if (Player.str > 0) {
print1("That's odd, the vine withdraws....");
print2("A spatter of dirt sprays into the void nearby.");
Level->site[Player.x][Player.y].locchar = FLOOR;
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
stationcheck();
}
else {
print2("The tendril has destroyed your strength!");
p_death("the Essence of Earth");
}
}
}
else print2("You step back from the ominous vegetation.");
}
void stationcheck(void)
{
int stationsleft=FALSE;
int i,j;
morewait();
clearmsg();
print1("You feel regenerated.");
Player.hp = Player.maxhp;
dataprint();
for(j=0;j<Level->level_length;j++)
for(i=0;i<Level->level_width;i++)
if ((Level->site[i][j].locchar == WATER) ||
(Level->site[i][j].locchar == HEDGE) ||
(Level->site[i][j].locchar == WHIRLWIND) ||
(Level->site[i][j].locchar == FIRE))
stationsleft=TRUE;
if (! stationsleft) {
print1("There is a noise like a wild horse's neigh.");
print2("You spin around, and don't see anyone around at all");
print3("except for a spurred black cloaked figure carrying a scythe.");
morewait();clearmsg();
print1("Death coughs apologetically. He seems a little embarrassed.");
print2("A voice peals out:");
print3("'An Adept must be able to conquer Death himself....");
make_site_monster(32,4,DEATH);
}
}
/* To survive the void, the other four stations must be visited first,
to activate the void, then something (Death's scythe, possibly)
must be thrown in to satiate the void, then all other items must
be dropped, then the void must be entered. */
void l_void_station(void)
{
int i,something=FALSE;
if (cinema_confirm("You're about to Peter Pan into an endless void.")=='y') {
if (Level->mlist == NULL) {
print2("You fall forever. Eventually you die of starvation.");
morewait();
while(Player.hp>0) {
Time+=60;
hourly_check();
usleep(250000);
}
}
else {
print1("You enter the void.");
print2("You feel a sudden surge of power from five directions.");
morewait();
something = (Player.packptr > 0);
if (! something)
for(i=0;((i<MAXITEMS)&&(!something));i++)
if (Player.possessions[i] != NULL)
something = TRUE;
if (something) {
print1("The flow of power is disrupted by something!");
print2("The power is unbalanced! You lose control!");
morewait();
print1("Each of your cells explodes with a little scream of pain.");
print2("Your disrupted essence merges with the megaflow.");
p_death("the Power of the Void");
}
else if (! gamestatusp(PREPARED_VOID)){
print1("The hungry void swallows you whole!");
print2("Your being dissipates with a pathetic little sigh....");
p_death("the Emptyness of the Void");
}
else {
print1("The flow of power rages through your body,");
print2("but you manage to master the surge!");
print3("You feel adept....");
morewait();clearmsg();
print1("With a thought, you soar up through the void to the");
print2("place from whence you came.");
print3("As the platform of the Challenge dwindles beneath you");
morewait();
clearmsg();
print1("You see Death raise his scythe to you in a salute.");
Player.rank[ADEPT] = 1;
setgamestatus(COMPLETED_CHALLENGE);
FixedPoints = calc_points();
/* set so change_environment puts player in correct temple! */
Player.x = 49;
Player.y = 59;
print2("You find yourself back in the Temple of Destiny.");
morewait();
change_environment(E_TEMPLE);
}
}
}
else print2("You back away from the edge....");
}
void l_voice1(void)
{
print1("A mysterious voice says: The Hunger of the Void must be satiated.");
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
}
void l_voice2(void)
{
print1("A strange voice recites: Enter the Void as you entered the World.");
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
}
void l_voice3(void)
{
print1("An eerie voice resounds: The Void is the fifth Elemental Station.");
Level->site[Player.x][Player.y].p_locf = L_NO_OP;
}
void l_whirlwind(void)
{
print1("Buffeting winds swirl you up!");
p_damage(random_range(difficulty()*10),NORMAL_DAMAGE,"a magic whirlwind");
if (random_range(2)) {
print2("You are jolted by lightning!");
p_damage(random_range(difficulty()*10),ELECTRICITY,"a magic whirlwind");
}
morewait();
if (random_range(2)) {
print1("The whirlwind carries you off....");
if (random_range(20)==17)
print2("'I don't think we're in Kansas anymore, toto.'");
p_teleport(0);
}
}
void l_enter_circle(void)
{
print1("You see a translucent stairway before you, leading down.");
print2("Take it? [yn] ");
if (ynq()=='y')
change_environment(E_CIRCLE);
}
void l_circle_library(void)
{
print1("You see before you the arcane library of the Circle of Sorcerors.");
}
void l_tome1(void)
{
menuclear();
menuprint("\nYou discover in a dusty tome some interesting information....");
menuprint("\nThe Star Gem holds a vast amount of mana, usable");
menuprint("\nfor either Law or Chaos. It is magically linked to Star Peak");
menuprint("\nand can either be activated or destroyed there. If destroyed,");
menuprint("\nits power will be used for Chaos, if activated, for Law.");
menuprint("\n\nIt is said the LawBringer has waited for an eternity");
menuprint("\nat Star Peak for someone to bring him the gem.");
menuprint("\nIt is also rumored that while anyone might destroy the gem,");
menuprint("\nreleasing chaotic energy, only the LawBringer can release");
menuprint("\nthe lawful potential of the gem.");
showmenu();
morewait();
xredraw();
}
void l_tome2(void)
{
menuclear();
menuprint("\nYou discover in some ancient notes that the Star Gem can be");
menuprint("\nused for transportation, but also read a caution that it must");
menuprint("\nbe allowed to recharge a long time between uses.");
menuprint("\nA marginal note says 'if only it could be reset to go somewhere");
menuprint("\nbesides Star Peak, the gem might be useful....'");
showmenu();
morewait();
xredraw();
}
void l_temple_warning(void)
{
print1("A stern voice thunders in the air around you:");
print2("'No unbelievers may enter these sacred precincts;");
print3("those who defile this shrine will be destroyed!");
}
void l_throne(void)
{
pob o;
int i;
print1("You have come upon a huge ornately appointed throne!");
print2("Sit in it? [yn] ");
if (ynq1()=='y') {
if (! find_item(&o,OB_SCEPTRE,-1)) {
print1("The throne emits an eerie violet-black radiance.");
print2("You find, to your horror, that you cannot get up!");
print3("You feel an abstract sucking sensation...");
for(i=0;i<NUMSPELLS;i++) Spells[i].known = FALSE;
Player.pow = 3;
Player.mana = 0;
Player.hp = 1;
dispel(-1);
morewait();clearmsg();
print1("The radiance finally ceases. You can get up now.");
}
else {
if (HiMagicUse == Date)
print3("You hear the sound of a magic kazoo played by an asthmatic.");
else {
HiMagicUse = Date;
print1("Following some strange impulse, you raise the Sceptre....");
print2("You hear a magical fanfare, repeated three times.");
switch(HiMagic++) {
case 0:
print3("Strength.");
Player.str+=5;
Player.maxstr+=5;
break;
case 1:
print3("Constitution.");
Player.con+=5;
Player.maxcon+=5;
break;
case 2:
print3("Dexterity.");
Player.dex+=5;
Player.maxdex+=5;
break;
case 3:
print3("Agility.");
Player.agi+=5;
Player.maxagi+=5;
break;
case 4:
print3("Intelligence.");
Player.iq+=5;
Player.maxiq+=5;
break;
case 5:
print3("Power.");
Player.pow+=5;
Player.maxpow+=5;
break;
default:
if (Spells[S_WISH].known) {
print1("A mysterious voice mutters peevishly....");
print2("So what do you want now? A medal?");
}
else {
print1("Mystic runes appear in the air before you:");
print2("They appear to describe some high-powered spell.");
morewait();
print1("You hear a distant voice....");
print2("'You may now tread the path of High Magic.'");
Spells[S_WISH].known = TRUE;
}
break;
case 17:
print1("Weird flickering lights play over the throne.");
print2("You hear a strange droning sound, as of a magical");
morewait();
print1("artifact stressed by excessive use....");
print2("With an odd tinkling sound the throne shatters!");
Level->site[Player.x][Player.y].locchar = RUBBLE;
Level->site[Player.x][Player.y].p_locf = L_RUBBLE;
lset(Player.x, Player.y, CHANGED);
if (find_and_remove_item(OB_SCEPTRE,-1)) {
morewait();
print1("Your sceptre reverberates with the noise, and");
print2("it too explodes in a spray of shards.");
}
break;
}
calc_melee();
dataprint();
}
}
}
}
void l_escalator(void)
{
print1("You have found an extremely long stairway going straight up.");
print2("The stairs are grilled steel and the bannister is rubber.");
morewait();
print1("Take the stairway? [yn] ");
if (ynq1()=='y') {
print1("The stairs suddenly start moving with a grind of gears!");
print2("You are wafted to the surface....");
change_environment(E_COUNTRYSIDE);
}
}
void l_enter_court(void)
{
print1("You have found a magical portal! Enter it? [yn] ");
if (ynq1()=='y') {
if (! gamestatusp(COMPLETED_CASTLE)) {
if (! gamestatusp(ATTACKED_ORACLE)) {
print2("A dulcet voice says: 'Jolly good show!'");
morewait();
}
setgamestatus(COMPLETED_CASTLE);
}
change_environment(E_COURT);
}
}
void l_chaostone(void)
{
print1("This is a menhir carved of black marble with veins of gold.");
print2("It emanates an aura of raw chaos, which is not terribly");
morewait();
print1("surprising, considering its location.");
if (Player.alignment < 0)
print2("You feel an almost unbearable attraction to the stone.");
else print2("You find it extremely difficult to approach the stone.");
morewait();
clearmsg();
if (cinema_confirm("You reach out your fist to strike it.")=='y') {
print1("A sudden flux of energy surrounds you!");
morewait();
if (stonecheck(-1)) {
print2("You feel stronger!");
Player.maxstr = min(Player.maxstr+10,max(30,Player.maxstr));
dataprint();
}
}
else print1("You step back from the ominous dolmech.");
}
void l_balancestone(void)
{
print1("This is a massive granite slab teetering dangerously on a corner.");