-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewShared.pas
83 lines (63 loc) · 2.19 KB
/
ViewShared.pas
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
(*
Copyright (C) 2024 Jeffrey Getzin.
Licensed under the GNU General Public License v3.0 with additional terms.
See the LICENSE file in the repository root for details.
*)
[Inherit ('SYS$LIBRARY:STARLET','Types','SMGRTL','STRRTL')]Module ViewShared;
Const
debug = false;
Var
Rounds_Left: [External]Array [Spell_Name] of Unsigned;
Direction: [External]Direction_Type;
Maze: [External]Level;
(******************************************************************************)
[Global]Function Sight_Blocked (Exit: Exit_Type): Boolean;
Begin
Sight_Blocked:=Not debug and Not (Exit in [Transparent,Passage]);
End;
(******************************************************************************)
[Global]Function Is_Special (Spot: Room_Record): Boolean;
Begin
Is_Special:=(Maze.Special_Table[Spot.Contents].Special<>Nothing);
End;
(******************************************************************************)
[Global]Function Is_Stairs (Spot: Room_Record): Boolean;
Begin
Is_Stairs:=(Maze.Special_Table[Spot.Contents].Special=Stairs);
End;
(******************************************************************************)
[Global]Procedure Get_Bearings (Spot: Room_Record; Var Up,Down,Left,Right: Exit_Type);
Begin
Case Direction of
North: Begin
Up:=Spot.North;
Down:=Spot.South;
Left:=Spot.West;
Right:=Spot.East;
End;
South: Begin
Up:=Spot.South;
Down:=Spot.North;
Left:=Spot.East;
Right:=Spot.West;
End;
East: Begin
Up:=Spot.East;
Down:=Spot.West;
Left:=Spot.North;
Right:=Spot.South;
End;
West: Begin
Up:=Spot.West;
Down:=Spot.East;
Left:=Spot.South;
Right:=Spot.North;
End;
End;
End;
(******************************************************************************)
[Global]Function Has_Light: [Volatile]Boolean;
Begin
Has_Light:=debug or (Rounds_Left[Lght]>0) or (Rounds_Left[CoLi]>0);
End;
End. { View Shared }