… | |
… | |
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 $ob->{player}; |
13 | |
13 | |
14 | $pl->ob->transfer ($x, $y); |
14 | $pl->ob->transfer ($x, $y); |
15 | $pl->set_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 | } |
18 | } |
18 | } |
19 | |
19 | |
20 | sub apply { |
20 | sub apply { |
… | |
… | |
92 | my $map = $self->{map} = []; |
92 | my $map = $self->{map} = []; |
93 | |
93 | |
94 | for my $x (0 .. $arg{width} - 1) { |
94 | for my $x (0 .. $arg{width} - 1) { |
95 | for my $y (0 .. $arg{height} - 1) { |
95 | for my $y (0 .. $arg{height} - 1) { |
96 | my $ob = $map->[$x][$y] = cf::object::new "minesweeper-unknown"; |
96 | my $ob = $map->[$x][$y] = cf::object::new "minesweeper-unknown"; |
97 | $ob->set_name ("apply to try your luck or intelligence"); |
97 | $ob->name ("apply to try your luck or intelligence"); |
98 | Scalar::Util::weaken ($ob->{meta} = $self); |
98 | Scalar::Util::weaken ($ob->{meta} = $self); |
99 | |
99 | |
100 | $ob->attach ("minesweeper_field"); |
100 | $ob->attach ("minesweeper_field"); |
101 | $ob->insert_ob_in_map_at ($self->map, undef, cf::INS_ABOVE_FLOOR_ONLY, |
101 | $ob->insert_ob_in_map_at ($self->map, undef, cf::INS_ABOVE_FLOOR_ONLY, |
102 | $self->x + $x, $self->y + $y); |
102 | $self->x + $x, $self->y + $y); |