… | |
… | |
7 | sub result { |
7 | sub result { |
8 | my ($ob, $status) = @_; |
8 | my ($ob, $status) = @_; |
9 | |
9 | |
10 | if (my $teleport = $ob->{options}{"teleport_$status"}) { |
10 | if (my $teleport = $ob->{options}{"teleport_$status"}) { |
11 | my ($x, $y, $damned) = split /,/, $teleport; |
11 | my ($x, $y, $damned) = split /,/, $teleport; |
12 | my $pl = cf::player::find $ob->{player}; |
12 | my $pl = cf::player::find_active $ob->{player}; |
13 | |
13 | |
14 | $pl->ob->transfer ($x, $y); |
14 | $pl->ob->transfer ($x, $y); |
15 | $pl->savebed ($pl->ob->map->path, $x, $y) |
15 | $pl->savebed ($pl->ob->map->path, $x, $y) |
16 | if $ob->{options}{"set_savebed_$status"}; |
16 | if $ob->{options}{"set_savebed_$status"}; |
17 | } |
17 | } |
… | |
… | |
60 | } |
60 | } |
61 | |
61 | |
62 | 1 |
62 | 1 |
63 | } |
63 | } |
64 | |
64 | |
65 | cf::register_attachment minesweeper => |
65 | cf::object::attachment minesweeper => |
66 | on_tick => sub { |
66 | on_tick => sub { |
67 | my ($self) = @_; |
67 | my ($self) = @_; |
68 | |
68 | |
69 | if (my $queue = $self->{queue}) { |
69 | if (my $queue = $self->{queue}) { |
70 | my $count = 4; |
70 | my $count = 4; |
… | |
… | |
117 | |
117 | |
118 | cf::override; |
118 | cf::override; |
119 | }, |
119 | }, |
120 | ; |
120 | ; |
121 | |
121 | |
122 | cf::register_attachment minesweeper_field => |
122 | cf::object::attachment minesweeper_field => |
123 | on_apply => sub { |
123 | on_apply => sub { |
124 | my ($ob, $who) = @_; |
124 | my ($ob, $who) = @_; |
125 | |
125 | |
126 | $ob->{meta}{player} = $who->name; |
126 | $ob->{meta}{player} = $who->name; |
127 | push @{$ob->{meta}{queue}}, $ob; |
127 | push @{$ob->{meta}{queue}}, $ob; |