line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Rezrov::ZStatus; |
2
|
|
|
|
|
|
|
# all info required to refresh the status line; see spec 8.2 |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
|
|
11
|
use Games::Rezrov::MethodMaker ([], |
5
|
|
|
|
|
|
|
qw( |
6
|
|
|
|
|
|
|
score |
7
|
|
|
|
|
|
|
moves |
8
|
|
|
|
|
|
|
hours |
9
|
|
|
|
|
|
|
minutes |
10
|
|
|
|
|
|
|
time_game |
11
|
|
|
|
|
|
|
score_game |
12
|
|
|
|
|
|
|
location |
13
|
1
|
|
|
1
|
|
6
|
)); |
|
1
|
|
|
|
|
1
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
7
|
use Games::Rezrov::Inliner; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
316
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $INLINE_CODE = ' |
20
|
|
|
|
|
|
|
sub update () { |
21
|
|
|
|
|
|
|
# refresh information required for status line. |
22
|
|
|
|
|
|
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# get the current location: |
25
|
|
|
|
|
|
|
my $object_id = get_global(0); |
26
|
|
|
|
|
|
|
# 8.2.2.1 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $zobj = new Games::Rezrov::ZObject($object_id); |
29
|
|
|
|
|
|
|
# FIX ME: use cache |
30
|
|
|
|
|
|
|
$self->location(${$zobj->print(Games::Rezrov::StoryFile::ztext())}); |
31
|
|
|
|
|
|
|
# die "loc = $location"; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $g1 = get_global(1); |
34
|
|
|
|
|
|
|
my $g2 = get_global(2); |
35
|
|
|
|
|
|
|
if ($self->time_game()) { |
36
|
|
|
|
|
|
|
$self->hours($g1); |
37
|
|
|
|
|
|
|
$self->minutes($g2); |
38
|
|
|
|
|
|
|
} else { |
39
|
|
|
|
|
|
|
$self->score(SIGNED_WORD($g1)); |
40
|
|
|
|
|
|
|
$self->moves($g2); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
'; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Games::Rezrov::Inliner::inline(\$INLINE_CODE); |
46
|
|
|
|
|
|
|
#print $INLINE_CODE; |
47
|
|
|
|
|
|
|
#die; |
48
|
0
|
0
|
|
0
|
0
|
0
|
eval $INLINE_CODE; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
49
|
|
|
|
|
|
|
undef $INLINE_CODE; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub new { |
52
|
1
|
|
|
1
|
0
|
2
|
my $self = []; |
53
|
1
|
|
|
|
|
4
|
bless $self, shift; |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
37
|
$self->hours(0); |
56
|
1
|
|
|
|
|
30
|
$self->minutes(0); |
57
|
1
|
|
|
|
|
28
|
$self->moves(0); |
58
|
1
|
|
|
|
|
26
|
$self->score(0); |
59
|
1
|
|
|
|
|
30
|
$self->time_game(0); |
60
|
1
|
|
|
|
|
30
|
$self->score_game(0); |
61
|
|
|
|
|
|
|
|
62
|
1
|
50
|
|
|
|
7
|
if (Games::Rezrov::StoryFile::header()->is_time_game()) { |
63
|
0
|
|
|
|
|
0
|
$self->time_game(1); |
64
|
|
|
|
|
|
|
} else { |
65
|
1
|
|
|
|
|
28
|
$self->score_game(1); |
66
|
|
|
|
|
|
|
} |
67
|
1
|
|
|
|
|
4
|
return $self; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub get_global { |
71
|
0
|
|
|
0
|
0
|
|
return Games::Rezrov::StoryFile::get_global_var($_[0]); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |