-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrogue.pas
More file actions
11229 lines (10691 loc) · 312 KB
/
rogue.pas
File metadata and controls
11229 lines (10691 loc) · 312 KB
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
(*$D-,C-,A-,M+ -*-PASCAL-*- *)
(* <RELPH.ROGUE>ROGUE.PAS.2290, 9-Jan-88 12:51:02, Edit by RELPH *)
(* **************************************************************************
ECL ROGUE
A pseudo Dungeons and Dragons Game for the PDP-10.
Written by: Gary Craig and Jay Skeer
and: Oscar Erickson, John Relph.
Thanks to: Bob Schwartzkopf, Maurice Wuts, and Mark Brown
May-December, 1982 --- Version 4
Edit History: Many until now:
3:48am Friday, 10 December 1982 -- JMR
Make GIGI terminals work right.
Change scrolls, potions, monsters, etc., to constants In
the file ROGUE.CONSTANTS.
Change mailing addresses for comments and Bug reports.
8:00pm Saturday, 11 December 1982 -- GAC
Removed 'the bolt shoots forward' and fixed up wand-attack echoing
Made scrolls and potions unidentifiable when blind, can't read when
blind either.
12:48am Thursday, 16 December 1982 -- JMR
Fixed ring of resurrection problem.
6:30pm Saturday, 19 December 1982 -- GAC
Made inventory use the echo line if it can. Slow inventory switch
still needs to be put it (I will do it shortly).
8:30pm Sunday, 20 December 1982 -- GAC
Put in slow inventory switch, updated doc file, help, and init-instr. file
Put in slow inventory command, 'I'. Re-init-terminal is now ^I.
Slow inventory is default on ttys with speed <= 300 baud (or unknown).
9:36pm Monday, 20 December 1982 -- JMR
Fixed slow inventory, inventory In slow mode, and fixed bug With
umpleby & arrow traps, wasn't echoing 'which kills you..' message.
1:30pm Saturday, 8 January 1983 -- GAC
Fixed the problem Oscar mentioned about Alchemy (wearing potions, etc.).
Other random diddling (personal_scores, curing, wonder).
12:55am Friday, 4 March 1983 -- JMR
Make save File just play the game without being able To keep the score
If the score File has been tampered With.
5:03pm Saturday, 5 March 1983 -- JMR
Fix purple worms To give you six turns inside Of them. You can
teleport out or hack your way out.
12:36am Monday, 14 March 1983 -- JMR
Add Trap_Identify Function To identify traps....duh
11:43pm Monday, 14 March 1983 -- JMR
Fix Nothing Appropriate complaint.
11:38am Tuesday, 15 March 1983 -- JMR
add staff of Searching
Fix cancellation To save
2:54am Friday, 25 March 1983 -- JMR
No more ' ' To heal. Changed To '.' by request.
Also fix staff Of searching problem. and Generation
Of monsters when no monsters can be on level.
6:02pm Saturday, April 2 1983 -- GAC
Undid previous ' ' to '.' change. Heal is now both, people
who don't like ' ' can go to hell. Also adjusted monster levels
to make middle harder in preparation for the Juiblex fix.
11:06pm Sunday, April 3 1983 -- OJE
Put in Juiblex fix. Instead of having to kill Juiblex to win the game
we now place the amulet in a random location and then put Juiblex on
top of it (asleep). Also make it so that there are no trapdoors on
level of the amulet.
3:26am Friday, 15 April 1983 -- JMR
Change staffy and trmchk routines To be keyword File,
change term To be non-monitor specific enumerated Type.
4:29am Friday, 15 April 1983 -- JMR
Fix Phantom Stalker special attack...
7:07pm Saturday, 16 April 1983 -- GAC
Added ^T (systat) command
1:56am Wednesday, 20 April 1983 -- JMR
Changed Bug-address To String variable; changed Staffy To only
be check Procedure, Procedure Init_Staffy sets it up and sets bug-address
8:22pm Thursday, 21 April 1983 -- JMR
Fixing Place_Next_to To Do something a little more reasonable
10:55pm Saturday, 23 April 1983 -- JMR/OJE
Fix parts To Read filenames from terminal,
and Got TURN around corners and move diagonal working.
Still a few weird things, though.
OH YEAH: CHANGE VERSION TO REFLECT EDIT LEVEL!!!!
In future edits, that is...
11:15pm Saturday, 23 April 1983 -- JMR
Take out the SIBEs For redisplay reasons; now With fast run
you aren't doing that much redisplay anyway.
Also added Type_Version call For NEW Players.
1:10pm Sunday, 24 April 1983 -- GAC
Fixed Name file handling, added WHOIS (^W) command.
2:42pm Monday, 25 April 1983 -- JMR
Added help For WHOIS, fixed problem With Init_Staffy.
1:46am Tuesday, 26 April 1983 -- JMR/OJE
Mimics and Intellect devourers...hahaha
3:27pm Tuesday, 26 April 1983 -- OJE
Make optimal turning.
12:08pm Saturday, 30 April 1983 -- GAC
Made Whois do substrings.
8:49pm Monday, 2 May 1983 -- JMR
Cut down size Of save File and take out date checking.
9:20pm Tuesday, 3 May 1983 -- JMR/OJE
Fix turning bug.
Recently -- JMR
Fix bug With creating mimics With no objs on level, and make
killmoulies same as no monster.
12:06pm Thursday, 5 May 1983 -- JMR
Fix Can_Carry bugs, and add 'another' message when finding an object.
Also, a couple of mimic fixes.
8:45pm Friday, 6 May 1983 -- JMR
Fix mimic bug, add hold portal scroll, add ring buffer Of echoes.
1:15am Saturday, 7 May 1983 -- GAC
Made high intelligence make you 'know' a scroll, made 'unknown object
type' an illusion object, in case that still happens...
1:51pm Sunday, 8 May 1983 -- J'
FIX GET OBJ CODE ONCE AND FOR ALL.
1:09am Sunday, 15 May 1983 -- JMR/OJE
Fix Place_Next_To code. Change monster/human hit messages.
Many other random changes
2:17pm Monday, 16 May 1983 -- JMR
Fix complaint about ^T/^C bug from Rutgers.
11:31pm Tuesday, 17 May 1983 -- JMR
Try To fix Restore_game bug. Don't know If it did anything.
But I gave it a shot. Also, make Identify more common.
12:37am Wednesday, 1 June 1983 -- JMR
Fix player.eaten stuff, Redisplay. Make hurled objects go thru doors.
Also Player.Blind Stuff. Purple worm polymorph stuff.
1:05am Wednesday, 1 June 1983 -- JMR
Add Datamedia-2500 terminal handling stuff.
sometime -- JMR
Fix Githyanki probability.
1:57am Sunday, 5 June 1983 -- JMR
Fix Towards/Away_From/Random_Move For monster stuff.
10:16pm Sunday, 5 June 1983 -- JMR
Fix Detect Gold/Magic/Monsters
3:41pm Sunday, 12 June 1983 -- JMR
Fix Remove_Ring stuff. Fix other Ring stuff. Purple Worm FIx.
4:31pm 29-jun-83 -- JMR
Fix save file problem. HAHAHAHAHAHA! very funny.
also fix problem with w_para...
7:19pm Wednesday, 6 July 1983 -- JMR
#46 Add Infoton-400 terminal handling.
10:40am Thursday, 14 July 1983 -- JMR
#47 add denial Of access by accounts.
1:00pm Saturday, 17 July 1983 -- GAC
#48 add Concept-108 terminal handling
10:32pm Tuesday, 9 August 1983 -- JMR
#49 Fix bugs With DM2500 terminal handling, and bugs With
restore_game failure. Fix Inf400 stuff. Fix Rings. Fix arrow wielding.
12:11pm Saturday, 19 November 1983 -- JMR
#50 add support For hazeltine-1500, version stuff
3:08pm Saturday, 21 January 1984 -- GAC
#51 Fix NIL pointer in Call_obj - got it when typing 'C','*','<esc>'.
12:10pm Monday, 6 February 1984 -- JMR
#52 Fix problem With mimics, violet fungi, and purple worm death.
9:52pm Thursday, 1 March 1984 -- JMR
#53 Fix 'f','F' move stuff, and change Set_Options
2:42am Thursday, 22 March 1984 -- JMR
#54 Found bug In THROW. It figgers. also Put Get_Line routine In.
2:48pm Tuesday, 27 March 1984 -- JMR
#55 Add Captain Fantastic''s Secret Decoder ring. Fix some things.
Change log File slightly, and ^T. Fix some strange bugs.
1:11pm Friday, 30 March 1984 -- JMR
#56 Fix bug In moving onto door diagonally from within dark room.
Add HP terminal Type.
4:13pm Tuesday, 3 April 1984 -- JMR
#57 Put In load checker, and startup version Text.
Allow healing While sleeping.
5:52pm Friday, 13 April 1984 -- JMR
#58 Fix a horrible bug that awoke a mimic but did Not change it
To a 'M' If you were attacking With a bow, sling, or crossbow.
Also fix bug In place_next_to (again).
1:59am Sunday, 29 April 1984 -- JMR
#59 Fix bug In Zap_Wand that gave monsters a move after <ESC>.
Also fix problems With NEW:PASCAL. And confirm when load too high.
6:32pm Thursday, 10 May 1984 -- JMR
#60 Change redisplay to include stats lines and echo line. Some other
optimization. Fix purple worm stuff
8:45pm Friday, 15 June 1984 -- JMR
#61 Put in padding For Con100 terminals.
7:14pm Tuesday, 3 July 1984 -- JMR
#62 Fix bug With hitting escape from Slow_inventory.
Parse the four File names from the CONFIGURATION FILE instead of from
the terminal.
5:33pm Wednesday, 29 August 1984 -- JMR
#63 Change random number generator. Move terminal handling to Extern.
Fix initialization stuff. Change score File, Names File formats.
Try to satisfy people who think there isn't enough food.
Fix bugs With restore_game.
6:39pm Tuesday, 4 September 1984 -- JMR
#64 Fix Monster stuff. Bummer, have to make this version 4.
5:36pm Wednesday, 31 October 1984 -- JMR
#1 Fix inventory to ask For letter of object when doing inventory.
Fix bug With wand of blunder.
2:36pm Saturday, 10 November 1984 -- JMR
#2 lowercase all names, add tombstone/switch. Change TRMCHK.
11:28pm Wednesday, 18 February 1987 -- JMR
#3 fix tombstonage
fix abort from Put on ring
10:57pm Tuesday, 31 March 1987
#4 Fix reaching level 13 problem.
#5 First attempt at fixing DISPOSE already clobbered object bug.
It's in Lose_Old_World in the object dispose loop. Don't know
why it's so confused, but it has already disposed of one of the
objects somewhere in the past... Sometimes...
#6 try to make monsters move a little smahter. fix erroneous monster moving
routine which got lost If monsters died in middle of moving especially If
person moving slow.
Add trap finding routine to magic_mapping.
HEY! CHANGE THE FIRST TWO VERSION CONSTANTS FOR EVERY CHANGE!!!.
****************************************************************************)
Program Rogue;
Include 'Rogue.Constants';
Const
Rogue_Update = 6;
Rogue_Edit = 2290; (* ^D *)
Rogue_Version = 4;
Chance_Of_No_Room = 9; (* 1/Chance of a Cell Being Devoid of room *)
Maze_Max_X = 3;
Maze_Max_Y = 3;
Max_Room = 9; (* Maze_Max_X * Maze_Max_Y *)
Max_Room_X = 24;
Max_Room_Y = 5;
Max_Cell_X = 26;
Max_Cell_Y = 7;
X_Orig = 1;
Y_Orig = 2;
S_Max_X = 78;
S_Max_Y = 22;
X_Orig_1 = 0;
Y_Orig_1 = 1;
S_Max_X_1 = 79;
S_Max_Y_1 = 23;
Real_Y_Orig = 0;
Real_X_Orig = 0;
Real_Max_X = 79;
Real_Max_Y = 25;
Redisp_X_Orig = 1;
Redisp_Y_Orig = 1;
Redisp_Max_X = 78;
Redisp_Max_Y = 24;
Max_Doors = 4;
Max_Chance = 1600; (* Sum of all the numbers in the chance field
of the treasure array. *)
Max_Word = 160; (* #6 Number of "funny" scroll words *)
Max_Item = 23; (* The maximum number Of objects player can carry *)
Fainting_Meal = 2750; (* turns before fainting *)
Weak_Meal = 2600; (* turns before feeling weak *)
Hungry_Meal = 2000; (* turns before being hungry *)
Not_Another = False; (* also, check everywhere this constant is *)
Name_Len = 30; (* #54 just For const''s sake *)
(* If this length is changed, many things in extern.mac will change too *)
Space = ' ';
Spaces = ' ';
Type
Q_Reason = (Quit_R,Saved_R,Died_R,Winner_R); (* #55,#2 *)
View_Array = Array[0..2] Of Char;
Name_string = Packed Array[1..Name_Len] of char;
Nam_ptr = ^Name_rec;
Name_rec = Record
Nam : Name_string;
Num : Integer;
Next : Nam_ptr
End; (* #63 *)
Long_string = Packed Array[1..80] of char;
String5 = Packed Array[1..5] of char;
String8 = Packed Array[1..8] of char;
Loc_Type = Record
X,Y : Integer;
End;
Obj_Class_Type = (Amulet_T,Food_T,Ring_T,Wand_T,Scroll_T,
Potion_T,Armor_T,Weapon_T,Gold_T,All_T);
Action_Type = (Eat_A,Put_On_A,Zap_A,Read_A,Quaff_A,Wear_A,Wield_A,
Drop_A,Identify_A,Call_A,Throw_A);
Status_type = (s_top,s_bottom);
Mon_Ptr = ^ Monster_Typ;
Trap_Ptr = ^ Trap_Typ;
Obj_Ptr = ^ Obj_Typ;
Monster_Typ = Record
Index : Integer;
HP : Integer;
Awake : Boolean;
Paralyzed_count : Integer;
Confused_count : Integer;
Loc : Loc_Type;
Next : Mon_Ptr;
Speed,Speed_count,Who_first : Integer;
Last_Dir : Char;
End;
Trap_Typ = Record
Loc : Loc_type;
Chance : Integer;
Kind : Integer;
Next : Trap_Ptr;
End;
Obj_Typ = Record
Obj_Typ : Obj_Class_Type;
Loc : Loc_Type;
Quan : Integer;
Index : Integer;
Plus_Hit : Integer;
Plus_Dam : Integer;
Know_magic : Boolean;
Cursed : Boolean;
Next : Obj_Ptr;
End;
Treasures = Record
Chance : Integer;
Index : Integer;
Typ : Obj_Class_Type;
End;
Monsters = Record
Long_Name : Name_String;
Len : Integer;
Ac,Th0,Hit_Dice : Integer;
Dam,Num : Integer;
Min_Level,Max_Level : Integer;
Special : 1..3; (* 1's bit = normal, 2's = special *)
Sleep : Integer;
Large : Boolean;
Name : Char;
Xpval : Integer;
End;
Potions = Record
Desc : Name_string;
D_leng : Integer;
Name : Name_string;
N_leng : Integer;
Id : Boolean;
Called : Boolean;
End;
Scrolls = Record
Desc : Name_string;
D_leng : Integer;
Name : Name_string;
N_leng : Integer;
Id : Boolean;
Called : Boolean;
Can_ID : Boolean;
End;
Wands = Record
Desc : Name_string;
D_leng : Integer;
Name : Name_string;
N_leng : Integer;
Is_wand : Boolean;
Id : Boolean;
Called : Boolean;
Dam : Integer;
Num : Integer;
End;
Rings = Record
Desc : Name_string;
D_leng : Integer;
Name : Name_string;
N_leng : Integer;
Id : Boolean;
Called : Boolean;
End;
Armors = Record
Name : Name_string;
N_leng : Integer;
Ac : Integer;
End;
Weapons = Record
Name : Name_string;
N_leng : Integer;
L_Num : Integer;
L_Dam : Integer;
S_Num : Integer;
S_Dam : Integer;
End;
Descriptions = Record
Name : Alfa;
Leng : Integer
End;
Hand_Type = (Left_H,Right_H); (* #49 *)
Player_Record = Record
Obj_List,
Cur_Wep,
Cur_Arm : Obj_Ptr;
Cur_Ring : Array[Hand_Type] Of Obj_Ptr; (* #49 *)
Gold,
XP,
Level,
HP : Integer;
Name : Name_string;
Max_HP,
ST,
Max_ST,
DX,
Max_DX,
IQ,
Max_IQ,
AC,
Died_Count,
SeeMon_Count,
Faint_count,
Confused_count,
Blind_count,
Paralyzed_count,
Sleep_count,
Trapped_count,
Fixed_count,
Invis_count,
Last_meal,
Heal_count,
Eaten_Count,
Eaten_Loss : Integer;
Blind,
Stuck,
Will_confuse,
Has_amulet : Boolean;
Speed,
Speed_count : Integer;
Prev,
Loc : Loc_Type;
End;
Score_rec = Record
User : Integer;
Score : Integer;
Day : String5;
Killer : Char;
Level : Integer
End;
Score_array = array[1..10] of score_rec;
Personal_rec = Record
Score : Integer;
Rest : Long_string;
End;
Personals = Array[1..10] of Personal_rec;
Door_Type = Record
abs_loc : loc_type;
Secret : Integer;
End;
Room_Type = Record
Max_X,Max_Y : Integer;
Abs_X,Abs_Y : Integer;
Light : Boolean;
Existant : Boolean;
Seen : Boolean;
Doors : Array [1..Max_Doors] Of Door_Type;
End;
Screen_Array = Array [X_Orig_1..S_Max_X_1,Y_Orig_1..S_Max_Y_1] of Char;
Real_Screen = Array[Real_Y_Orig..Real_Max_Y,Real_X_Orig..Real_Max_X] of Char;
Bool_Array = Array [X_Orig_1..S_Max_X_1,Y_Orig_1..S_Max_Y_1] of Boolean;
World_Rec = Record
Monsters : Mon_Ptr;
Objs : Obj_Ptr;
Traps : Trap_Ptr;
Level : Integer;
Num_mons, max_mons : integer;
Rooms : Array [1..Max_Room] of Room_Type;
S_World,
Mon,
Obj : Screen_Array;
This_Screen,
Screen : Real_Screen;
Room_array : Array[X_orig_1..S_max_x_1,Y_orig_1..S_max_y_1] of integer;
Seeable,
Seen : Bool_Array;
Lines : Array [Real_Y_Orig..Real_Max_Y] of Boolean;
End;
Maze_Cell = Packed Record
U,Up,Dn,Rt,Lt : Boolean;
End;
Maze_Array = Packed Array [0..4,0..4] of Maze_Cell;
Switch_record = Record (* must be declared this way: don''t change! *)
Ask_swi : Boolean;
Flush_swi : Boolean;
Jump_swi : Boolean;
Slow_swi : Boolean;
Terse_swi : Boolean;
Turn_swi : Boolean;
Tomb_swi : Boolean (* #2 *)
End;
FName_Rec = Record (* #62 *)
Log : ^Long_String;
Message : ^Long_String;
Names : ^Long_String;
Score : ^Long_String
End;
Fudge_Type = Packed Record Case Boolean Of
True : (Int : Integer);
False: (Boo : Packed Array[0..35] Of Boolean)
End;
Var
Rnd_J, Rnd_K : Integer; (* #63 *)
Rnds : Array[1..55] of Real; (* #63 *)
Files : FName_Rec; (* #62 *)
Old_World : View_Array;
World : World_Rec;
Player : Player_Record;
Fruit_name,Save_file,R_File_Name : Name_string;
False_array : Bool_array;
F : Text;
Nm : File of Name_rec;
S, Nulls, Bug_add : Long_string; (* #57 *)
Last_echo : Packed Array[0..4] Of Long_String;
Amulet_level, Seed, Blank_message, Scare_count,
Echo_index, Echo_point, Echo_Pos_X : Integer; (* #50 *)
Ctrl_L,Killer,Player_Move,Last_Item : Char;
Wait_chars,OkDirs,Okmons,Resp_chars : Set Of Char; (* #55 *)
Delta_Dir : Array[-1..1,-1..1] of Char; (* #6 *)
Virgin, Setup, Empty_Echo, Want_scores, F_temp, Fast,
Dont_Turn, Valid_Command, Do_Done, Moved, Has_Turned, Dead,
Quit_game, Saved, Not_Staffer : Boolean;
Reason : Q_Reason;
Change_stats : Set Of Status_type;
Orig_X,Orig_Y : Array [1..Max_Room] of Integer;
O_Used_list,M_Used_list : Array[1..Max_room] Of Boolean;
Ct : Maze_Array;
Switches : Switch_record;
Color : Array[1..Max_potion] Of Descriptions;
Stone : Array[1..Max_ring] Of Descriptions;
Wood : Array[1..Max_wand] Of Descriptions;
Metal : Array[1..Max_wand] Of Descriptions;
Word : Array[1..Max_word] Of Descriptions;
Wand : Array [1..Max_wand] Of Wands;
Ring : Array [1..Max_ring] Of Rings;
Scroll : Array [1..Max_scroll] Of Scrolls;
Armor : Array [1..Max_armor] Of Armors;
Weapon : Array [1..Max_weapon] Of Weapons;
Potion : Array [1..Max_potion] Of Potions;
Treasure : Array [1..Max_treasure] Of Treasures;
Monster : Array [1..Max_monster] Of Monsters;
Initprocedure;
Begin
Old_World[0] := '&'; (* This is an empty *)
Old_World[1] := '&';
Old_World[2] := '&';
Delta_Dir[-1,-1] := '7'; (* #6 *)
Delta_Dir[-1,0] := '4';
Delta_Dir[-1,1] := '1';
Delta_Dir[0,-1] := '8';
Delta_Dir[0,0] := '5';
Delta_Dir[0,1] := '2';
Delta_Dir[1,-1] := '9';
Delta_Dir[1,0] := '6';
Delta_Dir[1,1] := '3';
Virgin := True;
Setup := True;
End;
Initprocedure;
Begin
Monster[m_ant].Long_Name := 'giant ant ';
Monster[m_ant].Name := 'A';
Monster[m_ant].Len := 9;
Monster[m_ant].Hit_Dice := 2;
Monster[m_ant].Ac := 3;
Monster[m_ant].Th0 := 16;
Monster[m_ant].Dam := 6;
Monster[m_ant].Num := 1;
Monster[m_ant].Special := 3;
Monster[m_ant].Min_Level := 3;
Monster[m_ant].Max_Level := 9;
Monster[m_ant].Sleep := 15;
Monster[m_ant].Large := false;
Monster[m_ant].XPVal := 11;
Monster[m_bat].Long_Name := 'bat ';
Monster[m_bat].Name := 'B';
Monster[m_bat].Len := 3;
Monster[m_bat].Hit_Dice := 1;
Monster[m_bat].Ac := 7;
Monster[m_bat].Th0 := 20;
Monster[m_bat].Dam := 3;
Monster[m_bat].Num := 1;
Monster[m_bat].Special := 1;
Monster[m_bat].Min_Level := 1;
Monster[m_bat].Max_Level := 5;
Monster[m_bat].Sleep := 25;
Monster[m_bat].Large := false;
Monster[m_bat].XPVal := 1;
Monster[m_centaur].Long_Name := 'centaur ';
Monster[m_centaur].Name := 'C';
Monster[m_centaur].Len := 7;
Monster[m_centaur].Hit_Dice := 4;
Monster[m_centaur].Ac := 5;
Monster[m_centaur].Th0 := 15;
Monster[m_centaur].Dam := 6;
Monster[m_centaur].Num := 2;
Monster[m_centaur].Special := 1;
Monster[m_centaur].Min_Level := 7;
Monster[m_centaur].Max_Level := 15;
Monster[m_centaur].Sleep := 10;
Monster[m_centaur].Large := true;
Monster[m_centaur].XPVal := 15;
Monster[m_dragon].Long_Name := 'dragon ';
Monster[m_dragon].Name := 'D';
Monster[m_dragon].Len := 6;
Monster[m_dragon].Hit_Dice := 11;
Monster[m_dragon].Ac := -2;
Monster[m_dragon].Th0 := 9;
Monster[m_dragon].Dam := 12;
Monster[m_dragon].Num := 4;
Monster[m_dragon].Special := 1;
Monster[m_dragon].Min_Level := 21;
Monster[m_dragon].Max_Level := maxint;
Monster[m_dragon].Sleep := 30;
Monster[m_dragon].Large := true;
Monster[m_dragon].XPVal := 250;
Monster[m_eye].Long_Name := 'floating eye ';
Monster[m_eye].Name := 'E';
Monster[m_eye].Len := 12;
Monster[m_eye].Hit_Dice := 1;
Monster[m_eye].Ac := 9;
Monster[m_eye].Th0 := 20;
Monster[m_eye].Dam := 200;
Monster[m_eye].Num := 0;
Monster[m_eye].Special := 2;
Monster[m_eye].Min_Level := 3;
Monster[m_eye].Max_Level := 7;
Monster[m_eye].Sleep := 100;
Monster[m_eye].Large := false;
Monster[m_eye].XPVal := 8;
Monster[m_fungi].Long_Name := 'violet fungi ';
Monster[m_fungi].Name := 'F';
Monster[m_fungi].Len := 12;
Monster[m_fungi].Hit_Dice := 6;
Monster[m_fungi].Ac := 7;
Monster[m_fungi].Th0 := 16;
Monster[m_fungi].Dam := 8;
Monster[m_fungi].Num := 1;
Monster[m_fungi].Special := 3;
Monster[m_fungi].Min_Level := 16;
Monster[m_fungi].Max_Level := 22;
Monster[m_fungi].Sleep := 100;
Monster[m_fungi].Large := false;
Monster[m_fungi].XPVal := 15;
Monster[m_gnoll].Long_Name := 'gnoll ';
Monster[m_gnoll].Name := 'G';
Monster[m_gnoll].Len := 5;
Monster[m_gnoll].Hit_Dice := 2;
Monster[m_gnoll].Ac := 5;
Monster[m_gnoll].Th0 := 16;
Monster[m_gnoll].Dam := 4;
Monster[m_gnoll].Num := 2;
Monster[m_gnoll].Special := 1;
Monster[m_gnoll].Min_Level := 4;
Monster[m_gnoll].Max_Level := 12;
Monster[m_gnoll].Sleep := 15;
Monster[m_gnoll].Large := true;
Monster[m_gnoll].XPVal := 5;
Monster[m_hob].Long_Name := 'hobgoblin ';
Monster[m_hob].Name := 'H';
Monster[m_hob].Len := 9;
Monster[m_hob].Hit_Dice := 1;
Monster[m_hob].Ac := 5;
Monster[m_hob].Th0 := 18;
Monster[m_hob].Dam := 8;
Monster[m_hob].Num := 1;
Monster[m_hob].Special := 1;
Monster[m_hob].Min_Level := 1;
Monster[m_hob].Max_Level := 7;
Monster[m_hob].Sleep := 15;
Monster[m_hob].Large := false;
Monster[m_hob].XPVal := 3;
Monster[m_invis].Long_Name := 'invisible stalker ';
Monster[m_invis].Name := 'I';
Monster[m_invis].Len := 17;
Monster[m_invis].Hit_Dice := 8;
Monster[m_invis].Ac := 3;
Monster[m_invis].Th0 := 12;
Monster[m_invis].Dam := 4;
Monster[m_invis].Num := 4;
Monster[m_invis].Special := 1;
Monster[m_invis].Min_Level := 15;
Monster[m_invis].Max_Level := 20;
Monster[m_invis].Sleep := 0;
Monster[m_invis].Large := true;
Monster[m_invis].XPVal := 45;
Monster[m_jackal].Long_Name := 'jackal ';
Monster[m_jackal].Name := 'J';
Monster[m_jackal].Len := 6;
Monster[m_jackal].Hit_Dice := 1;
Monster[m_jackal].Ac := 7;
Monster[m_jackal].Th0 := 20;
Monster[m_jackal].Dam := 2;
Monster[m_jackal].Num := 1;
Monster[m_jackal].Special := 1;
Monster[m_jackal].Min_Level := 1;
Monster[m_jackal].Max_Level := 5;
Monster[m_jackal].Sleep := 15;
Monster[m_jackal].Large := false;
Monster[m_jackal].XPVal := 1;
Monster[m_kobold].Long_Name := 'kobold ';
Monster[m_kobold].Name := 'K';
Monster[m_kobold].Len := 6;
Monster[m_kobold].Hit_Dice := 1;
Monster[m_kobold].Ac := 7;
Monster[m_kobold].Th0 := 20;
Monster[m_kobold].Dam := 4;
Monster[m_kobold].Num := 1;
Monster[m_kobold].Special := 1;
Monster[m_kobold].Min_Level := 1;
Monster[m_kobold].Max_Level := 6;
Monster[m_kobold].Sleep := 15;
Monster[m_kobold].Large := false;
Monster[m_kobold].XPVal := 2;
Monster[m_lep].Long_Name := 'leprechaun ';
Monster[m_lep].Name := 'L';
Monster[m_lep].Len := 10;
Monster[m_lep].Hit_Dice := 2;
Monster[m_lep].Ac := 8;
Monster[m_lep].Th0 := 200;
Monster[m_lep].Dam := 200;
Monster[m_lep].Num := 0;
Monster[m_lep].Special := 2;
Monster[m_lep].Min_Level := 7;
Monster[m_lep].Max_Level := 16;
Monster[m_lep].Sleep := 100;
Monster[m_lep].Large := false;
Monster[m_lep].XPVal := 12;
Monster[m_mimic].Long_Name := 'mimic ';
Monster[m_mimic].Name := 'M';
Monster[m_mimic].Len := 5;
Monster[m_mimic].Hit_Dice := 9;
Monster[m_mimic].Ac := 7;
Monster[m_mimic].Th0 := 12;
Monster[m_mimic].Dam := 4;
Monster[m_mimic].Num := 3;
Monster[m_mimic].Special := 3;
Monster[m_mimic].Min_Level := 12;
Monster[m_mimic].Max_Level := maxint;
Monster[m_mimic].Sleep := 100;
Monster[m_mimic].Large := True;
Monster[m_mimic].XPVal := 35;
Monster[m_nymph].Long_Name := 'nymph ';
Monster[m_nymph].Name := 'N';
Monster[m_nymph].Len := 5;
Monster[m_nymph].Hit_Dice := 3;
Monster[m_nymph].Ac := 9;
Monster[m_nymph].Th0 := 200;
Monster[m_nymph].Dam := 200;
Monster[m_nymph].Num := 0;
Monster[m_nymph].Special := 2;
Monster[m_nymph].Min_Level := 10;
Monster[m_nymph].Max_Level := 15;
Monster[m_nymph].Sleep := 100;
Monster[m_nymph].Large := false;
Monster[m_nymph].XPVal := 10;
Monster[m_orc].Long_Name := 'orc ';
Monster[m_orc].Name := 'O';
Monster[m_orc].Len := 3;
Monster[m_orc].Hit_Dice := 1;
Monster[m_orc].Ac := 6;
Monster[m_orc].Th0 := 19;
Monster[m_orc].Dam := 6;
Monster[m_orc].Num := 1;
Monster[m_orc].Special := 1;
Monster[m_orc].Min_Level := 2;
Monster[m_orc].Max_Level := 10;
Monster[m_orc].Sleep := 15;
Monster[m_orc].Large := false;
Monster[m_orc].XPVal := 5;
Monster[m_purple].Long_Name := 'purple worm ';
Monster[m_purple].Name := 'P';
Monster[m_purple].Len := 11;
Monster[m_purple].Hit_Dice := 15;
Monster[m_purple].Ac := 6;
Monster[m_purple].Th0 := 8;
Monster[m_purple].Dam := 12;
Monster[m_purple].Num := 2;
Monster[m_purple].Special := 3;
Monster[m_purple].Min_Level := 22;
Monster[m_purple].Max_Level := maxint;
Monster[m_purple].Sleep := 15;
Monster[m_purple].Large := true;
Monster[m_purple].XPVal := 200;
Monster[m_quasit].Long_Name := 'quasit ';
Monster[m_quasit].Name := 'Q';
Monster[m_quasit].Len := 6;
Monster[m_quasit].Hit_Dice := 3;
Monster[m_quasit].Ac := 2;
Monster[m_quasit].Th0 := 16;
Monster[m_quasit].Dam := 4;
Monster[m_quasit].Num := 2;
Monster[m_quasit].Special := 1;
Monster[m_quasit].Min_Level := 9;
Monster[m_quasit].Max_Level := 15;
Monster[m_quasit].Sleep := 10;
Monster[m_quasit].Large := false;
Monster[m_quasit].XPVal := 15;
Monster[m_rust].Long_Name := 'rust monster ';
Monster[m_rust].Name := 'R';
Monster[m_rust].Len := 12;
Monster[m_rust].Hit_Dice := 5;
Monster[m_rust].Ac := 2;
Monster[m_rust].Th0 := 15;
Monster[m_rust].Dam := 200;
Monster[m_rust].Num := 0;
Monster[m_rust].Special := 2;
Monster[m_rust].Min_Level := 9;
Monster[m_rust].Max_Level := 16;
Monster[m_rust].Sleep := 0;
Monster[m_rust].Large := false;
Monster[m_rust].XPVal := 25;
Monster[m_snake].Long_Name := 'snake ';
Monster[m_snake].Name := 'S';
Monster[m_snake].Len := 5;
Monster[m_snake].Hit_Dice := 2;
Monster[m_snake].Ac := 5;
Monster[m_snake].Th0 := 17;
Monster[m_snake].Dam := 3;
Monster[m_snake].Num := 1;
Monster[m_snake].Special := 1;
Monster[m_snake].Min_Level := 1;
Monster[m_snake].Max_Level := 6;
Monster[m_snake].Sleep := 30;
Monster[m_snake].Large := true;
Monster[m_snake].XPVal := 2;
Monster[m_troll].Long_Name := 'troll ';
Monster[m_troll].Name := 'T';
Monster[m_troll].Len := 5;
Monster[m_troll].Hit_Dice := 7;
Monster[m_troll].Ac := 4;
Monster[m_troll].Th0 := 13;
Monster[m_troll].Dam := 4;
Monster[m_troll].Num := 7;
Monster[m_troll].Special := 1;
Monster[m_troll].Min_Level := 14;
Monster[m_troll].Max_Level := 18;
Monster[m_troll].Sleep := 10;
Monster[m_troll].Large := true;
Monster[m_troll].XPVal := 50;
Monster[m_umber].Long_Name := 'umber hulk ';
Monster[m_umber].Name := 'U';
Monster[m_umber].Len := 10;
Monster[m_umber].Hit_Dice := 9;
Monster[m_umber].Ac := 2;
Monster[m_umber].Th0 := 12;
Monster[m_umber].Dam := 4;
Monster[m_umber].Num := 8;
Monster[m_umber].Special := 3;
Monster[m_umber].Min_Level := 18;
Monster[m_umber].Max_Level := 22;
Monster[m_umber].Sleep := 10;
Monster[m_umber].Large := true;
Monster[m_umber].XPVal := 85;
Monster[m_vampire].Long_Name := 'vampire ';
Monster[m_vampire].Name := 'V';
Monster[m_vampire].Len := 7;
Monster[m_vampire].Hit_Dice := 8;
Monster[m_vampire].Ac := 1;
Monster[m_vampire].Th0 := 12;
Monster[m_vampire].Dam := 2;
Monster[m_vampire].Num := 5;
Monster[m_vampire].Special := 3;
Monster[m_vampire].Min_Level := 19;
Monster[m_vampire].Max_Level := 24;
Monster[m_vampire].Sleep := 40;
Monster[m_vampire].Large := false;
Monster[m_vampire].XPVal := 90;
Monster[m_wraith].Long_Name := 'wraith ';
Monster[m_wraith].Name := 'W';
Monster[m_wraith].Len := 6;
Monster[m_wraith].Hit_Dice := 5;
Monster[m_wraith].Ac := 4;
Monster[m_wraith].Th0 := 15;
Monster[m_wraith].Dam := 6;
Monster[m_wraith].Num := 1;
Monster[m_wraith].Special := 3;
Monster[m_wraith].Min_Level := 13;
Monster[m_wraith].Max_Level := 17;
Monster[m_wraith].Sleep := 30;
Monster[m_wraith].Large := false;
Monster[m_wraith].XPVal := 55;
Monster[m_xorn].Long_Name := 'xorn ';
Monster[m_xorn].Name := 'X';
Monster[m_xorn].Len := 4;
Monster[m_xorn].Hit_Dice := 8;
Monster[m_xorn].Ac := -2;
Monster[m_xorn].Th0 := 12;
Monster[m_xorn].Dam := 8;
Monster[m_xorn].Num := 4;
Monster[m_xorn].Special := 1;
Monster[m_xorn].Min_Level := 17;
Monster[m_xorn].Max_Level := 23;
Monster[m_xorn].Sleep := 10;
Monster[m_xorn].Large := false;
Monster[m_xorn].XPVal := 75;
Monster[m_yeti].Long_Name := 'yeti ';
Monster[m_yeti].Name := 'Y';
Monster[m_yeti].Len := 4;
Monster[m_yeti].Hit_Dice := 4;