1 |
root |
1.4 |
#! perl # mandatory |
2 |
root |
1.1 |
|
3 |
root |
1.9 |
# this is the map type for the {link} map, a singleton |
4 |
|
|
# this is the only map in the server that is guaranteed to exit |
5 |
|
|
# at all times without blocking, and this is ensured by not relying |
6 |
|
|
# on any external files. |
7 |
|
|
|
8 |
root |
1.1 |
cf::map->register (qr{^\{link\}}); |
9 |
|
|
|
10 |
|
|
sub load_header { |
11 |
|
|
my ($self) = @_; |
12 |
|
|
|
13 |
|
|
# singleton :/ |
14 |
root |
1.2 |
$self->width (21); |
15 |
|
|
$self->height (21); |
16 |
root |
1.7 |
$self->no_drop (1); |
17 |
root |
1.2 |
|
18 |
root |
1.5 |
$self->name ("interdimensional nothingness"); |
19 |
root |
1.2 |
|
20 |
root |
1.1 |
$self->alloc; |
21 |
root |
1.6 |
$self->in_memory (cf::MAP_ACTIVE); |
22 |
root |
1.1 |
|
23 |
|
|
# provide some exits "home" |
24 |
|
|
my $exit = cf::object::new "exit"; |
25 |
root |
1.8 |
Guard::scope_guard { $exit->destroy }; |
26 |
root |
1.1 |
|
27 |
root |
1.9 |
# these teleporters exist in case a player gets stuck |
28 |
root |
1.1 |
$exit->slaying ($cf::EMERGENCY_POSITION->[0]); |
29 |
|
|
$exit->stats->hp ($cf::EMERGENCY_POSITION->[1]); |
30 |
|
|
$exit->stats->sp ($cf::EMERGENCY_POSITION->[2]); |
31 |
|
|
|
32 |
root |
1.2 |
$self->insert ($exit->clone, 9, 9); |
33 |
|
|
$self->insert ($exit->clone, 9, 10); |
34 |
|
|
$self->insert ($exit->clone, 9, 11); |
35 |
|
|
$self->insert ($exit->clone, 10, 9); |
36 |
|
|
$self->insert ($exit->clone, 10, 11); |
37 |
|
|
$self->insert ($exit->clone, 11, 9); |
38 |
|
|
$self->insert ($exit->clone, 11, 10); |
39 |
|
|
$self->insert ($exit->clone, 11, 11); |
40 |
root |
1.1 |
|
41 |
|
|
$self->{deny_save} = 1; |
42 |
|
|
$self->{deny_reset} = 1; |
43 |
|
|
|
44 |
root |
1.3 |
$self->activate; |
45 |
|
|
|
46 |
root |
1.1 |
1 |
47 |
|
|
} |
48 |
|
|
|
49 |
|
|
1 |
50 |
|
|
|