line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::EmpyrionBlueprint; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:GETTY'; |
3
|
|
|
|
|
|
|
$App::EmpyrionBlueprint::VERSION = '0.001'; |
4
|
1
|
|
|
1
|
|
930
|
use Empyrion::Base; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use MooX::Options; |
6
|
|
|
|
|
|
|
use Empyrion::Blueprint; |
7
|
|
|
|
|
|
|
use DDP; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
option 'spawn_group' => ( |
10
|
|
|
|
|
|
|
is => 'ro', |
11
|
|
|
|
|
|
|
format => 's', |
12
|
|
|
|
|
|
|
predicate => 1, |
13
|
|
|
|
|
|
|
doc => 'set a new spawn group to the blueprint', |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
option 'no_spawn_group' => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
negativable => 0, |
19
|
|
|
|
|
|
|
doc => 'unset existing spawn group', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
option 'z_position' => ( |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
format => 's', |
25
|
|
|
|
|
|
|
predicate => 1, |
26
|
|
|
|
|
|
|
doc => 'set new z position for the blueprint', |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
option 'remove_terrain' => ( |
30
|
|
|
|
|
|
|
is => 'ro', |
31
|
|
|
|
|
|
|
negativable => 1, |
32
|
|
|
|
|
|
|
predicate => 1, |
33
|
|
|
|
|
|
|
doc => 'remove terrain around base on random spawn', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
option 'from' => ( |
37
|
|
|
|
|
|
|
is => 'ro', |
38
|
|
|
|
|
|
|
format => 's', |
39
|
|
|
|
|
|
|
required => 1, |
40
|
|
|
|
|
|
|
doc => 'filename to open (required)', |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
option 'to' => ( |
44
|
|
|
|
|
|
|
is => 'ro', |
45
|
|
|
|
|
|
|
format => 's', |
46
|
|
|
|
|
|
|
predicate => 1, |
47
|
|
|
|
|
|
|
doc => 'save changed blueprint here', |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub run { |
51
|
|
|
|
|
|
|
my ( $self ) = @_; |
52
|
|
|
|
|
|
|
my $bp = Empyrion::Blueprint->new($self->from); |
53
|
|
|
|
|
|
|
$bp->set_spawn_group($self->spawn_group) if $self->has_spawn_group; |
54
|
|
|
|
|
|
|
$bp->set_spawn_group(undef) if $self->no_spawn_group; |
55
|
|
|
|
|
|
|
$bp->set_spawn_group($self->spawn_group) if $self->has_spawn_group; |
56
|
|
|
|
|
|
|
$bp->set_z_position($self->z_position) if $self->has_z_position; |
57
|
|
|
|
|
|
|
$bp->set_remove_terrain($self->remove_terrain) if $self->has_remove_terrain; |
58
|
|
|
|
|
|
|
if ($self->has_to) { |
59
|
|
|
|
|
|
|
$bp->save($self->to); |
60
|
|
|
|
|
|
|
} else { |
61
|
|
|
|
|
|
|
p(%{$bp->data}); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
return 0; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |