… | |
… | |
472 | } |
472 | } |
473 | |
473 | |
474 | # escape the /'s in the path |
474 | # escape the /'s in the path |
475 | sub _escaped_path { |
475 | sub _escaped_path { |
476 | (my $path = $_[0]{path}) =~ s/\//$PATH_SEP/g; |
476 | (my $path = $_[0]{path}) =~ s/\//$PATH_SEP/g; |
|
|
477 | |
477 | $path |
478 | $path |
478 | } |
479 | } |
479 | |
480 | |
480 | # the original (read-only) location |
481 | # the original (read-only) location |
481 | sub load_path { |
482 | sub load_path { |
… | |
… | |
486 | |
487 | |
487 | # the temporary/swap location |
488 | # the temporary/swap location |
488 | sub save_path { |
489 | sub save_path { |
489 | my ($self) = @_; |
490 | my ($self) = @_; |
490 | |
491 | |
|
|
492 | $self->{user_rel} |
491 | $self->{user_rel} ? sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $self->_escaped_path |
493 | ? sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $self->_escaped_path |
492 | : $self->{random} ? sprintf "%s/%s", $RANDOM_MAPS, $self->{path} |
|
|
493 | : sprintf "%s/%s/%s", cf::localdir, cf::tmpdir, $self->_escaped_path |
494 | : sprintf "%s/%s/%s", cf::localdir, cf::tmpdir, $self->_escaped_path |
494 | } |
495 | } |
495 | |
496 | |
496 | # the unique path, undef == no special unique path |
497 | # the unique path, undef == no special unique path |
497 | sub uniq_path { |
498 | sub uniq_path { |
498 | my ($self) = @_; |
499 | my ($self) = @_; |
… | |
… | |
1265 | |
1266 | |
1266 | sub generate_random_map { |
1267 | sub generate_random_map { |
1267 | my ($path, $rmp) = @_; |
1268 | my ($path, $rmp) = @_; |
1268 | |
1269 | |
1269 | # mit "rum" bekleckern, nicht |
1270 | # mit "rum" bekleckern, nicht |
1270 | cf::map::_create_random_map |
1271 | cf::map::_create_random_map ( |
1271 | $path, |
1272 | $path, |
1272 | $rmp->{wallstyle}, $rmp->{wall_name}, $rmp->{floorstyle}, $rmp->{monsterstyle}, |
1273 | $rmp->{wallstyle}, $rmp->{wall_name}, $rmp->{floorstyle}, $rmp->{monsterstyle}, |
1273 | $rmp->{treasurestyle}, $rmp->{layoutstyle}, $rmp->{doorstyle}, $rmp->{decorstyle}, |
1274 | $rmp->{treasurestyle}, $rmp->{layoutstyle}, $rmp->{doorstyle}, $rmp->{decorstyle}, |
1274 | $rmp->{origin_map}, $rmp->{final_map}, $rmp->{exitstyle}, $rmp->{this_map}, |
1275 | $rmp->{origin_map}, $rmp->{final_map}, $rmp->{exitstyle}, $rmp->{this_map}, |
1275 | $rmp->{exit_on_final_map}, |
1276 | $rmp->{exit_on_final_map}, |
… | |
… | |
1277 | $rmp->{expand2x}, $rmp->{layoutoptions1}, $rmp->{layoutoptions2}, $rmp->{layoutoptions3}, |
1278 | $rmp->{expand2x}, $rmp->{layoutoptions1}, $rmp->{layoutoptions2}, $rmp->{layoutoptions3}, |
1278 | $rmp->{symmetry}, $rmp->{difficulty}, $rmp->{difficulty_given}, $rmp->{difficulty_increase}, |
1279 | $rmp->{symmetry}, $rmp->{difficulty}, $rmp->{difficulty_given}, $rmp->{difficulty_increase}, |
1279 | $rmp->{dungeon_level}, $rmp->{dungeon_depth}, $rmp->{decoroptions}, $rmp->{orientation}, |
1280 | $rmp->{dungeon_level}, $rmp->{dungeon_depth}, $rmp->{decoroptions}, $rmp->{orientation}, |
1280 | $rmp->{origin_y}, $rmp->{origin_x}, $rmp->{random_seed}, $rmp->{total_map_hp}, |
1281 | $rmp->{origin_y}, $rmp->{origin_x}, $rmp->{random_seed}, $rmp->{total_map_hp}, |
1281 | $rmp->{map_layout_style}, $rmp->{treasureoptions}, $rmp->{symmetry_used}, |
1282 | $rmp->{map_layout_style}, $rmp->{treasureoptions}, $rmp->{symmetry_used}, |
1282 | (cf::region::find $rmp->{region}) |
1283 | (cf::region::find $rmp->{region}), $rmp->{custom} |
|
|
1284 | ) |
1283 | } |
1285 | } |
1284 | |
1286 | |
1285 | # and all this just because we cannot iterate over |
1287 | # and all this just because we cannot iterate over |
1286 | # all maps in C++... |
1288 | # all maps in C++... |
1287 | sub change_all_map_light { |
1289 | sub change_all_map_light { |