… | |
… | |
154 | |
154 | |
155 | cf::override; |
155 | cf::override; |
156 | }, |
156 | }, |
157 | ; |
157 | ; |
158 | |
158 | |
|
|
159 | cf::attach_to_maps #TODO#d# remove, onyl for upgrading old to new nimbus |
|
|
160 | on_upgrade => sub { |
|
|
161 | my ($map) = @_; |
|
|
162 | |
|
|
163 | if ($map->path =~ /\/nimbus$/) { |
|
|
164 | warn "NIMBUS UPGRADE ", $map->path, "\n"; |
|
|
165 | |
|
|
166 | (grep length $_->slaying, $map->at (11, 1))[0]->attach (nimbus_exit => restore => 1); |
|
|
167 | |
|
|
168 | for my $x (37 .. 58) { |
|
|
169 | for my $y (32 .. 53) { |
|
|
170 | $_->remove for $map->at ($x, $y); |
|
|
171 | |
|
|
172 | my $portal = cf::object::new "well"; |
|
|
173 | |
|
|
174 | $portal->set_name ("free ride, courtesy of your friendly upgrade script"); |
|
|
175 | $portal->set_slaying ($map->path); |
|
|
176 | $portal->set_hp (1); |
|
|
177 | $portal->set_sp (1); |
|
|
178 | |
|
|
179 | $portal->insert_ob_in_map_at ($map, undef, cf::INS_ABOVE_FLOOR_ONLY, $x, $y); |
|
|
180 | } |
|
|
181 | } |
|
|
182 | } |
|
|
183 | }, |
|
|
184 | ; |
|
|
185 | |