ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-link.ext
Revision: 1.12
Committed: Wed May 4 07:36:40 2011 UTC (13 years ago) by root
Branch: MAIN
Changes since 1.11: +1 -1 lines
Log Message:
clean up in_memory handling

File Contents

# User Rev Content
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.10 $self->width (7);
15     $self->height (7);
16     $self->enter_x (1);
17     $self->enter_y (1);
18     $self->no_drop (1);
19     $self->no_reset (1);
20 root 1.2
21 root 1.5 $self->name ("interdimensional nothingness");
22 root 1.2
23 root 1.1 $self->alloc;
24 root 1.12 $self->in_memory (cf::MAP_INACTIVE);
25 root 1.1
26 root 1.10 # provide a floor
27     my $floor = cf::object::new "dirtfloor";
28     Guard::scope_guard { $floor->destroy };
29    
30     $floor->name ("{link}");
31     for my $x (0..6) {
32     for my $y (0 .. 6) {
33     $self->insert ($floor->clone, $x, $y);
34     }
35     }
36    
37 root 1.1 # provide some exits "home"
38     my $exit = cf::object::new "exit";
39 root 1.8 Guard::scope_guard { $exit->destroy };
40 root 1.1
41 root 1.9 # these teleporters exist in case a player gets stuck
42 root 1.1 $exit->slaying ($cf::EMERGENCY_POSITION->[0]);
43     $exit->stats->hp ($cf::EMERGENCY_POSITION->[1]);
44     $exit->stats->sp ($cf::EMERGENCY_POSITION->[2]);
45    
46 root 1.10 $self->insert ($exit->clone, 2, 2);
47     $self->insert ($exit->clone, 2, 3);
48     $self->insert ($exit->clone, 2, 4);
49     $self->insert ($exit->clone, 3, 2);
50     $self->insert ($exit->clone, 3, 4);
51     $self->insert ($exit->clone, 4, 2);
52     $self->insert ($exit->clone, 4, 3);
53     $self->insert ($exit->clone, 4, 4);
54 root 1.1
55     $self->{deny_save} = 1;
56     $self->{deny_reset} = 1;
57    
58 root 1.3 $self->activate;
59    
60 root 1.1 1
61     }
62