ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/follow.ext
(Generate patch)

Comparing deliantra/maps/perl/follow.ext (file contents):
Revision 1.19 by root, Sun Jul 16 17:52:57 2006 UTC vs.
Revision 1.24 by root, Fri Sep 8 17:33:55 2006 UTC

13 && abs ($pl->ob->x - $x) <= 1 13 && abs ($pl->ob->x - $x) <= 1
14 && abs ($pl->ob->y - $y) <= 1; 14 && abs ($pl->ob->y - $y) <= 1;
15 15
16 my $portal = cf::object::new "exit"; 16 my $portal = cf::object::new "exit";
17 17
18 $portal->set_slaying ($map); 18 $portal->slaying ($map);
19 $portal->set_hp ($x); 19 $portal->stats->hp ($x);
20 $portal->set_sp ($y); 20 $portal->stats->sp ($y);
21 21
22 $portal->apply ($pl->ob); 22 $portal->apply ($pl->ob);
23 23
24 $portal->free; 24 $portal->free;
25} 25}
39 @$his = ($map, $x, $y); 39 @$his = ($map, $x, $y);
40 } 40 }
41 41
42 my $map; 42 my $map;
43 43
44 if ($map = cf::map::map $mine->[0] 44 if ($map = cf::map::find $mine->[0]
45 and !grep $_->flag (cf::FLAG_UNIQUE) && $_->flag (cf::FLAG_IS_FLOOR), 45 and !grep $_->flag (cf::FLAG_UNIQUE) && $_->flag (cf::FLAG_IS_FLOOR),
46 $map->at ($mine->[1], $mine->[2])) { 46 $map->at ($mine->[1], $mine->[2])) {
47 teleport $who, @$mine; 47 teleport $who, @$mine;
48 } else { 48 } else {
49 delete $follow{$name}; 49 delete $follow{$name};
88 $who->message ("follow mode off"); 88 $who->message ("follow mode off");
89 delete $follow{$name}; 89 delete $follow{$name};
90 } 90 }
91}; 91};
92 92
93sub on_player_death { 93cf::attach_to_players
94 on_death => sub {
94 my ($ob) = @_; 95 my ($pl) = @_;
95 96
96 my $name = $ob->name; 97 my $name = $pl->ob->name;
97 98
98 delete $follow{$name}; 99 delete $follow{$name};
99 100
100 while (my ($k, $v) = each %follow) { 101 while (my ($k, $v) = each %follow) {
101 if ($v->[0] eq $name) { 102 if ($v->[0] eq $name) {
102 delete $follow{$k}; 103 delete $follow{$k};
104 }
103 } 105 }
104 } 106 },
105 107;
106 0
107}
108 108
109 109
110 110
111 111

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines