… | |
… | |
22 | |
22 | |
23 | $region = $region->parent |
23 | $region = $region->parent |
24 | or return cf::override 0; |
24 | or return cf::override 0; |
25 | } |
25 | } |
26 | |
26 | |
27 | my $portal = $spell->other_arch->instantiate; |
27 | my $portal = $spell->other_arch->instance; |
28 | |
28 | |
29 | $portal->name ("Magic Portal to nearest Town"); |
29 | $portal->name ("Magic Portal to nearest Town"); |
30 | $portal->slaying ($map); |
30 | $portal->slaying ($map); |
31 | $portal->stats->hp ($x); |
31 | $portal->stats->hp ($x); |
32 | $portal->stats->sp ($y); |
32 | $portal->stats->sp ($y); |
… | |
… | |
57 | my ($map, $x, $y, $uuid) = @{ $who->{town_portal} }; |
57 | my ($map, $x, $y, $uuid) = @{ $who->{town_portal} }; |
58 | |
58 | |
59 | $who->goto ($map, $x, $y, sub { |
59 | $who->goto ($map, $x, $y, sub { |
60 | my ($map) = @_; |
60 | my ($map) = @_; |
61 | |
61 | |
|
|
62 | $map->load; # make sure the map is loaded |
|
|
63 | |
62 | if (grep $_->uuid eq $uuid, $map->at ($x, $y)) { |
64 | if (grep $_->uuid eq $uuid, $map->at ($x, $y)) { |
63 | $who->reply (undef, "The town portal weaves its magic... and after a short moment, you return to the magic portal.", cf::NDI_NAVY); |
65 | $who->reply (undef, "The town portal weaves its magic... and after a short moment, you return to the magic portal.", cf::NDI_NAVY); |
64 | |
66 | |
65 | delete $who->{town_portal}; |
67 | delete $who->{town_portal}; |
66 | |
68 | |