Games-RolePlay-MapGen
view release on metacpan or search on metacpan
MapGen/Editor.pm view on Meta::CPAN
disable => { generator => sub { $_[0] ne "Basic" } },
fixes => [sub { $_[0] =~ s/\s+//g }],
matches => [qr/^\d+x\d+$/] },
{ mnemonic => "Open Room-Corridor: ",
type => "text",
desc => "The %-chance of a door occuring between a room tile and a corridor tile where there is already an opening. The percentages are listed as a four touple: door-chance, secret, stuck, locked (e.g., 95,2,25,50 means there's a 95% c...
name => 'open_room_corridor_door_percent',
default => '95, 2, 25, 50',
disable => { generator_plugins => sub { (grep {$_ eq "BasicDoors"} @{$_[0]}) ? 0:1 } },
convert => sub { my @a = split m/\D+/, $_[0]; { door=>$a[0], secret=>$a[1], stuck=>$a[2], locked=>$a[3] } },
trevnoc => sub { join(", ", @{$_[0]}{qw( door secret stuck locked )}) },
matches => [sub { (grep {$_ >= 0 and $_ <= 100} $_[0] =~ m/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)$/) == 4 }],
fixes => [sub { $_[0] =~ s/[^\d,\s]+//g }], },
{ mnemonic => "Closed Room-Corridor: ",
type => "text",
desc => "The %-chance of a door occuring between a room tile and a corridor tile where there isn't an opening. The percentages are listed as a four touple: door-chance, secret, stuck, locked.",
name => 'closed_room_corridor_door_percent',
default => '5, 95, 10, 30',
disable => { generator_plugins => sub { (grep {$_ eq "BasicDoors"} @{$_[0]}) ? 0:1 } },
convert => sub { my @a = split m/\D+/, $_[0]; { door=>$a[0], secret=>$a[1], stuck=>$a[2], locked=>$a[3] } },
trevnoc => sub { join(", ", @{$_[0]}{qw( door secret stuck locked )}) },
matches => [sub { (grep {$_ >= 0 and $_ <= 100} $_[0] =~ m/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)$/) == 4 }],
fixes => [sub { $_[0] =~ s/[^\d,\s]+//g }], },
{ mnemonic => "Open Corridor-Corridor: ",
type => "text",
desc => "The %-chance of a door occuring between a corridor tile and a corridor tile where there is already an opening. The percentages are listed as a four touple: door-chance, secret, stuck, locked.",
name => 'open_corridor_corridor_door_percent',
default => '1, 10, 25, 50',
disable => { generator_plugins => sub { (grep {$_ eq "BasicDoors"} @{$_[0]}) ? 0:1 } },
convert => sub { my @a = split m/\D+/, $_[0]; { door=>$a[0], secret=>$a[1], stuck=>$a[2], locked=>$a[3] } },
trevnoc => sub { join(", ", @{$_[0]}{qw( door secret stuck locked )}) },
matches => [sub { (grep {$_ >= 0 and $_ <= 100} $_[0] =~ m/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)$/) == 4 }],
fixes => [sub { $_[0] =~ s/[^\d,\s]+//g }], },
{ mnemonic => "Closed Corridor-Corridor: ",
type => "text",
desc => "The %-chance of a door occuring between a corridor tile and a corridor tile where there isn't an opening. The percentages are listed as a four touple: door-chance, secret, stuck, locked.",
name => 'closed_corridor_corridor_door_percent',
default => '1, 95, 10, 30',
disable => { generator_plugins => sub { (grep {$_ eq "BasicDoors"} @{$_[0]}) ? 0:1 } },
convert => sub { my @a = split m/\D+/, $_[0]; { door=>$a[0], secret=>$a[1], stuck=>$a[2], locked=>$a[3] } },
trevnoc => sub { join(", ", @{$_[0]}{qw( door secret stuck locked )}) },
matches => [sub { (grep {$_ >= 0 and $_ <= 100} $_[0] =~ m/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)$/) == 4 }],
fixes => [sub { $_[0] =~ s/[^\d,\s]+//g }], },
{ mnemonic => "Max Span: ",
type => "text",
desc => "The door dropper will close spans larger than a single tile in order to drop a door. This is the maximum sized span that it will close.",
name => 'max_span',
default => '50',
disable => { generator_plugins => sub { (grep {$_ eq "BasicDoors"} @{$_[0]}) ? 0:1 } },
MapGen/Generator/XMLImport.pm view on Meta::CPAN
for my $tile_group ($tilegroups->get_nodelist) {
my $t_name = $xp->findvalue( '@name' => $tile_group )->value;
my $t_type = $xp->findvalue( '@type' => $tile_group )->value;
my $group = &_group;
$group->name( $t_name );
$group->type( $t_type );
my $rectangles = $tile_group->find('rectangle');
for my $rec ($rectangles->get_nodelist) {
my @r_loc = split m/,/, $xp->findvalue( '@loc' => $rec );
my @r_size = split m/x/, $xp->findvalue( '@size' => $rec );
$group->add_rectangle(\@r_loc, \@r_size, $map);
}
push @$groups, $group;
}
$map = new Games::RolePlay::MapGen::_interconnected_map( $map );
return ($map, $groups);
( run in 0.936 second using v1.01-cache-2.11-cpan-71847e10f99 )