ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/magic_mapping.ext
(Generate patch)

Comparing deliantra/server/ext/magic_mapping.ext (file contents):
Revision 1.1 by root, Wed Nov 4 17:24:00 2009 UTC vs.
Revision 1.2 by root, Wed Nov 4 18:17:57 2009 UTC

16 or return; 16 or return;
17 17
18 my $bird = cf::object::new "magic_mapper"; 18 my $bird = cf::object::new "magic_mapper";
19 my $pl = $caster->contr; 19 my $pl = $caster->contr;
20 my $dist = 0; 20 my $dist = 0;
21 $caster->speed_left (-1000); 21 $caster->speed_left (-1); $pl->fire_on (0); $pl->run_on (0);
22
23 my $duration = $who->casting_level ($spell) * 150 / 100;
22 24
23 $pl->ns->async (sub { 25 $pl->ns->async (sub {
24 while (++$dist < 100) { 26 while (++$dist < $duration && $bird->valid) {
25 my $phi = 2 * $dist ** .5; 27 my $phi = 2 * $dist ** .5;
26 my $dx = (sin $phi) * $phi * 2; 28 my $dx = (sin $phi) * $phi * 2;
27 my $dy = (cos $phi) * $phi * 2; 29 my $dy = (cos $phi) * $phi * 2;
28 30
29 warn "a\n";#d#
30 warn $bird->insert_ob_in_map_at ($map, $caster, cf::INS_ON_TOP, $x + $dx, $y + $dy); 31 $bird->insert_ob_in_map_at ($map, $caster, cf::INS_ON_TOP, $x + $dx, $y + $dy)
31 warn "b\n";#d# 32 or last;
32 last unless $bird->valid;
33 warn "c\n";#d#
34 33
35 $pl->set_viewpoint ($bird); 34 $pl->set_viewpoint ($bird);
36 $caster->speed_left (-1000); 35 $caster->speed_left (-1);
37 cf::wait_for_tick; 36 cf::wait_for_tick;
38 } 37 }
39 38
40 $pl->set_viewpoint (undef); 39 $pl->set_viewpoint (undef);
41 $caster->speed_left (0); 40 $caster->speed_left (0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines