ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-link.ext
Revision: 1.9
Committed: Sat Mar 20 02:24:38 2010 UTC (14 years, 2 months ago) by root
Branch: MAIN
Changes since 1.8: +6 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #! perl # mandatory
2
3 # 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 cf::map->register (qr{^\{link\}});
9
10 sub load_header {
11 my ($self) = @_;
12
13 # singleton :/
14 $self->width (21);
15 $self->height (21);
16 $self->no_drop (1);
17
18 $self->name ("interdimensional nothingness");
19
20 $self->alloc;
21 $self->in_memory (cf::MAP_ACTIVE);
22
23 # provide some exits "home"
24 my $exit = cf::object::new "exit";
25 Guard::scope_guard { $exit->destroy };
26
27 # these teleporters exist in case a player gets stuck
28 $exit->slaying ($cf::EMERGENCY_POSITION->[0]);
29 $exit->stats->hp ($cf::EMERGENCY_POSITION->[1]);
30 $exit->stats->sp ($cf::EMERGENCY_POSITION->[2]);
31
32 $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
41 $self->{deny_save} = 1;
42 $self->{deny_reset} = 1;
43
44 $self->activate;
45
46 1
47 }
48
49 1
50