File Coverage

blib/lib/Games/Rezrov/ZOptions.pm
Criterion Covered Total %
statement 18 31 58.0
branch 17 56 30.3
condition 0 3 0.0
subroutine 16 28 57.1
pod 0 27 0.0
total 51 145 35.1


line stmt bran cond sub pod time code
1             # static flags for optional behaviors; set in "rezrov"
2              
3             package Games::Rezrov::ZOptions;
4              
5 1     1   525 use strict;
  1         2  
  1         798  
6              
7             my $INTERPRETER_ID = 6;
8             my $TANDY_BIT = 0;
9              
10             my $SNOOP_OBJECTS = 0;
11             my $SNOOP_PROPERTIES = 0;
12             my $SNOOP_ATTR_TEST = 0;
13             my $SNOOP_ATTR_SET = 0;
14             my $SNOOP_ATTR_CLEAR = 0;
15              
16             my $BEAUTIFY_LOCATIONS = 1;
17             my $HIGHLIGHT_OBJECTS = 0;
18              
19             my $GUESS_TITLE = 1;
20             my $MAXIMUM_SCROLLING = 0;
21              
22             my $CORRECT_TYPOS = 1;
23             # attempt to autocorrect typos a-la Nitfol
24              
25             my $EMULATE_NOTIFY = 1;
26             # whether to emulate the "notify" score-notification command.
27             # useful when playing games without a status line (ie ZIO_dumb.pm)
28              
29             my $NOTIFICATION_ON = 1;
30             # default startup state
31              
32             my $EMULATE_OOPS = 1;
33             # whether to emulate the "oops" command for games that do not
34             # implement it
35              
36             my $EMULATE_UNDO = 1;
37             # whether to emulate the "undo" command for games that do not support it
38              
39             my $UNDO_SLOTS = 10;
40             # how many turns can we undo by default?
41              
42             my $ALIASES = 1;
43             # for games that don't support them, alias:
44             # "x" to "examine"
45             # "g" to "again"
46             # "z" to "wait"
47             # "o" to "oops"
48              
49             my $EMULATE_COMMAND_SCRIPT = 1;
50             # emulate the "#reco" and "#unre" commands for games that do not
51             # support them
52              
53             my $COUNT_OPCODES = 0;
54             # print a count and summary of opcodes executed between inputs
55              
56             my $WRITE_OPCODES = 0;
57             # write a report of opcodes being executed
58              
59             my $MAGIC = 1;
60             # allow fun new words: "pilfer", "teleport", "bamf", "lingo", etc.
61              
62             my $SHAMELESS = 1;
63             # allow shameless self-promotion
64              
65             my $EMULATE_HELP = 1;
66             # pay attention to the "help" command
67              
68             my $TIME_24 = 0;
69             # in "time games", show time in 24-hour format rather than AM/PM
70              
71             my $PLAYBACK_DIE = 0;
72             # whether to exit after running a script file (for benchmarking)
73              
74             my $END_OF_SESSION_MESSAGE = 1;
75             # display "end of session" message and pause when interpreter exits
76              
77             1;
78              
79             sub notifying {
80 0 0   0 0 0 $NOTIFICATION_ON = $_[0] if @_;
81 0 0 0     0 return ($EMULATE_NOTIFY and $NOTIFICATION_ON) ? 1 : 0;
82             }
83              
84             sub SNOOP_OBJECTS {
85 4 50   4 0 22 return (defined $_[0] ? $SNOOP_OBJECTS = $_[0] : $SNOOP_OBJECTS);
86             }
87              
88             sub SNOOP_PROPERTIES {
89 14 50   14 0 383 return (defined $_[0] ? $SNOOP_PROPERTIES = $_[0] : $SNOOP_PROPERTIES);
90             }
91              
92             sub SNOOP_ATTR_TEST {
93 63 50   63 0 1688 return (defined $_[0] ? $SNOOP_ATTR_TEST = $_[0] : $SNOOP_ATTR_TEST);
94             }
95              
96             sub SNOOP_ATTR_SET {
97 8 50   8 0 416 return (defined $_[0] ? $SNOOP_ATTR_SET = $_[0] : $SNOOP_ATTR_SET);
98             }
99              
100             sub SNOOP_ATTR_CLEAR {
101 3 50   3 0 184 return (defined $_[0] ? $SNOOP_ATTR_CLEAR = $_[0] : $SNOOP_ATTR_CLEAR);
102             }
103              
104             sub BEAUTIFY_LOCATIONS {
105 20 50   20 0 185 return (defined $_[0] ? $BEAUTIFY_LOCATIONS = $_[0] : $BEAUTIFY_LOCATIONS);
106             }
107              
108             sub GUESS_TITLE {
109 5 100   5 0 32 return (defined $_[0] ? $GUESS_TITLE = $_[0] : $GUESS_TITLE);
110             }
111              
112             sub MAXIMUM_SCROLLING {
113 0 0   0 0 0 return (defined $_[0] ? $MAXIMUM_SCROLLING = $_[0] : $MAXIMUM_SCROLLING);
114             }
115              
116             sub EMULATE_NOTIFY {
117 0 0   0 0 0 return (defined $_[0] ? $EMULATE_NOTIFY = $_[0] : $EMULATE_NOTIFY);
118             }
119              
120             sub EMULATE_OOPS {
121 0 0   0 0 0 return (defined $_[0] ? $EMULATE_OOPS = $_[0] : $EMULATE_OOPS);
122             }
123              
124             sub EMULATE_UNDO {
125 9 50   9 0 78 return (defined $_[0] ? $EMULATE_UNDO = $_[0] : $EMULATE_UNDO);
126             }
127              
128             sub ALIASES {
129 0 0   0 0 0 return (defined $_[0] ? $ALIASES = $_[0] : $ALIASES);
130             }
131              
132             sub COUNT_OPCODES {
133 2 50   2 0 36 return (defined $_[0] ? $COUNT_OPCODES = $_[0] : $COUNT_OPCODES);
134             }
135              
136             sub WRITE_OPCODES {
137 2 50   2 0 20 return (defined $_[0] ? $WRITE_OPCODES = $_[0] : $WRITE_OPCODES);
138             }
139              
140             sub MAGIC {
141 0 0   0 0 0 return (defined $_[0] ? $MAGIC = $_[0] : $MAGIC);
142             }
143              
144             sub HIGHLIGHT_OBJECTS {
145 4 50   4 0 16 return (defined $_[0] ? $HIGHLIGHT_OBJECTS = $_[0] : $HIGHLIGHT_OBJECTS);
146             }
147              
148             sub INTERPRETER_ID {
149 0 0   0 0 0 return (defined $_[0] ? $INTERPRETER_ID = $_[0] : $INTERPRETER_ID);
150             }
151              
152             sub TANDY_BIT {
153 1 50   1 0 27 return (defined $_[0] ? $TANDY_BIT = $_[0] : $TANDY_BIT);
154             }
155              
156             sub UNDO_SLOTS {
157 4 50   4 0 24 return (defined $_[0] ? $UNDO_SLOTS = $_[0] : $UNDO_SLOTS);
158             }
159              
160             sub EMULATE_COMMAND_SCRIPT {
161 0 0   0 0 0 return (defined $_[0] ? $EMULATE_COMMAND_SCRIPT = $_[0] : $EMULATE_COMMAND_SCRIPT);
162             }
163              
164             sub SHAMELESS {
165 0 0   0 0 0 return (defined $_[0] ? $SHAMELESS = $_[0] : $SHAMELESS);
166             }
167              
168             sub EMULATE_HELP {
169 0 0   0 0 0 return (defined $_[0] ? $EMULATE_HELP = $_[0] : $EMULATE_HELP);
170             }
171              
172             sub TIME_24 {
173 0 0   0 0 0 return (defined $_[0] ? $TIME_24 = $_[0] : $TIME_24);
174             }
175              
176             sub PLAYBACK_DIE {
177 0 0   0 0 0 return (defined $_[0] ? $PLAYBACK_DIE = $_[0] : $PLAYBACK_DIE);
178             }
179              
180             sub END_OF_SESSION_MESSAGE {
181 2 100   2 0 45 return (defined $_[0] ? $END_OF_SESSION_MESSAGE = $_[0] : $END_OF_SESSION_MESSAGE);
182             }
183              
184             sub CORRECT_TYPOS {
185 4 50   4 0 20 return (defined $_[0] ? $CORRECT_TYPOS = $_[0] : $CORRECT_TYPOS);
186             }
187              
188