ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/minesweeper.ext
(Generate patch)

Comparing deliantra/maps/perl/minesweeper.ext (file contents):
Revision 1.5 by root, Sat Mar 25 04:47:56 2006 UTC vs.
Revision 1.7 by root, Fri Mar 31 22:47:19 2006 UTC

53 unless $bombs; 53 unless $bombs;
54 54
55 $who->remove; 55 $who->remove;
56 $who->free; 56 $who->free;
57 } 57 }
58
59 1
58} 60}
59 61
60sub on_time { 62sub on_time {
61 my ($event) = @_; 63 my ($event, $who) = @_;
62
63 my $who = $event->{who};
64 64
65 if (my $queue = $who->{queue}) { 65 if (my $queue = $who->{queue}) {
66 my $count = 4; 66 my $count = 4;
67 67
68 while (@$queue) { 68 while (@$queue) {
80 $count-- 80 $count--
81 or last; 81 or last;
82 } 82 }
83 } else { 83 } else {
84 # generate minesweeper field 84 # generate minesweeper field
85 my %arg = split /(?:\s+|=)/, $event->{options}; 85 my %arg = split /(?:\s+|=)/, $event->options;
86 86
87 $who->{options} = \%arg; 87 $who->{options} = \%arg;
88 $who->{queue} = []; 88 $who->{queue} = [];
89 89
90 my $map = $who->{map} = []; 90 my $map = $who->{map} = [];
118 } 118 }
119 } 119 }
120} 120}
121 121
122sub on_apply { 122sub on_apply {
123 my ($event) = @_; 123 my ($event, $ob, $who) = @_;
124 124
125 my $who = $event->{who};
126 my $activator = $event->{activator};
127
128 $who->{meta}{player} = $activator->name; 125 $ob->{meta}{player} = $who->name;
129 push @{$who->{meta}{queue}}, $who; 126 push @{$ob->{meta}{queue}}, $ob;
130 127
131 1 128 1
132} 129}
133 130
134 131

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines