--- cf.schmorp.de/maps/perl/nimbus.ext 2006/08/27 15:23:30 1.13 +++ cf.schmorp.de/maps/perl/nimbus.ext 2006/08/30 08:34:21 1.15 @@ -82,7 +82,7 @@ cf::localdir, cf::playerdir, $ob->name, "nimbus"; if ($ob->map->path ne $path) { - my $nimbus = cf::map::get_map "/schmorp/nimbus"; + my $nimbus = cf::map::find "/schmorp/nimbus"; $nimbus->set_path ($path); $nimbus->set_unique (1); @@ -156,3 +156,30 @@ }, ; +cf::attach_to_maps #TODO#d# remove, onyl for upgrading old to new nimbus + on_upgrade => sub { + my ($map) = @_; + + if ($map->path =~ /\/nimbus$/) { + warn "NIMBUS UPGRADE ", $map->path, "\n"; + + (grep length $_->slaying, $map->at (11, 1))[0]->attach (nimbus_exit => restore => 1); + + for my $x (37 .. 58) { + for my $y (32 .. 53) { + $_->remove for $map->at ($x, $y); + + my $portal = cf::object::new "well"; + + $portal->set_name ("free ride, courtesy of your friendly upgrade script"); + $portal->set_slaying ($map->path); + $portal->set_hp (1); + $portal->set_sp (1); + + $portal->insert_ob_in_map_at ($map, undef, cf::INS_ABOVE_FLOOR_ONLY, $x, $y); + } + } + } + }, +; +