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